回复: 回复: [PATCH v2 2/3] i2c: designware: Export symbols and add __weak for Starfive I2C driver
From: Lianfeng Ouyang
Date: Thu May 28 2026 - 04:36:25 EST
> -----邮件原件-----
> 发件人: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> 发送时间: 2026年5月28日 15:46
> 收件人: 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 28/05/2026 04:36, Lianfeng Ouyang wrote:
> >>> { .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
>
> You do not need to distinguish same devices usually, but I still do not
> understand why do you need all these different compatibles and your
> commit msgs or binding text do not help, so I don't know what to advise.
>
>
> Best regards,
> Krzysztof
The IP corresponding to the i2c driver submitted this time is quite unique,
so it should be distinguished. The master-slave of i2c designware are at the
same base address and switch according to the scene, so only one is initialized
in probe(). But i2c starfive has master-slave at different base addresses,
and it can work simultaneously. Therefore, both roles need to be initialized in
their respective probes. If we don't distinguish, we don't know if this probe is
initializing the master or the slave
Best Regards,
Lianfeng Ouyang