Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1663303
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property |
| Date | 2017-06-12 10:20 +0200 |
| Message-ID | <tRsJP-86G-3@gated-at.bofh.it> (permalink) |
| References | <tRqRH-6Wp-3@gated-at.bofh.it> <tRrNL-7wT-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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?
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-06-12 08:20 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Shawn Lin <shawn.lin@rock-chips.com> - 2017-06-12 09:20 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-12 10:20 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property jeffy <jeffy.chen@rock-chips.com> - 2017-06-12 10:50 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Mark Brown <broonie@kernel.org> - 2017-06-12 18:40 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property jeffy <jeffy.chen@rock-chips.com> - 2017-06-12 10:30 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Heiko Stübner <heiko@sntech.de> - 2017-06-12 10:40 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property jeffy <jeffy.chen@rock-chips.com> - 2017-06-12 11:20 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property Heiko Stübner <heiko@sntech.de> - 2017-06-12 11:30 +0200
Re: [PATCH 1/2] spi: rockchip: add support for "cs-gpios" dts property jeffy <jeffy.chen@rock-chips.com> - 2017-06-12 10:40 +0200
csiph-web