summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Cai <robby.cai@nxp.com>2016-01-07 18:19:34 +0800
committerOctavian Purdila <octavian.purdila@nxp.com>2017-02-23 14:21:42 +0200
commit2c660cd387b06fb1bb18bbfcd35a5963981962e5 (patch)
tree16f32528b183c8548729c926d82424ac8309bc02
parent3119ce5c601f7c7fee7dbbe7c2f2255497302f14 (diff)
MLK-12144 epdc: fix gpio active level to enable epdc signal
There's a GPIO pin to enable epdc signals on some platform like i.MX7D SDB. However, it's changed from active-low to active-high on i.MX7D SDB RevB board. Enhance the driver to handle the active level automatically, then only need to adjust gpio as well as active level in dts file if necessary. Signed-off-by: Robby Cai <robby.cai@nxp.com>
-rw-r--r--drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
index 4a1a474e11ce..2f784f012517 100644
--- a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
+++ b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
@@ -4920,6 +4920,7 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
phandle phandle;
u32 out_val[3];
int enable_gpio;
+ enum of_gpio_flags flag;
if (!np)
return -EINVAL;
@@ -4958,7 +4959,7 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
}
if (of_find_property(np, "en-gpios", NULL)) {
- enable_gpio = of_get_named_gpio(np, "en-gpios", 0);
+ enable_gpio = of_get_named_gpio_flags(np, "en-gpios", 0, &flag);
if (enable_gpio == -EPROBE_DEFER) {
dev_info(&pdev->dev, "GPIO requested is not"
"here yet, deferring the probe\n");
@@ -4970,7 +4971,9 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
ret = devm_gpio_request_one(&pdev->dev,
enable_gpio,
- GPIOF_OUT_INIT_LOW,
+ (flag & OF_GPIO_ACTIVE_LOW)
+ ? GPIOF_OUT_INIT_LOW :
+ GPIOF_OUT_INIT_HIGH,
"en_pins");
if (ret) {
dev_err(&pdev->dev, "failed to request gpio"