diff options
author | Mario Haustein <mario.haustein@hrz.tu-chemnitz.de> | 2016-09-21 18:50:52 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-09-22 17:31:23 +0200 |
commit | 28eb01ea61a05be331b6bccd8fa5aac7781c48b9 (patch) | |
tree | d3835a4b00465a2ca1a9b12a6b7da5fe74676982 | |
parent | 74ed5fab6a9b6330055e98dbd419f8fe84c84633 (diff) |
refactor I2C support of AVR32 Grasshopper board
- I2C can now be enabled in the config menu
-rw-r--r-- | target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch | 27 | ||||
-rw-r--r-- | target/linux/config/Config.in.i2c | 11 |
2 files changed, 30 insertions, 8 deletions
diff --git a/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch b/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch index da81cac3a..b0796ed5a 100644 --- a/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch +++ b/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch @@ -1,12 +1,25 @@ +diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig +--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:29:35.780351249 +0200 ++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:39:58.981762577 +0200 +@@ -44,4 +44,9 @@ + depends on BOARD_GRASSHOPPER_MMC + default n + ++config BOARD_GRASSHOPPER_I2C ++ bool "Enable I2C interface" ++ depends on I2C && I2C_GPIO ++ default y ++ + endif # BOARD_GRASSHOPPER diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c ---- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-14 10:48:53.403638569 +0200 -+++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-14 11:40:15.735513299 +0200 +--- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-20 11:29:35.781351262 +0200 ++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-20 11:32:21.270587433 +0200 @@ -129,6 +129,28 @@ }; #endif +/* I2C/TWI */ -+#ifdef CONFIG_I2C ++#ifdef CONFIG_BOARD_GRASSHOPPER_I2C +static struct i2c_gpio_platform_data i2c_gpio_data = { + .sda_pin = GPIO_PIN_PA(6), + .scl_pin = GPIO_PIN_PA(7), @@ -28,14 +41,14 @@ diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grassho +#endif + /* MCI */ - #ifdef CONFIG_MMC_ATMELMCI + #ifdef CONFIG_BOARD_GRASSHOPPER_MMC static struct mci_platform_data __initdata mci0_data = { @@ -168,6 +190,22 @@ ATMEL_LCDC_PRI_CONTROL | ATMEL_LCDC_PRI_24BIT); #endif + // I2C / TWI -+#ifdef CONFIG_I2C ++#ifdef CONFIG_BOARD_GRASSHOPPER_I2C + /* all these i2c/smbus pins should have external pullups for + * open-drain sharing among all I2C devices. SDA and SCL do; + * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), @@ -50,6 +63,6 @@ diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grassho + i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); +#endif + - #ifdef CONFIG_MMC_ATMELMCI - // at32_add_device_mci(0, &mci0_data); /* MMC/SD */ + #ifdef CONFIG_BOARD_GRASSHOPPER_MMC + at32_add_device_mci(0, &mci0_data); /* MMC/SD */ #endif diff --git a/target/linux/config/Config.in.i2c b/target/linux/config/Config.in.i2c index 1c9cc531c..2c7404b69 100644 --- a/target/linux/config/Config.in.i2c +++ b/target/linux/config/Config.in.i2c @@ -23,7 +23,6 @@ config ADK_KERNEL_I2C_GPIO select ADK_KERNEL_I2C_BOARDINFO select ADK_KERNEL_I2C_ALGOBIT default y if ADK_TARGET_SYSTEM_LINKSYS_NSLU2 - default y if ADK_TARGET_SYSTEM_GRASSHOPPER help config ADK_KERNEL_I2C_BCM2708 @@ -71,5 +70,15 @@ config ADK_KERNEL_SCX200_ACB default n help I2C driver for Geode boards. + +config ADK_KERNEL_BOARD_GRASSHOPPER_I2C + bool "I2C driver for AVR32 Grasshopper" + select ADK_KERNEL_I2C + select ADK_KERNEL_I2C_GPIO + select ADK_KERNEL_I2C_CHARDEV + default y if ADK_TARGET_SYSTEM_GRASSHOPPER + default n + help + I2C driver for Geode boards. endmenu |