($INBOX_DIR/description missing)
 help / color / Atom feed
* [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
@ 2019-08-19 12:16 Max Staudt
  2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Max Staudt @ 2019-08-19 12:16 UTC (permalink / raw)
  To: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, Guenter Roeck
  Cc: linux-m68k, linux-kernel, glaubitz, Max Staudt

This is the i2c-icy driver for the ICY board for Amiga computers.
It connects a PCF8584 I2C controller to the Zorro bus, providing I2C
connectivity. The original documentation can be found on Aminet:

https://aminet.net/package/docs/hard/icy

IRQ support is currently not implemented, as i2c-algo-pcf is built for
the ISA bus and a straight implementation of the same stack locks up a
Zorro machine.

v5: usleep_range() instead of udelay()
    Style

v3: Fixed %pa format string
    Dropped adapter class.
    Clarified licence.
    Removed clock parameter.

v2: Matched function names to callbacks from i2c-algo-pcf
    Used z_readb()/z_writeb()
    Removed BROKEN_ON_SMP in Kconfig
    Moved LTC2990 to a separate commit

Signed-off-by: Max Staudt <max@enpas.org>
---
 MAINTAINERS                  |   6 ++
 drivers/i2c/busses/Kconfig   |  11 +++
 drivers/i2c/busses/Makefile  |   1 +
 drivers/i2c/busses/i2c-icy.c | 174 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 192 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-icy.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 1be025959..70336c083 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7705,6 +7705,12 @@ S:	Maintained
 F:	drivers/mfd/lpc_ich.c
 F:	drivers/gpio/gpio-ich.c
 
+ICY I2C DRIVER
+M:	Max Staudt <max@enpas.org>
+L:	linux-i2c@vger.kernel.org
+S:	Maintained
+F:	drivers/i2c/busses/i2c-icy.c
+
 IDE SUBSYSTEM
 M:	"David S. Miller" <davem@davemloft.net>
 L:	linux-ide@vger.kernel.org
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index ee5dfb5ae..9e57e1101 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -1300,6 +1300,17 @@ config I2C_ELEKTOR
 	  This support is also available as a module.  If so, the module
 	  will be called i2c-elektor.
 
+config I2C_ICY
+	tristate "ICY Zorro card"
+	depends on ZORRO
+	select I2C_ALGOPCF
+	help
+	  This supports the PCF8584 Zorro bus I2C adapter, known as ICY.
+	  Say Y if you own such an adapter.
+
+	  This support is also available as a module.  If so, the module
+	  will be called i2c-icy.
+
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
 	depends on X86_64
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index a3245231b..d0e1c3d4e 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -139,6 +139,7 @@ obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
 obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
 obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
+obj-$(CONFIG_I2C_ICY)		+= i2c-icy.o
 obj-$(CONFIG_I2C_MLXCPLD)	+= i2c-mlxcpld.o
 obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
 obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
diff --git a/drivers/i2c/busses/i2c-icy.c b/drivers/i2c/busses/i2c-icy.c
new file mode 100644
index 000000000..20c0fbacf
--- /dev/null
+++ b/drivers/i2c/busses/i2c-icy.c
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * I2C driver for stand-alone PCF8584 style adapters on Zorro cards
+ *
+ * Original ICY documentation can be found on Aminet:
+ * https://aminet.net/package/docs/hard/icy
+ *
+ * There has been a modern community re-print of this design in 2019:
+ * https://www.a1k.org/forum/index.php?threads/70106/
+ *
+ * The card is basically a Philips PCF8584 connected straight to the
+ * beginning of the AutoConfig'd address space (register S1 on base+2),
+ * with /INT on /INT2 on the Zorro bus.
+ *
+ * Copyright (c) 2019 Max Staudt <max@enpas.org>
+ *
+ * This started as a fork of i2c-elektor.c and has evolved since.
+ * Thanks go to its authors for providing a base to grow on.
+ *
+ *
+ * IRQ support is currently not implemented.
+ *
+ * As it turns out, i2c-algo-pcf is really written with i2c-elektor's
+ * edge-triggered ISA interrupts in mind, while the Amiga's Zorro bus has
+ * level-triggered interrupts. This means that once an interrupt occurs, we
+ * have to tell the PCF8584 to shut up immediately, or it will keep the
+ * interrupt line busy and cause an IRQ storm.
+
+ * However, because of the PCF8584's host-side protocol, there is no good
+ * way to just quieten it without side effects. Rather, we have to perform
+ * the next read/write operation straight away, which will reset the /INT
+ * pin. This entails re-designing the core of i2c-algo-pcf in the future.
+ * For now, we never request an IRQ from the PCF8584, and poll it instead.
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-pcf.h>
+
+#include <asm/amigaints.h>
+#include <linux/zorro.h>
+
+#include "../algos/i2c-algo-pcf.h"
+
+struct icy_i2c {
+	struct i2c_adapter adapter;
+
+	void __iomem *reg_s0;
+	void __iomem *reg_s1;
+};
+
+/*
+ * Functions called by i2c-algo-pcf
+ */
+static void icy_pcf_setpcf(void *data, int ctl, int val)
+{
+	struct icy_i2c *i2c = (struct icy_i2c *)data;
+
+	u8 __iomem *address = ctl ? i2c->reg_s1 : i2c->reg_s0;
+
+	z_writeb(val, address);
+}
+
+static int icy_pcf_getpcf(void *data, int ctl)
+{
+	struct icy_i2c *i2c = (struct icy_i2c *)data;
+
+	u8 __iomem *address = ctl ? i2c->reg_s1 : i2c->reg_s0;
+	int val = z_readb(address);
+
+	return val;
+}
+
+static int icy_pcf_getown(void *data)
+{
+	return 0x55;
+}
+
+static int icy_pcf_getclock(void *data)
+{
+	return 0x1c;
+}
+
+static void icy_pcf_waitforpin(void *data)
+{
+	usleep_range(50, 150);
+}
+
+/*
+ * Main i2c-icy part
+ */
+static int icy_probe(struct zorro_dev *z,
+		     const struct zorro_device_id *ent)
+{
+	struct icy_i2c *i2c;
+	struct i2c_algo_pcf_data *algo_data;
+
+	i2c = devm_kzalloc(&z->dev, sizeof(*i2c), GFP_KERNEL);
+	if (!i2c)
+		return -ENOMEM;
+
+	algo_data = devm_kzalloc(&z->dev, sizeof(*algo_data), GFP_KERNEL);
+	if (!algo_data)
+		return -ENOMEM;
+
+	dev_set_drvdata(&z->dev, i2c);
+	i2c->adapter.dev.parent = &z->dev;
+	i2c->adapter.owner = THIS_MODULE;
+	/* i2c->adapter.algo assigned by i2c_pcf_add_bus() */
+	i2c->adapter.algo_data = algo_data;
+	strlcpy(i2c->adapter.name, "ICY I2C Zorro adapter",
+		sizeof(i2c->adapter.name));
+
+	if (!devm_request_mem_region(&z->dev,
+				     z->resource.start,
+				     4, i2c->adapter.name))
+		return -ENXIO;
+
+	/* Driver private data */
+	i2c->reg_s0 = ZTWO_VADDR(z->resource.start);
+	i2c->reg_s1 = ZTWO_VADDR(z->resource.start + 2);
+
+	algo_data->data = i2c;
+	algo_data->setpcf     = icy_pcf_setpcf;
+	algo_data->getpcf     = icy_pcf_getpcf;
+	algo_data->getown     = icy_pcf_getown;
+	algo_data->getclock   = icy_pcf_getclock;
+	algo_data->waitforpin = icy_pcf_waitforpin;
+
+	if (i2c_pcf_add_bus(&i2c->adapter)) {
+		dev_err(&z->dev, "i2c_pcf_add_bus() failed\n");
+		return -ENXIO;
+	}
+
+	dev_info(&z->dev, "ICY I2C controller at %pa, IRQ not implemented\n",
+		 &z->resource.start);
+
+	return 0;
+}
+
+static void icy_remove(struct zorro_dev *z)
+{
+	struct icy_i2c *i2c = dev_get_drvdata(&z->dev);
+
+	i2c_del_adapter(&i2c->adapter);
+}
+
+static const struct zorro_device_id icy_zorro_tbl[] = {
+	{ ZORRO_ID(VMC, 15, 0), },
+	{ 0 }
+};
+
+MODULE_DEVICE_TABLE(zorro, icy_zorro_tbl);
+
+static struct zorro_driver icy_driver = {
+	.name           = "i2c-icy",
+	.id_table       = icy_zorro_tbl,
+	.probe          = icy_probe,
+	.remove         = icy_remove,
+};
+
+module_driver(icy_driver,
+	      zorro_register_driver,
+	      zorro_unregister_driver);
+
+MODULE_AUTHOR("Max Staudt <max@enpas.org>");
+MODULE_DESCRIPTION("I2C bus via PCF8584 on ICY Zorro card");
+MODULE_LICENSE("GPL v2");
-- 
2.11.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support
  2019-08-19 12:16 [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
@ 2019-08-19 12:16 ` Max Staudt
  2019-08-20  9:09   ` Geert Uytterhoeven
  2019-08-20 15:07   ` Guenter Roeck
  2019-08-19 12:16 ` [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
  2019-08-20  9:08 ` [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Geert Uytterhoeven
  2 siblings, 2 replies; 14+ messages in thread
From: Max Staudt @ 2019-08-19 12:16 UTC (permalink / raw)
  To: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, Guenter Roeck
  Cc: linux-m68k, linux-kernel, glaubitz, Max Staudt

ltc2990 will now use device_property_read_u32_array() instead of
of_property_read_u32_array() - allowing the use of software nodes
via fwnode_create_software_node().

This allows code using i2c_new_device() to specify a default
measurement mode for the LTC2990 via fwnode_create_software_node().

Signed-off-by: Max Staudt <max@enpas.org>
---
 drivers/hwmon/ltc2990.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/ltc2990.c b/drivers/hwmon/ltc2990.c
index f9431ad43..53ff50517 100644
--- a/drivers/hwmon/ltc2990.c
+++ b/drivers/hwmon/ltc2990.c
@@ -13,7 +13,7 @@
 #include <linux/i2c.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/property.h>
 
 #define LTC2990_STATUS	0x00
 #define LTC2990_CONTROL	0x01
@@ -206,7 +206,6 @@ static int ltc2990_i2c_probe(struct i2c_client *i2c,
 	int ret;
 	struct device *hwmon_dev;
 	struct ltc2990_data *data;
-	struct device_node *of_node = i2c->dev.of_node;
 
 	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
 				     I2C_FUNC_SMBUS_WORD_DATA))
@@ -218,9 +217,10 @@ static int ltc2990_i2c_probe(struct i2c_client *i2c,
 
 	data->i2c = i2c;
 
-	if (of_node) {
-		ret = of_property_read_u32_array(of_node, "lltc,meas-mode",
-						 data->mode, 2);
+	if (dev_fwnode(&i2c->dev)) {
+		ret = device_property_read_u32_array(&i2c->dev,
+						     "lltc,meas-mode",
+						     data->mode, 2);
 		if (ret < 0)
 			return ret;
 
-- 
2.11.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision
  2019-08-19 12:16 [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
  2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
@ 2019-08-19 12:16 ` Max Staudt
  2019-08-20  9:18   ` Geert Uytterhoeven
  2019-08-29 19:06   ` Wolfram Sang
  2019-08-20  9:08 ` [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Geert Uytterhoeven
  2 siblings, 2 replies; 14+ messages in thread
From: Max Staudt @ 2019-08-19 12:16 UTC (permalink / raw)
  To: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, Guenter Roeck
  Cc: linux-m68k, linux-kernel, glaubitz, Max Staudt

Since the 2019 a1k.org community re-print of these PCBs sports an
LTC2990 hwmon chip as an example use case, let this driver autoprobe
for that as well. If it is present, modprobing ltc2990 is sufficient.

The property_entry enables the three additional inputs available on
this particular board:

  in1 will be the voltage of the 5V rail, divided by 2.
  in2 will be the voltage of the 12V rail, divided by 4.
  temp3 will be measured using a PCB loop next the chip.

v5: Style

v4: Style
    Added other possible addresses for LTC2990.

v3: Merged with initial LTC2990 support on ICY.
    Moved defaults from platform_data to swnode.
    Added note to Kconfig.

Signed-off-by: Max Staudt <max@enpas.org>
---
 drivers/i2c/busses/Kconfig   |  3 +++
 drivers/i2c/busses/i2c-icy.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 9e57e1101..a311d07f3 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -1311,6 +1311,9 @@ config I2C_ICY
 	  This support is also available as a module.  If so, the module
 	  will be called i2c-icy.
 
+	  If you have a 2019 edition board with an LTC2990 sensor at address
+	  0x4c, loading the module 'ltc2990' is sufficient to enable it.
+
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
 	depends on X86_64
diff --git a/drivers/i2c/busses/i2c-icy.c b/drivers/i2c/busses/i2c-icy.c
index 20c0fbacf..6dd303dc1 100644
--- a/drivers/i2c/busses/i2c-icy.c
+++ b/drivers/i2c/busses/i2c-icy.c
@@ -53,6 +53,8 @@ struct icy_i2c {
 
 	void __iomem *reg_s0;
 	void __iomem *reg_s1;
+	struct fwnode_handle *ltc2990_fwnode;
+	struct i2c_client *ltc2990_client;
 };
 
 /*
@@ -95,11 +97,34 @@ static void icy_pcf_waitforpin(void *data)
 /*
  * Main i2c-icy part
  */
+static unsigned short const icy_ltc2990_addresses[] = {
+	0x4c, 0x4d, 0x4e, 0x4f, I2C_CLIENT_END
+};
+
+/*
+ * Additional sensors exposed once this property is applied:
+ *
+ * in1 will be the voltage of the 5V rail, divided by 2.
+ * in2 will be the voltage of the 12V rail, divided by 4.
+ * temp3 will be measured using a PCB loop next the chip.
+ */
+static const u32 icy_ltc2990_meas_mode[] = {0, 3};
+
+static const struct property_entry icy_ltc2990_props[] = {
+	PROPERTY_ENTRY_U32_ARRAY("lltc,meas-mode", icy_ltc2990_meas_mode),
+	{ }
+};
+
 static int icy_probe(struct zorro_dev *z,
 		     const struct zorro_device_id *ent)
 {
 	struct icy_i2c *i2c;
 	struct i2c_algo_pcf_data *algo_data;
+	struct fwnode_handle *new_fwnode;
+	struct i2c_board_info ltc2990_info = {
+		.type		= "ltc2990",
+		.addr		= 0x4c,
+	};
 
 	i2c = devm_kzalloc(&z->dev, sizeof(*i2c), GFP_KERNEL);
 	if (!i2c)
@@ -141,6 +166,35 @@ static int icy_probe(struct zorro_dev *z,
 	dev_info(&z->dev, "ICY I2C controller at %pa, IRQ not implemented\n",
 		 &z->resource.start);
 
+	/*
+	 * The 2019 a1k.org PCBs have an LTC2990 at 0x4c, so start
+	 * it automatically once ltc2990 is modprobed.
+	 *
+	 * in0 is the voltage of the internal 5V power supply.
+	 * temp1 is the temperature inside the chip.
+	 *
+	 * See property_entry above for in1, in2, temp3.
+	 */
+	new_fwnode = fwnode_create_software_node(icy_ltc2990_props, NULL);
+	if (IS_ERR(new_fwnode)) {
+		dev_info(&z->dev, "Failed to create fwnode for LTC2990, error: %ld\n",
+			 PTR_ERR(new_fwnode));
+	} else {
+		/*
+		 * Store the fwnode so we can destroy it on .remove().
+		 * Only store it on success, as fwnode_remove_software_node()
+		 * is NULL safe, but not PTR_ERR safe.
+		 */
+		i2c->ltc2990_fwnode = new_fwnode;
+		ltc2990_info.fwnode = new_fwnode;
+
+		i2c->ltc2990_client =
+			i2c_new_probed_device(&i2c->adapter,
+					      &ltc2990_info,
+					      icy_ltc2990_addresses,
+					      NULL);
+	}
+
 	return 0;
 }
 
@@ -148,6 +202,9 @@ static void icy_remove(struct zorro_dev *z)
 {
 	struct icy_i2c *i2c = dev_get_drvdata(&z->dev);
 
+	i2c_unregister_device(i2c->ltc2990_client);
+	fwnode_remove_software_node(i2c->ltc2990_fwnode);
+
 	i2c_del_adapter(&i2c->adapter);
 }
 
-- 
2.11.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
  2019-08-19 12:16 [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
  2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
  2019-08-19 12:16 ` [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
@ 2019-08-20  9:08 ` Geert Uytterhoeven
  2019-08-20  9:23   ` Max
  2 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-08-20  9:08 UTC (permalink / raw)
  To: Max Staudt
  Cc: Linux I2C, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, Linux/m68k, Linux Kernel Mailing List,
	John Paul Adrian Glaubitz

On Mon, Aug 19, 2019 at 2:17 PM Max Staudt <max@enpas.org> wrote:
> This is the i2c-icy driver for the ICY board for Amiga computers.
> It connects a PCF8584 I2C controller to the Zorro bus, providing I2C
> connectivity. The original documentation can be found on Aminet:
>
> https://aminet.net/package/docs/hard/icy
>
> IRQ support is currently not implemented, as i2c-algo-pcf is built for
> the ISA bus and a straight implementation of the same stack locks up a
> Zorro machine.
>
> v5: usleep_range() instead of udelay()
>     Style
>
> v3: Fixed %pa format string
>     Dropped adapter class.
>     Clarified licence.
>     Removed clock parameter.
>
> v2: Matched function names to callbacks from i2c-algo-pcf
>     Used z_readb()/z_writeb()
>     Removed BROKEN_ON_SMP in Kconfig
>     Moved LTC2990 to a separate commit
>
> Signed-off-by: Max Staudt <max@enpas.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-icy.c

> +static int icy_pcf_getpcf(void *data, int ctl)
> +{
> +       struct icy_i2c *i2c = (struct icy_i2c *)data;
> +
> +       u8 __iomem *address = ctl ? i2c->reg_s1 : i2c->reg_s0;
> +       int val = z_readb(address);
> +
> +       return val;

return z_readb(address);

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support
  2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
@ 2019-08-20  9:09   ` Geert Uytterhoeven
  2019-08-20 15:07   ` Guenter Roeck
  1 sibling, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-08-20  9:09 UTC (permalink / raw)
  To: Max Staudt
  Cc: Linux I2C, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, Linux/m68k, Linux Kernel Mailing List,
	John Paul Adrian Glaubitz

On Mon, Aug 19, 2019 at 2:17 PM Max Staudt <max@enpas.org> wrote:
> ltc2990 will now use device_property_read_u32_array() instead of
> of_property_read_u32_array() - allowing the use of software nodes
> via fwnode_create_software_node().
>
> This allows code using i2c_new_device() to specify a default
> measurement mode for the LTC2990 via fwnode_create_software_node().
>
> Signed-off-by: Max Staudt <max@enpas.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision
  2019-08-19 12:16 ` [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
@ 2019-08-20  9:18   ` Geert Uytterhoeven
  2019-08-20  9:22     ` Max
  2019-08-29 19:06   ` Wolfram Sang
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-08-20  9:18 UTC (permalink / raw)
  To: Max Staudt
  Cc: Linux I2C, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, Linux/m68k, Linux Kernel Mailing List,
	John Paul Adrian Glaubitz, Bartosz Golaszewski

On Mon, Aug 19, 2019 at 2:17 PM Max Staudt <max@enpas.org> wrote:
> Since the 2019 a1k.org community re-print of these PCBs sports an
> LTC2990 hwmon chip as an example use case, let this driver autoprobe
> for that as well. If it is present, modprobing ltc2990 is sufficient.
>
> The property_entry enables the three additional inputs available on
> this particular board:
>
>   in1 will be the voltage of the 5V rail, divided by 2.
>   in2 will be the voltage of the 12V rail, divided by 4.
>   temp3 will be measured using a PCB loop next the chip.
>
> v5: Style
>
> v4: Style
>     Added other possible addresses for LTC2990.
>
> v3: Merged with initial LTC2990 support on ICY.
>     Moved defaults from platform_data to swnode.
>     Added note to Kconfig.
>
> Signed-off-by: Max Staudt <max@enpas.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

One comment below...

> --- a/drivers/i2c/busses/i2c-icy.c
> +++ b/drivers/i2c/busses/i2c-icy.c

> @@ -141,6 +166,35 @@ static int icy_probe(struct zorro_dev *z,
>         dev_info(&z->dev, "ICY I2C controller at %pa, IRQ not implemented\n",
>                  &z->resource.start);
>
> +       /*
> +        * The 2019 a1k.org PCBs have an LTC2990 at 0x4c, so start
> +        * it automatically once ltc2990 is modprobed.
> +        *
> +        * in0 is the voltage of the internal 5V power supply.
> +        * temp1 is the temperature inside the chip.
> +        *
> +        * See property_entry above for in1, in2, temp3.
> +        */
> +       new_fwnode = fwnode_create_software_node(icy_ltc2990_props, NULL);
> +       if (IS_ERR(new_fwnode)) {
> +               dev_info(&z->dev, "Failed to create fwnode for LTC2990, error: %ld\n",
> +                        PTR_ERR(new_fwnode));
> +       } else {
> +               /*
> +                * Store the fwnode so we can destroy it on .remove().
> +                * Only store it on success, as fwnode_remove_software_node()
> +                * is NULL safe, but not PTR_ERR safe.
> +                */
> +               i2c->ltc2990_fwnode = new_fwnode;
> +               ltc2990_info.fwnode = new_fwnode;
> +
> +               i2c->ltc2990_client =
> +                       i2c_new_probed_device(&i2c->adapter,
> +                                             &ltc2990_info,
> +                                             icy_ltc2990_addresses,
> +                                             NULL);
> +       }
> +
>         return 0;
>  }

Since commit d3e1b617ae20c459 ("i2c: allow specify device properties in
i2c_board_info"), the properties could be provided by info->properties, too.
However, according to the comments for device_add_properties(), this is
valid only if there is a real firmware node present.

If that is true, Max' use is correct, while e.g. commit 6a7836ba7fb4abf6
("ARM: imx: pca100: use device properties for at24 eeprom") isn't?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision
  2019-08-20  9:18   ` Geert Uytterhoeven
@ 2019-08-20  9:22     ` Max
  0 siblings, 0 replies; 14+ messages in thread
From: Max @ 2019-08-20  9:22 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux I2C, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, Linux/m68k, Linux Kernel Mailing List,
	John Paul Adrian Glaubitz, Bartosz Golaszewski



On August 20, 2019 11:18:36 AM GMT+02:00, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>Since commit d3e1b617ae20c459 ("i2c: allow specify device properties in
>i2c_board_info"), the properties could be provided by info->properties,
>too.
>However, according to the comments for device_add_properties(), this is
>valid only if there is a real firmware node present.
>
>If that is true, Max' use is correct, while e.g. commit
>6a7836ba7fb4abf6
>("ARM: imx: pca100: use device properties for at24 eeprom") isn't?

Yup, I saw that too. Any hints would be greatly appreciated!

Max

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
  2019-08-20  9:08 ` [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Geert Uytterhoeven
@ 2019-08-20  9:23   ` Max
  2019-08-20  9:27     ` [PATCH] " Max Staudt
  0 siblings, 1 reply; 14+ messages in thread
From: Max @ 2019-08-20  9:23 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux I2C, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, Linux/m68k, Linux Kernel Mailing List,
	John Paul Adrian Glaubitz



On August 20, 2019 11:08:00 AM GMT+02:00, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> +       int val = z_readb(address);
>> +
>> +       return val;
>
>return z_readb(address);

Argh, that slipped through the cracks. I'll mend it later. Thank you.

Max

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
  2019-08-20  9:23   ` Max
@ 2019-08-20  9:27     ` " Max Staudt
  2019-08-29 19:00       ` Wolfram Sang
  0 siblings, 1 reply; 14+ messages in thread
From: Max Staudt @ 2019-08-20  9:27 UTC (permalink / raw)
  To: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, Guenter Roeck
  Cc: linux-m68k, linux-kernel, glaubitz, Max Staudt

This is the i2c-icy driver for the ICY board for Amiga computers.
It connects a PCF8584 I2C controller to the Zorro bus, providing I2C
connectivity. The original documentation can be found on Aminet:

https://aminet.net/package/docs/hard/icy

IRQ support is currently not implemented, as i2c-algo-pcf is built for
the ISA bus and a straight implementation of the same stack locks up a
Zorro machine.

v5: usleep_range() instead of udelay()
    Style

v3: Fixed %pa format string
    Dropped adapter class.
    Clarified licence.
    Removed clock parameter.

v2: Matched function names to callbacks from i2c-algo-pcf
    Used z_readb()/z_writeb()
    Removed BROKEN_ON_SMP in Kconfig
    Moved LTC2990 to a separate commit

Signed-off-by: Max Staudt <max@enpas.org>
---
 MAINTAINERS                  |   6 ++
 drivers/i2c/busses/Kconfig   |  11 +++
 drivers/i2c/busses/Makefile  |   1 +
 drivers/i2c/busses/i2c-icy.c | 172 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 190 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-icy.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 1be025959..70336c083 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7705,6 +7705,12 @@ S:	Maintained
 F:	drivers/mfd/lpc_ich.c
 F:	drivers/gpio/gpio-ich.c
 
+ICY I2C DRIVER
+M:	Max Staudt <max@enpas.org>
+L:	linux-i2c@vger.kernel.org
+S:	Maintained
+F:	drivers/i2c/busses/i2c-icy.c
+
 IDE SUBSYSTEM
 M:	"David S. Miller" <davem@davemloft.net>
 L:	linux-ide@vger.kernel.org
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index ee5dfb5ae..9e57e1101 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -1300,6 +1300,17 @@ config I2C_ELEKTOR
 	  This support is also available as a module.  If so, the module
 	  will be called i2c-elektor.
 
+config I2C_ICY
+	tristate "ICY Zorro card"
+	depends on ZORRO
+	select I2C_ALGOPCF
+	help
+	  This supports the PCF8584 Zorro bus I2C adapter, known as ICY.
+	  Say Y if you own such an adapter.
+
+	  This support is also available as a module.  If so, the module
+	  will be called i2c-icy.
+
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
 	depends on X86_64
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index a3245231b..d0e1c3d4e 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -139,6 +139,7 @@ obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
 obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
 obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
+obj-$(CONFIG_I2C_ICY)		+= i2c-icy.o
 obj-$(CONFIG_I2C_MLXCPLD)	+= i2c-mlxcpld.o
 obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
 obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
diff --git a/drivers/i2c/busses/i2c-icy.c b/drivers/i2c/busses/i2c-icy.c
new file mode 100644
index 000000000..7b7083da8
--- /dev/null
+++ b/drivers/i2c/busses/i2c-icy.c
@@ -0,0 +1,172 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * I2C driver for stand-alone PCF8584 style adapters on Zorro cards
+ *
+ * Original ICY documentation can be found on Aminet:
+ * https://aminet.net/package/docs/hard/icy
+ *
+ * There has been a modern community re-print of this design in 2019:
+ * https://www.a1k.org/forum/index.php?threads/70106/
+ *
+ * The card is basically a Philips PCF8584 connected straight to the
+ * beginning of the AutoConfig'd address space (register S1 on base+2),
+ * with /INT on /INT2 on the Zorro bus.
+ *
+ * Copyright (c) 2019 Max Staudt <max@enpas.org>
+ *
+ * This started as a fork of i2c-elektor.c and has evolved since.
+ * Thanks go to its authors for providing a base to grow on.
+ *
+ *
+ * IRQ support is currently not implemented.
+ *
+ * As it turns out, i2c-algo-pcf is really written with i2c-elektor's
+ * edge-triggered ISA interrupts in mind, while the Amiga's Zorro bus has
+ * level-triggered interrupts. This means that once an interrupt occurs, we
+ * have to tell the PCF8584 to shut up immediately, or it will keep the
+ * interrupt line busy and cause an IRQ storm.
+
+ * However, because of the PCF8584's host-side protocol, there is no good
+ * way to just quieten it without side effects. Rather, we have to perform
+ * the next read/write operation straight away, which will reset the /INT
+ * pin. This entails re-designing the core of i2c-algo-pcf in the future.
+ * For now, we never request an IRQ from the PCF8584, and poll it instead.
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-pcf.h>
+
+#include <asm/amigaints.h>
+#include <linux/zorro.h>
+
+#include "../algos/i2c-algo-pcf.h"
+
+struct icy_i2c {
+	struct i2c_adapter adapter;
+
+	void __iomem *reg_s0;
+	void __iomem *reg_s1;
+};
+
+/*
+ * Functions called by i2c-algo-pcf
+ */
+static void icy_pcf_setpcf(void *data, int ctl, int val)
+{
+	struct icy_i2c *i2c = (struct icy_i2c *)data;
+
+	u8 __iomem *address = ctl ? i2c->reg_s1 : i2c->reg_s0;
+
+	z_writeb(val, address);
+}
+
+static int icy_pcf_getpcf(void *data, int ctl)
+{
+	struct icy_i2c *i2c = (struct icy_i2c *)data;
+
+	u8 __iomem *address = ctl ? i2c->reg_s1 : i2c->reg_s0;
+	return z_readb(address);
+}
+
+static int icy_pcf_getown(void *data)
+{
+	return 0x55;
+}
+
+static int icy_pcf_getclock(void *data)
+{
+	return 0x1c;
+}
+
+static void icy_pcf_waitforpin(void *data)
+{
+	usleep_range(50, 150);
+}
+
+/*
+ * Main i2c-icy part
+ */
+static int icy_probe(struct zorro_dev *z,
+		     const struct zorro_device_id *ent)
+{
+	struct icy_i2c *i2c;
+	struct i2c_algo_pcf_data *algo_data;
+
+	i2c = devm_kzalloc(&z->dev, sizeof(*i2c), GFP_KERNEL);
+	if (!i2c)
+		return -ENOMEM;
+
+	algo_data = devm_kzalloc(&z->dev, sizeof(*algo_data), GFP_KERNEL);
+	if (!algo_data)
+		return -ENOMEM;
+
+	dev_set_drvdata(&z->dev, i2c);
+	i2c->adapter.dev.parent = &z->dev;
+	i2c->adapter.owner = THIS_MODULE;
+	/* i2c->adapter.algo assigned by i2c_pcf_add_bus() */
+	i2c->adapter.algo_data = algo_data;
+	strlcpy(i2c->adapter.name, "ICY I2C Zorro adapter",
+		sizeof(i2c->adapter.name));
+
+	if (!devm_request_mem_region(&z->dev,
+				     z->resource.start,
+				     4, i2c->adapter.name))
+		return -ENXIO;
+
+	/* Driver private data */
+	i2c->reg_s0 = ZTWO_VADDR(z->resource.start);
+	i2c->reg_s1 = ZTWO_VADDR(z->resource.start + 2);
+
+	algo_data->data = i2c;
+	algo_data->setpcf     = icy_pcf_setpcf;
+	algo_data->getpcf     = icy_pcf_getpcf;
+	algo_data->getown     = icy_pcf_getown;
+	algo_data->getclock   = icy_pcf_getclock;
+	algo_data->waitforpin = icy_pcf_waitforpin;
+
+	if (i2c_pcf_add_bus(&i2c->adapter)) {
+		dev_err(&z->dev, "i2c_pcf_add_bus() failed\n");
+		return -ENXIO;
+	}
+
+	dev_info(&z->dev, "ICY I2C controller at %pa, IRQ not implemented\n",
+		 &z->resource.start);
+
+	return 0;
+}
+
+static void icy_remove(struct zorro_dev *z)
+{
+	struct icy_i2c *i2c = dev_get_drvdata(&z->dev);
+
+	i2c_del_adapter(&i2c->adapter);
+}
+
+static const struct zorro_device_id icy_zorro_tbl[] = {
+	{ ZORRO_ID(VMC, 15, 0), },
+	{ 0 }
+};
+
+MODULE_DEVICE_TABLE(zorro, icy_zorro_tbl);
+
+static struct zorro_driver icy_driver = {
+	.name           = "i2c-icy",
+	.id_table       = icy_zorro_tbl,
+	.probe          = icy_probe,
+	.remove         = icy_remove,
+};
+
+module_driver(icy_driver,
+	      zorro_register_driver,
+	      zorro_unregister_driver);
+
+MODULE_AUTHOR("Max Staudt <max@enpas.org>");
+MODULE_DESCRIPTION("I2C bus via PCF8584 on ICY Zorro card");
+MODULE_LICENSE("GPL v2");
-- 
2.11.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support
  2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
  2019-08-20  9:09   ` Geert Uytterhoeven
@ 2019-08-20 15:07   ` Guenter Roeck
  2019-08-20 15:08     ` Max Staudt
  1 sibling, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2019-08-20 15:07 UTC (permalink / raw)
  To: Max Staudt
  Cc: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, linux-m68k,
	linux-kernel, glaubitz

On Mon, Aug 19, 2019 at 02:16:17PM +0200, Max Staudt wrote:
> ltc2990 will now use device_property_read_u32_array() instead of
> of_property_read_u32_array() - allowing the use of software nodes
> via fwnode_create_software_node().
> 
> This allows code using i2c_new_device() to specify a default
> measurement mode for the LTC2990 via fwnode_create_software_node().
> 
> Signed-off-by: Max Staudt <max@enpas.org>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/ltc2990.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwmon/ltc2990.c b/drivers/hwmon/ltc2990.c
> index f9431ad43..53ff50517 100644
> --- a/drivers/hwmon/ltc2990.c
> +++ b/drivers/hwmon/ltc2990.c
> @@ -13,7 +13,7 @@
>  #include <linux/i2c.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
> +#include <linux/property.h>
>  
>  #define LTC2990_STATUS	0x00
>  #define LTC2990_CONTROL	0x01
> @@ -206,7 +206,6 @@ static int ltc2990_i2c_probe(struct i2c_client *i2c,
>  	int ret;
>  	struct device *hwmon_dev;
>  	struct ltc2990_data *data;
> -	struct device_node *of_node = i2c->dev.of_node;
>  
>  	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
>  				     I2C_FUNC_SMBUS_WORD_DATA))
> @@ -218,9 +217,10 @@ static int ltc2990_i2c_probe(struct i2c_client *i2c,
>  
>  	data->i2c = i2c;
>  
> -	if (of_node) {
> -		ret = of_property_read_u32_array(of_node, "lltc,meas-mode",
> -						 data->mode, 2);
> +	if (dev_fwnode(&i2c->dev)) {
> +		ret = device_property_read_u32_array(&i2c->dev,
> +						     "lltc,meas-mode",
> +						     data->mode, 2);
>  		if (ret < 0)
>  			return ret;
>  

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support
  2019-08-20 15:07   ` Guenter Roeck
@ 2019-08-20 15:08     ` Max Staudt
  0 siblings, 0 replies; 14+ messages in thread
From: Max Staudt @ 2019-08-20 15:08 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare, linux-m68k,
	linux-kernel, glaubitz

On 08/20/2019 05:07 PM, Guenter Roeck wrote:
> On Mon, Aug 19, 2019 at 02:16:17PM +0200, Max Staudt wrote:
>> ltc2990 will now use device_property_read_u32_array() instead of
>> of_property_read_u32_array() - allowing the use of software nodes
>> via fwnode_create_software_node().
>>
>> This allows code using i2c_new_device() to specify a default
>> measurement mode for the LTC2990 via fwnode_create_software_node().
>>
>> Signed-off-by: Max Staudt <max@enpas.org>
>> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> Applied to hwmon-next.
> 
> Thanks,
> Guenter

Thanks for your help, reviewing, and applying!

Max

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
  2019-08-20  9:27     ` [PATCH] " Max Staudt
@ 2019-08-29 19:00       ` Wolfram Sang
  2019-08-29 19:17         ` Max Staudt
  0 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2019-08-29 19:00 UTC (permalink / raw)
  To: Max Staudt
  Cc: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, linux-m68k, linux-kernel, glaubitz

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

On Tue, Aug 20, 2019 at 11:27:39AM +0200, Max Staudt wrote:
> This is the i2c-icy driver for the ICY board for Amiga computers.
> It connects a PCF8584 I2C controller to the Zorro bus, providing I2C
> connectivity. The original documentation can be found on Aminet:
> 
> https://aminet.net/package/docs/hard/icy
> 
> IRQ support is currently not implemented, as i2c-algo-pcf is built for
> the ISA bus and a straight implementation of the same stack locks up a
> Zorro machine.
> 
> v5: usleep_range() instead of udelay()
>     Style
> 
> v3: Fixed %pa format string
>     Dropped adapter class.
>     Clarified licence.
>     Removed clock parameter.
> 
> v2: Matched function names to callbacks from i2c-algo-pcf
>     Used z_readb()/z_writeb()
>     Removed BROKEN_ON_SMP in Kconfig
>     Moved LTC2990 to a separate commit

Thanks for the changelog; it should go below the '---' line, however.

> 
> Signed-off-by: Max Staudt <max@enpas.org>

Fixed a freshly introduced checkpatch warning for you.

But most importantly, applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision
  2019-08-19 12:16 ` [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
  2019-08-20  9:18   ` Geert Uytterhoeven
@ 2019-08-29 19:06   ` Wolfram Sang
  1 sibling, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2019-08-29 19:06 UTC (permalink / raw)
  To: Max Staudt
  Cc: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, linux-m68k, linux-kernel, glaubitz

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Mon, Aug 19, 2019 at 02:16:18PM +0200, Max Staudt wrote:
> Since the 2019 a1k.org community re-print of these PCBs sports an
> LTC2990 hwmon chip as an example use case, let this driver autoprobe
> for that as well. If it is present, modprobing ltc2990 is sufficient.
> 
> The property_entry enables the three additional inputs available on
> this particular board:
> 
>   in1 will be the voltage of the 5V rail, divided by 2.
>   in2 will be the voltage of the 12V rail, divided by 4.
>   temp3 will be measured using a PCB loop next the chip.
> 
> v5: Style
> 
> v4: Style
>     Added other possible addresses for LTC2990.
> 
> v3: Merged with initial LTC2990 support on ICY.
>     Moved defaults from platform_data to swnode.
>     Added note to Kconfig.
> 
> Signed-off-by: Max Staudt <max@enpas.org>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] i2c/busses: Add i2c-icy for I2C on m68k/Amiga
  2019-08-29 19:00       ` Wolfram Sang
@ 2019-08-29 19:17         ` Max Staudt
  0 siblings, 0 replies; 14+ messages in thread
From: Max Staudt @ 2019-08-29 19:17 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-hwmon, Wolfram Sang, Jean Delvare,
	Guenter Roeck, linux-m68k, linux-kernel, glaubitz

On 08/29/2019 09:00 PM, Wolfram Sang wrote:
> Thanks for the changelog; it should go below the '---' line, however.

Thanks if you fixed it up!


> Fixed a freshly introduced checkpatch warning for you.

Ditto.


> But most importantly, applied to for-next, thanks!

Thank you too for taking this, and Geert for the extra reviews.



Max

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 12:16 [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
2019-08-19 12:16 ` [PATCH v5 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
2019-08-20  9:09   ` Geert Uytterhoeven
2019-08-20 15:07   ` Guenter Roeck
2019-08-20 15:08     ` Max Staudt
2019-08-19 12:16 ` [PATCH v5 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
2019-08-20  9:18   ` Geert Uytterhoeven
2019-08-20  9:22     ` Max
2019-08-29 19:06   ` Wolfram Sang
2019-08-20  9:08 ` [PATCH v5 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Geert Uytterhoeven
2019-08-20  9:23   ` Max
2019-08-20  9:27     ` [PATCH] " Max Staudt
2019-08-29 19:00       ` Wolfram Sang
2019-08-29 19:17         ` Max Staudt

($INBOX_DIR/description missing)

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-m68k/0 linux-m68k/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-m68k linux-m68k/ https://lore.kernel.org/linux-m68k \
		linux-m68k@vger.kernel.org
	public-inbox-index linux-m68k

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-m68k


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git