All of lore.kernel.org
 help / color / mirror / Atom feed
From: jeffy <jeffy.chen@rock-chips.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Shawn Lin <shawn.lin@rock-chips.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Brian Norris <briannorris@chromium.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Doug Anderson <dianders@chromium.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-arm-kernel@lists.infradead.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 16:48:51 +0800	[thread overview]
Message-ID: <593E5573.90202@rock-chips.com> (raw)
In-Reply-To: <CAMuHMdUDjtSNRiBxcBnAMdUEaCZbioPoRE1h=p9=BqHMGmQaEQ@mail.gmail.com>

Hi Geert,

On 06/12/2017 04:18 PM, Geert Uytterhoeven wrote:
> On Mon, Jun 12, 2017 at 9:15 AM, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>> 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>
>
>>> index 83da493..02171b2 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> @@ -17,6 +17,7 @@ Required Properties:
>>>           region.
>>>    - interrupts: The interrupt number to the cpu. The interrupt specifier
>>> format
>>>                  depends on the interrupt controller.
>>> +- cs-gpios : Specifies the gpio pins to be used for chipselects.
>>
>> It's not a required property, otherwise how other boards work as your
>> patch 2 only add this for rk3399-gru.
>
>>> --- a/drivers/spi/spi-rockchip.c
>>> +++ b/drivers/spi/spi-rockchip.c
>
>>> @@ -297,6 +302,50 @@ static void rockchip_spi_set_cs(struct spi_device
>>> *spi, bool enable)
>>>          pm_runtime_put_sync(rs->dev);
>>>    }
>>>    +static int rockchip_spi_setup(struct spi_device *spi)
>>> +{
>>> +       int ret = 0;
>>> +       unsigned long flags = (spi->mode & SPI_CS_HIGH) ?
>>> +                             GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH;
>>> +       struct rockchip_spi_data *data = spi_get_ctldata(spi);
>>> +
>>> +       if (!gpio_is_valid(spi->cs_gpio))
>>> +               return 0;
>
>> return -EINVAL?
>
> Isn't this check meant to fall back to hardware CS if no cs-gpios property
> is present?

Thanks for your comment, and yes it is. I'll add a comment in the code 
to explain it :)
>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds
>
>
>

WARNING: multiple messages have this Message-ID (diff)
From: jeffy <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: Geert Uytterhoeven
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
	Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Brian Norris
	<briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"open list:ARM/Rockchip SoC..."
	<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"
	<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 16:48:51 +0800	[thread overview]
Message-ID: <593E5573.90202@rock-chips.com> (raw)
In-Reply-To: <CAMuHMdUDjtSNRiBxcBnAMdUEaCZbioPoRE1h=p9=BqHMGmQaEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Geert,

On 06/12/2017 04:18 PM, Geert Uytterhoeven wrote:
> On Mon, Jun 12, 2017 at 9:15 AM, Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org> wrote:
>> 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>
>
>>> index 83da493..02171b2 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> @@ -17,6 +17,7 @@ Required Properties:
>>>           region.
>>>    - interrupts: The interrupt number to the cpu. The interrupt specifier
>>> format
>>>                  depends on the interrupt controller.
>>> +- cs-gpios : Specifies the gpio pins to be used for chipselects.
>>
>> It's not a required property, otherwise how other boards work as your
>> patch 2 only add this for rk3399-gru.
>
>>> --- a/drivers/spi/spi-rockchip.c
>>> +++ b/drivers/spi/spi-rockchip.c
>
>>> @@ -297,6 +302,50 @@ static void rockchip_spi_set_cs(struct spi_device
>>> *spi, bool enable)
>>>          pm_runtime_put_sync(rs->dev);
>>>    }
>>>    +static int rockchip_spi_setup(struct spi_device *spi)
>>> +{
>>> +       int ret = 0;
>>> +       unsigned long flags = (spi->mode & SPI_CS_HIGH) ?
>>> +                             GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH;
>>> +       struct rockchip_spi_data *data = spi_get_ctldata(spi);
>>> +
>>> +       if (!gpio_is_valid(spi->cs_gpio))
>>> +               return 0;
>
>> return -EINVAL?
>
> Isn't this check meant to fall back to hardware CS if no cs-gpios property
> is present?

Thanks for your comment, and yes it is. I'll add a comment in the code 
to explain it :)
>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds
>
>
>


--
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: jeffy.chen@rock-chips.com (jeffy)
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 16:48:51 +0800	[thread overview]
Message-ID: <593E5573.90202@rock-chips.com> (raw)
In-Reply-To: <CAMuHMdUDjtSNRiBxcBnAMdUEaCZbioPoRE1h=p9=BqHMGmQaEQ@mail.gmail.com>

Hi Geert,

On 06/12/2017 04:18 PM, Geert Uytterhoeven wrote:
> On Mon, Jun 12, 2017 at 9:15 AM, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>> 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>
>
>>> index 83da493..02171b2 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
>>> @@ -17,6 +17,7 @@ Required Properties:
>>>           region.
>>>    - interrupts: The interrupt number to the cpu. The interrupt specifier
>>> format
>>>                  depends on the interrupt controller.
>>> +- cs-gpios : Specifies the gpio pins to be used for chipselects.
>>
>> It's not a required property, otherwise how other boards work as your
>> patch 2 only add this for rk3399-gru.
>
>>> --- a/drivers/spi/spi-rockchip.c
>>> +++ b/drivers/spi/spi-rockchip.c
>
>>> @@ -297,6 +302,50 @@ static void rockchip_spi_set_cs(struct spi_device
>>> *spi, bool enable)
>>>          pm_runtime_put_sync(rs->dev);
>>>    }
>>>    +static int rockchip_spi_setup(struct spi_device *spi)
>>> +{
>>> +       int ret = 0;
>>> +       unsigned long flags = (spi->mode & SPI_CS_HIGH) ?
>>> +                             GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH;
>>> +       struct rockchip_spi_data *data = spi_get_ctldata(spi);
>>> +
>>> +       if (!gpio_is_valid(spi->cs_gpio))
>>> +               return 0;
>
>> return -EINVAL?
>
> Isn't this check meant to fall back to hardware CS if no cs-gpios property
> is present?

Thanks for your comment, and yes it is. I'll add a comment in the code 
to explain it :)
>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds
>
>
>

  reply	other threads:[~2017-06-12  8:49 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 [this message]
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
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=593E5573.90202@rock-chips.com \
    --to=jeffy.chen@rock-chips.com \
    --cc=briannorris@chromium.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=geert@linux-m68k.org \
    --cc=heiko@sntech.de \
    --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.