All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: jeffy <jeffy.chen@rock-chips.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
	linux-kernel@vger.kernel.org, broonie@kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, briannorris@chromium.org,
	dianders@chromium.org, linux-spi@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property
Date: Mon, 12 Jun 2017 11:23:37 +0200	[thread overview]
Message-ID: <2280770.UMxRo5IhGO@diego> (raw)
In-Reply-To: <593E5AF8.1080404@rock-chips.com>

Am Montag, 12. Juni 2017, 17:12:24 CEST schrieb jeffy:
> Hi Heiko,
> 
> thanx for your comments.
> 
> On 06/12/2017 04:36 PM, Heiko Stübner wrote:
> > Am Montag, 12. Juni 2017, 16:26:07 CEST schrieb jeffy:
> >> Hi Shawn,
> >> 
> >> On 06/12/2017 03:15 PM, Shawn Lin wrote:
> >>> Hi Jeffy,
> >>> 
> >>> On 2017/6/12 14:14, Jeffy Chen wrote:
> >>>> Support using "cs-gpios" property to specify cs gpios.
> >>>> 
> >>>> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> >>>> ---
> >>>> 
> >>>>    .../devicetree/bindings/spi/spi-rockchip.txt       |  2 +
> >>>>    drivers/spi/spi-rockchip.c                         | 52
> >>>> 
> >>>> ++++++++++++++++++++++
> >>>> 
> >>>>    2 files changed, 54 insertions(+)
> >>>> 
> >>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> index 83da493..02171b2 100644
> >>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>> 
> >>> The changes for doc should be another patch, and...
> >> 
> >> but i saw others didn't separate them:
> >> cf9e478 spi: sh-msiof: Add slave mode support
> >> 23e291c spi: rockchip: support "sleep" pin configuration
> > 
> > it sometimes falls through the cracks, but having dt-binding patches
> > separate is meant to make it easier on DT-Maintainers to find
> > patches they need to look at.
> 
> ok, will do.
> 
> >>>> +    if (!data->cs_gpio_requested) {
> >>>> +        ret = gpio_request_one(spi->cs_gpio, flags,
> >>>> +                       dev_name(&spi->dev));
> >>>> +        if (!ret)
> >>>> +            data->cs_gpio_requested = 1;
> >>>> +    } else
> >>>> +        ret = gpio_direction_output(spi->cs_gpio, flags);
> >>> 
> >>> need brace around 'else' statement. Also I don't see data used
> >>> elsewhere, so you need these code above.
> >> 
> >> ok.
> >> and the cs_gpio_requested is to mark cs_gpio requested, because the
> >> setup func might be called multiple times, we only need to request gpio
> >> at the first time.
> > 
> > Aren't the gpiod* functions meant to be used for new things?
> > Also you might actually do a bit of error handling there, especially
> > EPROBE_DEFER.
> 
> so you are suggesting to use gpiod* functions here to replace gpio_*
> functions right?

correct. And handle errors that may get returned, especially EPROBE_DEFER,
but also other errors may indicate that your spi won't function as expected.


Heiko

WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: jeffy <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property
Date: Mon, 12 Jun 2017 11:23:37 +0200	[thread overview]
Message-ID: <2280770.UMxRo5IhGO@diego> (raw)
In-Reply-To: <593E5AF8.1080404-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

Am Montag, 12. Juni 2017, 17:12:24 CEST schrieb jeffy:
> Hi Heiko,
> 
> thanx for your comments.
> 
> On 06/12/2017 04:36 PM, Heiko Stübner wrote:
> > Am Montag, 12. Juni 2017, 16:26:07 CEST schrieb jeffy:
> >> Hi Shawn,
> >> 
> >> On 06/12/2017 03:15 PM, Shawn Lin wrote:
> >>> Hi Jeffy,
> >>> 
> >>> On 2017/6/12 14:14, Jeffy Chen wrote:
> >>>> Support using "cs-gpios" property to specify cs gpios.
> >>>> 
> >>>> Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> >>>> ---
> >>>> 
> >>>>    .../devicetree/bindings/spi/spi-rockchip.txt       |  2 +
> >>>>    drivers/spi/spi-rockchip.c                         | 52
> >>>> 
> >>>> ++++++++++++++++++++++
> >>>> 
> >>>>    2 files changed, 54 insertions(+)
> >>>> 
> >>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> index 83da493..02171b2 100644
> >>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>> 
> >>> The changes for doc should be another patch, and...
> >> 
> >> but i saw others didn't separate them:
> >> cf9e478 spi: sh-msiof: Add slave mode support
> >> 23e291c spi: rockchip: support "sleep" pin configuration
> > 
> > it sometimes falls through the cracks, but having dt-binding patches
> > separate is meant to make it easier on DT-Maintainers to find
> > patches they need to look at.
> 
> ok, will do.
> 
> >>>> +    if (!data->cs_gpio_requested) {
> >>>> +        ret = gpio_request_one(spi->cs_gpio, flags,
> >>>> +                       dev_name(&spi->dev));
> >>>> +        if (!ret)
> >>>> +            data->cs_gpio_requested = 1;
> >>>> +    } else
> >>>> +        ret = gpio_direction_output(spi->cs_gpio, flags);
> >>> 
> >>> need brace around 'else' statement. Also I don't see data used
> >>> elsewhere, so you need these code above.
> >> 
> >> ok.
> >> and the cs_gpio_requested is to mark cs_gpio requested, because the
> >> setup func might be called multiple times, we only need to request gpio
> >> at the first time.
> > 
> > Aren't the gpiod* functions meant to be used for new things?
> > Also you might actually do a bit of error handling there, especially
> > EPROBE_DEFER.
> 
> so you are suggesting to use gpiod* functions here to replace gpio_*
> functions right?

correct. And handle errors that may get returned, especially EPROBE_DEFER,
but also other errors may indicate that your spi won't function as expected.


Heiko
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property
Date: Mon, 12 Jun 2017 11:23:37 +0200	[thread overview]
Message-ID: <2280770.UMxRo5IhGO@diego> (raw)
In-Reply-To: <593E5AF8.1080404@rock-chips.com>

Am Montag, 12. Juni 2017, 17:12:24 CEST schrieb jeffy:
> Hi Heiko,
> 
> thanx for your comments.
> 
> On 06/12/2017 04:36 PM, Heiko St?bner wrote:
> > Am Montag, 12. Juni 2017, 16:26:07 CEST schrieb jeffy:
> >> Hi Shawn,
> >> 
> >> On 06/12/2017 03:15 PM, Shawn Lin wrote:
> >>> Hi Jeffy,
> >>> 
> >>> On 2017/6/12 14:14, Jeffy Chen wrote:
> >>>> Support using "cs-gpios" property to specify cs gpios.
> >>>> 
> >>>> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> >>>> ---
> >>>> 
> >>>>    .../devicetree/bindings/spi/spi-rockchip.txt       |  2 +
> >>>>    drivers/spi/spi-rockchip.c                         | 52
> >>>> 
> >>>> ++++++++++++++++++++++
> >>>> 
> >>>>    2 files changed, 54 insertions(+)
> >>>> 
> >>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> index 83da493..02171b2 100644
> >>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
> >>> 
> >>> The changes for doc should be another patch, and...
> >> 
> >> but i saw others didn't separate them:
> >> cf9e478 spi: sh-msiof: Add slave mode support
> >> 23e291c spi: rockchip: support "sleep" pin configuration
> > 
> > it sometimes falls through the cracks, but having dt-binding patches
> > separate is meant to make it easier on DT-Maintainers to find
> > patches they need to look at.
> 
> ok, will do.
> 
> >>>> +    if (!data->cs_gpio_requested) {
> >>>> +        ret = gpio_request_one(spi->cs_gpio, flags,
> >>>> +                       dev_name(&spi->dev));
> >>>> +        if (!ret)
> >>>> +            data->cs_gpio_requested = 1;
> >>>> +    } else
> >>>> +        ret = gpio_direction_output(spi->cs_gpio, flags);
> >>> 
> >>> need brace around 'else' statement. Also I don't see data used
> >>> elsewhere, so you need these code above.
> >> 
> >> ok.
> >> and the cs_gpio_requested is to mark cs_gpio requested, because the
> >> setup func might be called multiple times, we only need to request gpio
> >> at the first time.
> > 
> > Aren't the gpiod* functions meant to be used for new things?
> > Also you might actually do a bit of error handling there, especially
> > EPROBE_DEFER.
> 
> so you are suggesting to use gpiod* functions here to replace gpio_*
> functions right?

correct. And handle errors that may get returned, especially EPROBE_DEFER,
but also other errors may indicate that your spi won't function as expected.


Heiko

  reply	other threads:[~2017-06-12  9:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12  6:14 [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Jeffy Chen
2017-06-12  6:14 ` Jeffy Chen
2017-06-12  6:14 ` Jeffy Chen
2017-06-12  6:14 ` [PATCH 2/2] arm64: dts: rockchip: use cs-gpios for cros_ec_spi Jeffy Chen
2017-06-12  6:14   ` Jeffy Chen
2017-06-12  6:14   ` Jeffy Chen
2017-06-12  7:15 ` [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Shawn Lin
2017-06-12  7:15   ` Shawn Lin
2017-06-12  7:15   ` Shawn Lin
2017-06-12  8:18   ` Geert Uytterhoeven
2017-06-12  8:18     ` Geert Uytterhoeven
2017-06-12  8:18     ` Geert Uytterhoeven
2017-06-12  8:48     ` jeffy
2017-06-12  8:48       ` jeffy
2017-06-12  8:48       ` jeffy
2017-06-12 16:38     ` Mark Brown
2017-06-12 16:38       ` Mark Brown
2017-06-12 16:38       ` Mark Brown
2017-06-12  8:26   ` jeffy
2017-06-12  8:26     ` jeffy
2017-06-12  8:26     ` jeffy
2017-06-12  8:33     ` jeffy
2017-06-12  8:33       ` jeffy
2017-06-12  8:33       ` jeffy
2017-06-12  8:36     ` Heiko Stübner
2017-06-12  8:36       ` Heiko Stübner
2017-06-12  8:36       ` Heiko Stübner
2017-06-12  9:12       ` jeffy
2017-06-12  9:12         ` jeffy
2017-06-12  9:12         ` jeffy
2017-06-12  9:23         ` Heiko Stübner [this message]
2017-06-12  9:23           ` Heiko Stübner
2017-06-12  9:23           ` Heiko Stübner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2280770.UMxRo5IhGO@diego \
    --to=heiko@sntech.de \
    --cc=briannorris@chromium.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.