diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-11-11 17:44:31 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-11-11 17:44:31 -0500 |
commit | 90b128ed1557c2f523995a379a53e5105891ecf8 (patch) | |
tree | d64cc5dc7448b0dba62b14565e2d187245f7874e | |
parent | 5e90169c5a02da69a1ef721bea7a823e9e48fcb6 (diff) | |
parent | 9a46847aeac1148d8b15f0db629c8bbd754dfe24 (diff) |
Merge tag 'mfd-lee-3.13-3' of git://git.linaro.org/people/ljones/mfd
mfd-lee-3.13-3
MFD patches due for v3.13 - 2nd round.
-rw-r--r-- | Documentation/devicetree/bindings/mfd/s2mps11.txt | 13 | ||||
-rw-r--r-- | drivers/mfd/mfd-core.c | 29 | ||||
-rw-r--r-- | drivers/mfd/pm8921-core.c | 9 | ||||
-rw-r--r-- | drivers/mfd/wm5110-tables.c | 8 | ||||
-rw-r--r-- | include/linux/mfd/core.h | 2 |
5 files changed, 38 insertions, 23 deletions
diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt index c9332c626021..78a840d7510d 100644 --- a/Documentation/devicetree/bindings/mfd/s2mps11.txt +++ b/Documentation/devicetree/bindings/mfd/s2mps11.txt | |||
@@ -1,10 +1,10 @@ | |||
1 | 1 | ||
2 | * Samsung S2MPS11 Voltage and Current Regulator | 2 | * Samsung S2MPS11 Voltage and Current Regulator |
3 | 3 | ||
4 | The Samsung S2MP211 is a multi-function device which includes voltage and | 4 | The Samsung S2MPS11 is a multi-function device which includes voltage and |
5 | current regulators, RTC, charger controller and other sub-blocks. It is | 5 | current regulators, RTC, charger controller and other sub-blocks. It is |
6 | interfaced to the host controller using a I2C interface. Each sub-block is | 6 | interfaced to the host controller using an I2C interface. Each sub-block is |
7 | addressed by the host system using different I2C slave address. | 7 | addressed by the host system using different I2C slave addresses. |
8 | 8 | ||
9 | Required properties: | 9 | Required properties: |
10 | - compatible: Should be "samsung,s2mps11-pmic". | 10 | - compatible: Should be "samsung,s2mps11-pmic". |
@@ -43,7 +43,8 @@ sub-node should be of the format as listed below. | |||
43 | 43 | ||
44 | BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explictly | 44 | BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explictly |
45 | regulator-ramp-delay = <0> can be used for them to disable ramp delay. | 45 | regulator-ramp-delay = <0> can be used for them to disable ramp delay. |
46 | In absence of regulator-ramp-delay property, default ramp delay will be used. | 46 | In the absence of the regulator-ramp-delay property, the default ramp |
47 | delay will be used. | ||
47 | 48 | ||
48 | NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set | 49 | NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set |
49 | for a particular group of BUCKs. So provide same regulator-ramp-delay<value>. | 50 | for a particular group of BUCKs. So provide same regulator-ramp-delay<value>. |
@@ -58,10 +59,10 @@ supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number | |||
58 | as per the datasheet of s2mps11. | 59 | as per the datasheet of s2mps11. |
59 | 60 | ||
60 | - LDOn | 61 | - LDOn |
61 | - valid values for n are 1 to 28 | 62 | - valid values for n are 1 to 38 |
62 | - Example: LDO0, LD01, LDO28 | 63 | - Example: LDO0, LD01, LDO28 |
63 | - BUCKn | 64 | - BUCKn |
64 | - valid values for n are 1 to 9. | 65 | - valid values for n are 1 to 10. |
65 | - Example: BUCK1, BUCK2, BUCK9 | 66 | - Example: BUCK1, BUCK2, BUCK9 |
66 | 67 | ||
67 | Example: | 68 | Example: |
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index f421586f29fb..968775da638a 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
@@ -63,7 +63,8 @@ int mfd_cell_disable(struct platform_device *pdev) | |||
63 | EXPORT_SYMBOL(mfd_cell_disable); | 63 | EXPORT_SYMBOL(mfd_cell_disable); |
64 | 64 | ||
65 | static int mfd_platform_add_cell(struct platform_device *pdev, | 65 | static int mfd_platform_add_cell(struct platform_device *pdev, |
66 | const struct mfd_cell *cell) | 66 | const struct mfd_cell *cell, |
67 | atomic_t *usage_count) | ||
67 | { | 68 | { |
68 | if (!cell) | 69 | if (!cell) |
69 | return 0; | 70 | return 0; |
@@ -72,11 +73,12 @@ static int mfd_platform_add_cell(struct platform_device *pdev, | |||
72 | if (!pdev->mfd_cell) | 73 | if (!pdev->mfd_cell) |
73 | return -ENOMEM; | 74 | return -ENOMEM; |
74 | 75 | ||
76 | pdev->mfd_cell->usage_count = usage_count; | ||
75 | return 0; | 77 | return 0; |
76 | } | 78 | } |
77 | 79 | ||
78 | static int mfd_add_device(struct device *parent, int id, | 80 | static int mfd_add_device(struct device *parent, int id, |
79 | const struct mfd_cell *cell, | 81 | const struct mfd_cell *cell, atomic_t *usage_count, |
80 | struct resource *mem_base, | 82 | struct resource *mem_base, |
81 | int irq_base, struct irq_domain *domain) | 83 | int irq_base, struct irq_domain *domain) |
82 | { | 84 | { |
@@ -115,7 +117,7 @@ static int mfd_add_device(struct device *parent, int id, | |||
115 | goto fail_res; | 117 | goto fail_res; |
116 | } | 118 | } |
117 | 119 | ||
118 | ret = mfd_platform_add_cell(pdev, cell); | 120 | ret = mfd_platform_add_cell(pdev, cell, usage_count); |
119 | if (ret) | 121 | if (ret) |
120 | goto fail_res; | 122 | goto fail_res; |
121 | 123 | ||
@@ -180,12 +182,12 @@ fail_alloc: | |||
180 | } | 182 | } |
181 | 183 | ||
182 | int mfd_add_devices(struct device *parent, int id, | 184 | int mfd_add_devices(struct device *parent, int id, |
183 | struct mfd_cell *cells, int n_devs, | 185 | const struct mfd_cell *cells, int n_devs, |
184 | struct resource *mem_base, | 186 | struct resource *mem_base, |
185 | int irq_base, struct irq_domain *domain) | 187 | int irq_base, struct irq_domain *domain) |
186 | { | 188 | { |
187 | int i; | 189 | int i; |
188 | int ret = 0; | 190 | int ret; |
189 | atomic_t *cnts; | 191 | atomic_t *cnts; |
190 | 192 | ||
191 | /* initialize reference counting for all cells */ | 193 | /* initialize reference counting for all cells */ |
@@ -195,16 +197,19 @@ int mfd_add_devices(struct device *parent, int id, | |||
195 | 197 | ||
196 | for (i = 0; i < n_devs; i++) { | 198 | for (i = 0; i < n_devs; i++) { |
197 | atomic_set(&cnts[i], 0); | 199 | atomic_set(&cnts[i], 0); |
198 | cells[i].usage_count = &cnts[i]; | 200 | ret = mfd_add_device(parent, id, cells + i, cnts + i, mem_base, |
199 | ret = mfd_add_device(parent, id, cells + i, mem_base, | ||
200 | irq_base, domain); | 201 | irq_base, domain); |
201 | if (ret) | 202 | if (ret) |
202 | break; | 203 | goto fail; |
203 | } | 204 | } |
204 | 205 | ||
205 | if (ret) | 206 | return 0; |
206 | mfd_remove_devices(parent); | ||
207 | 207 | ||
208 | fail: | ||
209 | if (i) | ||
210 | mfd_remove_devices(parent); | ||
211 | else | ||
212 | kfree(cnts); | ||
208 | return ret; | 213 | return ret; |
209 | } | 214 | } |
210 | EXPORT_SYMBOL(mfd_add_devices); | 215 | EXPORT_SYMBOL(mfd_add_devices); |
@@ -259,8 +264,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones) | |||
259 | for (i = 0; i < n_clones; i++) { | 264 | for (i = 0; i < n_clones; i++) { |
260 | cell_entry.name = clones[i]; | 265 | cell_entry.name = clones[i]; |
261 | /* don't give up if a single call fails; just report error */ | 266 | /* don't give up if a single call fails; just report error */ |
262 | if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, NULL, 0, | 267 | if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, |
263 | NULL)) | 268 | cell_entry.usage_count, NULL, 0, NULL)) |
264 | dev_err(dev, "failed to create platform device '%s'\n", | 269 | dev_err(dev, "failed to create platform device '%s'\n", |
265 | clones[i]); | 270 | clones[i]); |
266 | } | 271 | } |
diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index a6841f77aa5e..484fe66e6c88 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c | |||
@@ -171,11 +171,12 @@ static int pm8921_remove(struct platform_device *pdev) | |||
171 | drvdata = platform_get_drvdata(pdev); | 171 | drvdata = platform_get_drvdata(pdev); |
172 | if (drvdata) | 172 | if (drvdata) |
173 | pmic = drvdata->pm_chip_data; | 173 | pmic = drvdata->pm_chip_data; |
174 | if (pmic) | 174 | if (pmic) { |
175 | mfd_remove_devices(pmic->dev); | 175 | mfd_remove_devices(pmic->dev); |
176 | if (pmic->irq_chip) { | 176 | if (pmic->irq_chip) { |
177 | pm8xxx_irq_exit(pmic->irq_chip); | 177 | pm8xxx_irq_exit(pmic->irq_chip); |
178 | pmic->irq_chip = NULL; | 178 | pmic->irq_chip = NULL; |
179 | } | ||
179 | } | 180 | } |
180 | 181 | ||
181 | return 0; | 182 | return 0; |
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index c5c116a7b5ff..bf8b3b5ad1fe 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c | |||
@@ -243,6 +243,12 @@ int wm5110_patch(struct arizona *arizona) | |||
243 | EXPORT_SYMBOL_GPL(wm5110_patch); | 243 | EXPORT_SYMBOL_GPL(wm5110_patch); |
244 | 244 | ||
245 | static const struct regmap_irq wm5110_aod_irqs[ARIZONA_NUM_IRQ] = { | 245 | static const struct regmap_irq wm5110_aod_irqs[ARIZONA_NUM_IRQ] = { |
246 | [ARIZONA_IRQ_MICD_CLAMP_FALL] = { | ||
247 | .mask = ARIZONA_MICD_CLAMP_FALL_EINT1 | ||
248 | }, | ||
249 | [ARIZONA_IRQ_MICD_CLAMP_RISE] = { | ||
250 | .mask = ARIZONA_MICD_CLAMP_RISE_EINT1 | ||
251 | }, | ||
246 | [ARIZONA_IRQ_GP5_FALL] = { .mask = ARIZONA_GP5_FALL_EINT1 }, | 252 | [ARIZONA_IRQ_GP5_FALL] = { .mask = ARIZONA_GP5_FALL_EINT1 }, |
247 | [ARIZONA_IRQ_GP5_RISE] = { .mask = ARIZONA_GP5_RISE_EINT1 }, | 253 | [ARIZONA_IRQ_GP5_RISE] = { .mask = ARIZONA_GP5_RISE_EINT1 }, |
248 | [ARIZONA_IRQ_JD_FALL] = { .mask = ARIZONA_JD1_FALL_EINT1 }, | 254 | [ARIZONA_IRQ_JD_FALL] = { .mask = ARIZONA_JD1_FALL_EINT1 }, |
@@ -505,6 +511,7 @@ static const struct reg_default wm5110_reg_default[] = { | |||
505 | { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ | 511 | { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ |
506 | { 0x0000029B, 0x0020 }, /* R667 - Headphone Detect 1 */ | 512 | { 0x0000029B, 0x0020 }, /* R667 - Headphone Detect 1 */ |
507 | { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ | 513 | { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ |
514 | { 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */ | ||
508 | { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ | 515 | { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ |
509 | { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ | 516 | { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ |
510 | { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */ | 517 | { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */ |
@@ -1439,6 +1446,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) | |||
1439 | case ARIZONA_ACCESSORY_DETECT_MODE_1: | 1446 | case ARIZONA_ACCESSORY_DETECT_MODE_1: |
1440 | case ARIZONA_HEADPHONE_DETECT_1: | 1447 | case ARIZONA_HEADPHONE_DETECT_1: |
1441 | case ARIZONA_HEADPHONE_DETECT_2: | 1448 | case ARIZONA_HEADPHONE_DETECT_2: |
1449 | case ARIZONA_MICD_CLAMP_CONTROL: | ||
1442 | case ARIZONA_MIC_DETECT_1: | 1450 | case ARIZONA_MIC_DETECT_1: |
1443 | case ARIZONA_MIC_DETECT_2: | 1451 | case ARIZONA_MIC_DETECT_2: |
1444 | case ARIZONA_MIC_DETECT_3: | 1452 | case ARIZONA_MIC_DETECT_3: |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cebe97ee98b8..60ced604664f 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -98,7 +98,7 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | extern int mfd_add_devices(struct device *parent, int id, | 100 | extern int mfd_add_devices(struct device *parent, int id, |
101 | struct mfd_cell *cells, int n_devs, | 101 | const struct mfd_cell *cells, int n_devs, |
102 | struct resource *mem_base, | 102 | struct resource *mem_base, |
103 | int irq_base, struct irq_domain *irq_domain); | 103 | int irq_base, struct irq_domain *irq_domain); |
104 | 104 | ||