[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71533474-eb08-438c-b7ec-5f3277c195fc@sirena.org.uk>
Date: Fri, 15 Mar 2024 20:41:21 +0000
From: Mark Brown <broonie@...nel.org>
To: Justin Swartz <justin.swartz@...ingedge.co.za>
Cc: Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] spi: mt7621: allow GPIO chip select lines
On Fri, Mar 15, 2024 at 10:21:53PM +0200, Justin Swartz wrote:
> On 2024-03-15 19:47, Mark Brown wrote:
> > Look at other drivers that support GPIO chip selects?
> Of the 43 drivers (of drivers/spi/*.c) that setup the
> spi_controller's use_gpio_descriptors as true:
> 39 drivers use the transfer_one hook, and
> 4 drivers use the transfer_one_message hook.
> Drivers that use the transfer_one hook benefit from the core
> taking care of chip selection on their behalf.
> Drivers that use the transfer_one_message hook handle chip
> selection on their own, within the function they've pointed
> the hook at.
Oh, this is an old school driver. Glancing at the code I can't see any
particular reason why it's not using transfer_one(), you should just
convert the driver to that which will reduce the open coding and just
generally improve functionality. You could add a callback to flush the
write FIFO or add that into the write function, I'm not sure if there's
a meaningful performance benefit there.
> Considering spi-mt7621.c was implemented using the
> transfer_one_message() hook, I'd assumed that it made more
I think it's just old and based on having gone through staging likely
based on even older BSP code.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists