History

Merge tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD fixes from Samuel Ortiz: "This is the first pull request for MFD fixes for 3.8 We have some build failure fixes (twl4030, vexpress, abx500 and tps65910), some actual runtime oops and lockup fixes (rtsx, da9052), and some more hypothetical NULL pointers dereferences fixes for pcf50633 and max776xx. Then we also have additional rtsx fixes for a correct switch output voltage and clock divider correctness for rtl8411 (rtsx driver), and irqdomain fix for db8550-prcmu, and some more cosmetic fixes for arizona and wm5102." * tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: mfd: rtsx: Fix oops when rtsx_pci_sdmmc is not probed mfd: wm5102: Fix definition of WM5102_MAX_REGISTER mfd: twl4030: Don't warn about uninitialized return code mfd: da9052/53 lockup fix mfd: rtsx: Add clock divider hook mmc: rtsx: Call MFD hook to switch output voltage mfd: rtsx: Add output voltage switch hook mfd: Fix compile errors and warnings when !CONFIG_AB8500_BM mfd: vexpress: Export global functions to fix build error mfd: arizona: Check errors from regcache_sync() mfd: tc3589x: Use simple irqdomain mfd: pcf50633: Init pcf->dev before using it mfd: max77693: Init max77693->dev before using it mfd: max77686: Init max77686->dev before using it mfd: db8500-prcmu: Fix irqdomain usage mfd: tps65910: Select REGMAP_IRQ in Kconfig to fix build error mfd: arizona: Disable control interface reporting for WM5102 and WM5110

Linus Torvalds committed 13 years ago

Commit 325a86b2 parents 22f8379 2d1484f24 files · +314 −129Browse files

Unified · Split

24 files
  1. drivers/mfd/Kconfig +1 −0
  2. drivers/mfd/ab8500-core.c +1 −0
  3. drivers/mfd/arizona-core.c +6 −1
  4. drivers/mfd/arizona-irq.c +2 −16
  5. drivers/mfd/da9052-i2c.c +61 −0
  6. drivers/mfd/db8500-prcmu.c +9 −4
  7. drivers/mfd/max77686.c +9 −9
  8. drivers/mfd/max77693.c +18 −16
  9. drivers/mfd/pcf50633-core.c +2 −3
  10. drivers/mfd/rtl8411.c +29 −0
  11. drivers/mfd/rts5209.c +21 −0
  12. drivers/mfd/rts5229.c +21 −0
  13. drivers/mfd/rtsx_pcr.c +23 −4
  14. drivers/mfd/tc3589x.c +5 −12
  15. drivers/mfd/twl4030-power.c +1 −1
  16. drivers/mfd/vexpress-config.c +6 −2
  17. drivers/mfd/wm5102-tables.c +1 −1
  18. drivers/mmc/host/rtsx_pci_sdmmc.c +5 −25
  19. include/linux/mfd/abx500.h +0 −2
  20. include/linux/mfd/abx500/ab8500-bm.h +4 −25
  21. include/linux/mfd/da9052/da9052.h +62 −4
  22. include/linux/mfd/da9052/reg.h +3 −0
  23. include/linux/mfd/rtsx_common.h +3 −0
  24. include/linux/mfd/rtsx_pci.h +21 −4
drivers/mfd/Kconfig+1−0
@@ -237,6 +237,7 @@ config MFD_TPS65910 · 236 unmodified lines
237237 depends on I2C=y && GPIOLIB
238238 select MFD_CORE
239239 select REGMAP_I2C
240+ select REGMAP_IRQ
240241 select IRQ_DOMAIN
241242 help
242243 if you say yes here you get support for the TPS65910 series of
drivers/mfd/ab8500-core.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/mfd/core.h>
2020 #include <linux/mfd/abx500.h>
2121 #include <linux/mfd/abx500/ab8500.h>
22+#include <linux/mfd/abx500/ab8500-bm.h>
2223 #include <linux/mfd/dbx500-prcmu.h>
2324 #include <linux/regulator/ab8500.h>
2425 #include <linux/of.h>
drivers/mfd/arizona-core.c+6−1
@@ -239,7 +239,12 @@ static int arizona_runtime_resume(struct device *dev) · 238 unmodified lines
239239 return ret;
240240 }
241241
242− regcache_sync(arizona->regmap);
242+ ret = regcache_sync(arizona->regmap);
243+ if (ret != 0) {
244+ dev_err(arizona->dev, "Failed to restore register cache\n");
245+ regulator_disable(arizona->dcvdd);
246+ return ret;
247+ }
243248
244249 return 0;
245250 }
drivers/mfd/arizona-irq.c+2−16
@@ -176,14 +176,7 @@ int arizona_irq_init(struct arizona *arizona) · 175 unmodified lines
176176 aod = &wm5102_aod;
177177 irq = &wm5102_irq;
178178
179− switch (arizona->rev) {
180− case 0:
181− case 1:
182− ctrlif_error = false;
183− break;
184− default:
185− break;
186− }
179+ ctrlif_error = false;
187180 break;
188181 #endif
189182 #ifdef CONFIG_MFD_WM5110
@@ -191,14 +184,7 @@ int arizona_irq_init(struct arizona *arizona) · 1 unmodified line
191184 aod = &wm5110_aod;
192185 irq = &wm5110_irq;
193186
194− switch (arizona->rev) {
195− case 0:
196− case 1:
197− ctrlif_error = false;
198− break;
199− default:
200− break;
201− }
187+ ctrlif_error = false;
202188 break;
203189 #endif
204190 default:
drivers/mfd/da9052-i2c.c+61−0
@@ -27,6 +27,66 @@ · 26 unmodified lines
2727 #include <linux/of_device.h>
2828 #endif
2929
30+/* I2C safe register check */
31+static inline bool i2c_safe_reg(unsigned char reg)
32+{
33+ switch (reg) {
34+ case DA9052_STATUS_A_REG:
35+ case DA9052_STATUS_B_REG:
36+ case DA9052_STATUS_C_REG:
37+ case DA9052_STATUS_D_REG:
38+ case DA9052_ADC_RES_L_REG:
39+ case DA9052_ADC_RES_H_REG:
40+ case DA9052_VDD_RES_REG:
41+ case DA9052_ICHG_AV_REG:
42+ case DA9052_TBAT_RES_REG:
43+ case DA9052_ADCIN4_RES_REG:
44+ case DA9052_ADCIN5_RES_REG:
45+ case DA9052_ADCIN6_RES_REG:
46+ case DA9052_TJUNC_RES_REG:
47+ case DA9052_TSI_X_MSB_REG:
48+ case DA9052_TSI_Y_MSB_REG:
49+ case DA9052_TSI_LSB_REG:
50+ case DA9052_TSI_Z_MSB_REG:
51+ return true;
52+ default:
53+ return false;
54+ }
55+}
56+
57+/*
58+ * There is an issue with DA9052 and DA9053_AA/BA/BB PMIC where the PMIC
59+ * gets lockup up or fails to respond following a system reset.
60+ * This fix is to follow any read or write with a dummy read to a safe
61+ * register.
62+ */
63+int da9052_i2c_fix(struct da9052 *da9052, unsigned char reg)
64+{
65+ int val;
66+
67+ switch (da9052->chip_id) {
68+ case DA9052:
69+ case DA9053_AA:
70+ case DA9053_BA:
71+ case DA9053_BB:
72+ /* A dummy read to a safe register address. */
73+ if (!i2c_safe_reg(reg))
74+ return regmap_read(da9052->regmap,
75+ DA9052_PARK_REGISTER,
76+ &val);
77+ break;
78+ default:
79+ /*
80+ * For other chips parking of I2C register
81+ * to a safe place is not required.
82+ */
83+ break;
84+ }
85+
86+ return 0;
87+}
88+EXPORT_SYMBOL(da9052_i2c_fix);
89+
3090 static int da9052_i2c_enable_multiwrite(struct da9052 *da9052)
3191 {
3292 int reg_val, ret;
@@ -83,6 +143,7 @@ static int da9052_i2c_probe(struct i2c_client *client, · 50 unmodified lines
83143
84144 da9052->dev = &client->dev;
85145 da9052->chip_irq = client->irq;
146+ da9052->fix_io = da9052_i2c_fix;
86147
87148 i2c_set_clientdata(client, da9052);
88149
drivers/mfd/db8500-prcmu.c+9−4
@@ -2524,7 +2524,7 @@ static bool read_mailbox_0(void) · 2523 unmodified lines
25242524
25252525 for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) {
25262526 if (ev & prcmu_irq_bit[n])
2527− generic_handle_irq(IRQ_PRCMU_BASE + n);
2527+ generic_handle_irq(irq_find_mapping(db8500_irq_domain, n));
25282528 }
25292529 r = true;
25302530 break;
@@ -2737,13 +2737,14 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq, · 206 unmodified lines
27372737 }
27382738
27392739 static struct irq_domain_ops db8500_irq_ops = {
2740− .map = db8500_irq_map,
2741− .xlate = irq_domain_xlate_twocell,
2740+ .map = db8500_irq_map,
2741+ .xlate = irq_domain_xlate_twocell,
27422742 };
27432743
27442744 static int db8500_irq_init(struct device_node *np)
27452745 {
2746− int irq_base = -1;
2746+ int irq_base = 0;
2747+ int i;
27472748
27482749 /* In the device tree case, just take some IRQs */
27492750 if (!np)
@@ -2758,6 +2759,10 @@ static int db8500_irq_init(struct device_node *np) · 8 unmodified lines
27582759 return -ENOSYS;
27592760 }
27602761
2762+ /* All wakeups will be used, so create mappings for all */
2763+ for (i = 0; i < NUM_PRCMU_WAKEUPS; i++)
2764+ irq_create_mapping(db8500_irq_domain, i);
2765+
27612766 return 0;
27622767 }
27632768
drivers/mfd/max77686.c+9−9
@@ -93,15 +93,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c, · 92 unmodified lines
9393 if (max77686 == NULL)
9494 return -ENOMEM;
9595
96− max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
97− if (IS_ERR(max77686->regmap)) {
98− ret = PTR_ERR(max77686->regmap);
99− dev_err(max77686->dev, "Failed to allocate register map: %d\n",
100− ret);
101− kfree(max77686);
102− return ret;
103− }
104−
10596 i2c_set_clientdata(i2c, max77686);
10697 max77686->dev = &i2c->dev;
10798 max77686->i2c = i2c;
@@ -111,6 +102,15 @@ static int max77686_i2c_probe(struct i2c_client *i2c, · 3 unmodified lines
111102 max77686->irq_gpio = pdata->irq_gpio;
112103 max77686->irq = i2c->irq;
113104
105+ max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
106+ if (IS_ERR(max77686->regmap)) {
107+ ret = PTR_ERR(max77686->regmap);
108+ dev_err(max77686->dev, "Failed to allocate register map: %d\n",
109+ ret);
110+ kfree(max77686);
111+ return ret;
112+ }
113+
114114 if (regmap_read(max77686->regmap,
115115 MAX77686_REG_DEVICE_ID, &data) < 0) {
116116 dev_err(max77686->dev,
drivers/mfd/max77693.c+18−16
@@ -114,35 +114,37 @@ static int max77693_i2c_probe(struct i2c_client *i2c, · 113 unmodified lines
114114 u8 reg_data;
115115 int ret = 0;
116116
117+ if (!pdata) {
118+ dev_err(&i2c->dev, "No platform data found.\n");
119+ return -EINVAL;
120+ }
121+
117122 max77693 = devm_kzalloc(&i2c->dev,
118123 sizeof(struct max77693_dev), GFP_KERNEL);
119124 if (max77693 == NULL)
120125 return -ENOMEM;
121126
122− max77693->regmap = devm_regmap_init_i2c(i2c, &max77693_regmap_config);
123− if (IS_ERR(max77693->regmap)) {
124− ret = PTR_ERR(max77693->regmap);
125− dev_err(max77693->dev,"failed to allocate register map: %d\n",
126− ret);
127− goto err_regmap;
128− }
129−
130127 i2c_set_clientdata(i2c, max77693);
131128 max77693->dev = &i2c->dev;
132129 max77693->i2c = i2c;
133130 max77693->irq = i2c->irq;
134131 max77693->type = id->driver_data;
135132
136− if (!pdata)
137− goto err_regmap;
133+ max77693->regmap = devm_regmap_init_i2c(i2c, &max77693_regmap_config);
134+ if (IS_ERR(max77693->regmap)) {
135+ ret = PTR_ERR(max77693->regmap);
136+ dev_err(max77693->dev, "failed to allocate register map: %d\n",
137+ ret);
138+ return ret;
139+ }
138140
139141 max77693->wakeup = pdata->wakeup;
140142
141− if (max77693_read_reg(max77693->regmap,
142− MAX77693_PMIC_REG_PMIC_ID2, &reg_data) < 0) {
143+ ret = max77693_read_reg(max77693->regmap, MAX77693_PMIC_REG_PMIC_ID2,
144+ &reg_data);
145+ if (ret < 0) {
143146 dev_err(max77693->dev, "device not found on this channel\n");
144− ret = -ENODEV;
145− goto err_regmap;
147+ return ret;
146148 } else
147149 dev_info(max77693->dev, "device ID: 0x%x\n", reg_data);
148150
@@ -163,7 +165,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c, · 14 unmodified lines
163165 ret = PTR_ERR(max77693->regmap_muic);
164166 dev_err(max77693->dev,
165167 "failed to allocate register map: %d\n", ret);
166− goto err_regmap;
168+ goto err_regmap_muic;
167169 }
168170
169171 ret = max77693_irq_init(max77693);
@@ -184,9 +186,9 @@ static int max77693_i2c_probe(struct i2c_client *i2c, · 14 unmodified lines
184186 err_mfd:
185187 max77693_irq_exit(max77693);
186188 err_irq:
189+err_regmap_muic:
187190 i2c_unregister_device(max77693->muic);
188191 i2c_unregister_device(max77693->haptic);
189−err_regmap:
190192 return ret;
191193 }
192194
drivers/mfd/pcf50633-core.c+2−3
@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client, · 207 unmodified lines
208208 if (!pcf)
209209 return -ENOMEM;
210210
211+ i2c_set_clientdata(client, pcf);
212+ pcf->dev = &client->dev;
211213 pcf->pdata = pdata;
212214
213215 mutex_init(&pcf->lock);
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client, · 5 unmodified lines
219221 return ret;
220222 }
221223
222− i2c_set_clientdata(client, pcf);
223− pcf->dev = &client->dev;
224−
225224 version = pcf50633_reg_read(pcf, 0);
226225 variant = pcf50633_reg_read(pcf, 1);
227226 if (version < 0 || variant < 0) {
drivers/mfd/rtl8411.c+29−0
@@ -112,6 +112,21 @@ static int rtl8411_card_power_off(struct rtsx_pcr *pcr, int card) · 111 unmodified lines
112112 BPP_LDO_POWB, BPP_LDO_SUSPEND);
113113 }
114114
115+static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
116+{
117+ u8 mask, val;
118+
119+ mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_MASK;
120+ if (voltage == OUTPUT_3V3)
121+ val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_3V3;
122+ else if (voltage == OUTPUT_1V8)
123+ val = (BPP_ASIC_1V8 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_1V8;
124+ else
125+ return -EINVAL;
126+
127+ return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
128+}
129+
115130 static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
116131 {
117132 unsigned int card_exist;
@@ -163,6 +178,18 @@ static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr) · 45 unmodified lines
163178 return card_exist;
164179 }
165180
181+static int rtl8411_conv_clk_and_div_n(int input, int dir)
182+{
183+ int output;
184+
185+ if (dir == CLK_TO_DIV_N)
186+ output = input * 4 / 5 - 2;
187+ else
188+ output = (input + 2) * 5 / 4;
189+
190+ return output;
191+}
192+
166193 static const struct pcr_ops rtl8411_pcr_ops = {
167194 .extra_init_hw = rtl8411_extra_init_hw,
168195 .optimize_phy = NULL,
@@ -172,7 +199,9 @@ static const struct pcr_ops rtl8411_pcr_ops = { · 3 unmodified lines
172199 .disable_auto_blink = rtl8411_disable_auto_blink,
173200 .card_power_on = rtl8411_card_power_on,
174201 .card_power_off = rtl8411_card_power_off,
202+ .switch_output_voltage = rtl8411_switch_output_voltage,
175203 .cd_deglitch = rtl8411_cd_deglitch,
204+ .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n,
176205 };
177206
178207 /* SD Pull Control Enable:
drivers/mfd/rts5209.c+21−0
@@ -144,6 +144,25 @@ static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card) · 143 unmodified lines
144144 return rtsx_pci_send_cmd(pcr, 100);
145145 }
146146
147+static int rts5209_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
148+{
149+ int err;
150+
151+ if (voltage == OUTPUT_3V3) {
152+ err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
153+ if (err < 0)
154+ return err;
155+ } else if (voltage == OUTPUT_1V8) {
156+ err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
157+ if (err < 0)
158+ return err;
159+ } else {
160+ return -EINVAL;
161+ }
162+
163+ return 0;
164+}
165+
147166 static const struct pcr_ops rts5209_pcr_ops = {
148167 .extra_init_hw = rts5209_extra_init_hw,
149168 .optimize_phy = rts5209_optimize_phy,
@@ -153,7 +172,9 @@ static const struct pcr_ops rts5209_pcr_ops = { · 3 unmodified lines
153172 .disable_auto_blink = rts5209_disable_auto_blink,
154173 .card_power_on = rts5209_card_power_on,
155174 .card_power_off = rts5209_card_power_off,
175+ .switch_output_voltage = rts5209_switch_output_voltage,
156176 .cd_deglitch = NULL,
177+ .conv_clk_and_div_n = NULL,
157178 };
158179
159180 /* SD Pull Control Enable:
drivers/mfd/rts5229.c+21−0
@@ -114,6 +114,25 @@ static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card) · 113 unmodified lines
114114 return rtsx_pci_send_cmd(pcr, 100);
115115 }
116116
117+static int rts5229_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
118+{
119+ int err;
120+
121+ if (voltage == OUTPUT_3V3) {
122+ err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
123+ if (err < 0)
124+ return err;
125+ } else if (voltage == OUTPUT_1V8) {
126+ err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
127+ if (err < 0)
128+ return err;
129+ } else {
130+ return -EINVAL;
131+ }
132+
133+ return 0;
134+}
135+
117136 static const struct pcr_ops rts5229_pcr_ops = {
118137 .extra_init_hw = rts5229_extra_init_hw,
119138 .optimize_phy = rts5229_optimize_phy,
@@ -123,7 +142,9 @@ static const struct pcr_ops rts5229_pcr_ops = { · 3 unmodified lines
123142 .disable_auto_blink = rts5229_disable_auto_blink,
124143 .card_power_on = rts5229_card_power_on,
125144 .card_power_off = rts5229_card_power_off,
145+ .switch_output_voltage = rts5229_switch_output_voltage,
126146 .cd_deglitch = NULL,
147+ .conv_clk_and_div_n = NULL,
127148 };
128149
129150 /* SD Pull Control Enable:
drivers/mfd/rtsx_pcr.c+23−4
@@ -630,7 +630,10 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, · 629 unmodified lines
630630 if (clk == pcr->cur_clock)
631631 return 0;
632632
633− N = (u8)(clk - 2);
633+ if (pcr->ops->conv_clk_and_div_n)
634+ N = (u8)pcr->ops->conv_clk_and_div_n(clk, CLK_TO_DIV_N);
635+ else
636+ N = (u8)(clk - 2);
634637 if ((clk <= 2) || (N > max_N))
635638 return -EINVAL;
636639
@@ -641,7 +644,14 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, · 4 unmodified lines
641644 /* Make sure that the SSC clock div_n is equal or greater than min_N */
642645 div = CLK_DIV_1;
643646 while ((N < min_N) && (div < max_div)) {
644− N = (N + 2) * 2 - 2;
647+ if (pcr->ops->conv_clk_and_div_n) {
648+ int dbl_clk = pcr->ops->conv_clk_and_div_n(N,
649+ DIV_N_TO_CLK) * 2;
650+ N = (u8)pcr->ops->conv_clk_and_div_n(dbl_clk,
651+ CLK_TO_DIV_N);
652+ } else {
653+ N = (N + 2) * 2 - 2;
654+ }
645655 div++;
646656 }
647657 dev_dbg(&(pcr->pci->dev), "N = %d, div = %d\n", N, div);
@@ -703,6 +713,15 @@ int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card) · 55 unmodified lines
703713 }
704714 EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
705715
716+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
717+{
718+ if (pcr->ops->switch_output_voltage)
719+ return pcr->ops->switch_output_voltage(pcr, voltage);
720+
721+ return 0;
722+}
723+EXPORT_SYMBOL_GPL(rtsx_pci_switch_output_voltage);
724+
706725 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr)
707726 {
708727 unsigned int val;
@@ -767,10 +786,10 @@ static void rtsx_pci_card_detect(struct work_struct *work) · 58 unmodified lines
767786
768787 spin_unlock_irqrestore(&pcr->lock, flags);
769788
770− if (card_detect & SD_EXIST)
789+ if ((card_detect & SD_EXIST) && pcr->slots[RTSX_SD_CARD].card_event)
771790 pcr->slots[RTSX_SD_CARD].card_event(
772791 pcr->slots[RTSX_SD_CARD].p_dev);
773− if (card_detect & MS_EXIST)
792+ if ((card_detect & MS_EXIST) && pcr->slots[RTSX_MS_CARD].card_event)
774793 pcr->slots[RTSX_MS_CARD].card_event(
775794 pcr->slots[RTSX_MS_CARD].p_dev);
776795 }
drivers/mfd/tc3589x.c+5−12
@@ -219,25 +219,18 @@ static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq) · 218 unmodified lines
219219 }
220220
221221 static struct irq_domain_ops tc3589x_irq_ops = {
222− .map = tc3589x_irq_map,
222+ .map = tc3589x_irq_map,
223223 .unmap = tc3589x_irq_unmap,
224− .xlate = irq_domain_xlate_twocell,
224+ .xlate = irq_domain_xlate_twocell,
225225 };
226226
227227 static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
228228 {
229229 int base = tc3589x->irq_base;
230230
231− if (base) {
232− tc3589x->domain = irq_domain_add_legacy(
233− NULL, TC3589x_NR_INTERNAL_IRQS, base,
234− 0, &tc3589x_irq_ops, tc3589x);
235− }
236− else {
237− tc3589x->domain = irq_domain_add_linear(
238− np, TC3589x_NR_INTERNAL_IRQS,
239− &tc3589x_irq_ops, tc3589x);
240− }
231+ tc3589x->domain = irq_domain_add_simple(
232+ np, TC3589x_NR_INTERNAL_IRQS, base,
233+ &tc3589x_irq_ops, tc3589x);
241234
242235 if (!tc3589x->domain) {
243236 dev_err(tc3589x->dev, "Failed to create irqdomain\n");
drivers/mfd/twl4030-power.c+1−1
@@ -159,7 +159,7 @@ out: · 158 unmodified lines
159159 static int twl4030_write_script(u8 address, struct twl4030_ins *script,
160160 int len)
161161 {
162− int err;
162+ int err = -EINVAL;
163163
164164 for (; len; len--, address++, script++) {
165165 if (len == 1) {
drivers/mfd/vexpress-config.c+6−2
@@ -67,6 +67,7 @@ struct vexpress_config_bridge *vexpress_config_bridge_register( · 66 unmodified lines
6767
6868 return bridge;
6969 }
70+EXPORT_SYMBOL(vexpress_config_bridge_register);
7071
7172 void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge)
7273 {
@@ -83,6 +84,7 @@ void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge) · 10 unmodified lines
8384 while (!list_empty(&__bridge.transactions))
8485 cpu_relax();
8586 }
87+EXPORT_SYMBOL(vexpress_config_bridge_unregister);
8688
8789
8890 struct vexpress_config_func {
@@ -142,6 +144,7 @@ struct vexpress_config_func *__vexpress_config_func_get(struct device *dev, · 53 unmodified lines
142144
143145 return func;
144146 }
147+EXPORT_SYMBOL(__vexpress_config_func_get);
145148
146149 void vexpress_config_func_put(struct vexpress_config_func *func)
147150 {
@@ -149,7 +152,7 @@ void vexpress_config_func_put(struct vexpress_config_func *func) · 1 unmodified line
149152 of_node_put(func->bridge->node);
150153 kfree(func);
151154 }
152−
155+EXPORT_SYMBOL(vexpress_config_func_put);
153156
154157 struct vexpress_config_trans {
155158 struct vexpress_config_func *func;
@@ -229,6 +232,7 @@ void vexpress_config_complete(struct vexpress_config_bridge *bridge, · 73 unmodified lines
229232
230233 complete(&trans->completion);
231234 }
235+EXPORT_SYMBOL(vexpress_config_complete);
232236
233237 int vexpress_config_wait(struct vexpress_config_trans *trans)
234238 {
@@ -236,7 +240,7 @@ int vexpress_config_wait(struct vexpress_config_trans *trans) · 1 unmodified line
236240
237241 return trans->status;
238242 }
239−
243+EXPORT_SYMBOL(vexpress_config_wait);
240244
241245 int vexpress_config_read(struct vexpress_config_func *func, int offset,
242246 u32 *data)
drivers/mfd/wm5102-tables.c+1−1
@@ -1882,7 +1882,7 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg) · 1881 unmodified lines
18821882 }
18831883 }
18841884
1885−#define WM5102_MAX_REGISTER 0x1a8fff
1885+#define WM5102_MAX_REGISTER 0x1a9800
18861886
18871887 const struct regmap_config wm5102_spi_regmap = {
18881888 .reg_bits = 32,
drivers/mmc/host/rtsx_pci_sdmmc.c+5−25
@@ -1060,26 +1060,6 @@ static int sd_wait_voltage_stable_2(struct realtek_pci_sdmmc *host) · 1059 unmodified lines
10601060 return 0;
10611061 }
10621062
1063−static int sd_change_bank_voltage(struct realtek_pci_sdmmc *host, u8 voltage)
1064−{
1065− struct rtsx_pcr *pcr = host->pcr;
1066− int err;
1067−
1068− if (voltage == SD_IO_3V3) {
1069− err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
1070− if (err < 0)
1071− return err;
1072− } else if (voltage == SD_IO_1V8) {
1073− err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
1074− if (err < 0)
1075− return err;
1076− } else {
1077− return -EINVAL;
1078− }
1079−
1080− return 0;
1081−}
1082−
10831063 static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
10841064 {
10851065 struct realtek_pci_sdmmc *host = mmc_priv(mmc);
@@ -1098,11 +1078,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) · 12 unmodified lines
10981078 rtsx_pci_start_run(pcr);
10991079
11001080 if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)
1101− voltage = SD_IO_3V3;
1081+ voltage = OUTPUT_3V3;
11021082 else
1103− voltage = SD_IO_1V8;
1083+ voltage = OUTPUT_1V8;
11041084
1105− if (voltage == SD_IO_1V8) {
1085+ if (voltage == OUTPUT_1V8) {
11061086 err = rtsx_pci_write_register(pcr,
11071087 SD30_DRIVE_SEL, 0x07, DRIVER_TYPE_B);
11081088 if (err < 0)
@@ -1113,11 +1093,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) · 4 unmodified lines
11131093 goto out;
11141094 }
11151095
1116− err = sd_change_bank_voltage(host, voltage);
1096+ err = rtsx_pci_switch_output_voltage(pcr, voltage);
11171097 if (err < 0)
11181098 goto out;
11191099
1120− if (voltage == SD_IO_1V8) {
1100+ if (voltage == OUTPUT_1V8) {
11211101 err = sd_wait_voltage_stable_2(host);
11221102 if (err < 0)
11231103 goto out;
include/linux/mfd/abx500.h+0−2
@@ -272,8 +272,6 @@ struct abx500_bm_data { · 271 unmodified lines
272272 const struct abx500_fg_parameters *fg_params;
273273 };
274274
275−extern struct abx500_bm_data ab8500_bm_data;
276−
277275 enum {
278276 NTC_EXTERNAL = 0,
279277 NTC_INTERNAL,
include/linux/mfd/abx500/ab8500-bm.h+4−25
@@ -422,7 +422,10 @@ struct ab8500_chargalg_platform_data { · 421 unmodified lines
422422 struct ab8500_btemp;
423423 struct ab8500_gpadc;
424424 struct ab8500_fg;
425+
425426 #ifdef CONFIG_AB8500_BM
427+extern struct abx500_bm_data ab8500_bm_data;
428+
426429 void ab8500_fg_reinit(void);
427430 void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA);
428431 struct ab8500_btemp *ab8500_btemp_get(void);
@@ -434,31 +437,7 @@ int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res); · 5 unmodified lines
434437 int ab8500_fg_inst_curr_done(struct ab8500_fg *di);
435438
436439 #else
437−int ab8500_fg_inst_curr_done(struct ab8500_fg *di)
438−{
439−}
440−static void ab8500_fg_reinit(void)
441−{
442−}
443−static void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA)
444−{
445−}
446−static struct ab8500_btemp *ab8500_btemp_get(void)
447−{
448− return NULL;
449−}
450−static int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp)
451−{
452− return 0;
453−}
454−struct ab8500_fg *ab8500_fg_get(void)
455−{
456− return NULL;
457−}
458−static int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev)
459−{
460− return -ENODEV;
461−}
440+static struct abx500_bm_data ab8500_bm_data;
462441
463442 static inline int ab8500_fg_inst_curr_start(struct ab8500_fg *di)
464443 {
include/linux/mfd/da9052/da9052.h+62−4
@@ -99,6 +99,9 @@ struct da9052 { · 98 unmodified lines
9999 u8 chip_id;
100100
101101 int chip_irq;
102+
103+ /* SOC I/O transfer related fixes for DA9052/53 */
104+ int (*fix_io) (struct da9052 *da9052, unsigned char reg);
102105 };
103106
104107 /* ADC API */
@@ -113,32 +116,87 @@ static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg) · 8 unmodified lines
113116 ret = regmap_read(da9052->regmap, reg, &val);
114117 if (ret < 0)
115118 return ret;
119+
120+ if (da9052->fix_io) {
121+ ret = da9052->fix_io(da9052, reg);
122+ if (ret < 0)
123+ return ret;
124+ }
125+
116126 return val;
117127 }
118128
119129 static inline int da9052_reg_write(struct da9052 *da9052, unsigned char reg,
120130 unsigned char val)
121131 {
122− return regmap_write(da9052->regmap, reg, val);
132+ int ret;
133+
134+ ret = regmap_write(da9052->regmap, reg, val);
135+ if (ret < 0)
136+ return ret;
137+
138+ if (da9052->fix_io) {
139+ ret = da9052->fix_io(da9052, reg);
140+ if (ret < 0)
141+ return ret;
142+ }
143+
144+ return ret;
123145 }
124146
125147 static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg,
126148 unsigned reg_cnt, unsigned char *val)
127149 {
128− return regmap_bulk_read(da9052->regmap, reg, val, reg_cnt);
150+ int ret;
151+
152+ ret = regmap_bulk_read(da9052->regmap, reg, val, reg_cnt);
153+ if (ret < 0)
154+ return ret;
155+
156+ if (da9052->fix_io) {
157+ ret = da9052->fix_io(da9052, reg);
158+ if (ret < 0)
159+ return ret;
160+ }
161+
162+ return ret;
129163 }
130164
131165 static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg,
132166 unsigned reg_cnt, unsigned char *val)
133167 {
134− return regmap_raw_write(da9052->regmap, reg, val, reg_cnt);
168+ int ret;
169+
170+ ret = regmap_raw_write(da9052->regmap, reg, val, reg_cnt);
171+ if (ret < 0)
172+ return ret;
173+
174+ if (da9052->fix_io) {
175+ ret = da9052->fix_io(da9052, reg);
176+ if (ret < 0)
177+ return ret;
178+ }
179+
180+ return ret;
135181 }
136182
137183 static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
138184 unsigned char bit_mask,
139185 unsigned char reg_val)
140186 {
141− return regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val);
187+ int ret;
188+
189+ ret = regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val);
190+ if (ret < 0)
191+ return ret;
192+
193+ if (da9052->fix_io) {
194+ ret = da9052->fix_io(da9052, reg);
195+ if (ret < 0)
196+ return ret;
197+ }
198+
199+ return ret;
142200 }
143201
144202 int da9052_device_init(struct da9052 *da9052, u8 chip_id);
include/linux/mfd/da9052/reg.h+3−0
@@ -34,6 +34,9 @@ · 33 unmodified lines
3434 #define DA9052_STATUS_C_REG 3
3535 #define DA9052_STATUS_D_REG 4
3636
37+/* PARK REGISTER */
38+#define DA9052_PARK_REGISTER DA9052_STATUS_D_REG
39+
3740 /* EVENT REGISTERS */
3841 #define DA9052_EVENT_A_REG 5
3942 #define DA9052_EVENT_B_REG 6
include/linux/mfd/rtsx_common.h+3−0
@@ -38,6 +38,9 @@ · 37 unmodified lines
3838 #define RTSX_SD_CARD 0
3939 #define RTSX_MS_CARD 1
4040
41+#define CLK_TO_DIV_N 0
42+#define DIV_N_TO_CLK 1
43+
4144 struct platform_device;
4245
4346 struct rtsx_slot {
include/linux/mfd/rtsx_pci.h+21−4
@@ -158,10 +158,9 @@ · 157 unmodified lines
158158 #define SG_TRANS_DATA (0x02 << 4)
159159 #define SG_LINK_DESC (0x03 << 4)
160160
161−/* SD bank voltage */
162−#define SD_IO_3V3 0
163−#define SD_IO_1V8 1
164−
161+/* Output voltage */
162+#define OUTPUT_3V3 0
163+#define OUTPUT_1V8 1
165164
166165 /* Card Clock Enable Register */
167166 #define SD_CLK_EN 0x04
@@ -201,6 +200,20 @@ · 33 unmodified lines
201200 #define CHANGE_CLK 0x01
202201
203202 /* LDO_CTL */
203+#define BPP_ASIC_1V7 0x00
204+#define BPP_ASIC_1V8 0x01
205+#define BPP_ASIC_1V9 0x02
206+#define BPP_ASIC_2V0 0x03
207+#define BPP_ASIC_2V7 0x04
208+#define BPP_ASIC_2V8 0x05
209+#define BPP_ASIC_3V2 0x06
210+#define BPP_ASIC_3V3 0x07
211+#define BPP_REG_TUNED18 0x07
212+#define BPP_TUNED18_SHIFT_8402 5
213+#define BPP_TUNED18_SHIFT_8411 4
214+#define BPP_PAD_MASK 0x04
215+#define BPP_PAD_3V3 0x04
216+#define BPP_PAD_1V8 0x00
204217 #define BPP_LDO_POWB 0x03
205218 #define BPP_LDO_ON 0x00
206219 #define BPP_LDO_SUSPEND 0x02
@@ -688,7 +701,10 @@ struct pcr_ops { · 481 unmodified lines
688701 int (*disable_auto_blink)(struct rtsx_pcr *pcr);
689702 int (*card_power_on)(struct rtsx_pcr *pcr, int card);
690703 int (*card_power_off)(struct rtsx_pcr *pcr, int card);
704+ int (*switch_output_voltage)(struct rtsx_pcr *pcr,
705+ u8 voltage);
691706 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
707+ int (*conv_clk_and_div_n)(int clk, int dir);
692708 };
693709
694710 enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
@@ -783,6 +799,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, · 88 unmodified lines
783799 u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
784800 int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
785801 int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
802+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage);
786803 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
787804 void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);
788805