linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] devicetree: i2c: add binding for Sigma Designs SMP8642 I2C master
@ 2015-10-31 17:35 Mans Rullgard
  2015-10-31 17:35 ` [PATCH 2/2] i2c: add driver " Mans Rullgard
       [not found] ` <1446312957-18744-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Mans Rullgard @ 2015-10-31 17:35 UTC (permalink / raw)
  To: Wolfram Sang, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

This adds a binding for the Sigma Designs SMP8642 built-in I2C master
controller.

Signed-off-by: Mans Rullgard <mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
---
 .../devicetree/bindings/i2c/sigma,smp8642-i2c.txt  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt

diff --git a/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt b/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt
new file mode 100644
index 0000000..117fc8b
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt
@@ -0,0 +1,24 @@
+Sigma Designs SMP8642 I2C master
+
+Required properties:
+- compatible: should be "sigma,smp8642-i2c"
+- reg: physical address space of the device
+- interrupts: the interrupt of the device
+- clocks: phandle of the clock for the device
+- #address-cells: should be <1>
+- #size-cells: should be <0>
+
+Optional properties:
+- clock-frequency: frequency of bus clock in Hz, default 100kHz
+
+Example:
+
+i2c@10480 {
+	compatible = "sigma,smp8642-i2c";
+	reg = <0x10480 0x2c>;
+	interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
+	clocks = <&sys_clk>;
+	clock-frequency = <100000>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+};
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/2] i2c: add driver for Sigma Designs SMP8642 I2C master
  2015-10-31 17:35 [PATCH 1/2] devicetree: i2c: add binding for Sigma Designs SMP8642 I2C master Mans Rullgard
@ 2015-10-31 17:35 ` Mans Rullgard
  2015-11-01  6:42   ` Wolfram Sang
       [not found] ` <1446312957-18744-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Mans Rullgard @ 2015-10-31 17:35 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, linux-i2c

This adds a driver for the Sigma Designs SMP8642 built-in I2C master
controller.  The hardware is very similar to the I2C controller in the
Ralink RT3050 chip with the addition of interrupt generation and an
inverted busy/idle status bit.  There are typically two controllers with
a shared IRQ.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/i2c/busses/Kconfig      |   8 +
 drivers/i2c/busses/Makefile     |   1 +
 drivers/i2c/busses/i2c-tangox.c | 330 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 339 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-tangox.c

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 08b8617..f764e3a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -974,6 +974,14 @@ config I2C_RCAR
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-rcar.
 
+config I2C_TANGOX
+	tristate "SMP86xx I2C master support"
+	depends on ARCH_TANGOX
+	help
+	  This driver supports the Sigma Designs SMP86xx built-in I2c master.
+
+	  If built as a module, it will be called i2c-tangox.
+
 comment "External I2C/SMBus adapter drivers"
 
 config I2C_DIOLAN_U2C
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 6df3b30..d7a9f94 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -94,6 +94,7 @@ obj-$(CONFIG_I2C_XILINX)	+= i2c-xiic.o
 obj-$(CONFIG_I2C_XLR)		+= i2c-xlr.o
 obj-$(CONFIG_I2C_XLP9XX)	+= i2c-xlp9xx.o
 obj-$(CONFIG_I2C_RCAR)		+= i2c-rcar.o
+obj-$(CONFIG_I2C_TANGOX)	+= i2c-tangox.o
 
 # External I2C/SMBus adapter drivers
 obj-$(CONFIG_I2C_DIOLAN_U2C)	+= i2c-diolan-u2c.o
diff --git a/drivers/i2c/busses/i2c-tangox.c b/drivers/i2c/busses/i2c-tangox.c
new file mode 100644
index 0000000..586b3cb
--- /dev/null
+++ b/drivers/i2c/busses/i2c-tangox.c
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/ioport.h>
+#include <linux/i2c.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/clk.h>
+#include <linux/wait.h>
+
+#define TANGOX_I2C_CONFIG		0x00
+#define TANGOX_I2C_CLKDIV		0x04
+#define TANGOX_I2C_DEVADDR		0x08
+#define TANGOX_I2C_ADDR			0x0c
+#define TANGOX_I2C_DATAOUT		0x10
+#define TANGOX_I2C_DATAIN		0x14
+#define TANGOX_I2C_STATUS		0x18
+#define TANGOX_I2C_STARTXFER		0x1c
+#define TANGOX_I2C_BYTECNT		0x20
+#define TANGOX_I2C_INT_EN		0x24
+#define TANGOX_I2C_INT_STAT		0x28
+
+#define TANGOX_I2C_CFG_EN		(1 << 8)
+#define TANGOX_I2C_CFG_ADDRLEN(x)	((x) << 5)
+#define TANGOX_I2C_CFG_DEVADLEN(x)	((x) << 2)
+#define TANGOX_I2C_CFG_ADDRDIS		(1 << 1)
+#define TANGOX_I2C_CFG_DEVADDIS		(1 << 0)
+
+#define TANGOX_I2C_STATUS_IDLE		(1 << 0)
+#define TANGOX_I2C_STATUS_SDOEMPTY	(1 << 1)
+#define TANGOX_I2C_STATUS_DATARDY	(1 << 2)
+#define TANGOX_I2C_STATUS_ACKERR	(1 << 3)
+#define TANGOX_I2C_STATUS_STARTERR	(1 << 4)
+
+#define TANGOX_I2C_XFER_WR		0
+#define TANGOX_I2C_XFER_RD		1
+#define TANGOX_I2C_XFER_NODATA		2
+
+#define TANGOX_I2C_CFG_WR		0x1f8
+#define TANGOX_I2C_CFG_RD		0x1fa
+
+#define TANGOX_I2C_TIMEOUT(len)		msecs_to_jiffies(10 * len)
+
+struct tangox_i2c {
+	struct i2c_adapter adap;
+	void __iomem *base;
+	struct i2c_msg *msg;
+	int pos;
+	wait_queue_head_t wait;
+	struct clk *clk;
+};
+
+static int tangox_i2c_idle(struct tangox_i2c *ti2c)
+{
+	return readl(ti2c->base + TANGOX_I2C_STATUS) & TANGOX_I2C_STATUS_IDLE;
+}
+
+static int tangox_i2c_wait(struct tangox_i2c *ti2c, unsigned long timeout)
+{
+	int status;
+	int t;
+
+	t = wait_event_timeout(ti2c->wait, tangox_i2c_idle(ti2c), timeout);
+	if (!t)
+		return -ETIMEDOUT;
+
+	status = readl(ti2c->base + TANGOX_I2C_STATUS);
+
+	return status & TANGOX_I2C_STATUS_ACKERR ? -EIO : 0;
+}
+
+static void tangox_i2c_tx_irq(struct tangox_i2c *ti2c, u32 status)
+{
+	struct i2c_msg *msg = ti2c->msg;
+
+	if (status & TANGOX_I2C_STATUS_SDOEMPTY)
+		writel(msg->buf[ti2c->pos++], ti2c->base + TANGOX_I2C_DATAOUT);
+}
+
+static void tangox_i2c_rx_irq(struct tangox_i2c *ti2c, u32 status)
+{
+	struct i2c_msg *msg = ti2c->msg;
+
+	if (status & TANGOX_I2C_STATUS_DATARDY)
+		msg->buf[ti2c->pos++] = readl(ti2c->base + TANGOX_I2C_DATAIN);
+}
+
+static irqreturn_t tangox_i2c_irq(int irq, void *dev_id)
+{
+	struct tangox_i2c *ti2c = dev_id;
+	struct i2c_msg *msg = ti2c->msg;
+	u32 int_stat, status;
+
+	int_stat = readl(ti2c->base + TANGOX_I2C_INT_STAT);
+	if (!int_stat)
+		return IRQ_NONE;
+
+	writel(int_stat, ti2c->base + TANGOX_I2C_INT_STAT);
+
+	if (!msg)
+		return IRQ_HANDLED;
+
+	status = readl(ti2c->base + TANGOX_I2C_STATUS);
+
+	if (ti2c->pos < msg->len) {
+		if (msg->flags & I2C_M_RD)
+			tangox_i2c_rx_irq(ti2c, status);
+		else
+			tangox_i2c_tx_irq(ti2c, status);
+	}
+
+	if (status & TANGOX_I2C_STATUS_IDLE)
+		wake_up(&ti2c->wait);
+
+	return IRQ_HANDLED;
+}
+
+static int tangox_i2c_tx(struct tangox_i2c *ti2c, struct i2c_msg *msg)
+{
+	int devaddr = msg->addr;
+	int pos = 0;
+	int addr;
+	int xfer;
+	int err;
+
+	if (msg->len < 1)
+		return -EINVAL;
+
+	addr = msg->buf[pos++];
+
+	writel(TANGOX_I2C_CFG_WR, ti2c->base + TANGOX_I2C_CONFIG);
+	writel(devaddr, ti2c->base + TANGOX_I2C_DEVADDR);
+	writel(addr, ti2c->base + TANGOX_I2C_ADDR);
+
+	if (msg->len == 1) {
+		writel(0, ti2c->base + TANGOX_I2C_BYTECNT);
+		xfer = TANGOX_I2C_XFER_WR | TANGOX_I2C_XFER_NODATA;
+	} else {
+		writel(msg->len - 2, ti2c->base + TANGOX_I2C_BYTECNT);
+		writel(msg->buf[pos++], ti2c->base + TANGOX_I2C_DATAOUT);
+		xfer = TANGOX_I2C_XFER_WR;
+	}
+
+	ti2c->msg = msg;
+	ti2c->pos = pos;
+
+	writel(xfer, ti2c->base + TANGOX_I2C_STARTXFER);
+
+	err = tangox_i2c_wait(ti2c, TANGOX_I2C_TIMEOUT(msg->len));
+
+	ti2c->msg = NULL;
+
+	return err;
+}
+
+static int tangox_i2c_rx(struct tangox_i2c *ti2c, struct i2c_msg *msg)
+{
+	int devaddr = msg->addr;
+	int err;
+
+	if (msg->len < 1)
+		return -EINVAL;
+
+	ti2c->msg = msg;
+	ti2c->pos = 0;
+
+	writel(TANGOX_I2C_CFG_RD, ti2c->base + TANGOX_I2C_CONFIG);
+	writel(devaddr, ti2c->base + TANGOX_I2C_DEVADDR);
+	writel(msg->len - 1, ti2c->base + TANGOX_I2C_BYTECNT);
+	writel(TANGOX_I2C_XFER_RD, ti2c->base + TANGOX_I2C_STARTXFER);
+
+	err = tangox_i2c_wait(ti2c, TANGOX_I2C_TIMEOUT(msg->len));
+
+	ti2c->msg = NULL;
+
+	return err;
+}
+
+static int tangox_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
+			   int num)
+{
+	struct tangox_i2c *ti2c = adap->algo_data;
+	int completed = 0;
+	int err;
+
+	while (num--) {
+		if (msg->flags & I2C_M_RD)
+			err = tangox_i2c_rx(ti2c, msg);
+		else
+			err = tangox_i2c_tx(ti2c, msg);
+
+		if (err)
+			return err;
+
+		completed++;
+		msg++;
+	}
+
+	return completed;
+}
+
+static u32 tangox_i2c_func(struct i2c_adapter *adap)
+{
+	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static const struct i2c_algorithm tangox_i2c_algo = {
+	.master_xfer	= tangox_i2c_xfer,
+	.functionality	= tangox_i2c_func,
+};
+
+static int tangox_i2c_probe(struct platform_device *pdev)
+{
+	struct tangox_i2c *ti2c;
+	struct resource *res;
+	struct clk *clk;
+	u32 busfreq;
+	int clkdiv;
+	int rate;
+	int irq;
+	int err;
+
+	ti2c = devm_kzalloc(&pdev->dev, sizeof(*ti2c), GFP_KERNEL);
+	if (!ti2c)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+
+	ti2c->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(ti2c->base))
+		return PTR_ERR(ti2c->base);
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq <= 0)
+		return -EINVAL;
+
+	if (of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+				 &busfreq))
+		busfreq = 100000;
+
+	clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
+
+	err = clk_prepare_enable(clk);
+	if (err)
+		return err;
+
+	rate = clk_get_rate(clk);
+
+	ti2c->adap.dev.parent = &pdev->dev;
+	ti2c->adap.dev.of_node = pdev->dev.of_node;
+	ti2c->adap.algo = &tangox_i2c_algo;
+	ti2c->adap.algo_data = ti2c;
+	snprintf(ti2c->adap.name, sizeof(ti2c->adap.name), "tangox-i2c-%x",
+		 res->start);
+
+	init_waitqueue_head(&ti2c->wait);
+	ti2c->clk = clk;
+
+	platform_set_drvdata(pdev, ti2c);
+	i2c_set_adapdata(&ti2c->adap, ti2c);
+
+	clkdiv = DIV_ROUND_UP(rate, 2 * busfreq);
+
+	writel(0, ti2c->base + TANGOX_I2C_CONFIG);
+	writel(clkdiv, ti2c->base + TANGOX_I2C_CLKDIV);
+	writel(0xf, ti2c->base + TANGOX_I2C_INT_STAT);
+
+	err = devm_request_irq(&pdev->dev, irq, tangox_i2c_irq, IRQF_SHARED,
+			       dev_name(&pdev->dev), ti2c);
+	if (err)
+		goto err_out;
+
+	writel(0xf, ti2c->base + TANGOX_I2C_INT_EN);
+
+	err = i2c_add_adapter(&ti2c->adap);
+	if (err)
+		goto err_out;
+
+	dev_info(&ti2c->adap.dev, "SMP86xx I2C master at %x\n", res->start);
+
+	return 0;
+
+err_out:
+	clk_disable_unprepare(clk);
+
+	return err;
+}
+
+static int tangox_i2c_remove(struct platform_device *pdev)
+{
+	struct tangox_i2c *ti2c = platform_get_drvdata(pdev);
+
+	i2c_del_adapter(&ti2c->adap);
+	clk_disable_unprepare(ti2c->clk);
+
+	return 0;
+}
+
+static const struct of_device_id tangox_i2c_dt_ids[] = {
+	{ .compatible = "sigma,smp8642-i2c" },
+	{ }
+};
+
+static struct platform_driver tangox_i2c_driver = {
+	.probe	= tangox_i2c_probe,
+	.remove	= tangox_i2c_remove,
+	.driver	= {
+		.name		= "tangox-i2c",
+		.of_match_table	= tangox_i2c_dt_ids,
+	},
+};
+module_platform_driver(tangox_i2c_driver);
+
+MODULE_DESCRIPTION("SMP86xx I2C bus driver");
+MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
+MODULE_LICENSE("GPL");
-- 
2.6.2

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

* Re: [PATCH 1/2] devicetree: i2c: add binding for Sigma Designs SMP8642 I2C master
       [not found] ` <1446312957-18744-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
@ 2015-10-31 18:38   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2015-10-31 18:38 UTC (permalink / raw)
  To: Mans Rullgard
  Cc: Wolfram Sang, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Sat, Oct 31, 2015 at 12:35 PM, Mans Rullgard <mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org> wrote:
> This adds a binding for the Sigma Designs SMP8642 built-in I2C master
> controller.
>
> Signed-off-by: Mans Rullgard <mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

> ---
>  .../devicetree/bindings/i2c/sigma,smp8642-i2c.txt  | 24 ++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt
>
> diff --git a/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt b/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt
> new file mode 100644
> index 0000000..117fc8b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/sigma,smp8642-i2c.txt
> @@ -0,0 +1,24 @@
> +Sigma Designs SMP8642 I2C master
> +
> +Required properties:
> +- compatible: should be "sigma,smp8642-i2c"
> +- reg: physical address space of the device
> +- interrupts: the interrupt of the device
> +- clocks: phandle of the clock for the device
> +- #address-cells: should be <1>
> +- #size-cells: should be <0>
> +
> +Optional properties:
> +- clock-frequency: frequency of bus clock in Hz, default 100kHz
> +
> +Example:
> +
> +i2c@10480 {
> +       compatible = "sigma,smp8642-i2c";
> +       reg = <0x10480 0x2c>;
> +       interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
> +       clocks = <&sys_clk>;
> +       clock-frequency = <100000>;
> +       #address-cells = <1>;
> +       #size-cells = <0>;
> +};
> --
> 2.6.2
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/2] i2c: add driver for Sigma Designs SMP8642 I2C master
  2015-10-31 17:35 ` [PATCH 2/2] i2c: add driver " Mans Rullgard
@ 2015-11-01  6:42   ` Wolfram Sang
  2015-11-01 13:12     ` Måns Rullgård
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2015-11-01  6:42 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-kernel, linux-i2c

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

On Sat, Oct 31, 2015 at 05:35:57PM +0000, Mans Rullgard wrote:
> This adds a driver for the Sigma Designs SMP8642 built-in I2C master
> controller.  The hardware is very similar to the I2C controller in the
> Ralink RT3050 chip with the addition of interrupt generation and an
> inverted busy/idle status bit.  There are typically two controllers with
> a shared IRQ.
> 
> Signed-off-by: Mans Rullgard <mans@mansr.com>

Thanks for the driver. Same answer as here, though:

http://www.spinics.net/lists/linux-i2c/msg17001.html

> +#define TANGOX_I2C_CONFIG		0x00
> +#define TANGOX_I2C_CLKDIV		0x04
> +#define TANGOX_I2C_DEVADDR		0x08
> +#define TANGOX_I2C_ADDR			0x0c
> +#define TANGOX_I2C_DATAOUT		0x10
> +#define TANGOX_I2C_DATAIN		0x14
> +#define TANGOX_I2C_STATUS		0x18
> +#define TANGOX_I2C_STARTXFER		0x1c
> +#define TANGOX_I2C_BYTECNT		0x20
> +#define TANGOX_I2C_INT_EN		0x24
> +#define TANGOX_I2C_INT_STAT		0x28

The register set looks like the one from i2c-xlr.c, only that they are
32 bit apart instead of 8. Can you check if you can reuse that driver?

Thanks,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 2/2] i2c: add driver for Sigma Designs SMP8642 I2C master
  2015-11-01  6:42   ` Wolfram Sang
@ 2015-11-01 13:12     ` Måns Rullgård
  2015-11-01 15:38       ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Måns Rullgård @ 2015-11-01 13:12 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-kernel, linux-i2c

Wolfram Sang <wsa@the-dreams.de> writes:

> On Sat, Oct 31, 2015 at 05:35:57PM +0000, Mans Rullgard wrote:
>> This adds a driver for the Sigma Designs SMP8642 built-in I2C master
>> controller.  The hardware is very similar to the I2C controller in the
>> Ralink RT3050 chip with the addition of interrupt generation and an
>> inverted busy/idle status bit.  There are typically two controllers with
>> a shared IRQ.
>> 
>> Signed-off-by: Mans Rullgard <mans@mansr.com>
>
> Thanks for the driver. Same answer as here, though:
>
> http://www.spinics.net/lists/linux-i2c/msg17001.html
>
>> +#define TANGOX_I2C_CONFIG		0x00
>> +#define TANGOX_I2C_CLKDIV		0x04
>> +#define TANGOX_I2C_DEVADDR		0x08
>> +#define TANGOX_I2C_ADDR			0x0c
>> +#define TANGOX_I2C_DATAOUT		0x10
>> +#define TANGOX_I2C_DATAIN		0x14
>> +#define TANGOX_I2C_STATUS		0x18
>> +#define TANGOX_I2C_STARTXFER		0x1c
>> +#define TANGOX_I2C_BYTECNT		0x20
>> +#define TANGOX_I2C_INT_EN		0x24
>> +#define TANGOX_I2C_INT_STAT		0x28
>
> The register set looks like the one from i2c-xlr.c, only that they are
> 32 bit apart instead of 8. Can you check if you can reuse that driver?

It does look very similar indeed.  I thought I'd checked for an existing
driver, but apparently I missed that one.  I'll modify the xlr driver to
handle this hardware as well instead.

-- 
Måns Rullgård
mans@mansr.com

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

* Re: [PATCH 2/2] i2c: add driver for Sigma Designs SMP8642 I2C master
  2015-11-01 13:12     ` Måns Rullgård
@ 2015-11-01 15:38       ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-11-01 15:38 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel, linux-i2c

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


> > The register set looks like the one from i2c-xlr.c, only that they are
> > 32 bit apart instead of 8. Can you check if you can reuse that driver?
> 
> It does look very similar indeed.  I thought I'd checked for an existing
> driver, but apparently I missed that one.  I'll modify the xlr driver to
> handle this hardware as well instead.

Thanks, much appreciated!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-11-01 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-31 17:35 [PATCH 1/2] devicetree: i2c: add binding for Sigma Designs SMP8642 I2C master Mans Rullgard
2015-10-31 17:35 ` [PATCH 2/2] i2c: add driver " Mans Rullgard
2015-11-01  6:42   ` Wolfram Sang
2015-11-01 13:12     ` Måns Rullgård
2015-11-01 15:38       ` Wolfram Sang
     [not found] ` <1446312957-18744-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
2015-10-31 18:38   ` [PATCH 1/2] devicetree: i2c: add binding " Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).