回复: [PATCH v2 2/3] i2c: designware: Export symbols and add __weak for Starfive I2C driver

From: Lianfeng Ouyang

Date: Wed May 27 2026 - 22:45:56 EST



Hi, Krzysztof
Thanks for the review.

> -----邮件原件-----
> 发件人: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> 发送时间: 2026年5月27日 21:07
> 收件人: Lianfeng Ouyang <lianfeng.ouyang@xxxxxxxxxxxxxxxx>; Andi Shyti
> <andi.shyti@xxxxxxxxxx>; Rob Herring <robh@xxxxxxxxxx>; Krzysztof Kozlowski
> <krzk+dt@xxxxxxxxxx>; Conor Dooley <conor+dt@xxxxxxxxxx>; Mika
> Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>; Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx>
> 抄送: linux-i2c@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx
> 主题: Re: [PATCH v2 2/3] i2c: designware: Export symbols and add __weak for
> Starfive I2C driver
>
> On 27/05/2026 10:50, lianfeng.ouyang wrote:
> > dev->dev = device;
> > dev->irq = irq;
> > dev->flags = flags;
> > @@ -255,6 +259,8 @@ static const struct of_device_id dw_i2c_of_match[] =
> {
> > { .compatible = "mobileye,eyeq6lplus-i2c" },
> > { .compatible = "mscc,ocelot-i2c" },
> > { .compatible = "snps,designware-i2c" },
> > + { .compatible = "starfive,jhb100-i2c-master" },
> > + { .compatible = "starfive,jhb100-i2c-slave" },
>
> So both devices are the same... Or you miss proper entry in ID table.
> Don't sprinkle compatibles around the code - ID table match data is for
> variant customization.
>
> Best regards,
> Krzysztof

Ok, Master and slave have different base addresses and interrupt numbers, but
the register layout is the same, so in the next version, I will only use the same
compatible ”starfive, jhb100-i2c“, and then add starfive, i2c-slave to the dts node
of the slave to distinguish them

Best Regards,
Lianfeng Ouyang