bf609: add gpio soft switch platform data for mcp23017 i2c devices
authorSonic Zhang <sonic.zhang@analog.com>
Wed, 20 Aug 2014 09:04:55 +0000 (17:04 +0800)
committerSteven Miao <realmz6@gmail.com>
Thu, 23 Apr 2015 13:34:28 +0000 (21:34 +0800)
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
arch/blackfin/mach-bf609/boards/ezkit.c

index 68cd89544a6a07c9b1bac1907b6a3e0991b608a7..cc03ae2e559cfe4c181e9ce76cde5c8d931e6be9 100644 (file)
@@ -1862,6 +1862,19 @@ static struct platform_device i2c_bfin_twi1_device = {
 };
 #endif
 
+#if IS_ENABLED(CONFIG_GPIO_MCP23S08)
+#include <linux/spi/mcp23s08.h>
+static const struct mcp23s08_platform_data bfin_mcp23s08_soft_switch0 = {
+       .base = 120,
+};
+static const struct mcp23s08_platform_data bfin_mcp23s08_soft_switch1 = {
+       .base = 130,
+};
+static const struct mcp23s08_platform_data bfin_mcp23s08_soft_switch2 = {
+       .base = 140,
+};
+#endif
+
 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
 #if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)
        {
@@ -1881,6 +1894,20 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
                I2C_BOARD_INFO("ssm2602", 0x1b),
        },
 #endif
+#if IS_ENABLED(CONFIG_GPIO_MCP23S08)
+       {
+               I2C_BOARD_INFO("mcp23017", 0x21),
+               .platform_data = (void *)&bfin_mcp23s08_soft_switch0
+       },
+       {
+               I2C_BOARD_INFO("mcp23017", 0x22),
+               .platform_data = (void *)&bfin_mcp23s08_soft_switch1
+       },
+       {
+               I2C_BOARD_INFO("mcp23017", 0x23),
+               .platform_data = (void *)&bfin_mcp23s08_soft_switch2
+       },
+#endif
 };
 
 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {