From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>, Pratyush Yadav <p.yadav@ti.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] spi: fsl-spi: Implement trailing bits
Date: Mon, 28 Feb 2022 16:02:30 +0000 [thread overview]
Message-ID: <7afaab3d-50e0-4716-18d4-41eabc2a9cb9@csgroup.eu> (raw)
In-Reply-To: <YhzqbYW1q5bPNWXn@sirena.org.uk>
Le 28/02/2022 à 16:29, Mark Brown a écrit :
> On Mon, Feb 28, 2022 at 04:15:46PM +0100, Christophe Leroy wrote:
>
>> + if (!status && spi->trailing_bits) {
>> + struct spi_transfer t = {
>> + .len = 1,
>> + .tx_buf = empty_zero_page,
>> + };
>> +
>> + if (spi->trailing_bits < 4)
>> + t.bits_per_word = 4;
>> + else if (spi->trailing_bits > 8)
>> + t.bits_per_word = 16;
>> + else
>> + t.bits_per_word = spi->trailing_bits;
>> +
>> + status = fsl_spi_setup_transfer(spi, &t);
>> + if (!status)
>> + status = fsl_spi_bufs(spi, &t, 0);
>> + }
>> + m->status = status;
>
> The binding looks good now but this is still driver specific code when
> it looks like it could easily be implemented in the core - like I said
> on the previous version you'd need to update drivers to advertise less
> than 8 bits but there's basically nothing driver specific I can see here
> so any driver using transfer_one() would get support that way.
Argh ! Sorry your comment to the previous version ended up in Junk
mails. I see it now.
We discussed that back in 2016 in
https://lore.kernel.org/linux-spi/20160824112701.GE22076@sirena.org.uk/
and my understanding at that time was that it was not something that
could be done at core level.
But maybe things have changed since then ?
By the way, fsl-spi driver doesn't implement transfer_one() but
transfer_one_message() so it takes care of the chipselect changes and
therefore the final dummy transfer with CS off is to be done there as
far as I understand.
Would it mean changing fsl-spi driver to implement transfer_one() first ?
Thanks
Christophe
next prev parent reply other threads:[~2022-02-28 16:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-28 15:15 [PATCH v2 0/2] Add support for components requiring trailing clock after transfer Christophe Leroy
2022-02-28 15:15 ` [PATCH v2 1/2] spi: Add optional number of additional clock cycles to be generated Christophe Leroy
2022-03-08 0:52 ` Rob Herring
2022-02-28 15:15 ` [PATCH v2 2/2] spi: fsl-spi: Implement trailing bits Christophe Leroy
2022-02-28 15:29 ` Mark Brown
2022-02-28 16:02 ` Christophe Leroy [this message]
2022-02-28 16:14 ` Mark Brown
2022-03-01 12:53 ` Christophe Leroy
2022-03-01 13:25 ` Mark Brown
2022-08-18 18:35 ` Christophe Leroy
2022-08-22 17:15 ` Mark Brown
2022-08-22 18:38 ` Christophe Leroy
2022-08-22 19:29 ` Mark Brown
2022-02-28 18:28 ` kernel test robot
2022-02-28 18:38 ` kernel test robot
2022-02-28 18:48 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7afaab3d-50e0-4716-18d4-41eabc2a9cb9@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=p.yadav@ti.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®