Commit 89ae3d3b authored by Uwe Kleine-König's avatar Uwe Kleine-König

drm/msm/dp: use flags argument of devm_gpiod_get to set direction

Since 39b2bbe3 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Use this to simplify the driver. Furthermore this is one caller less
that stops us making the flags argument to gpiod_get*() mandatory.
Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent d770e558
...@@ -373,7 +373,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl) ...@@ -373,7 +373,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
struct device *dev = &ctrl->pdev->dev; struct device *dev = &ctrl->pdev->dev;
int ret; int ret;
ctrl->panel_hpd_gpio = devm_gpiod_get(dev, "panel-hpd"); ctrl->panel_hpd_gpio = devm_gpiod_get(dev, "panel-hpd", GPIOD_IN);
if (IS_ERR(ctrl->panel_hpd_gpio)) { if (IS_ERR(ctrl->panel_hpd_gpio)) {
ret = PTR_ERR(ctrl->panel_hpd_gpio); ret = PTR_ERR(ctrl->panel_hpd_gpio);
ctrl->panel_hpd_gpio = NULL; ctrl->panel_hpd_gpio = NULL;
...@@ -381,13 +381,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl) ...@@ -381,13 +381,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
return ret; return ret;
} }
ret = gpiod_direction_input(ctrl->panel_hpd_gpio); ctrl->panel_en_gpio = devm_gpiod_get(dev, "panel-en", GPIOD_OUT_LOW);
if (ret) {
pr_err("%s: Set direction for hpd failed, %d\n", __func__, ret);
return ret;
}
ctrl->panel_en_gpio = devm_gpiod_get(dev, "panel-en");
if (IS_ERR(ctrl->panel_en_gpio)) { if (IS_ERR(ctrl->panel_en_gpio)) {
ret = PTR_ERR(ctrl->panel_en_gpio); ret = PTR_ERR(ctrl->panel_en_gpio);
ctrl->panel_en_gpio = NULL; ctrl->panel_en_gpio = NULL;
...@@ -395,13 +389,6 @@ static int edp_gpio_config(struct edp_ctrl *ctrl) ...@@ -395,13 +389,6 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
return ret; return ret;
} }
ret = gpiod_direction_output(ctrl->panel_en_gpio, 0);
if (ret) {
pr_err("%s: Set direction for panel_en failed, %d\n",
__func__, ret);
return ret;
}
DBG("gpio on"); DBG("gpio on");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment