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