aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2013-02-03 18:49:47 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-04 05:31:31 -0500
commit26aec009f6b61c077c6de1a96cca7a5132851dbe (patch)
tree4d5ea32c3df9eee4a314403a4a82456866d434c8
parent31a932e1079d771df6c2daf0b8a871b9b34d7e83 (diff)
regulator: add device tree support for s5m8767
This device tree support is added for PMIC block of S5m8767 multi function driver. The usage detail is added in the device tree documentation section. This change is tested on exynos5250 based arndale platform by regulator voltage set/get API's. Reviewed-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Tested-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt152
-rw-r--r--drivers/mfd/sec-core.c75
-rw-r--r--drivers/regulator/s5m8767.c186
-rw-r--r--include/linux/mfd/samsung/core.h11
4 files changed, 417 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt b/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt
new file mode 100644
index 000000000000..a35ff99003a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt
@@ -0,0 +1,152 @@
1* Samsung S5M8767 Voltage and Current Regulator
2
3The Samsung S5M8767 is a multi-function device which includes volatage and
4current regulators, rtc, charger controller and other sub-blocks. It is
5interfaced to the host controller using a i2c interface. Each sub-block is
6addressed by the host system using different i2c slave address. This document
7describes the bindings for 'pmic' sub-block of s5m8767.
8
9Required properties:
10- compatible: Should be "samsung,s5m8767-pmic".
11- reg: Specifies the i2c slave address of the pmic block. It should be 0x66.
12
13- s5m8767,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
14 units for buck2 when changing voltage using gpio dvs. Refer to [1] below
15 for additional information.
16
17- s5m8767,pmic-buck3-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
18 units for buck3 when changing voltage using gpio dvs. Refer to [1] below
19 for additional information.
20
21- s5m8767,pmic-buck4-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
22 units for buck4 when changing voltage using gpio dvs. Refer to [1] below
23 for additional information.
24
25- s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
26 for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
27
28[1] If none of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
29 property is specified, the 's5m8767,pmic-buck[2/3/4]-dvs-voltage'
30 property should specify atleast one voltage level (which would be a
31 safe operating voltage).
32
33 If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
34 property is specified, then all the eight voltage values for the
35 's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
36
37Optional properties:
38- interrupt-parent: Specifies the phandle of the interrupt controller to which
39 the interrupts from s5m8767 are delivered to.
40- interrupts: Interrupt specifiers for two interrupt sources.
41 - First interrupt specifier is for 'irq1' interrupt.
42 - Second interrupt specifier is for 'alert' interrupt.
43- s5m8767,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
44- s5m8767,pmic-buck3-uses-gpio-dvs: 'buck3' can be controlled by gpio dvs.
45- s5m8767,pmic-buck4-uses-gpio-dvs: 'buck4' can be controlled by gpio dvs.
46
47Additional properties required if either of the optional properties are used:
48
49- s5m8767,pmic-buck234-default-dvs-idx: Default voltage setting selected from
50 the possible 8 options selectable by the dvs gpios. The value of this
51 property should be between 0 and 7. If not specified or if out of range, the
52 default value of this property is set to 0.
53
54- s5m8767,pmic-buck-dvs-gpios: GPIO specifiers for three host gpio's used
55 for dvs. The format of the gpio specifier depends in the gpio controller.
56
57Regulators: The regulators of s5m8767 that have to be instantiated should be
58included in a sub-node named 'regulators'. Regulator nodes included in this
59sub-node should be of the format as listed below.
60
61 regulator_name {
62 ldo1_reg: LDO1 {
63 regulator-name = "VDD_ALIVE_1.0V";
64 regulator-min-microvolt = <1100000>;
65 regulator-max-microvolt = <1100000>;
66 regulator-always-on;
67 regulator-boot-on;
68 op_mode = <1>; /* Normal Mode */
69 };
70 };
71The above regulator entries are defined in regulator bindings documentation
72except op_mode description.
73 - op_mode: describes the different operating modes of the LDO's with
74 power mode change in SOC. The different possible values are,
75 0 - always off mode
76 1 - on in normal mode
77 2 - low power mode
78 3 - suspend mode
79
80The following are the names of the regulators that the s5m8767 pmic block
81supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
82as per the datasheet of s5m8767.
83
84 - LDOn
85 - valid values for n are 1 to 28
86 - Example: LDO0, LD01, LDO28
87 - BUCKn
88 - valid values for n are 1 to 9.
89 - Example: BUCK1, BUCK2, BUCK9
90
91The bindings inside the regulator nodes use the standard regulator bindings
92which are documented elsewhere.
93
94Example:
95
96 s5m8767_pmic@66 {
97 compatible = "samsung,s5m8767-pmic";
98 reg = <0x66>;
99
100 s5m8767,pmic-buck2-uses-gpio-dvs;
101 s5m8767,pmic-buck3-uses-gpio-dvs;
102 s5m8767,pmic-buck4-uses-gpio-dvs;
103
104 s5m8767,pmic-buck-default-dvs-idx = <0>;
105
106 s5m8767,pmic-buck-dvs-gpios = <&gpx0 0 1 0 0>, /* DVS1 */
107 <&gpx0 1 1 0 0>, /* DVS2 */
108 <&gpx0 2 1 0 0>; /* DVS3 */
109
110 s5m8767,pmic-buck-ds-gpios = <&gpx2 3 1 0 0>, /* SET1 */
111 <&gpx2 4 1 0 0>, /* SET2 */
112 <&gpx2 5 1 0 0>; /* SET3 */
113
114 s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>,
115 <1250000>, <1200000>,
116 <1150000>, <1100000>,
117 <1000000>, <950000>;
118
119 s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
120 <1100000>, <1100000>,
121 <1000000>, <1000000>,
122 <1000000>, <1000000>;
123
124 s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
125 <1200000>, <1200000>,
126 <1200000>, <1200000>,
127 <1200000>, <1200000>;
128
129 regulators {
130 ldo1_reg: LDO1 {
131 regulator-name = "VDD_ABB_3.3V";
132 regulator-min-microvolt = <3300000>;
133 regulator-max-microvolt = <3300000>;
134 op_mode = <1>; /* Normal Mode */
135 };
136
137 ldo2_reg: LDO2 {
138 regulator-name = "VDD_ALIVE_1.1V";
139 regulator-min-microvolt = <1100000>;
140 regulator-max-microvolt = <1100000>;
141 regulator-always-on;
142 };
143
144 buck1_reg: BUCK1 {
145 regulator-name = "VDD_MIF_1.2V";
146 regulator-min-microvolt = <950000>;
147 regulator-max-microvolt = <1350000>;
148 regulator-always-on;
149 regulator-boot-on;
150 };
151 };
152 };
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 49d361a618d0..ae029834d0a0 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -17,6 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/of_irq.h>
20#include <linux/interrupt.h> 21#include <linux/interrupt.h>
21#include <linux/pm_runtime.h> 22#include <linux/pm_runtime.h>
22#include <linux/mutex.h> 23#include <linux/mutex.h>
@@ -60,6 +61,15 @@ static struct mfd_cell s2mps11_devs[] = {
60 }, 61 },
61}; 62};
62 63
64#ifdef CONFIG_OF
65static struct of_device_id sec_dt_match[] = {
66 { .compatible = "samsung,s5m8767-pmic",
67 .data = (void *)S5M8767X,
68 },
69 {},
70};
71#endif
72
63int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest) 73int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
64{ 74{
65 return regmap_read(sec_pmic->regmap, reg, dest); 75 return regmap_read(sec_pmic->regmap, reg, dest);
@@ -95,6 +105,57 @@ static struct regmap_config sec_regmap_config = {
95 .val_bits = 8, 105 .val_bits = 8,
96}; 106};
97 107
108
109#ifdef CONFIG_OF
110/*
111 * Only the common platform data elements for s5m8767 are parsed here from the
112 * device tree. Other sub-modules of s5m8767 such as pmic, rtc , charger and
113 * others have to parse their own platform data elements from device tree.
114 *
115 * The s5m8767 platform data structure is instantiated here and the drivers for
116 * the sub-modules need not instantiate another instance while parsing their
117 * platform data.
118 */
119static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
120 struct device *dev)
121{
122 struct sec_platform_data *pd;
123
124 pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
125 if (!pd) {
126 dev_err(dev, "could not allocate memory for pdata\n");
127 return ERR_PTR(-ENOMEM);
128 }
129
130 /*
131 * ToDo: the 'wakeup' member in the platform data is more of a linux
132 * specfic information. Hence, there is no binding for that yet and
133 * not parsed here.
134 */
135
136 return pd;
137}
138#else
139static struct sec_platform_data *sec_i2c_parse_dt_pdata(
140 struct device *dev)
141{
142 return 0;
143}
144#endif
145
146static inline int sec_i2c_get_driver_data(struct i2c_client *i2c,
147 const struct i2c_device_id *id)
148{
149#ifdef CONFIG_OF
150 if (i2c->dev.of_node) {
151 const struct of_device_id *match;
152 match = of_match_node(sec_dt_match, i2c->dev.of_node);
153 return (int)match->data;
154 }
155#endif
156 return (int)id->driver_data;
157}
158
98static int sec_pmic_probe(struct i2c_client *i2c, 159static int sec_pmic_probe(struct i2c_client *i2c,
99 const struct i2c_device_id *id) 160 const struct i2c_device_id *id)
100{ 161{
@@ -111,13 +172,22 @@ static int sec_pmic_probe(struct i2c_client *i2c,
111 sec_pmic->dev = &i2c->dev; 172 sec_pmic->dev = &i2c->dev;
112 sec_pmic->i2c = i2c; 173 sec_pmic->i2c = i2c;
113 sec_pmic->irq = i2c->irq; 174 sec_pmic->irq = i2c->irq;
114 sec_pmic->type = id->driver_data; 175 sec_pmic->type = sec_i2c_get_driver_data(i2c, id);
115 176
177 if (sec_pmic->dev->of_node) {
178 pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev);
179 if (IS_ERR(pdata)) {
180 ret = PTR_ERR(pdata);
181 return ret;
182 }
183 pdata->device_type = sec_pmic->type;
184 }
116 if (pdata) { 185 if (pdata) {
117 sec_pmic->device_type = pdata->device_type; 186 sec_pmic->device_type = pdata->device_type;
118 sec_pmic->ono = pdata->ono; 187 sec_pmic->ono = pdata->ono;
119 sec_pmic->irq_base = pdata->irq_base; 188 sec_pmic->irq_base = pdata->irq_base;
120 sec_pmic->wakeup = pdata->wakeup; 189 sec_pmic->wakeup = pdata->wakeup;
190 sec_pmic->pdata = pdata;
121 } 191 }
122 192
123 sec_pmic->regmap = devm_regmap_init_i2c(i2c, &sec_regmap_config); 193 sec_pmic->regmap = devm_regmap_init_i2c(i2c, &sec_regmap_config);
@@ -192,6 +262,7 @@ static struct i2c_driver sec_pmic_driver = {
192 .driver = { 262 .driver = {
193 .name = "sec_pmic", 263 .name = "sec_pmic",
194 .owner = THIS_MODULE, 264 .owner = THIS_MODULE,
265 .of_match_table = of_match_ptr(sec_dt_match),
195 }, 266 },
196 .probe = sec_pmic_probe, 267 .probe = sec_pmic_probe,
197 .remove = sec_pmic_remove, 268 .remove = sec_pmic_remove,
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index aa0ccef5c31c..1250cef43d7b 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -14,6 +14,7 @@
14#include <linux/bug.h> 14#include <linux/bug.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/of_gpio.h>
17#include <linux/slab.h> 18#include <linux/slab.h>
18#include <linux/module.h> 19#include <linux/module.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
@@ -21,6 +22,9 @@
21#include <linux/regulator/machine.h> 22#include <linux/regulator/machine.h>
22#include <linux/mfd/samsung/core.h> 23#include <linux/mfd/samsung/core.h>
23#include <linux/mfd/samsung/s5m8767.h> 24#include <linux/mfd/samsung/s5m8767.h>
25#include <linux/regulator/of_regulator.h>
26
27#define S5M8767_OPMODE_NORMAL_MODE 0x1
24 28
25struct s5m8767_info { 29struct s5m8767_info {
26 struct device *dev; 30 struct device *dev;
@@ -474,15 +478,194 @@ static struct regulator_desc regulators[] = {
474 s5m8767_regulator_desc(BUCK9), 478 s5m8767_regulator_desc(BUCK9),
475}; 479};
476 480
481#ifdef CONFIG_OF
482static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
483 struct sec_platform_data *pdata,
484 struct device_node *pmic_np)
485{
486 int i, gpio;
487
488 for (i = 0; i < 3; i++) {
489 gpio = of_get_named_gpio(pmic_np,
490 "s5m8767,pmic-buck-dvs-gpios", i);
491 if (!gpio_is_valid(gpio)) {
492 dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
493 return -EINVAL;
494 }
495 pdata->buck_gpios[i] = gpio;
496 }
497 return 0;
498}
499
500static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev,
501 struct sec_platform_data *pdata,
502 struct device_node *pmic_np)
503{
504 int i, gpio;
505
506 for (i = 0; i < 3; i++) {
507 gpio = of_get_named_gpio(pmic_np,
508 "s5m8767,pmic-buck-ds-gpios", i);
509 if (!gpio_is_valid(gpio)) {
510 dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
511 return -EINVAL;
512 }
513 pdata->buck_ds[i] = gpio;
514 }
515 return 0;
516}
517
518static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev,
519 struct sec_platform_data *pdata)
520{
521 struct device_node *pmic_np, *regulators_np, *reg_np;
522 struct sec_regulator_data *rdata;
523 struct sec_opmode_data *rmode;
524 unsigned int i, dvs_voltage_nr = 1, ret;
525
526 pmic_np = iodev->dev->of_node;
527 if (!pmic_np) {
528 dev_err(iodev->dev, "could not find pmic sub-node\n");
529 return -ENODEV;
530 }
531
532 regulators_np = of_find_node_by_name(pmic_np, "regulators");
533 if (!regulators_np) {
534 dev_err(iodev->dev, "could not find regulators sub-node\n");
535 return -EINVAL;
536 }
537
538 /* count the number of regulators to be supported in pmic */
539 pdata->num_regulators = 0;
540 for_each_child_of_node(regulators_np, reg_np)
541 pdata->num_regulators++;
542
543 rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) *
544 pdata->num_regulators, GFP_KERNEL);
545 if (!rdata) {
546 dev_err(iodev->dev,
547 "could not allocate memory for regulator data\n");
548 return -ENOMEM;
549 }
550
551 rmode = devm_kzalloc(iodev->dev, sizeof(*rmode) *
552 pdata->num_regulators, GFP_KERNEL);
553 if (!rdata) {
554 dev_err(iodev->dev,
555 "could not allocate memory for regulator mode\n");
556 return -ENOMEM;
557 }
558
559 pdata->regulators = rdata;
560 pdata->opmode = rmode;
561 for_each_child_of_node(regulators_np, reg_np) {
562 for (i = 0; i < ARRAY_SIZE(regulators); i++)
563 if (!of_node_cmp(reg_np->name, regulators[i].name))
564 break;
565
566 if (i == ARRAY_SIZE(regulators)) {
567 dev_warn(iodev->dev,
568 "don't know how to configure regulator %s\n",
569 reg_np->name);
570 continue;
571 }
572
573 rdata->id = i;
574 rdata->initdata = of_get_regulator_init_data(
575 iodev->dev, reg_np);
576 rdata->reg_node = reg_np;
577 rdata++;
578 rmode->id = i;
579 if (of_property_read_u32(reg_np, "op_mode",
580 &rmode->mode)) {
581 dev_warn(iodev->dev,
582 "no op_mode property property at %s\n",
583 reg_np->full_name);
584
585 rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
586 }
587 rmode++;
588 }
589
590 if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL))
591 pdata->buck2_gpiodvs = true;
592
593 if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL))
594 pdata->buck3_gpiodvs = true;
595
596 if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL))
597 pdata->buck4_gpiodvs = true;
598
599 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
600 pdata->buck4_gpiodvs) {
601 ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
602 if (ret)
603 return -EINVAL;
604
605 if (of_property_read_u32(pmic_np,
606 "s5m8767,pmic-buck-default-dvs-idx",
607 &pdata->buck_default_idx)) {
608 pdata->buck_default_idx = 0;
609 } else {
610 if (pdata->buck_default_idx >= 8) {
611 pdata->buck_default_idx = 0;
612 dev_info(iodev->dev,
613 "invalid value for default dvs index, use 0\n");
614 }
615 }
616 dvs_voltage_nr = 8;
617 }
618
619 ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
620 if (ret)
621 return -EINVAL;
622
623 if (of_property_read_u32_array(pmic_np,
624 "s5m8767,pmic-buck2-dvs-voltage",
625 pdata->buck2_voltage, dvs_voltage_nr)) {
626 dev_err(iodev->dev, "buck2 voltages not specified\n");
627 return -EINVAL;
628 }
629
630 if (of_property_read_u32_array(pmic_np,
631 "s5m8767,pmic-buck3-dvs-voltage",
632 pdata->buck3_voltage, dvs_voltage_nr)) {
633 dev_err(iodev->dev, "buck3 voltages not specified\n");
634 return -EINVAL;
635 }
636
637 if (of_property_read_u32_array(pmic_np,
638 "s5m8767,pmic-buck4-dvs-voltage",
639 pdata->buck4_voltage, dvs_voltage_nr)) {
640 dev_err(iodev->dev, "buck4 voltages not specified\n");
641 return -EINVAL;
642 }
643
644 return 0;
645}
646#else
647static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev,
648 struct sec_platform_data *pdata)
649{
650 return 0;
651}
652#endif /* CONFIG_OF */
653
477static int s5m8767_pmic_probe(struct platform_device *pdev) 654static int s5m8767_pmic_probe(struct platform_device *pdev)
478{ 655{
479 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); 656 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
480 struct sec_platform_data *pdata = dev_get_platdata(iodev->dev); 657 struct sec_platform_data *pdata = iodev->pdata;
481 struct regulator_config config = { }; 658 struct regulator_config config = { };
482 struct regulator_dev **rdev; 659 struct regulator_dev **rdev;
483 struct s5m8767_info *s5m8767; 660 struct s5m8767_info *s5m8767;
484 int i, ret, size, buck_init; 661 int i, ret, size, buck_init;
485 662
663 if (iodev->dev->of_node) {
664 ret = s5m8767_pmic_dt_parse_pdata(iodev, pdata);
665 if (ret)
666 return ret;
667 }
668
486 if (!pdata) { 669 if (!pdata) {
487 dev_err(pdev->dev.parent, "Platform data not supplied\n"); 670 dev_err(pdev->dev.parent, "Platform data not supplied\n");
488 return -ENODEV; 671 return -ENODEV;
@@ -726,6 +909,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
726 config.init_data = pdata->regulators[i].initdata; 909 config.init_data = pdata->regulators[i].initdata;
727 config.driver_data = s5m8767; 910 config.driver_data = s5m8767;
728 config.regmap = iodev->regmap; 911 config.regmap = iodev->regmap;
912 config.of_node = pdata->regulators[i].reg_node;
729 913
730 rdev[i] = regulator_register(&regulators[id], &config); 914 rdev[i] = regulator_register(&regulators[id], &config);
731 if (IS_ERR(rdev[i])) { 915 if (IS_ERR(rdev[i])) {
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index b50c38f8bc48..f0f4de3b4ccc 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -26,6 +26,7 @@ enum sec_device_type {
26/** 26/**
27 * struct sec_pmic_dev - s5m87xx master device for sub-drivers 27 * struct sec_pmic_dev - s5m87xx master device for sub-drivers
28 * @dev: master device of the chip (can be used to access platform data) 28 * @dev: master device of the chip (can be used to access platform data)
29 * @pdata: pointer to private data used to pass platform data to child
29 * @i2c: i2c client private data for regulator 30 * @i2c: i2c client private data for regulator
30 * @rtc: i2c client private data for rtc 31 * @rtc: i2c client private data for rtc
31 * @iolock: mutex for serializing io access 32 * @iolock: mutex for serializing io access
@@ -39,6 +40,7 @@ enum sec_device_type {
39 */ 40 */
40struct sec_pmic_dev { 41struct sec_pmic_dev {
41 struct device *dev; 42 struct device *dev;
43 struct sec_platform_data *pdata;
42 struct regmap *regmap; 44 struct regmap *regmap;
43 struct i2c_client *i2c; 45 struct i2c_client *i2c;
44 struct i2c_client *rtc; 46 struct i2c_client *rtc;
@@ -82,11 +84,11 @@ struct sec_platform_data {
82 84
83 int buck_gpios[3]; 85 int buck_gpios[3];
84 int buck_ds[3]; 86 int buck_ds[3];
85 int buck2_voltage[8]; 87 unsigned int buck2_voltage[8];
86 bool buck2_gpiodvs; 88 bool buck2_gpiodvs;
87 int buck3_voltage[8]; 89 unsigned int buck3_voltage[8];
88 bool buck3_gpiodvs; 90 bool buck3_gpiodvs;
89 int buck4_voltage[8]; 91 unsigned int buck4_voltage[8];
90 bool buck4_gpiodvs; 92 bool buck4_gpiodvs;
91 93
92 int buck_set1; 94 int buck_set1;
@@ -127,6 +129,7 @@ struct sec_platform_data {
127struct sec_regulator_data { 129struct sec_regulator_data {
128 int id; 130 int id;
129 struct regulator_init_data *initdata; 131 struct regulator_init_data *initdata;
132 struct device_node *reg_node;
130}; 133};
131 134
132/* 135/*
@@ -136,7 +139,7 @@ struct sec_regulator_data {
136 */ 139 */
137struct sec_opmode_data { 140struct sec_opmode_data {
138 int id; 141 int id;
139 int mode; 142 unsigned int mode;
140}; 143};
141 144
142/* 145/*