Skip to contentSkip to conversation

gpio: tca642x: Add the tca642x gpio expander driver

PATCH Superseded Dan Murphy 3 participants 11 messages Jul 10, 2013 – Jul 12, 2013 GPIO

lore
Share & tools
lore

Dan Murphy

author
#0 lore raw

PATCH v3 1/2 gpio: tca642x: Add the tca642x gpio expander driver

Add the tca642x gpio expander driver

Datasheet:
http://www.ti.com/product/tca6424a

---
 drivers/gpio/Makefile  |    1 +
 drivers/gpio/tca642x.c |  322 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/tca642x.h      |   66 ++++++++++
 3 files changed, 389 insertions(+)
 create mode 100644 drivers/gpio/tca642x.c
 create mode 100644 include/tca642x.h
drivers/gpio/Makefile +1 -0
index f77c1ec..7e74dfe 100644
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_BCM2835_GPIO)	+= bcm2835_gpio.o
 COBJS-$(CONFIG_S3C2440_GPIO)	+= s3c2440_gpio.o
 COBJS-$(CONFIG_XILINX_GPIO)	+= xilinx_gpio.o
 COBJS-$(CONFIG_ADI_GPIO2)	+= adi_gpio2.o
+COBJS-$(CONFIG_TCA642X)		+= tca642x.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/gpio/tca642x.c new file +322 -0

322 lines not on this page · raw message

include/tca642x.h new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
 board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
 board/ti/omap5_uevm/mux_data.h |    2 ++
 include/configs/omap5_uevm.h   |    5 +++++
 3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +21 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
 #include <palmas.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
 #include "mux_data.h"
 
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
 	"Board: OMAP5430 EVM\n"
 };
 
+/* @brief tca642x_init - Initial states for the GPIO expander
+ * input reg, output reg, polarity reg, configuration reg
+ */
+struct tca642x_bank_info tca642x_init[] = {
+	{ .input_reg = 0x00,
+	  .output_reg = 0x04,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0x80 },
+	{ .input_reg = 0x00,
+	  .output_reg = 0x00,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0xff },
+	{ .input_reg = 0x00,
+	  .output_reg = 0x00,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0x40 },
+};
+
 /**
  * @brief board_init
  *
@@ -46,6 +65,8 @@ int board_init(void)
 	gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM;
 	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
 
+	tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
+
 	return 0;
 }
 
board/ti/omap5_uevm/mux_data.h +2 -0
index a82795d..7e6415e 100644
@@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = {
 	{USBD0_HS_DP, (IEN | M0)},	/*  USBD0_HS_DP */
 	{USBD0_HS_DM, (IEN | M0)},	/*  USBD0_HS_DM */
 	{USBD0_SS_RX, (IEN | M0)},	/*  USBD0_SS_RX */
+	{I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */
+	{I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */
 
 };
 
include/configs/omap5_uevm.h +5 -0
index 46dacc2..bee1278 100644
@@ -53,6 +53,11 @@
 #define CONFIG_PARTITION_UUIDS
 #define CONFIG_CMD_PART
 
+#define CONFIG_TCA642X
+#define CONFIG_CMD_TCA642X
+#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4
+#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22
+
 #define CONFIG_SYS_PROMPT		"OMAP5432 uEVM # "
 
 #define CONSOLEDEV		"ttyO2"
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Quoted 23 lines · Dan Murphy

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
  board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
  board/ti/omap5_uevm/mux_data.h |    2 ++
  include/configs/omap5_uevm.h   |    5 +++++
  3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +1 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
  #include <palmas.h>
  #include <asm/arch/sys_proto.h>
  #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
  #include "mux_data.h"
 

board/ti/omap5_uevm/evm.c const struct omap_sysinfo sysinfo = { · line 39

Quoted 4 lines
board/ti/omap5_uevm/evm.c +1 -0
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
  	"Board: OMAP5430 EVM\n"
  };
 
+/* @brief tca642x_init - Initial states for the GPIO expander

documentation style?
/*
* @brief
?

Quoted 34 lines
board/ti/omap5_uevm/evm.c +19 -0
+ * input reg, output reg, polarity reg, configuration reg
+ */
+struct tca642x_bank_info tca642x_init[] = {
+	{ .input_reg = 0x00,
+	  .output_reg = 0x04,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0x80 },
+	{ .input_reg = 0x00,
+	  .output_reg = 0x00,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0xff },
+	{ .input_reg = 0x00,
+	  .output_reg = 0x00,
+	  .polarity_reg = 0x00,
+	  .configuration_reg = 0x40 },
+};
+
  /**
   * @brief board_init
   *
@@ -46,6 +65,8 @@ int board_init(void)
  	gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM;
  	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
 
+	tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
+
  	return 0;
  }
 
board/ti/omap5_uevm/mux_data.h +0 -0
index a82795d..7e6415e 100644

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry core_padconf_array_essential[] = { · line 59

Quoted 4 lines
board/ti/omap5_uevm/mux_data.h +1 -0
@@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = {
  	{USBD0_HS_DP, (IEN | M0)},	/*  USBD0_HS_DP */
  	{USBD0_HS_DM, (IEN | M0)},	/*  USBD0_HS_DM */
  	{USBD0_SS_RX, (IEN | M0)},	/*  USBD0_SS_RX */
+	{I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */

nit pick -> SCL (or i2c clk) is out put from master - always. IEN enables full duplex, but anyways.. just a nitpick :)

Quoted 11 lines
board/ti/omap5_uevm/mux_data.h +1 -0
+	{I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */
 
  };
 
include/configs/omap5_uevm.h +0 -0
index 46dacc2..bee1278 100644
@@ -53,6 +53,11 @@
  #define CONFIG_PARTITION_UUIDS

include/configs/omap5_uevm.h line 63

Quoted 10 lines
include/configs/omap5_uevm.h +5 -0
  #define CONFIG_CMD_PART
 
+#define CONFIG_TCA642X
+#define CONFIG_CMD_TCA642X
+#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4
+#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22
+
  #define CONFIG_SYS_PROMPT		"OMAP5432 uEVM # "
 
  #define CONSOLEDEV		"ttyO2"

Else,
no further comments from me.
--
Regards,
Nishanth Menon

#3 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Dan Murphy

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
 board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
 board/ti/omap5_uevm/mux_data.h |    2 ++
 include/configs/omap5_uevm.h   |    5 +++++
 3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +1 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
 #include <palmas.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
 #include "mux_data.h"
 
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
 	"Board: OMAP5430 EVM\n"
 };
 
Quoted 5 lines

board/ti/omap5_uevm/evm.c const struct omap_sysinfo sysinfo = { · line 39

Quoted 1 line
board/ti/omap5_uevm/evm.c +1 -0
+/* @brief tca642x_init - Initial states for the GPIO expander

documentation style?
/*
* @brief
?

/**
* @brief

even :)

And, no other comments.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130711/c95a021f/attachment.pgp>
author
#4 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Quoted 33 lines · Tom Rini
Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Dan Murphy

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
 board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
 board/ti/omap5_uevm/mux_data.h |    2 ++
 include/configs/omap5_uevm.h   |    5 +++++
 3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +1 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
 #include <palmas.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
 #include "mux_data.h"
 
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
 	"Board: OMAP5430 EVM\n"
 };
 
Quoted 5 lines

board/ti/omap5_uevm/evm.c const struct omap_sysinfo sysinfo = { · line 39

Quoted 1 line
board/ti/omap5_uevm/evm.c +1 -0
+/* @brief tca642x_init - Initial states for the GPIO expander

documentation style?
/*
* @brief
?

Quoted 7 lines

/**
* @brief

even :)

And, no other comments.

Got it will fix it

Signature · 2 lines
------------------
Dan Murphy
author
#5 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

In reply to Nishanth Menon
Quoted 61 lines · Nishanth Menon
Quoted 23 lines · Dan Murphy

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
  board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
  board/ti/omap5_uevm/mux_data.h |    2 ++
  include/configs/omap5_uevm.h   |    5 +++++
  3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +1 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
  #include <palmas.h>
  #include <asm/arch/sys_proto.h>
  #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
  #include "mux_data.h"
 

board/ti/omap5_uevm/evm.c const struct omap_sysinfo sysinfo = { · line 39

Quoted 4 lines
board/ti/omap5_uevm/evm.c +1 -0
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
      "Board: OMAP5430 EVM\n"
  };
 
+/* @brief tca642x_init - Initial states for the GPIO expander

documentation style?
/*
* @brief
?

Quoted 29 lines
board/ti/omap5_uevm/evm.c +19 -0
+ * input reg, output reg, polarity reg, configuration reg
+ */
+struct tca642x_bank_info tca642x_init[] = {
+    { .input_reg = 0x00,
+      .output_reg = 0x04,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0x80 },
+    { .input_reg = 0x00,
+      .output_reg = 0x00,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0xff },
+    { .input_reg = 0x00,
+      .output_reg = 0x00,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0x40 },
+};
+
  /**
   * @brief board_init
   *
@@ -46,6 +65,8 @@ int board_init(void)
      gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM;
      gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
 
+    tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
+
      return 0;
  }
 
Quoted 11 lines

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry core_padconf_array_essential[] = { · line 59

Quoted 9 lines
board/ti/omap5_uevm/mux_data.h +1 -0
index a82795d..7e6415e 100644
@@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = {
      {USBD0_HS_DP, (IEN | M0)},    /*  USBD0_HS_DP */
      {USBD0_HS_DM, (IEN | M0)},    /*  USBD0_HS_DM */
      {USBD0_SS_RX, (IEN | M0)},    /*  USBD0_SS_RX */
+    {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */

nit pick -> SCL (or i2c clk) is out put from master - always. IEN enables full duplex, but anyways.. just a nitpick :)

OK I changed this and did a test and reads fail without the IEN set. This is to sync the client clocks.

Quoted 27 lines
Quoted 11 lines
board/ti/omap5_uevm/mux_data.h +1 -0
+    {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */
 
  };
 
include/configs/omap5_uevm.h +0 -0
index 46dacc2..bee1278 100644
@@ -53,6 +53,11 @@
  #define CONFIG_PARTITION_UUIDS

include/configs/omap5_uevm.h line 63

Quoted 10 lines
include/configs/omap5_uevm.h +5 -0
  #define CONFIG_CMD_PART
 
+#define CONFIG_TCA642X
+#define CONFIG_CMD_TCA642X
+#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4
+#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22
+
  #define CONFIG_SYS_PROMPT        "OMAP5432 uEVM # "
 
  #define CONSOLEDEV        "ttyO2"

Else,
no further comments from me.

Signature · 2 lines
Regards,
Nishanth Menon
Signature · 2 lines
------------------
Dan Murphy
#6 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Quoted 49 lines · Dan Murphy
Quoted 47 lines · Nishanth Menon
Quoted 23 lines · Dan Murphy

Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

---
  board/ti/omap5_uevm/evm.c      |   21 +++++++++++++++++++++
  board/ti/omap5_uevm/mux_data.h |    2 ++
  include/configs/omap5_uevm.h   |    5 +++++
  3 files changed, 28 insertions(+)
board/ti/omap5_uevm/evm.c +1 -0
index 90046e8..0e9a559 100644
@@ -26,6 +26,7 @@
  #include <palmas.h>
  #include <asm/arch/sys_proto.h>
  #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
  #include "mux_data.h"
 

board/ti/omap5_uevm/evm.c const struct omap_sysinfo sysinfo = { · line 39

Quoted 4 lines
board/ti/omap5_uevm/evm.c +1 -0
@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = {
      "Board: OMAP5430 EVM\n"
  };
 
+/* @brief tca642x_init - Initial states for the GPIO expander

documentation style?
/*
* @brief
?

Quoted 15 lines
board/ti/omap5_uevm/evm.c +15 -0
+ * input reg, output reg, polarity reg, configuration reg
+ */
+struct tca642x_bank_info tca642x_init[] = {
+    { .input_reg = 0x00,
+      .output_reg = 0x04,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0x80 },
+    { .input_reg = 0x00,
+      .output_reg = 0x00,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0xff },
+    { .input_reg = 0x00,
+      .output_reg = 0x00,
+      .polarity_reg = 0x00,
+      .configuration_reg = 0x40 },
Quoted 8 lines
Quoted 8 lines

board/ti/omap5_uevm/evm.c int board_init(void) · line 66

Quoted 8 lines
board/ti/omap5_uevm/evm.c +2 -0
+};
+
  /**
   * @brief board_init
   *
@@ -46,6 +65,8 @@ int board_init(void)
      gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM;
      gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param

addr */

Quoted 2 lines
Quoted 2 lines

board/ti/omap5_uevm/evm.c int board_init(void) · line 67

Quoted 2 lines
board/ti/omap5_uevm/evm.c +1 -0
+    tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR,

tca642x_init);

Quoted 5 lines
Quoted 5 lines

Review

Quoted 5 lines
board/ti/omap5_uevm/evm.c +1 -0
+
      return 0;
  }
 
(quoted diff) +0 -0

b/board/ti/omap5_uevm/mux_data.h

Quoted 4 lines
Quoted 4 lines

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry

Quoted 4 lines

index a82795d..7e6415e 100644

board/ti/omap5_uevm/mux_data.h +0 -0
@@ -56,6 +56,8 @@ const struct pad_conf_entry

core_padconf_array_essential[] = {

Quoted 5 lines
Quoted 5 lines

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry core_padconf_array_essential[] = { · line 59

Quoted 4 lines
board/ti/omap5_uevm/mux_data.h +1 -0
      {USBD0_HS_DP, (IEN | M0)},    /*  USBD0_HS_DP */
      {USBD0_HS_DM, (IEN | M0)},    /*  USBD0_HS_DM */
      {USBD0_SS_RX, (IEN | M0)},    /*  USBD0_SS_RX */
+    {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */

nit pick -> SCL (or i2c clk) is out put from master - always. IEN

enables full duplex, but anyways.. just a nitpick :)

Quoted 3 lines
Quoted 1 line

OK I changed this and did a test and reads fail without the IEN set. This is to sync the client clocks.

Scl? I2c clock? Does not work without input- something is fishy no?

Quoted 5 lines
Quoted 5 lines

Review

Quoted 5 lines
board/ti/omap5_uevm/mux_data.h +1 -0
+    {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */
 
  };
 
(quoted diff) +0 -0

b/include/configs/omap5_uevm.h

Quoted 32 lines
Quoted 14 lines
Quoted 14 lines

index 46dacc2..bee1278 100644

include/configs/omap5_uevm.h +5 -0
@@ -53,6 +53,11 @@
  #define CONFIG_PARTITION_UUIDS
  #define CONFIG_CMD_PART
 
+#define CONFIG_TCA642X
+#define CONFIG_CMD_TCA642X
+#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4
+#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22
+
  #define CONFIG_SYS_PROMPT        "OMAP5432 uEVM # "
 
Quoted 8 lines

include/configs/omap5_uevm.h line 63

Quoted 2 lines
include/configs/omap5_uevm.h +0 -0
  #define CONSOLEDEV        "ttyO2"

Else,
no further comments from me.
--
Regards,
Nishanth Menon

--
------------------
Dan Murphy

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

author
#7 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

NM

On 07/11/2013 01:02 PM, Nishanth Menon wrote:
<snip>

Quoted 11 lines
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/board/ti/omap5_uevm/mux_data.h

Quoted 4 lines
Quoted 4 lines

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry

Quoted 4 lines

index a82795d..7e6415e 100644

board/ti/omap5_uevm/mux_data.h +0 -0
@@ -56,6 +56,8 @@ const struct pad_conf_entry

core_padconf_array_essential[] = {

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/ti/omap5_uevm/mux_data.h +1 -0
      {USBD0_HS_DP, (IEN | M0)},    /*  USBD0_HS_DP */
      {USBD0_HS_DM, (IEN | M0)},    /*  USBD0_HS_DM */
      {USBD0_SS_RX, (IEN | M0)},    /*  USBD0_SS_RX */
+    {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */
Quoted 5 lines
Quoted 1 line
Quoted 1 line

nit pick -> SCL (or i2c clk) is out put from master - always. IEN

enables full duplex, but anyways.. just a nitpick :)

Quoted 2 lines

OK I changed this and did a test and reads fail without the IEN set. This is to sync the client clocks.

Scl? I2c clock? Does not work without input- something is fishy no?

Nope. There is clock synchronization and clock arbitration that happens and the I2C master needs to see the SCL as an input.

Kernel configures the I2C mux for 1 and 5 the same way. <snip>

Signature · 2 lines
------------------
Dan Murphy
#8 lore raw

PATCH v3 2/2 gpio: omap5-uevm: Configure the tca6424 gpio expander

Quoted 12 lines · Dan Murphy
Quoted 11 lines · Nishanth Menon
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/board/ti/omap5_uevm/mux_data.h

Quoted 4 lines
Quoted 4 lines

board/ti/omap5_uevm/mux_data.h const struct pad_conf_entry

Quoted 4 lines

index a82795d..7e6415e 100644

board/ti/omap5_uevm/mux_data.h +0 -0
@@ -56,6 +56,8 @@ const struct pad_conf_entry

core_padconf_array_essential[] = {

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/ti/omap5_uevm/mux_data.h +1 -0
      {USBD0_HS_DP, (IEN | M0)},    /*  USBD0_HS_DP */
      {USBD0_HS_DM, (IEN | M0)},    /*  USBD0_HS_DM */
      {USBD0_SS_RX, (IEN | M0)},    /*  USBD0_SS_RX */
+    {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

nit pick -> SCL (or i2c clk) is out put from master - always. IEN

enables full duplex, but anyways.. just a nitpick :)

Quoted 2 lines

OK I changed this and did a test and reads fail without the IEN set. This is to sync the client clocks.

Scl? I2c clock? Does not work without input- something is fishy no?

Nope. There is clock synchronization and clock arbitration that happens and the I2C master needs to see the SCL as an input.

Also, Table 24-1. HS I2C Input/Output in OMAP5 ES2.0 TRM Rev U supports the requirement of SCL being input as well.

I think you mean bus busy condition here[1] rather than multi-master arbitration? in the case of arbitration, the SDA will be monitored than SCL - See "Figure 24-9. HS I2C Arbitration Between Master Transmitters" in TRM.

Bus busy on the other hand needs stop condition detection for transmission which involves SCL and SDA. yet another need is the requirement to support clock stretching[2] (where the i2c slave holds the SCL low while it does "something").

Either way, it explains why SCL needs to be in IEN.

[1] http://www.i2c-bus.org/MultiMaster/
[2] http://www.i2c-bus.org/clock-stretching/
Regards,
Nishanth Menon

#9 lore raw

PATCH v3 1/2 gpio: tca642x: Add the tca642x gpio expander driver

In reply to Dan Murphy
Quoted 5 lines · Dan Murphy

Add the tca642x gpio expander driver

Datasheet:
http://www.ti.com/product/tca6424a

Quoted 8 lines
---
 drivers/gpio/Makefile  |    1 +
 drivers/gpio/tca642x.c |  322 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/tca642x.h      |   66 ++++++++++
 3 files changed, 389 insertions(+)
 create mode 100644 drivers/gpio/tca642x.c
 create mode 100644 include/tca642x.h

Generally fine, but running checkpatch.pl:
total: 0 errors, 12 warnings, 2 checks, 395 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

/tmp/gpio1.mbox has style problems, please review.

If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.

So, please address those.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130711/246e0831/attachment.pgp>
author
#10 lore raw

PATCH v3 1/2 gpio: tca642x: Add the tca642x gpio expander driver

Quoted 22 lines · Tom Rini
Quoted 5 lines · Dan Murphy

Add the tca642x gpio expander driver

Datasheet:
http://www.ti.com/product/tca6424a

Quoted 8 lines
---
 drivers/gpio/Makefile  |    1 +
 drivers/gpio/tca642x.c |  322 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/tca642x.h      |   66 ++++++++++
 3 files changed, 389 insertions(+)
 create mode 100644 drivers/gpio/tca642x.c
 create mode 100644 include/tca642x.h

Generally fine, but running checkpatch.pl:
total: 0 errors, 12 warnings, 2 checks, 395 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

Quoted 7 lines

/tmp/gpio1.mbox has style problems, please review.

If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.

So, please address those.

Yeah I ran cp on this file and when I looked @ it fixing the LTLs would have made the code look messy IMHO.

But I will fix it anyway and re-submit.

Signature · 2 lines
------------------
Dan Murphy