All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
@ 2015-06-09  9:38 Uwe Kleine-König
  2015-06-10  2:23 ` Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2015-06-09  9:38 UTC (permalink / raw)
  To: David Airlie; +Cc: dri-devel, kernel

Since 39b2bbe3d715 (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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/msm/edp/edp_ctrl.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c
index 29e52d7c61c0..490f751c5804 100644
--- a/drivers/gpu/drm/msm/edp/edp_ctrl.c
+++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c
@@ -373,7 +373,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 	struct device *dev = &ctrl->pdev->dev;
 	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)) {
 		ret = PTR_ERR(ctrl->panel_hpd_gpio);
 		ctrl->panel_hpd_gpio = NULL;
@@ -381,13 +381,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 		return ret;
 	}
 
-	ret = gpiod_direction_input(ctrl->panel_hpd_gpio);
-	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");
+	ctrl->panel_en_gpio = devm_gpiod_get(dev, "panel-en", GPIOD_OUT_LOW);
 	if (IS_ERR(ctrl->panel_en_gpio)) {
 		ret = PTR_ERR(ctrl->panel_en_gpio);
 		ctrl->panel_en_gpio = NULL;
@@ -395,13 +389,6 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 		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");
 
 	return 0;
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-09  9:38 [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
@ 2015-06-10  2:23 ` Alexandre Courbot
  2015-06-10 12:57 ` Linus Walleij
  2015-06-15 21:00 ` Uwe Kleine-König
  2 siblings, 0 replies; 7+ messages in thread
From: Alexandre Courbot @ 2015-06-10  2:23 UTC (permalink / raw)
  To: Uwe Kleine-König, David Airlie; +Cc: dri-devel, kernel

On 06/09/2015 06:38 PM, Uwe Kleine-König wrote:
> Since 39b2bbe3d715 (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: Alexandre Courbot <acourbot@nvidia.com>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-09  9:38 [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
  2015-06-10  2:23 ` Alexandre Courbot
@ 2015-06-10 12:57 ` Linus Walleij
  2015-06-15 21:00 ` Uwe Kleine-König
  2 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2015-06-10 12:57 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: open list:DRM PANEL DRIVERS, Sascha Hauer

On Tue, Jun 9, 2015 at 11:38 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Since 39b2bbe3d715 (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.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-09  9:38 [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
  2015-06-10  2:23 ` Alexandre Courbot
  2015-06-10 12:57 ` Linus Walleij
@ 2015-06-15 21:00 ` Uwe Kleine-König
  2015-06-16  1:00   ` Rob Clark
  2 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2015-06-15 21:00 UTC (permalink / raw)
  To: David Airlie; +Cc: dri-devel, kernel

On Tue, Jun 09, 2015 at 11:38:45AM +0200, Uwe Kleine-König wrote:
> Since 39b2bbe3d715 (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.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
gentle ping.

I intend to make the flags parameter mandatory for 4.3. So if this patch
doesn't make it in for 4.2-rc1 I'd like to take it as part of the
respective gpio change via the gpio tree.

What's your plan regarding this change?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-15 21:00 ` Uwe Kleine-König
@ 2015-06-16  1:00   ` Rob Clark
  2015-06-18 14:51     ` Emil Velikov
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Clark @ 2015-06-16  1:00 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org

On Mon, Jun 15, 2015 at 5:00 PM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Tue, Jun 09, 2015 at 11:38:45AM +0200, Uwe Kleine-König wrote:
>> Since 39b2bbe3d715 (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.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> gentle ping.
>
> I intend to make the flags parameter mandatory for 4.3. So if this patch
> doesn't make it in for 4.2-rc1 I'd like to take it as part of the
> respective gpio change via the gpio tree.
>
> What's your plan regarding this change?

I had planned to send a second pull request for 4.2 with some
additional hdcp patches that depend on scm changes coming in via
arm-soc tree for 4.2.. if that is ok, I can include this patch with
that second pull req..  otherwise I'm ok with Dave applying it
directly or you taking it in via gpio tree.  Either way is fine by me.

BR,
-R

> Best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-16  1:00   ` Rob Clark
@ 2015-06-18 14:51     ` Emil Velikov
  2015-06-18 17:48       ` Uwe Kleine-König
  0 siblings, 1 reply; 7+ messages in thread
From: Emil Velikov @ 2015-06-18 14:51 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
	Uwe Kleine-König

On 16 June 2015 at 02:00, Rob Clark <robdclark@gmail.com> wrote:
> On Mon, Jun 15, 2015 at 5:00 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>> On Tue, Jun 09, 2015 at 11:38:45AM +0200, Uwe Kleine-König wrote:
>>> Since 39b2bbe3d715 (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.
>>>
>>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> gentle ping.
>>
>> I intend to make the flags parameter mandatory for 4.3. So if this patch
>> doesn't make it in for 4.2-rc1 I'd like to take it as part of the
>> respective gpio change via the gpio tree.
>>
>> What's your plan regarding this change?
>
> I had planned to send a second pull request for 4.2 with some
> additional hdcp patches that depend on scm changes coming in via
> arm-soc tree for 4.2.. if that is ok, I can include this patch with
> that second pull req..  otherwise I'm ok with Dave applying it
> directly or you taking it in via gpio tree.  Either way is fine by me.
>
Mildly related:

Rob, would it make things a bit easier if we have you listed in
MAINTAINERS for the msm/freedreno driver ?

Uwe, you might have greater input if you explicitly CC the
{unofficial,} maintainer of the relevant driver. Some drivers don't
have one explicitly listed in MAINTAINERS, so git log tends to help
there :-)

Cheers,
Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-06-18 14:51     ` Emil Velikov
@ 2015-06-18 17:48       ` Uwe Kleine-König
  0 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2015-06-18 17:48 UTC (permalink / raw)
  To: Emil Velikov; +Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de

Hello Emil,

On Thu, Jun 18, 2015 at 03:51:26PM +0100, Emil Velikov wrote:
> > I had planned to send a second pull request for 4.2 with some
> > additional hdcp patches that depend on scm changes coming in via
> > arm-soc tree for 4.2.. if that is ok, I can include this patch with
> > that second pull req..  otherwise I'm ok with Dave applying it
> > directly or you taking it in via gpio tree.  Either way is fine by me.
> >
> Mildly related:
> 
> Rob, would it make things a bit easier if we have you listed in
> MAINTAINERS for the msm/freedreno driver ?
> 
> Uwe, you might have greater input if you explicitly CC the
> {unofficial,} maintainer of the relevant driver. Some drivers don't
> have one explicitly listed in MAINTAINERS, so git log tends to help
> there :-)
I consider it hard to choose the right set of recipents for areas where
I don't usually patch. Addressing too much people is bad as is addressing
too less. And what is considered right differs per
subsystem/maintainer/contributor. I don't claim it's impossible to find
out the right person, but for a patch stack with more than say a dozen
patches distributed all over the source tree it's the easiest to check
scripts/get_maintainer.pl and select what looks reasonable from its
output. So having the maintainer listed is definitly nice because at
least for me it increases the chance considerably to pick him for cc.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-18 17:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09  9:38 [PATCH] drm/msm/dp: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
2015-06-10  2:23 ` Alexandre Courbot
2015-06-10 12:57 ` Linus Walleij
2015-06-15 21:00 ` Uwe Kleine-König
2015-06-16  1:00   ` Rob Clark
2015-06-18 14:51     ` Emil Velikov
2015-06-18 17:48       ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.