[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vd1i2rDwVcK54tox_5=q3b5HHjTa2dcsQqK_UE5ODcsVQ@mail.gmail.com>
Date: Thu, 30 Jan 2020 18:43:52 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc: Mark Brown <broonie@...nel.org>, Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
linux-spi <linux-spi@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] spi: Add generic SPI multiplexer
On Mon, Jan 27, 2020 at 11:04 PM Chris Packham
<chris.packham@...iedtelesis.co.nz> wrote:
>
> Add a SPI device driver that sits in-band and provides a SPI controller
> which supports chip selects via a mux-control. This enables extra SPI
> devices to be connected with limited native chip selects.
...
> obj-$(CONFIG_SPI_MEM) += spi-mem.o
> obj-$(CONFIG_SPI_SPIDEV) += spidev.o
> obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o
> +obj-$(CONFIG_SPI_MUX) += spi-mux.o
Maybe after SPI_MEM ?
...
> +struct spi_mux_priv {
> + struct spi_device *spi;
> + unsigned int current_cs;
> +
> + void (*child_mesg_complete)(void *context);
> + void *child_mesg_context;
> + struct spi_device *child_mesg_dev;
mesg -> msg ?
> + struct mux_control *mux;
> +};
...
> +static int spi_mux_select(struct spi_device *spi)
> +{
> + struct spi_mux_priv *priv = spi_controller_get_devdata(spi->controller);
> + int ret = 0;
Drop this assignment...
> + if (priv->current_cs != spi->chip_select) {
...convert this to
if (cs == chip_select)
return 0;
> + dev_dbg(&priv->spi->dev,
> + "setting up the mux for cs %d\n",
> + spi->chip_select);
After above changes this perhaps fits one line (now it fits two, by
the way, not three).
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists