aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 15:41:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 15:41:17 -0400
commit3e701cdfe601306817604ca7f79f1d1c1088007c (patch)
tree1b0a4088a091f035d8be06758a604ca449223fc0 /drivers/regulator
parent7d3d09b01a028e9dd1282149fdcd2a6e0edd73e4 (diff)
parent3c1534c7ecffeb4330bba4c55d17f301528195b6 (diff)
Merge tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD bits from Samuel Ortiz: "We have support for a few new drivers: - Samsung s2mps11 - Wolfson Microelectronics wm5102 and wm5110 - Marvell 88PM800 and 88PM805 - TI twl6041 We also have our regular driver improvements: - Device tree and IRQ domain support for STE AB8500 - Regmap and devm_* API conversion for TI tps6586x - Device tree support for Samsung max77686 - devm_* API conversion for STE AB3100 Besides that, quite a lot of fixing and cleanup for mc13xxx, tps65910, tps65090, da9052 and twl-core." Fix up mostly trivial conflicts, with the exception of drivers/usb/host/ehci-omap.c in particular, which had some re-organization of the reset sequence (commit 1a49e2ac9651: "EHCI: centralize controller initialization") that clashed with commit 2761a6394516 ("mfd: USB: Fix the omap-usb EHCI ULPI PHY reset fix issues"). In particular, commit 2761a6394516 moved the usb_add_hcd() to the *middle* of the reset sequence, which clashes fairly badly with the reset sequence re-organization (although it could have been done inside the new omap_ehci_init() function). I left that part of commit 2761a6394516 just undone. * tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (110 commits) mfd: Ensure AB8500 platform data is passed through db8500-prcmu to MFD Core mfd: Arizone core should select MFD_CORE mfd: Fix arizona-irq.c build by selecting REGMAP_IRQ mfd: Add debug trace on entering and leaving arizone runtime suspend mfd: Correct tps65090 cell names mfd: Remove gpio support from tps6586x core driver ARM: tegra: defconfig: Enable tps6586x gpio gpio: tps6586x: Add gpio support through platform driver mfd: Cache tps6586x register through regmap mfd: Use regmap for tps6586x register access. mfd: Use devm managed resources for tps6586x input: Add onkey support for 88PM80X PMIC mfd: Add support for twl6041 mfd: Fix twl6040 revision information mfd: Matches should be NULL when populate anatop child devices input: ab8500-ponkey: Create AB8500 domain IRQ mapping mfd: Add missing out of memory check for pcf50633 Documentation: Describe the AB8500 Device Tree bindings mfd: Add tps65910 32-kHz-crystal-input init mfd: Drop modifying mc13xxx driver's id_table in probe ...
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/Kconfig2
-rw-r--r--drivers/regulator/ab8500.c6
-rw-r--r--drivers/regulator/db8500-prcmu.c6
-rw-r--r--drivers/regulator/s5m8767.c72
4 files changed, 37 insertions, 49 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index f34c3be6c9fe..4e932cc695e9 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -272,7 +272,7 @@ config REGULATOR_S2MPS11
272 272
273config REGULATOR_S5M8767 273config REGULATOR_S5M8767
274 tristate "Samsung S5M8767A voltage regulator" 274 tristate "Samsung S5M8767A voltage regulator"
275 depends on MFD_S5M_CORE 275 depends on MFD_SEC_CORE
276 help 276 help
277 This driver supports a Samsung S5M8767A voltage output regulator 277 This driver supports a Samsung S5M8767A voltage output regulator
278 via I2C bus. S5M8767A have 9 Bucks and 28 LDOs output and 278 via I2C bus. S5M8767A have 9 Bucks and 28 LDOs output and
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 13d424fc1c14..10f2f4d4d190 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -848,18 +848,12 @@ static __devexit int ab8500_regulator_remove(struct platform_device *pdev)
848 return 0; 848 return 0;
849} 849}
850 850
851static const struct of_device_id ab8500_regulator_match[] = {
852 { .compatible = "stericsson,ab8500-regulator", },
853 {}
854};
855
856static struct platform_driver ab8500_regulator_driver = { 851static struct platform_driver ab8500_regulator_driver = {
857 .probe = ab8500_regulator_probe, 852 .probe = ab8500_regulator_probe,
858 .remove = __devexit_p(ab8500_regulator_remove), 853 .remove = __devexit_p(ab8500_regulator_remove),
859 .driver = { 854 .driver = {
860 .name = "ab8500-regulator", 855 .name = "ab8500-regulator",
861 .owner = THIS_MODULE, 856 .owner = THIS_MODULE,
862 .of_match_table = ab8500_regulator_match,
863 }, 857 },
864}; 858};
865 859
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c
index 9dbb491b6efa..359f8d18fc3f 100644
--- a/drivers/regulator/db8500-prcmu.c
+++ b/drivers/regulator/db8500-prcmu.c
@@ -547,16 +547,10 @@ static int __exit db8500_regulator_remove(struct platform_device *pdev)
547 return 0; 547 return 0;
548} 548}
549 549
550static const struct of_device_id db8500_prcmu_regulator_match[] = {
551 { .compatible = "stericsson,db8500-prcmu-regulator", },
552 {}
553};
554
555static struct platform_driver db8500_regulator_driver = { 550static struct platform_driver db8500_regulator_driver = {
556 .driver = { 551 .driver = {
557 .name = "db8500-prcmu-regulators", 552 .name = "db8500-prcmu-regulators",
558 .owner = THIS_MODULE, 553 .owner = THIS_MODULE,
559 .of_match_table = db8500_prcmu_regulator_match,
560 }, 554 },
561 .probe = db8500_regulator_probe, 555 .probe = db8500_regulator_probe,
562 .remove = __exit_p(db8500_regulator_remove), 556 .remove = __exit_p(db8500_regulator_remove),
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 102287fa7ecb..5a0d18a7aa2a 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -19,15 +19,15 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/regulator/driver.h> 20#include <linux/regulator/driver.h>
21#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
22#include <linux/mfd/s5m87xx/s5m-core.h> 22#include <linux/mfd/samsung/core.h>
23#include <linux/mfd/s5m87xx/s5m-pmic.h> 23#include <linux/mfd/samsung/s5m8767.h>
24 24
25struct s5m8767_info { 25struct s5m8767_info {
26 struct device *dev; 26 struct device *dev;
27 struct s5m87xx_dev *iodev; 27 struct sec_pmic_dev *iodev;
28 int num_regulators; 28 int num_regulators;
29 struct regulator_dev **rdev; 29 struct regulator_dev **rdev;
30 struct s5m_opmode_data *opmode; 30 struct sec_opmode_data *opmode;
31 31
32 int ramp_delay; 32 int ramp_delay;
33 bool buck2_ramp; 33 bool buck2_ramp;
@@ -45,43 +45,43 @@ struct s5m8767_info {
45 int buck_gpioindex; 45 int buck_gpioindex;
46}; 46};
47 47
48struct s5m_voltage_desc { 48struct sec_voltage_desc {
49 int max; 49 int max;
50 int min; 50 int min;
51 int step; 51 int step;
52}; 52};
53 53
54static const struct s5m_voltage_desc buck_voltage_val1 = { 54static const struct sec_voltage_desc buck_voltage_val1 = {
55 .max = 2225000, 55 .max = 2225000,
56 .min = 650000, 56 .min = 650000,
57 .step = 6250, 57 .step = 6250,
58}; 58};
59 59
60static const struct s5m_voltage_desc buck_voltage_val2 = { 60static const struct sec_voltage_desc buck_voltage_val2 = {
61 .max = 1600000, 61 .max = 1600000,
62 .min = 600000, 62 .min = 600000,
63 .step = 6250, 63 .step = 6250,
64}; 64};
65 65
66static const struct s5m_voltage_desc buck_voltage_val3 = { 66static const struct sec_voltage_desc buck_voltage_val3 = {
67 .max = 3000000, 67 .max = 3000000,
68 .min = 750000, 68 .min = 750000,
69 .step = 12500, 69 .step = 12500,
70}; 70};
71 71
72static const struct s5m_voltage_desc ldo_voltage_val1 = { 72static const struct sec_voltage_desc ldo_voltage_val1 = {
73 .max = 3950000, 73 .max = 3950000,
74 .min = 800000, 74 .min = 800000,
75 .step = 50000, 75 .step = 50000,
76}; 76};
77 77
78static const struct s5m_voltage_desc ldo_voltage_val2 = { 78static const struct sec_voltage_desc ldo_voltage_val2 = {
79 .max = 2375000, 79 .max = 2375000,
80 .min = 800000, 80 .min = 800000,
81 .step = 25000, 81 .step = 25000,
82}; 82};
83 83
84static const struct s5m_voltage_desc *reg_voltage_map[] = { 84static const struct sec_voltage_desc *reg_voltage_map[] = {
85 [S5M8767_LDO1] = &ldo_voltage_val2, 85 [S5M8767_LDO1] = &ldo_voltage_val2,
86 [S5M8767_LDO2] = &ldo_voltage_val2, 86 [S5M8767_LDO2] = &ldo_voltage_val2,
87 [S5M8767_LDO3] = &ldo_voltage_val1, 87 [S5M8767_LDO3] = &ldo_voltage_val1,
@@ -213,7 +213,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev)
213 else if (ret) 213 else if (ret)
214 return ret; 214 return ret;
215 215
216 ret = s5m_reg_read(s5m8767->iodev, reg, &val); 216 ret = sec_reg_read(s5m8767->iodev, reg, &val);
217 if (ret) 217 if (ret)
218 return ret; 218 return ret;
219 219
@@ -230,7 +230,7 @@ static int s5m8767_reg_enable(struct regulator_dev *rdev)
230 if (ret) 230 if (ret)
231 return ret; 231 return ret;
232 232
233 return s5m_reg_update(s5m8767->iodev, reg, enable_ctrl, mask); 233 return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, mask);
234} 234}
235 235
236static int s5m8767_reg_disable(struct regulator_dev *rdev) 236static int s5m8767_reg_disable(struct regulator_dev *rdev)
@@ -243,7 +243,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
243 if (ret) 243 if (ret)
244 return ret; 244 return ret;
245 245
246 return s5m_reg_update(s5m8767->iodev, reg, ~mask, mask); 246 return sec_reg_update(s5m8767->iodev, reg, ~mask, mask);
247} 247}
248 248
249static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg) 249static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
@@ -305,7 +305,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev *rdev)
305 305
306 mask = (reg_id < S5M8767_BUCK1) ? 0x3f : 0xff; 306 mask = (reg_id < S5M8767_BUCK1) ? 0x3f : 0xff;
307 307
308 ret = s5m_reg_read(s5m8767->iodev, reg, &val); 308 ret = sec_reg_read(s5m8767->iodev, reg, &val);
309 if (ret) 309 if (ret)
310 return ret; 310 return ret;
311 311
@@ -315,7 +315,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev *rdev)
315} 315}
316 316
317static int s5m8767_convert_voltage_to_sel( 317static int s5m8767_convert_voltage_to_sel(
318 const struct s5m_voltage_desc *desc, 318 const struct sec_voltage_desc *desc,
319 int min_vol, int max_vol) 319 int min_vol, int max_vol)
320{ 320{
321 int selector = 0; 321 int selector = 0;
@@ -407,7 +407,7 @@ static int s5m8767_set_voltage_sel(struct regulator_dev *rdev,
407 if (ret) 407 if (ret)
408 return ret; 408 return ret;
409 409
410 return s5m_reg_update(s5m8767->iodev, reg, selector, mask); 410 return sec_reg_update(s5m8767->iodev, reg, selector, mask);
411 } 411 }
412} 412}
413 413
@@ -416,7 +416,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
416 unsigned int new_sel) 416 unsigned int new_sel)
417{ 417{
418 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 418 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
419 const struct s5m_voltage_desc *desc; 419 const struct sec_voltage_desc *desc;
420 int reg_id = rdev_get_id(rdev); 420 int reg_id = rdev_get_id(rdev);
421 421
422 desc = reg_voltage_map[reg_id]; 422 desc = reg_voltage_map[reg_id];
@@ -501,8 +501,8 @@ static struct regulator_desc regulators[] = {
501 501
502static __devinit int s5m8767_pmic_probe(struct platform_device *pdev) 502static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
503{ 503{
504 struct s5m87xx_dev *iodev = dev_get_drvdata(pdev->dev.parent); 504 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
505 struct s5m_platform_data *pdata = dev_get_platdata(iodev->dev); 505 struct sec_platform_data *pdata = dev_get_platdata(iodev->dev);
506 struct regulator_config config = { }; 506 struct regulator_config config = { };
507 struct regulator_dev **rdev; 507 struct regulator_dev **rdev;
508 struct s5m8767_info *s5m8767; 508 struct s5m8767_info *s5m8767;
@@ -671,13 +671,13 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
671 671
672 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || 672 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
673 pdata->buck4_gpiodvs) { 673 pdata->buck4_gpiodvs) {
674 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL, 674 sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL,
675 (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1), 675 (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1),
676 1 << 1); 676 1 << 1);
677 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL, 677 sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL,
678 (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1), 678 (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1),
679 1 << 1); 679 1 << 1);
680 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK4CTRL, 680 sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK4CTRL,
681 (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1), 681 (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1),
682 1 << 1); 682 1 << 1);
683 } 683 }
@@ -685,61 +685,61 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
685 /* Initialize GPIO DVS registers */ 685 /* Initialize GPIO DVS registers */
686 for (i = 0; i < 8; i++) { 686 for (i = 0; i < 8; i++) {
687 if (s5m8767->buck2_gpiodvs) { 687 if (s5m8767->buck2_gpiodvs) {
688 s5m_reg_write(s5m8767->iodev, S5M8767_REG_BUCK2DVS1 + i, 688 sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK2DVS1 + i,
689 s5m8767->buck2_vol[i]); 689 s5m8767->buck2_vol[i]);
690 } 690 }
691 691
692 if (s5m8767->buck3_gpiodvs) { 692 if (s5m8767->buck3_gpiodvs) {
693 s5m_reg_write(s5m8767->iodev, S5M8767_REG_BUCK3DVS1 + i, 693 sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK3DVS1 + i,
694 s5m8767->buck3_vol[i]); 694 s5m8767->buck3_vol[i]);
695 } 695 }
696 696
697 if (s5m8767->buck4_gpiodvs) { 697 if (s5m8767->buck4_gpiodvs) {
698 s5m_reg_write(s5m8767->iodev, S5M8767_REG_BUCK4DVS1 + i, 698 sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK4DVS1 + i,
699 s5m8767->buck4_vol[i]); 699 s5m8767->buck4_vol[i]);
700 } 700 }
701 } 701 }
702 702
703 if (s5m8767->buck2_ramp) 703 if (s5m8767->buck2_ramp)
704 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x08, 0x08); 704 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x08, 0x08);
705 705
706 if (s5m8767->buck3_ramp) 706 if (s5m8767->buck3_ramp)
707 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x04, 0x04); 707 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x04, 0x04);
708 708
709 if (s5m8767->buck4_ramp) 709 if (s5m8767->buck4_ramp)
710 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x02, 0x02); 710 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x02, 0x02);
711 711
712 if (s5m8767->buck2_ramp || s5m8767->buck3_ramp 712 if (s5m8767->buck2_ramp || s5m8767->buck3_ramp
713 || s5m8767->buck4_ramp) { 713 || s5m8767->buck4_ramp) {
714 switch (s5m8767->ramp_delay) { 714 switch (s5m8767->ramp_delay) {
715 case 5: 715 case 5:
716 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 716 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
717 0x40, 0xf0); 717 0x40, 0xf0);
718 break; 718 break;
719 case 10: 719 case 10:
720 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 720 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
721 0x90, 0xf0); 721 0x90, 0xf0);
722 break; 722 break;
723 case 25: 723 case 25:
724 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 724 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
725 0xd0, 0xf0); 725 0xd0, 0xf0);
726 break; 726 break;
727 case 50: 727 case 50:
728 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 728 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
729 0xe0, 0xf0); 729 0xe0, 0xf0);
730 break; 730 break;
731 case 100: 731 case 100:
732 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 732 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
733 0xf0, 0xf0); 733 0xf0, 0xf0);
734 break; 734 break;
735 default: 735 default:
736 s5m_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 736 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
737 0x90, 0xf0); 737 0x90, 0xf0);
738 } 738 }
739 } 739 }
740 740
741 for (i = 0; i < pdata->num_regulators; i++) { 741 for (i = 0; i < pdata->num_regulators; i++) {
742 const struct s5m_voltage_desc *desc; 742 const struct sec_voltage_desc *desc;
743 int id = pdata->regulators[i].id; 743 int id = pdata->regulators[i].id;
744 744
745 desc = reg_voltage_map[id]; 745 desc = reg_voltage_map[id];