Re: [PATCH 1/4 v3] spi: Support high CS when using descriptors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Wed, Jan 16, 2019 at 7:27 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> All controllers using GPIO descriptors can by definition
> support high CS connections, so just enforce this when
> registering an SPI controller.

But that is guaranteed to be true only for chip selects handled by a GPIO,
right?
Native chip selects may still not support SPI_CS_HIGH, depending
on the controller.
Before, the bad_bits check in spi_setup() would detect this, and return
an error. After, this will fail silently.

I agree configuring the system like this is a mistake by the integrator,
to be detected during integration testing.

> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2336,6 +2336,11 @@ int spi_register_controller(struct spi_controller *ctlr)
>                         status = spi_get_gpio_descs(ctlr);
>                         if (status)
>                                 return status;
> +                       /*
> +                        * A controller using GPIO descriptors always
> +                        * supports SPI_CS_HIGH if need be.
> +                        */
> +                       ctlr->mode_bits |= SPI_CS_HIGH;
>                 } else {
>                         /* Legacy code path for GPIOs from DT */
>                         status = of_spi_register_master(ctlr);

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux