]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: omap5-uevm: Configure the tca6424 gpio expander
authorDan Murphy <dmurphy@ti.com>
Thu, 11 Jul 2013 18:10:28 +0000 (13:10 -0500)
committerTom Rini <trini@ti.com>
Tue, 30 Jul 2013 13:21:42 +0000 (09:21 -0400)
Configure the tca6424 gpio expander
This allows use of the debug and tri color LEDs.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
board/ti/omap5_uevm/evm.c
board/ti/omap5_uevm/mux_data.h
include/configs/omap5_uevm.h

index ea83e6c3e702e61f1754f14afd41efd790e41ab8..2c00648470fe5728d3ef1b24aca6e7f457df3dd4 100644 (file)
@@ -10,6 +10,7 @@
 #include <palmas.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <tca642x.h>
 
 #include "mux_data.h"
 
@@ -19,6 +20,25 @@ const struct omap_sysinfo sysinfo = {
        "Board: OMAP5430 EVM\n"
 };
 
+/**
+ * @brief tca642x_init - uEVM default values 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
  *
@@ -30,6 +50,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;
 }
 
index 36b723e6ccc34594f8ed5df05ce57fa66b6cb300..612c13e4792f2b617df27155ed7cc7f5effad0a5 100644 (file)
@@ -40,6 +40,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 */
 
 };
 
index 9c045d30569f6efc7555ad2988aa11f43fa9f577..47568e95c0590f8ab620c45e207f205069d400f4 100644 (file)
 #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"