Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-17 Thread Sergio Paracuellos
On Mon, Dec 17, 2018 at 8:11 PM Dan Carpenter wrote: > > On Mon, Dec 17, 2018 at 07:22:51PM +0100, Sergio Paracuellos wrote: > > > > +static int ksz_i2c_write(struct ksz_device *dev, u32 reg, u8 *val, > > > > + unsigned int len) > > > > +{ > > > > + struct i2c_client *clie

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-17 Thread Dan Carpenter
On Mon, Dec 17, 2018 at 07:22:51PM +0100, Sergio Paracuellos wrote: > > > +static int ksz_i2c_write(struct ksz_device *dev, u32 reg, u8 *val, > > > + unsigned int len) > > > +{ > > > + struct i2c_client *client = dev->priv; > > > + unsigned int cnt = len; > > > + in

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-17 Thread Sergio Paracuellos
Hi Dan, Thanks for the feedback. On Mon, Dec 17, 2018 at 7:55 AM Dan Carpenter wrote: > > On Sun, Dec 16, 2018 at 08:57:40AM +0100, Sergio Paracuellos wrote: > > +static int ksz_i2c_write(struct ksz_device *dev, u32 reg, u8 *val, > > + unsigned int len) > > +{ > > + stru

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-16 Thread Dan Carpenter
On Sun, Dec 16, 2018 at 08:57:40AM +0100, Sergio Paracuellos wrote: > +static int ksz_i2c_write(struct ksz_device *dev, u32 reg, u8 *val, > + unsigned int len) > +{ > + struct i2c_client *client = dev->priv; > + unsigned int cnt = len; > + int i = 0; > + u8 txb[

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-16 Thread Andrew Lunn
> I'll change these two to to get memory from kernel allocators instead > of using the stack. Thanks for let me know this. There appear to be other cases as well. Please review the whole driver. Thanks Andrew

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-16 Thread Sergio Paracuellos
On Sun, Dec 16, 2018 at 9:15 AM Andrew Lunn wrote: > > On Sun, Dec 16, 2018 at 08:57:40AM +0100, Sergio Paracuellos wrote: > > +static int ksz_i2c_read_reg(struct i2c_client *client, u32 reg, u8 *val, > > + unsigned int len) > > +{ > > + struct i2c_adapter *adapter = cl

Re: [PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-16 Thread Andrew Lunn
On Sun, Dec 16, 2018 at 08:57:40AM +0100, Sergio Paracuellos wrote: > +static int ksz_i2c_read_reg(struct i2c_client *client, u32 reg, u8 *val, > + unsigned int len) > +{ > + struct i2c_adapter *adapter = client->adapter; > + struct i2c_msg msg[2]; > + u8 txd[2];

[PATCH 1/2] net: dsa: ksz9477: add I2C managed mode support

2018-12-15 Thread Sergio Paracuellos
In this mode the switch device and the internal phys will be managed via I2C interface. Signed-off-by: Sergio Paracuellos --- drivers/net/dsa/microchip/Kconfig | 6 + drivers/net/dsa/microchip/Makefile | 1 + drivers/net/dsa/microchip/ksz9477_i2c.c | 258