From: Jiri Pirko <jiri@resnulli.us>
To: Tristram.Ha@microchip.com
Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Marek Vasut <marex@denx.de>,
Dan Carpenter <dan.carpenter@oracle.com>,
vivien.didelot@savoirfairelinux.com,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next] net: dsa: microchip: add KSZ9477 I2C driver
Date: Wed, 19 Dec 2018 11:05:32 +0100 [thread overview]
Message-ID: <20181219100532.GA2066@nanopsycho> (raw)
In-Reply-To: <1545190897-22622-1-git-send-email-Tristram.Ha@microchip.com>
Wed, Dec 19, 2018 at 04:41:37AM CET, Tristram.Ha@microchip.com wrote:
>From: Tristram Ha <Tristram.Ha@microchip.com>
>
>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 <Tristram.Ha@microchip.com>
>diff --git a/drivers/net/dsa/microchip/ksz_i2c.h b/drivers/net/dsa/microchip/ksz_i2c.h
>new file mode 100644
>index 0000000..b9af0a8
>--- /dev/null
>+++ b/drivers/net/dsa/microchip/ksz_i2c.h
>@@ -0,0 +1,69 @@
>+/* SPDX-License-Identifier: GPL-2.0
>+ * Microchip KSZ series I2C access common header
>+ *
>+ * Copyright (C) 2018 Microchip Technology Inc.
>+ * Tristram Ha <Tristram.Ha@microchip.com>
>+ */
>+
>+#ifndef __KSZ_I2C_H
>+#define __KSZ_I2C_H
>+
>+/* Chip dependent I2C access */
>+static int ksz_i2c_read(struct ksz_device *dev, u32 reg, u8 *data,
>+ unsigned int len);
>+static int ksz_i2c_write(struct ksz_device *dev, u32 reg, void *data,
>+ unsigned int len);
>+
>+static int ksz_i2c_read8(struct ksz_device *dev, u32 reg, u8 *val)
>+{
>+ return ksz_i2c_read(dev, reg, val, 1);
>+}
>+
>+static int ksz_i2c_read16(struct ksz_device *dev, u32 reg, u16 *val)
>+{
>+ int ret = ksz_i2c_read(dev, reg, (u8 *)val, 2);
>+
>+ if (!ret)
>+ *val = be16_to_cpu(*val);
>+
>+ return ret;
>+}
>+
>+static int ksz_i2c_read32(struct ksz_device *dev, u32 reg, u32 *val)
>+{
>+ int ret = ksz_i2c_read(dev, reg, (u8 *)val, 4);
>+
>+ if (!ret)
>+ *val = be32_to_cpu(*val);
>+
>+ return ret;
>+}
>+
>+static int ksz_i2c_write8(struct ksz_device *dev, u32 reg, u8 value)
>+{
>+ return ksz_i2c_write(dev, reg, &value, 1);
>+}
>+
>+static int ksz_i2c_write16(struct ksz_device *dev, u32 reg, u16 value)
>+{
>+ value = cpu_to_be16(value);
>+ return ksz_i2c_write(dev, reg, &value, 2);
>+}
>+
>+static int ksz_i2c_write32(struct ksz_device *dev, u32 reg, u32 value)
>+{
>+ value = cpu_to_be32(value);
>+ return ksz_i2c_write(dev, reg, &value, 4);
>+}
>+
>+static int ksz_i2c_get(struct ksz_device *dev, u32 reg, void *data, size_t len)
>+{
>+ return ksz_i2c_read(dev, reg, data, len);
>+}
>+
>+static int ksz_i2c_set(struct ksz_device *dev, u32 reg, void *data, size_t len)
>+{
>+ return ksz_i2c_write(dev, reg, data, len);
>+}
This header file makes no sense. Please move the functions into .c
>+
>+#endif
>--
>1.9.1
>
next prev parent reply other threads:[~2018-12-19 10:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 3:41 [PATCH v1 net-next] net: dsa: microchip: add KSZ9477 I2C driver Tristram.Ha
2018-12-19 4:31 ` Woojung.Huh
2018-12-19 22:59 ` Tristram.Ha
2018-12-19 23:19 ` Woojung.Huh
2018-12-19 8:09 ` Marek Vasut
2018-12-19 22:30 ` Tristram.Ha
2018-12-19 23:11 ` Marek Vasut
2018-12-19 23:31 ` Marek Vasut
2018-12-20 1:10 ` Marek Vasut
2018-12-21 0:48 ` Tristram.Ha
2018-12-21 2:03 ` Marek Vasut
2018-12-19 10:05 ` Jiri Pirko [this message]
2018-12-19 16:08 ` Pavel Machek
2018-12-19 16:15 ` Jiri Pirko
2018-12-19 17:22 ` Pavel Machek
2018-12-19 17:24 ` Marek Vasut
2018-12-19 22:50 ` Tristram.Ha
2018-12-19 23:12 ` Marek Vasut
2018-12-21 9:29 ` Dan Carpenter
2018-12-21 12:14 ` Marek Vasut
2018-12-21 12:23 ` Dan Carpenter
2018-12-21 12:39 ` Marek Vasut
2019-01-09 16:05 ` Pavel Machek
2019-01-09 16:15 ` Marek Vasut
2018-12-19 16:45 ` David Miller
2019-01-10 8:15 ` Sergio Paracuellos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181219100532.GA2066@nanopsycho \
--to=jiri@resnulli.us \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@oracle.com \
--cc=f.fainelli@gmail.com \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=sergio.paracuellos@gmail.com \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.