All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: linux-i2c@vger.kernel.org,
	Chris Packham <chris.packham@alliedtelesis.co.nz>,
	Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jonas Jelonek <jelonek.jonas@gmail.com>
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>,
	Jonas Jelonek <jelonek.jonas@gmail.com>
Subject: Re: [PATCH v3 1/3] i2c: rework RTL9300 I2C controller driver
Date: Sat, 02 Aug 2025 16:33:01 +0200	[thread overview]
Message-ID: <7182147.lOV4Wx5bFT@sven-desktop> (raw)
In-Reply-To: <20250727114800.3046-2-jelonek.jonas@gmail.com>

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

On Sunday, 27 July 2025 13:47:58 CEST Jonas Jelonek wrote:
> Rework the RTL9300 I2C controller driver to use more of the regmap
> API, especially make use of reg_field and regmap_field to represent
> registers instead of macros. Most register operations are performed
> through regmap_field_* API then.
> 
> Handle SCL selection using separate chip-specific functions since this
> is already known to differ between the Realtek SoC families in such a
> way that this cannot be properly handled using just a different
> reg_field.
> 
> These changes make it a lot easier to add support for newer generations
> or to handle differences between specific revisions within a series.
> Support can be added by defining a separate driver data structure with
> the corresponding register field definitions and linking it to a new
> compatible string.
[...]

Thank you for the patchset - used it to get the driver working on an RTL931x 
device.

[...]
>  
>  static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
>  				    int size, union i2c_smbus_data *data, int len)
>  {
[...]
> -	ret = regmap_read_poll_timeout(i2c->regmap, i2c->reg_base + RTL9300_I2C_MST_CTRL1,
> -				       val, !(val & RTL9300_I2C_MST_CTRL1_I2C_TRIG), 100, 2000);
> +	regmap_field_read_poll_timeout(i2c->fields[F_I2C_TRIG], val, !val, 100, 2000);
>  	if (ret)
>  		return ret;

The "ret =" was lost here. As result, I get "corrupted" data after a timeout 
instead of the expected error.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-08-02 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-27 11:47 [PATCH v3 0/3] i2c: rework and extend RTL9300 I2C driver Jonas Jelonek
2025-07-27 11:47 ` [PATCH v3 1/3] i2c: rework RTL9300 I2C controller driver Jonas Jelonek
2025-08-02 14:33   ` Sven Eckelmann [this message]
2025-07-27 11:47 ` [PATCH v3 2/3] dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support Jonas Jelonek
2025-07-27 11:48 ` [PATCH v3 3/3] i2c: add RTL9310 support to RTL9300 I2C controller driver Jonas Jelonek

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=7182147.lOV4Wx5bFT@sven-desktop \
    --to=sven@narfation.org \
    --cc=andi.shyti@kernel.org \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jelonek.jonas@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.stockhausen@gmx.de \
    --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.