[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <36840e0caeca5f53eef4fab615fc7976@mail.gmail.com>
Date: Tue, 24 Jan 2023 16:57:49 -0800
From: William Zhang <william.zhang@...adcom.com>
To: Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>,
broonie@...nel.org, miquel.raynal@...tlin.com, richard@....at,
vigneshr@...com, jic23@...nel.org, tudor.ambarus@...rochip.com,
pratyush@...nel.org, sanju.mehta@....com,
chin-ting_kuo@...eedtech.com, clg@...d.org, kdasu.kdev@...il.com,
f.fainelli@...il.com, rjui@...adcom.com, sbranden@...adcom.com,
eajames@...ux.ibm.com, olteanv@...il.com, han.xu@....com,
john.garry@...wei.com, shawnguo@...nel.org, s.hauer@...gutronix.de,
narmstrong@...libre.com, khilman@...libre.com,
matthias.bgg@...il.com, haibo.chen@....com,
linus.walleij@...aro.org, daniel@...que.org,
haojian.zhuang@...il.com, robert.jarzmik@...e.fr,
agross@...nel.org, bjorn.andersson@...aro.org, heiko@...ech.de,
krzysztof.kozlowski@...aro.org, andi@...zian.org,
mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com,
wens@...e.org, jernej.skrabec@...il.com, samuel@...lland.org,
masahisa.kojima@...aro.org, jaswinder.singh@...aro.org,
rostedt@...dmis.org, mingo@...hat.com, l.stelmach@...sung.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, alex.aring@...il.com, stefan@...enfreihafen.org,
kvalo@...nel.org, thierry.reding@...il.com, jonathanh@...dia.com,
skomatineni@...dia.com, sumit.semwal@...aro.org,
christian.koenig@....com, j.neuschaefer@....net,
vireshk@...nel.org, rmfrfs@...il.com, johan@...nel.org,
elder@...nel.org, gregkh@...uxfoundation.org
Cc: git@....com, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, joel@....id.au, andrew@...id.au,
radu_nicolae.pirea@....ro, nicolas.ferre@...rochip.com,
alexandre.belloni@...tlin.com, claudiu.beznea@...rochip.com,
bcm-kernel-feedback-list@...adcom.com, fancer.lancer@...il.com,
kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
jbrunet@...libre.com, martin.blumenstingl@...glemail.com,
avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
yogeshgaur.83@...il.com, konrad.dybcio@...ainline.org,
alim.akhtar@...sung.com, ldewangan@...dia.com,
michal.simek@....com, linux-aspeed@...ts.ozlabs.org,
openbmc@...ts.ozlabs.org, linux-arm-kernel@...ts.infradead.org,
linux-rpi-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-sunxi@...ts.linux.dev, linux-tegra@...r.kernel.org,
netdev@...r.kernel.org, linux-wpan@...r.kernel.org,
libertas-dev@...ts.infradead.org, linux-wireless@...r.kernel.org,
linux-mtd@...ts.infradead.org, lars@...afoo.de,
Michael.Hennerich@...log.com, linux-iio@...r.kernel.org,
michael@...le.cc, palmer@...belt.com,
linux-riscv@...ts.infradead.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, greybus-dev@...ts.linaro.org,
linux-staging@...ts.linux.dev, amitrkcian2002@...il.com
Subject: Re: [PATCH v2 02/13] spi: Replace all spi->chip_select and
spi->cs_gpiod references with function call
On 01/19/2023 10:53 AM, 'Amit Kumar Mahapatra' via
BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
> diff --git a/drivers/spi/spi-bcm63xx-hsspi.c
> b/drivers/spi/spi-bcm63xx-hsspi.c
> index b871fd810d80..dc179c4677d4 100644
> --- a/drivers/spi/spi-bcm63xx-hsspi.c
> +++ b/drivers/spi/spi-bcm63xx-hsspi.c
> @@ -130,7 +130,7 @@ static void bcm63xx_hsspi_set_cs(struct bcm63xx_hsspi
> *bs, unsigned int cs,
> static void bcm63xx_hsspi_set_clk(struct bcm63xx_hsspi *bs,
> struct spi_device *spi, int hz)
> {
> - unsigned int profile = spi->chip_select;
> + unsigned int profile = spi_get_chipselect(spi, 0);
> u32 reg;
>
> reg = DIV_ROUND_UP(2048, DIV_ROUND_UP(bs->speed_hz, hz));
> @@ -157,7 +157,7 @@ static void bcm63xx_hsspi_set_clk(struct bcm63xx_hsspi
> *bs,
> static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct
> spi_transfer *t)
> {
> struct bcm63xx_hsspi *bs = spi_master_get_devdata(spi->master);
> - unsigned int chip_select = spi->chip_select;
> + unsigned int chip_select = spi_get_chipselect(spi, 0);
> u16 opcode = 0;
> int pending = t->len;
> int step_size = HSSPI_BUFFER_LEN;
> @@ -165,7 +165,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device
> *spi, struct spi_transfer *t)
> u8 *rx = t->rx_buf;
>
> bcm63xx_hsspi_set_clk(bs, spi, t->speed_hz);
> - bcm63xx_hsspi_set_cs(bs, spi->chip_select, true);
> + bcm63xx_hsspi_set_cs(bs, spi_get_chipselect(spi, 0), true);
>
> if (tx && rx)
> opcode = HSSPI_OP_READ_WRITE;
> @@ -228,14 +228,14 @@ static int bcm63xx_hsspi_setup(struct spi_device
> *spi)
> u32 reg;
>
> reg = __raw_readl(bs->regs +
> - HSSPI_PROFILE_SIGNAL_CTRL_REG(spi->chip_select));
> + HSSPI_PROFILE_SIGNAL_CTRL_REG(spi_get_chipselect(spi, 0)));
> reg &= ~(SIGNAL_CTRL_LAUNCH_RISING | SIGNAL_CTRL_LATCH_RISING);
> if (spi->mode & SPI_CPHA)
> reg |= SIGNAL_CTRL_LAUNCH_RISING;
> else
> reg |= SIGNAL_CTRL_LATCH_RISING;
> __raw_writel(reg, bs->regs +
> - HSSPI_PROFILE_SIGNAL_CTRL_REG(spi->chip_select));
> + HSSPI_PROFILE_SIGNAL_CTRL_REG(spi_get_chipselect(spi, 0)));
>
> mutex_lock(&bs->bus_mutex);
> reg = __raw_readl(bs->regs + HSSPI_GLOBAL_CTRL_REG);
> @@ -243,16 +243,16 @@ static int bcm63xx_hsspi_setup(struct spi_device
> *spi)
> /* only change actual polarities if there is no transfer */
> if ((reg & GLOBAL_CTRL_CS_POLARITY_MASK) == bs->cs_polarity) {
> if (spi->mode & SPI_CS_HIGH)
> - reg |= BIT(spi->chip_select);
> + reg |= BIT(spi_get_chipselect(spi, 0));
> else
> - reg &= ~BIT(spi->chip_select);
> + reg &= ~BIT(spi_get_chipselect(spi, 0));
> __raw_writel(reg, bs->regs + HSSPI_GLOBAL_CTRL_REG);
> }
>
> if (spi->mode & SPI_CS_HIGH)
> - bs->cs_polarity |= BIT(spi->chip_select);
> + bs->cs_polarity |= BIT(spi_get_chipselect(spi, 0));
> else
> - bs->cs_polarity &= ~BIT(spi->chip_select);
> + bs->cs_polarity &= ~BIT(spi_get_chipselect(spi, 0));
>
> mutex_unlock(&bs->bus_mutex);
>
> @@ -283,7 +283,7 @@ static int bcm63xx_hsspi_transfer_one(struct
> spi_master *master,
> * e. At the end restore the polarities again to their default values.
> */
>
> - dummy_cs = !spi->chip_select;
> + dummy_cs = !spi_get_chipselect(spi, 0);
> bcm63xx_hsspi_set_cs(bs, dummy_cs, true);
>
> list_for_each_entry(t, &msg->transfers, transfer_list) {
> @@ -296,7 +296,7 @@ static int bcm63xx_hsspi_transfer_one(struct
> spi_master *master,
> spi_transfer_delay_exec(t);
>
> if (t->cs_change)
> - bcm63xx_hsspi_set_cs(bs, spi->chip_select, false);
> + bcm63xx_hsspi_set_cs(bs, spi_get_chipselect(spi, 0), false);
> }
>
> mutex_lock(&bs->bus_mutex);
For bcm63xx-hsspi driver,
Acked-by: William Zhang <william.zhang@...adcom.com>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4212 bytes)
Powered by blists - more mailing lists