summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2013-06-14 17:12:50 +0800
committerRobby Cai <R63905@freescale.com>2013-06-19 11:47:09 +0800
commit7a4e5cb4469269e90957463ee32564a3c0752090 (patch)
tree1f70b4721f8e087ccd628daa2db5930b87615041
parent607e877e4d69c24836fb345b6fc87d37cefd0d69 (diff)
ENGR00267228-1 dts: imx6qdl-sabresd: add sensor power supply
Add dts for sensor power ctrl, this is needed for light sensor, eCompass, disp pmic, etc. Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit da2346d4b04ea92829067c4c6898a2840c77ebf4)
-rw-r--r--Documentation/devicetree/bindings/regulator/max17135-regulator.txt2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabresd.dtsi8
-rw-r--r--drivers/mfd/max17135-core.c10
3 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/regulator/max17135-regulator.txt b/Documentation/devicetree/bindings/regulator/max17135-regulator.txt
index ded1c193b7b7..3241baf6736f 100644
--- a/Documentation/devicetree/bindings/regulator/max17135-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/max17135-regulator.txt
@@ -16,6 +16,7 @@ Required properties :
- vpos_pwrdn: the timing for VPOS power down
- gvee_pwrdn: the timing for GVEE power down
- vneg_pwrdn: the timing for VNEG power down
+- SENSOR-supply: the gpio regulator to control the supply for this chip
- gpio_pmic_pwrgood: gpio setting for EPDC_PWRSTAT
- gpio_pmic_vcom_ctrl: gpio setting for EPDC_VCOM
- gpio_pmic_wakeup: gpio setting for EPDC_PWRWAKEUP
@@ -44,6 +45,7 @@ Example:
vpos_pwrdn = <2>;
gvee_pwrdn = <1>;
vneg_pwrdn = <1>;
+ SENSOR-supply = <&reg_sensor>;
gpio_pmic_pwrgood = <&gpio2 21 0>;
gpio_pmic_vcom_ctrl = <&gpio3 17 0>;
gpio_pmic_wakeup = <&gpio3 20 0>;
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 16ba13977e8f..2b3c29c2e4dc 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -373,6 +373,7 @@
vpos_pwrdn = <2>;
gvee_pwrdn = <1>;
vneg_pwrdn = <1>;
+ SENSOR-supply = <&reg_sensor>;
gpio_pmic_pwrgood = <&gpio2 21 0>;
gpio_pmic_vcom_ctrl = <&gpio3 17 0>;
gpio_pmic_wakeup = <&gpio3 20 0>;
@@ -511,6 +512,13 @@
gpio = <&gpio1 29 0>;
enable-active-high;
};
+
+ reg_sensor: sensor_supply {
+ compatible = "regulator-fixed";
+ regulator-name = "sensor-SUPPLY";
+ gpio = <&gpio2 31 0>;
+ enable-active-high;
+ };
};
sound-hdmi {
diff --git a/drivers/mfd/max17135-core.c b/drivers/mfd/max17135-core.c
index ee119022bbb8..52efe22964e5 100644
--- a/drivers/mfd/max17135-core.c
+++ b/drivers/mfd/max17135-core.c
@@ -49,6 +49,7 @@
#include <asm/mach-types.h>
struct i2c_client *max17135_client;
+static struct regulator *gpio_regulator;
static struct mfd_cell max17135_devs[] = {
{ .name = "max17135-pmic", },
@@ -137,6 +138,15 @@ static int max17135_probe(struct i2c_client *client,
if (!np)
return -ENODEV;
+ gpio_regulator = devm_regulator_get(&client->dev, "SENSOR");
+ if (gpio_regulator) {
+ ret = regulator_enable(gpio_regulator);
+ if (ret) {
+ dev_err(&client->dev, "gpio set voltage error\n");
+ return ret;
+ }
+ }
+
/* Create the PMIC data structure */
max17135 = kzalloc(sizeof(struct max17135), GFP_KERNEL);
if (max17135 == NULL) {