linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
@ 2025-04-17 15:24 Andy Shevchenko
  2025-04-17 15:24 ` [PATCH v3 1/2] spi: Add spi_bpw_to_bytes() helper and use it Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Andy Shevchenko @ 2025-04-17 15:24 UTC (permalink / raw)
  To: Mark Brown, Andy Shevchenko, linux-spi, linux-kernel; +Cc: David Lechner

Recently in the discussion with David the idea of having
a common helper popped up. The helper converts the given
bits per word to bytes. The result will always be power-of-two
(e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
More details are in the respective code comment.

This mini-series introduces it and replaces current users
under drivers/spi and we expect more (and possibly some
lurking in other subsystems).

Mark, if you okay with the idea, please, make this to be
an immutable branch or tag for others to pull.

In v3:
- fixed the typos in the examples

In v2:
- improved examples in the code comment and commit message (David)

Andy Shevchenko (2):
  spi: Add spi_bpw_to_bytes() helper and use it
  spi: dw: Use spi_bpw_to_bytes() helper

 drivers/spi/spi-dw-core.c |  2 +-
 drivers/spi/spi.c         |  2 +-
 include/linux/spi/spi.h   | 26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-18  5:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 15:24 [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes() Andy Shevchenko
2025-04-17 15:24 ` [PATCH v3 1/2] spi: Add spi_bpw_to_bytes() helper and use it Andy Shevchenko
2025-04-17 15:24 ` [PATCH v3 2/2] spi: dw: Use spi_bpw_to_bytes() helper Andy Shevchenko
2025-04-17 15:30 ` [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes() David Lechner
2025-04-17 16:00   ` Andy Shevchenko
2025-04-17 16:22 ` Mukesh Kumar Savaliya
2025-04-18  5:25 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).