Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-18 Thread Marek Vasut
On 12/18/2018 11:01 AM, Andrew Lunn wrote: > On Tue, Dec 18, 2018 at 07:24:52AM +0100, Sergio Paracuellos wrote: >>> +static int ksz9477_i2c_read_reg(struct i2c_client *i2c, u32 reg, u8 *val, >>> + unsigned int len) >>> +{ >>> + struct i2c_msg msg[2]; >>> +

Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-18 Thread Andrew Lunn
On Tue, Dec 18, 2018 at 07:24:52AM +0100, Sergio Paracuellos wrote: > > +static int ksz9477_i2c_read_reg(struct i2c_client *i2c, u32 reg, u8 *val, > > + unsigned int len) > > +{ > > + struct i2c_msg msg[2]; > > + int ret = 0; > > + > > + val[0] = (u8)

Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-18 Thread Sergio Paracuellos
On Tue, Dec 18, 2018 at 9:06 AM Dan Carpenter wrote: > > Do we still need Sergio's device tree patch? I think is useful. If not at least add a clarification that the reg "5f" for the i2c is the one to use. > > regards, > dan carpenter > Thanks, Sergio Paracuellos

Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-18 Thread Dan Carpenter
Do we still need Sergio's device tree patch? regards, dan carpenter

Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Sergio Paracuellos
Hi Tristam, On Tue, Dec 18, 2018 at 5:16 AM wrote: > > Sorry about the patch. I know you were using the code from the new SPI and > old I2C drivers to come up with your patch. You can incorporate the changes > and test the driver and re-submit the patch if you want. For me is ok to just use

Re: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Sergio Paracuellos
Hi Tristram, Two minor comments. On Tue, Dec 18, 2018 at 2:40 AM wrote: > > From: Tristram Ha > > Add KSZ9477 I2C driver support. The code ksz9477.c and ksz_common.c are > used together to generate the I2C driver. > > Signed-off-by: Tristram Ha > --- > drivers/net/dsa/microchip/Kconfig

RE: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Tristram.Ha
Sorry about the patch. I know you were using the code from the new SPI and old I2C drivers to come up with your patch. You can incorporate the changes and test the driver and re-submit the patch if you want. Your i2c_probe function displays an error message when ksz9477_switch_register is not

RE: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Woojung.Huh
Tristram, > +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c .. > +MODULE_AUTHOR("Woojung Huh "); Believe this should be your name. Thanks. Woojung

[PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Tristram.Ha
From: Tristram Ha Add KSZ9477 I2C driver support. The code ksz9477.c and ksz_common.c are used together to generate the I2C driver. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/Kconfig | 6 + drivers/net/dsa/microchip/Makefile | 1 + drivers/net/dsa/microchip/ksz947

[PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver

2018-12-17 Thread Tristram.Ha
From: Tristram Ha This patch adds KSZ9477 I2C driver support. I know a patch for KSZ9477 I2C driver was already submitted. There is a minor problem though. The structure and code of the I2C driver should match those in the SPI driver. The only difference is the register access. Accordingly t