Re: [PATCH V10 3/4] i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram:

Sorry for the late reply.

On Fri, Jan 20, 2023 at 5:08 PM Wolfram Sang <wsa@xxxxxxxxxx> wrote:
>
> Hi,
>
> the driver looks mostly good. Thank you for your hard work, and also
> thanks to Andy for his great review efforts again!
>
> > +static unsigned int ls2x_i2c_func(struct i2c_adapter *adap)
> > +{
> > +     return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> > +}
>
> Have you tried messages with zero-length or the SMBUS_QUICK transfer
> which is basically the same? i2cdectect uses it by default, so if that
> works, then we are good.

Yes, I have tried this, and i2cdetect shows the following:

[root@xxx ~]# ./i2c-tools-4.3/tools/i2cdetect -q -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 51 52 53 54 55 56 UU UU UU UU UU UU UU UU --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
[root@xxx ~]# ./i2c-tools-4.3/tools/i2cdetect -q -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Do you mean this?

>
> > +/* The DC subsystem depends on it, we should initialize it earlier. */
> > +static int __init ls2x_i2c_init_driver(void)
> > +{
> > +     return platform_driver_register(&ls2x_i2c_driver);
> > +}
> > +subsys_initcall(ls2x_i2c_init_driver);
>
> Can't this be handled with deferred probing?

Emm, I've been trying to register using the generic method before and
deferred probing should be a better option.
Also, I'll use module_platform_driver(ls2x_i2c_driver); instead in the
next version.

Thanks.
Binbin

>
> Happy hacking,
>
>    Wolfram
>



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux