[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YgZHalrdhhilxROt@sirena.org.uk>
Date: Fri, 11 Feb 2022 11:24:26 +0000
From: Mark Brown <broonie@...nel.org>
To: Jon Lin <jon.lin@...k-chips.com>
Cc: heiko@...ech.de, linux-spi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] spi: rockchip: Preset cs-high and clk polarity in
setup progress
On Fri, Feb 11, 2022 at 11:43:38AM +0800, Jon Lin wrote:
> +static int rockchip_spi_setup(struct spi_device *spi)
> +{
> + struct rockchip_spi *rs = spi_controller_get_devdata(spi->controller);
> + u32 cr0;
> +
> + pm_runtime_get_sync(rs->dev);
> +
> + cr0 = readl_relaxed(rs->regs + ROCKCHIP_SPI_CTRLR0);
> +
> + cr0 |= ((spi->mode & 0x3) << CR0_SCPH_OFFSET);
> + if (spi->mode & SPI_CS_HIGH)
> + cr0 |= BIT(spi->chip_select) << CR0_SOI_OFFSET;
What ensures that this read/modify/write doesn't race with a transfer
running on another client device in the case where the controller has
more than one device connected? Similarly with the mode, though it's
not great to have devices with different modes connected to a single
controller.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists