[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN6PR1101MB213030E9505BDC3385A57DFEE7BE0@BN6PR1101MB2130.namprd11.prod.outlook.com>
Date: Wed, 19 Dec 2018 04:31:10 +0000
From: <Woojung.Huh@...rochip.com>
To: <Tristram.Ha@...rochip.com>, <sergio.paracuellos@...il.com>,
<andrew@...n.ch>, <f.fainelli@...il.com>, <pavel@....cz>,
<marex@...x.de>, <dan.carpenter@...cle.com>
CC: <vivien.didelot@...oirfairelinux.com>,
<UNGLinuxDriver@...rochip.com>, <netdev@...r.kernel.org>
Subject: RE: [PATCH v1 net-next] net: dsa: microchip: add KSZ9477 I2C driver
Hi Tristram,
> diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c
> b/drivers/net/dsa/microchip/ksz9477_i2c.c
> new file mode 100644
> index 0000000..29511e9
> --- /dev/null
> +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c
..
> +static int ksz_i2c_read24(struct ksz_device *dev, u32 reg, u32 *val)
> +{
> + int ret;
> +
> + *val = 0;
> + ret = ksz_i2c_read(dev, reg, (u8 *)val, 3);
> + if (!ret) {
> + *val = be32_to_cpu(*val);
> + /* convert to 24bit */
> + *val >>= 8;
> + }
> +
> + return ret;
> +}
> +
> +static int ksz_i2c_write24(struct ksz_device *dev, u32 reg, u32 value)
> +{
> + /* make it to big endian 24bit from MSB */
> + value <<= 8;
> + value = cpu_to_be32(value);
> + return ksz_i2c_write(dev, reg, &value, 3);
> +}
Is there any specific reason that ksz_i2c_read24 & ksz_i2c_write24 in ksz9477_i2c.c
but, other functions are in ksz_i2c.h?
> +
> +static const struct ksz_io_ops ksz9477_i2c_ops = {
> + .read8 = ksz_i2c_read8,
> + .read16 = ksz_i2c_read16,
> + .read24 = ksz_i2c_read24,
> + .read32 = ksz_i2c_read32,
> + .write8 = ksz_i2c_write8,
> + .write16 = ksz_i2c_write16,
> + .write24 = ksz_i2c_write24,
> + .write32 = ksz_i2c_write32,
> + .get = ksz_i2c_get,
> + .set = ksz_i2c_set,
> +};
Thanks.
Woojung
Powered by blists - more mailing lists