All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Jorge Marques <jorge.marques@analog.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-i3c@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] i3c: master: Add driver for Analog Devices I3C Controller IP
Date: Thu, 5 Jun 2025 22:14:10 +0200	[thread overview]
Message-ID: <aEH6kpXStLc0dWZq@shikoro> (raw)
In-Reply-To: <aECaFQzkPYdfjagK@lizhi-Precision-Tower-5810>


[-- Attachment #1.1: Type: text/plain, Size: 653 bytes --]


> > +static void adi_i3c_master_wr_to_tx_fifo(struct adi_i3c_master *master,
> > +					 const u8 *bytes, int nbytes)
> > +{
> > +	writesl(master->regs + REG_SDO_FIFO, bytes, nbytes / 4);
> > +	if (nbytes & 3) {
> > +		u32 tmp = 0;
> > +
> > +		memcpy(&tmp, bytes + (nbytes & ~3), nbytes & 3);
> 
> ALIGN_DOWN(bytes, 4)?
> 
> Do you need conside big/little endian to trim down data?

The driver uses the same code for reading/writing the FIFO as the
Designware and Cadence driver. The Renesas driver I am working on has
also the same pattern. Time for a helper function maybe

	i3c_{read|write}l_to_fifo(register, data, length);

?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 111 bytes --]

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Jorge Marques <jorge.marques@analog.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-i3c@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] i3c: master: Add driver for Analog Devices I3C Controller IP
Date: Thu, 5 Jun 2025 22:14:10 +0200	[thread overview]
Message-ID: <aEH6kpXStLc0dWZq@shikoro> (raw)
In-Reply-To: <aECaFQzkPYdfjagK@lizhi-Precision-Tower-5810>

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]


> > +static void adi_i3c_master_wr_to_tx_fifo(struct adi_i3c_master *master,
> > +					 const u8 *bytes, int nbytes)
> > +{
> > +	writesl(master->regs + REG_SDO_FIFO, bytes, nbytes / 4);
> > +	if (nbytes & 3) {
> > +		u32 tmp = 0;
> > +
> > +		memcpy(&tmp, bytes + (nbytes & ~3), nbytes & 3);
> 
> ALIGN_DOWN(bytes, 4)?
> 
> Do you need conside big/little endian to trim down data?

The driver uses the same code for reading/writing the FIFO as the
Designware and Cadence driver. The Renesas driver I am working on has
also the same pattern. Time for a helper function maybe

	i3c_{read|write}l_to_fifo(register, data, length);

?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2025-06-24  0:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 15:48 [PATCH 0/2] Add ADI I3C Controller Jorge Marques
2025-06-04 15:48 ` Jorge Marques
2025-06-04 15:48 ` [PATCH 1/2] dt-bindings: i3c: Add adi-i3c-master Jorge Marques
2025-06-04 15:48   ` Jorge Marques
2025-06-04 18:36   ` Frank Li
2025-06-04 18:36     ` Frank Li
2025-06-06  9:40     ` Jorge Marques
2025-06-06  9:40       ` Jorge Marques
2025-06-04 15:48 ` [PATCH 2/2] i3c: master: Add driver for Analog Devices I3C Controller IP Jorge Marques
2025-06-04 15:48   ` Jorge Marques
2025-06-04 19:10   ` Frank Li
2025-06-04 19:10     ` Frank Li
2025-06-04 22:00     ` Wolfram Sang
2025-06-04 22:00       ` Wolfram Sang
2025-06-06 10:15       ` Jorge Marques
2025-06-06 10:15         ` Jorge Marques
2025-06-05 20:14     ` Wolfram Sang [this message]
2025-06-05 20:14       ` Wolfram Sang
2025-06-06 10:05     ` Jorge Marques
2025-06-06 10:05       ` Jorge Marques
2025-06-05  2:05   ` kernel test robot
2025-06-05  2:05     ` kernel test robot
2025-06-05  5:12   ` kernel test robot
2025-06-05  5:12     ` 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=aEH6kpXStLc0dWZq@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=Frank.li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jorge.marques@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.