[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190307160924.GE6529@sirena.org.uk>
Date: Thu, 7 Mar 2019 16:09:24 +0000
From: Mark Brown <broonie@...nel.org>
To: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Cc: xiao jin <jin.xiao@...el.com>, daniel@...que.org,
haojian.zhuang@...il.com, robert.jarzmik@...e.fr,
linux-arm-kernel@...ts.infradead.org, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, yanmin.zhang@...el.com,
bo <bo.he@...el.com>
Subject: Re: [PATCH] [RFC] spi: pxa2xx: Do cs if restart the SSP during
pxa2xx_spi_transfer_one()
On Thu, Mar 07, 2019 at 05:26:53PM +0200, Jarkko Nikula wrote:
> On 3/7/19 9:24 AM, xiao jin wrote:
> > The patch is to do cs again if spi-pxa2xx restar the SSP during
> > pxa2xx_spi_transfer_one()
> Hmm.. please correct me if I'm wrong but pxa2xx_spi_unprepare_transfer() is
> called always when there is no more messages pending and the spi core should
> have deasserted the CS already?
Yes.
> > @@ -1056,6 +1057,11 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *master,
> > if ((pxa2xx_spi_read(drv_data, SSCR0) != cr0)
> > || (pxa2xx_spi_read(drv_data, SSCR1) & change_mask)
> > != (cr1 & change_mask)) {
> > + /* It needs to deassert the chip selection
> > + * firstly before restart the SPP */
> > + need_cs_change = true;
> > + cs_deassert(spi);
> I think code comes here at the beginning of each transfer so will be hit
> multiple times before pxa2xx_spi_unprepare_transfer() if SPI message
> consists of multiple transfers.
> This makes me wondering if the device driver setting up the "struct
> spi_transfer" is maybe missing the cs_change flag set for transfers before
> last one in case HW needs CS toggling between transfers? For instance what
> following drivers are doing with the cs_change flag:
> drivers/char/tpm/tpm_tis_spi.c: tpm_tis_spi_transfer()
> drivers/input/touchscreen/ad7877.c: ad7877_read(), ad7877_read_adc()
Right, this really feels like it's fixing the wrong thing.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists