[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201002102246.GX3956970@smile.fi.intel.com>
Date: Fri, 2 Oct 2020 13:22:46 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Mark Brown <broonie@...nel.org>,
Serge Semin <fancer.lancer@...il.com>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
Lars Povlsen <lars.povlsen@...rochip.com>,
"wuxu . wu" <wuxu.wu@...wei.com>, Feng Tang <feng.tang@...el.com>,
Rob Herring <robh+dt@...nel.org>, linux-spi@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config
method
On Fri, Oct 02, 2020 at 01:28:11AM +0300, Serge Semin wrote:
> Indeed there is no point in detecting the SPI peripheral device parameters
> and initializing the CR0 register fields each time an SPI transfer is
> executed. Instead let's define a dedicated CR0 chip-data member, which
> will be initialized in accordance with the SPI device settings at the
> moment of setting it up.
>
> By doing so we'll finally make the SPI device chip_data serving as it's
> supposed to - to preserve the SPI device specific DW SPI configuration.
> See spi-fsl-dspi.c, spi-pl022.c, spi-pxa2xx.c drivers for example of the
> way the chip data is utilized.
> +static void dw_spi_update_cr0(struct dw_spi *dws, struct spi_device *spi,
> + struct spi_transfer *transfer)
Yep, why not to place this in previous patch exactly here?
> + /*
> + * Update CR0 data each time the setup callback is invoked since
> + * the device parameters could have been changed, for instance, by
> + * the MMC SPI driver or something else.
> + */
> + chip->cr0 = dw_spi_get_cr0(dws, spi);
I would rather name it prepare or alike. 'get' assumes getting value or
something like that.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists