aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-14 15:04:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-14 15:04:49 -0400
commit3860cae64c0a2c3faeca5de92d5f8e37fddd340c (patch)
tree8b6a902ee2e406c4ccfcd2be716e4b518c34faa0 /include/linux
parent010b0e708e08727d38b82accb21832b63fe2c250 (diff)
parentd22d59362b7b2c749245f1269d447011c76ca41d (diff)
Merge tag 'regulator-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "The biggest set of changes in here is the addition of the Qualcomm RPMH driver. As well as the regualtor driver itself being quite large due to the usual involved Qualcomm regulator stuff there's also some code shared with the arm-soc tree, a bus driver required to communicate with the hardware that actually winds up being much larger than the regulator driver itself and a LLCC driver that was part of the same signed tag used with the arm-soc tree. Other than that it's a fairly standard and quiet release, highlights include: - Addition of device links from regulator consumers to their regulators, helping the core avoid dependency issues during suspend. - Support for the entertainingly innovative suspend implementation in the BD9571MWV. - Support for switch regulators on the PFUZE100, this required two goes due to backwards compatibility issues with old DTs that were discovered. - Support for Freescale PFUZE3001 and SocioNext UniPhier. - The aforementioned Qualcomm RPMH driver together with the driver changes required to support it" * tag 'regulator-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits) regulator: add QCOM RPMh regulator driver regulator: dt-bindings: add QCOM RPMh regulator bindings regulator: samsung: Add SPDX license identifiers regulator: maxim: Add SPDX license identifiers regulator: bd71837: adobt MFD changes to regulator driver regulator: tps65217: Fix NULL pointer dereference on probe regulator: Add support for CPCAP regulators on Motorola Xoom devices. regulator: Add sw2_sw4 voltage table to cpcap regulator. regulator: bd9571mwv: Make symbol 'dev_attr_backup_mode' static regulator: pfuze100: add support to en-/disable switch regulators regulator: pfuze100: add optional disable switch-regulators binding soc: qcom: rmtfs-mem: fix memleak in probe error paths soc: qcom: llc-slice: Add missing MODULE_LICENSE() drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs firmware: qcom: scm: add a dummy qcom_scm_assign_mem() drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children drivers: qcom: rpmh-rsc: allow active requests from wake TCS drivers: qcom: rpmh: add support for batch RPMH request drivers: qcom: rpmh: allow requests to be sent asynchronously ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h1
-rw-r--r--include/linux/qcom_scm.h4
-rw-r--r--include/linux/regulator/driver.h4
-rw-r--r--include/linux/regulator/pfuze100.h11
-rw-r--r--include/linux/soc/qcom/llcc-qcom.h180
5 files changed, 198 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 6d3b000be57e..b42c301c0f90 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1316,6 +1316,7 @@ extern const char *dev_driver_string(const struct device *dev);
1316struct device_link *device_link_add(struct device *consumer, 1316struct device_link *device_link_add(struct device *consumer,
1317 struct device *supplier, u32 flags); 1317 struct device *supplier, u32 flags);
1318void device_link_del(struct device_link *link); 1318void device_link_del(struct device_link *link);
1319void device_link_remove(void *consumer, struct device *supplier);
1319 1320
1320#ifdef CONFIG_PRINTK 1321#ifdef CONFIG_PRINTK
1321 1322
diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h
index b401b962afff..5d65521260b3 100644
--- a/include/linux/qcom_scm.h
+++ b/include/linux/qcom_scm.h
@@ -87,6 +87,10 @@ static inline int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr,
87static inline int 87static inline int
88qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; } 88qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; }
89static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; } 89static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }
90static inline int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
91 unsigned int *src,
92 struct qcom_scm_vmperm *newvm,
93 int dest_cnt) { return -ENODEV; }
90static inline void qcom_scm_cpu_power_down(u32 flags) {} 94static inline void qcom_scm_cpu_power_down(u32 flags) {}
91static inline u32 qcom_scm_get_version(void) { return 0; } 95static inline u32 qcom_scm_get_version(void) { return 0; }
92static inline u32 96static inline u32
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index fc2dc8df476f..0fd8fbb74763 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -46,7 +46,7 @@ enum regulator_status {
46/** 46/**
47 * struct regulator_linear_range - specify linear voltage ranges 47 * struct regulator_linear_range - specify linear voltage ranges
48 * 48 *
49 * Specify a range of voltages for regulator_map_linar_range() and 49 * Specify a range of voltages for regulator_map_linear_range() and
50 * regulator_list_linear_range(). 50 * regulator_list_linear_range().
51 * 51 *
52 * @min_uV: Lowest voltage in range 52 * @min_uV: Lowest voltage in range
@@ -220,7 +220,7 @@ struct regulator_ops {
220 /* set regulator suspend operating mode (defined in consumer.h) */ 220 /* set regulator suspend operating mode (defined in consumer.h) */
221 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); 221 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
222 222
223 int (*resume_early)(struct regulator_dev *rdev); 223 int (*resume)(struct regulator_dev *rdev);
224 224
225 int (*set_pull_down) (struct regulator_dev *); 225 int (*set_pull_down) (struct regulator_dev *);
226}; 226};
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h
index e0ccf46f66cf..cb5aecd40f07 100644
--- a/include/linux/regulator/pfuze100.h
+++ b/include/linux/regulator/pfuze100.h
@@ -64,6 +64,17 @@
64#define PFUZE3000_VLDO3 11 64#define PFUZE3000_VLDO3 11
65#define PFUZE3000_VLDO4 12 65#define PFUZE3000_VLDO4 12
66 66
67#define PFUZE3001_SW1 0
68#define PFUZE3001_SW2 1
69#define PFUZE3001_SW3 2
70#define PFUZE3001_VSNVS 3
71#define PFUZE3001_VLDO1 4
72#define PFUZE3001_VLDO2 5
73#define PFUZE3001_VCCSD 6
74#define PFUZE3001_V33 7
75#define PFUZE3001_VLDO3 8
76#define PFUZE3001_VLDO4 9
77
67struct regulator_init_data; 78struct regulator_init_data;
68 79
69struct pfuze_regulator_platform_data { 80struct pfuze_regulator_platform_data {
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
new file mode 100644
index 000000000000..7e3b9c605ab2
--- /dev/null
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -0,0 +1,180 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
4 *
5 */
6
7#include <linux/platform_device.h>
8#ifndef __LLCC_QCOM__
9#define __LLCC_QCOM__
10
11#define LLCC_CPUSS 1
12#define LLCC_VIDSC0 2
13#define LLCC_VIDSC1 3
14#define LLCC_ROTATOR 4
15#define LLCC_VOICE 5
16#define LLCC_AUDIO 6
17#define LLCC_MDMHPGRW 7
18#define LLCC_MDM 8
19#define LLCC_CMPT 10
20#define LLCC_GPUHTW 11
21#define LLCC_GPU 12
22#define LLCC_MMUHWT 13
23#define LLCC_CMPTDMA 15
24#define LLCC_DISP 16
25#define LLCC_VIDFW 17
26#define LLCC_MDMHPFX 20
27#define LLCC_MDMPNG 21
28#define LLCC_AUDHW 22
29
30/**
31 * llcc_slice_desc - Cache slice descriptor
32 * @slice_id: llcc slice id
33 * @slice_size: Size allocated for the llcc slice
34 */
35struct llcc_slice_desc {
36 u32 slice_id;
37 size_t slice_size;
38};
39
40/**
41 * llcc_slice_config - Data associated with the llcc slice
42 * @usecase_id: usecase id for which the llcc slice is used
43 * @slice_id: llcc slice id assigned to each slice
44 * @max_cap: maximum capacity of the llcc slice
45 * @priority: priority of the llcc slice
46 * @fixed_size: whether the llcc slice can grow beyond its size
47 * @bonus_ways: bonus ways associated with llcc slice
48 * @res_ways: reserved ways associated with llcc slice
49 * @cache_mode: mode of the llcc slice
50 * @probe_target_ways: Probe only reserved and bonus ways on a cache miss
51 * @dis_cap_alloc: Disable capacity based allocation
52 * @retain_on_pc: Retain through power collapse
53 * @activate_on_init: activate the slice on init
54 */
55struct llcc_slice_config {
56 u32 usecase_id;
57 u32 slice_id;
58 u32 max_cap;
59 u32 priority;
60 bool fixed_size;
61 u32 bonus_ways;
62 u32 res_ways;
63 u32 cache_mode;
64 u32 probe_target_ways;
65 bool dis_cap_alloc;
66 bool retain_on_pc;
67 bool activate_on_init;
68};
69
70/**
71 * llcc_drv_data - Data associated with the llcc driver
72 * @regmap: regmap associated with the llcc device
73 * @cfg: pointer to the data structure for slice configuration
74 * @lock: mutex associated with each slice
75 * @cfg_size: size of the config data table
76 * @max_slices: max slices as read from device tree
77 * @bcast_off: Offset of the broadcast bank
78 * @num_banks: Number of llcc banks
79 * @bitmap: Bit map to track the active slice ids
80 * @offsets: Pointer to the bank offsets array
81 */
82struct llcc_drv_data {
83 struct regmap *regmap;
84 const struct llcc_slice_config *cfg;
85 struct mutex lock;
86 u32 cfg_size;
87 u32 max_slices;
88 u32 bcast_off;
89 u32 num_banks;
90 unsigned long *bitmap;
91 u32 *offsets;
92};
93
94#if IS_ENABLED(CONFIG_QCOM_LLCC)
95/**
96 * llcc_slice_getd - get llcc slice descriptor
97 * @uid: usecase_id of the client
98 */
99struct llcc_slice_desc *llcc_slice_getd(u32 uid);
100
101/**
102 * llcc_slice_putd - llcc slice descritpor
103 * @desc: Pointer to llcc slice descriptor
104 */
105void llcc_slice_putd(struct llcc_slice_desc *desc);
106
107/**
108 * llcc_get_slice_id - get slice id
109 * @desc: Pointer to llcc slice descriptor
110 */
111int llcc_get_slice_id(struct llcc_slice_desc *desc);
112
113/**
114 * llcc_get_slice_size - llcc slice size
115 * @desc: Pointer to llcc slice descriptor
116 */
117size_t llcc_get_slice_size(struct llcc_slice_desc *desc);
118
119/**
120 * llcc_slice_activate - Activate the llcc slice
121 * @desc: Pointer to llcc slice descriptor
122 */
123int llcc_slice_activate(struct llcc_slice_desc *desc);
124
125/**
126 * llcc_slice_deactivate - Deactivate the llcc slice
127 * @desc: Pointer to llcc slice descriptor
128 */
129int llcc_slice_deactivate(struct llcc_slice_desc *desc);
130
131/**
132 * qcom_llcc_probe - program the sct table
133 * @pdev: platform device pointer
134 * @table: soc sct table
135 * @sz: Size of the config table
136 */
137int qcom_llcc_probe(struct platform_device *pdev,
138 const struct llcc_slice_config *table, u32 sz);
139#else
140static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
141{
142 return NULL;
143}
144
145static inline void llcc_slice_putd(struct llcc_slice_desc *desc)
146{
147
148};
149
150static inline int llcc_get_slice_id(struct llcc_slice_desc *desc)
151{
152 return -EINVAL;
153}
154
155static inline size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
156{
157 return 0;
158}
159static inline int llcc_slice_activate(struct llcc_slice_desc *desc)
160{
161 return -EINVAL;
162}
163
164static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc)
165{
166 return -EINVAL;
167}
168static inline int qcom_llcc_probe(struct platform_device *pdev,
169 const struct llcc_slice_config *table, u32 sz)
170{
171 return -ENODEV;
172}
173
174static inline int qcom_llcc_remove(struct platform_device *pdev)
175{
176 return -ENODEV;
177}
178#endif
179
180#endif