at91 add i2c-gpio suport
cover at91 add i2c-gpio suport
Hi,
This paatch serie add the i2c suport to at91 using the i2c-gpio as teh IP is broken until the sam9x5. For the sam9x5 untill we have the hw driver support use the i2c-gpio too
on the sam9x5ek enable the i2c and the qt1070
This patch serie depends on i2c qt1070 patch and the at91sam9x5ek 1-wire one
The following changes since commit 3a5609a37a19b0b6b5f4c61e3c561b7bf2d25b72:
i2c: add versatile support (2012-11-01 06:58:21 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/at91_i2c
for you to fetch changes up to 2d2aee2451a0210cfb0d141db7729b648d0a32a4:
at91sam9x5ek: add i2c support (2012-11-01 06:58:25 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (7):
at91sam9x5: add i2c support
at91rm9200: add i2c support
at91sam9260/sam9g20: add i2c support
at91sam9263: add i2c support
at91sam9261/sam9g10: add i2c support
at91sam9g45: add i2c support
at91sam9x5ek: add i2c supportarch/arm/boards/at91sam9x5ek/init.c | 12 ++++++++++++ arch/arm/configs/at91sam9x5ek_defconfig | 5 ++++- arch/arm/mach-at91/at91rm9200_devices.c | 28 ++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9260_devices.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9261_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9263_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9g45_devices.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9x5_devices.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 +++ 9 files changed, 249 insertions(+), 1 deletion(-)
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/7 at91sam9x5: add i2c support
use i2c-gpio until we add the hw drivers
--- arch/arm/mach-at91/at91sam9x5_devices.c | 58 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 ++ 2 files changed, 61 insertions(+)
arch/arm/mach-at91/at91sam9x5_devices.c +58 -0
@@ -19,6 +19,7 @@#include <mach/gpio.h> #include <mach/io.h> #include <mach/cpu.h> +#include <i2c/i2c-gpio.h> #include "generic.h"
@@ -169,6 +170,63 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)void __init at91_add_device_nand (struct atmel_nand_data *data) {}#endif +#if defined(CONFIG_I2C_GPIO ) +static struct i2c_gpio_platform_data pdata_i2c0 = { + .sda_pin =AT91_PIN_PA30 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PA31 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +static struct i2c_gpio_platform_data pdata_i2c1 = { + .sda_pin =AT91_PIN_PC0 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PC1 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +static struct i2c_gpio_platform_data pdata_i2c2 = { + .sda_pin =AT91_PIN_PB4 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PB5 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata; + +i2c_register_board_info (i2c_id, devices, nr_devices); + +switch (i2c_id) { +case 0 : + pdata = &pdata_i2c0; +break ; +case 1 : + pdata = &pdata_i2c1; +break ; +case 2 : + pdata = &pdata_i2c2; +break ; +default : +return ; + } + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" , i2c_id,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif +/* -------------------------------------------------------------------- * UART * -------------------------------------------------------------------- */
arch/arm/mach-at91/include/mach/board.h +3 -0
@@ -21,6 +21,7 @@#include <mach/hardware.h> #include <sizes.h> #include <net.h> +#include <i2c/i2c.h> #include <spi/spi.h> #include <linux/mtd/mtd.h>
@@ -71,6 +72,8 @@ struct at91_ether_platform_data {void at91_add_device_eth (int id,struct at91_ether_platform_data *data); +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices); +/* SDRAM */ void at91_add_device_sdram (u32 size);
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/7 at91rm9200: add i2c support
use i2c-gpio as the hw ip is broken
--- arch/arm/mach-at91/at91rm9200_devices.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm/mach-at91/at91rm9200_devices.c +28 -0
@@ -18,6 +18,7 @@#include <mach/gpio.h> #include <mach/io.h> #include <mach/at91rm9200_mc.h> +#include <i2c/i2c-gpio.h> #include <sizes.h> #include "generic.h"
@@ -154,6 +155,33 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)void __init at91_add_device_nand (struct atmel_nand_data *data) {}#endif +#if defined(CONFIG_I2C_GPIO ) +static struct i2c_gpio_platform_data pdata_i2c = { + .sda_pin =AT91_PIN_PA25 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PA26 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata = &pdata_i2c; + +i2c_register_board_info (0 , devices, nr_devices); + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" ,0 ,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif +/* -------------------------------------------------------------------- * SPI * -------------------------------------------------------------------- */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/7 at91sam9260/sam9g20: add i2c support
In reply to Jean-Christophe PLAGNIOL-VILLARDuse i2c-gpio as the hw ip is broken
--- arch/arm/mach-at91/at91sam9260_devices.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm/mach-at91/at91sam9260_devices.c +32 -0
@@ -20,6 +20,7 @@#include <mach/gpio.h> #include <mach/io.h> #include <mach/cpu.h> +#include <i2c/i2c-gpio.h> #include "generic.h"
@@ -155,6 +156,37 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}#endif /* -------------------------------------------------------------------- +* TWI (i2c) +* -------------------------------------------------------------------- */ + +#if defined(CONFIG_I2C_GPIO ) +static struct i2c_gpio_platform_data pdata_i2c = { + .sda_pin =AT91_PIN_PA23 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PA24 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata = &pdata_i2c; + +i2c_register_board_info (0 , devices, nr_devices); + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" ,0 ,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif + +/* -------------------------------------------------------------------- * SPI * -------------------------------------------------------------------- */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/7 at91sam9263: add i2c support
In reply to Jean-Christophe PLAGNIOL-VILLARDuse i2c-gpio as the hw ip is broken
--- arch/arm/mach-at91/at91sam9263_devices.c | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm/mach-at91/at91sam9263_devices.c +31 -0
@@ -19,6 +19,7 @@#include <mach/board.h> #include <mach/gpio.h> #include <mach/io.h> +#include <i2c/i2c-gpio.h> #include "generic.h"
@@ -157,6 +158,36 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}#endif /* -------------------------------------------------------------------- +* TWI (i2c) +* -------------------------------------------------------------------- */ +#if defined(CONFIG_I2C_GPIO ) +static struct i2c_gpio_platform_data pdata_i2c = { + .sda_pin =AT91_PIN_PB4 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PB5 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata = &pdata_i2c; + +i2c_register_board_info (0 , devices, nr_devices); + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" ,0 ,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif + +/* -------------------------------------------------------------------- * SPI * -------------------------------------------------------------------- */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/7 at91sam9261/sam9g10: add i2c support
In reply to Jean-Christophe PLAGNIOL-VILLARDuse i2c-gpio as the hw ip is broken
--- arch/arm/mach-at91/at91sam9261_devices.c | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm/mach-at91/at91sam9261_devices.c +31 -0
@@ -20,6 +20,7 @@#include <mach/gpio.h> #include <mach/io.h> #include <mach/cpu.h> +#include <i2c/i2c-gpio.h> #include "generic.h"
@@ -107,6 +108,36 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}#endif /* -------------------------------------------------------------------- +* TWI (i2c) +* -------------------------------------------------------------------- */ +#if defined(CONFIG_I2C_GPIO ) +static struct i2c_gpio_platform_data pdata_i2c = { + .sda_pin =AT91_PIN_PA7 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PA8 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata = &pdata_i2c; + +i2c_register_board_info (0 , devices, nr_devices); + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" ,0 ,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif + +/* -------------------------------------------------------------------- * SPI * -------------------------------------------------------------------- */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 6/7 at91sam9g45: add i2c support
In reply to Jean-Christophe PLAGNIOL-VILLARDuse i2c-gpio as the hw ip is broken
--- arch/arm/mach-at91/at91sam9g45_devices.c | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
arch/arm/mach-at91/at91sam9g45_devices.c +50 -0
@@ -18,6 +18,7 @@#include <mach/board.h> #include <mach/gpio.h> #include <mach/io.h> +#include <i2c/i2c-gpio.h> #include "generic.h"
@@ -132,6 +133,55 @@ void at91_add_device_nand(struct atmel_nand_data *data)void at91_add_device_nand (struct atmel_nand_data *data) {}#endif +/* -------------------------------------------------------------------- +* TWI (i2c) +* -------------------------------------------------------------------- */ +#if defined(CONFIG_I2C_GPIO ) || defined(CONFIG_I2C_GPIO_MODULE ) +static struct i2c_gpio_platform_data pdata_i2c0 = { + .sda_pin =AT91_PIN_PA20 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PA21 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +static struct i2c_gpio_platform_data pdata_i2c1 = { + .sda_pin =AT91_PIN_PB10 , + .sda_is_open_drain =1 , + .scl_pin =AT91_PIN_PB11 , + .scl_is_open_drain =1 , + .udelay =5 ,/* ~100 kHz */ +}; + +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) +{ +struct i2c_gpio_platform_data *pdata = &pdata_i2c; + +i2c_register_board_info (i2c_id, devices, nr_devices); + +switch (i2c_id) { + case 0; + pdata = &pdata_i2c0; +break ; + case 1; + pdata = &pdata_i2c1; +break ; +default : +return ; + } + +at91_set_GPIO_periph (pdata->sda_pin,1 );/* TWD (SDA) */ +at91_set_multi_drive (pdata->sda_pin,1 ); + +at91_set_GPIO_periph (pdata->scl_pin,1 );/* TWCK (SCL) */ +at91_set_multi_drive (pdata->scl_pin,1 ); + +add_generic_device_res ("i2c-gpio" , i2c_id,NULL ,0 , pdata); +} +#else +void at91_add_device_i2c (short i2c_id,struct i2c_board_info *devices,int nr_devices) {} +#endif +resource_size_t __init at91_configure_dbgu (void ) {at91_set_A_periph (AT91_PIN_PB12 ,0 );/* DRXD */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 7/7 at91sam9x5ek: add i2c support
In reply to Jean-Christophe PLAGNIOL-VILLARDenable qt1070 support
--- arch/arm/boards/at91sam9x5ek/init.c | 12 ++++++++++++ arch/arm/configs/at91sam9x5ek_defconfig | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/boards/at91sam9x5ek/init.c +12 -0
@@ -114,6 +114,17 @@ static void ek_add_device_eth(void)at91_add_device_eth (0 , &macb_pdata); } +static struct i2c_board_info i2c_devices[] = { + { +I2C_BOARD_INFO ("qt1070" ,0x1b ), + }, +}; + +static void ek_add_device_i2c (void ) +{ +at91_add_device_i2c (0 , i2c_devices,ARRAY_SIZE (i2c_devices)); +} +/* * USB Host port */
@@ -172,6 +183,7 @@ static int at91sam9x5ek_devices_init(void)ek_add_device_eth ();at91_add_device_usbh_ohci (&ek_usbh_data);ek_add_led (); +ek_add_device_i2c ();armlinux_set_bootparams ((void *)(AT91_CHIPSELECT_1 +0x100 ));armlinux_set_architecture (CONFIG_MACH_AT91SAM9X5EK );
arch/arm/configs/at91sam9x5ek_defconfig +4 -1
@@ -41,6 +41,7 @@ CONFIG_CMD_OFTREE=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y CONFIG_CMD_LED=y CONFIG_CMD_LED_TRIGGER=y CONFIG_NET=y
@@ -52,6 +53,8 @@ CONFIG_FS_TFTP=y CONFIG_NET_NETCONSOLE=y CONFIG_DRIVER_NET_MACB=y # CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_GPIO=y CONFIG_MTD=y CONFIG_NAND=y # CONFIG_NAND_ECC_HW is not set
@@ -64,7 +67,7 @@ CONFIG_DISK_WRITE=y CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_LED_TRIGGERS=y -CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_QT1070=y CONFIG_W1=y CONFIG_W1_MASTER_GPIO=y CONFIG_W1_SLAVE_DS2431=y
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 1/1 at91sam9x5ek: add i2c support
enable the qt1070 for debug only as this slow down barebox a lot as we need to read the i2c via poller
---
HI
branch updated
The following changes since commit 3a5609a37a19b0b6b5f4c61e3c561b7bf2d25b72:
i2c: add versatile support (2012-11-01 06:58:21 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/at91_i2c
for you to fetch changes up to 3c67dcab6fc9b1ab0966b2693f2952209f18cdda:
at91sam9x5ek: add i2c support (2012-11-01 11:26:25 +0800)
Jean-Christophe PLAGNIOL-VILLARD (7):
at91sam9x5: add i2c support
at91rm9200: add i2c support
at91sam9260/sam9g20: add i2c support
at91sam9263: add i2c support
at91sam9261/sam9g10: add i2c support
at91sam9g45: add i2c support
at91sam9x5ek: add i2c supportarch/arm/boards/at91sam9x5ek/init.c | 12 ++++++++++++ arch/arm/configs/at91sam9x5ek_defconfig | 3 +++ arch/arm/mach-at91/at91rm9200_devices.c | 28 ++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9260_devices.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9261_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9263_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9g45_devices.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9x5_devices.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 +++ 9 files changed, 248 insertions(+)
Best Regards,
J.
arch/arm/configs/at91sam9x5ek_defconfig | 3 +++ 2 files changed, 15 insertions(+)
arch/arm/boards/at91sam9x5ek/init.c +12 -0
@@ -114,6 +114,17 @@ static void ek_add_device_eth(void)at91_add_device_eth (0 , &macb_pdata); } +static struct i2c_board_info i2c_devices[] = { + { +I2C_BOARD_INFO ("qt1070" ,0x1b ), + }, +}; + +static void ek_add_device_i2c (void ) +{ +at91_add_device_i2c (0 , i2c_devices,ARRAY_SIZE (i2c_devices)); +} +/* * USB Host port */
@@ -172,6 +183,7 @@ static int at91sam9x5ek_devices_init(void)ek_add_device_eth ();at91_add_device_usbh_ohci (&ek_usbh_data);ek_add_led (); +ek_add_device_i2c ();armlinux_set_bootparams ((void *)(AT91_CHIPSELECT_1 +0x100 ));armlinux_set_architecture (CONFIG_MACH_AT91SAM9X5EK );
arch/arm/configs/at91sam9x5ek_defconfig +3 -0
@@ -41,6 +41,7 @@ CONFIG_CMD_OFTREE=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y CONFIG_CMD_LED=y CONFIG_CMD_LED_TRIGGER=y CONFIG_NET=y
@@ -52,6 +53,8 @@ CONFIG_FS_TFTP=y CONFIG_NET_NETCONSOLE=y CONFIG_DRIVER_NET_MACB=y # CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_GPIO=y CONFIG_MTD=y CONFIG_NAND=y # CONFIG_NAND_ECC_HW is not set
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 1/1 at91sam9x5ek: add i2c support
enable qt1070 support
---
v3:
provide irq_pin for qt1070
and enable it by default
branch updated
The following changes since commit 220c2476bc88b8297607ca0a3f8e2e3495da6edb:
i2c: add versatile support (2012-11-03 04:09:17 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/at91_i2c
for you to fetch changes up to 5824ffb7201d38315a24fa4ba21124ffaf86068f:
at91sam9x5ek: add i2c support (2012-11-03 04:09:55 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (7):
at91sam9x5: add i2c support
at91rm9200: add i2c support
at91sam9260/sam9g20: add i2c support
at91sam9263: add i2c support
at91sam9261/sam9g10: add i2c support
at91sam9g45: add i2c support
at91sam9x5ek: add i2c supportarch/arm/boards/at91sam9x5ek/init.c | 21 ++++++++++++++++++++- arch/arm/configs/at91sam9x5ek_defconfig | 5 ++++- arch/arm/mach-at91/at91rm9200_devices.c | 28 ++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9260_devices.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9261_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9263_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9g45_devices.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9x5_devices.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 +++ 9 files changed, 257 insertions(+), 2 deletions(-)
Best Regards,
J.
arch/arm/boards/at91sam9x5ek/init.c | 21 ++++++++++++++++++++- arch/arm/configs/at91sam9x5ek_defconfig | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-)
arch/arm/boards/at91sam9x5ek/init.c +20 -1
@@ -37,7 +37,7 @@#include <mach/at91_pmc.h> #include <mach/at91_rstc.h> #include <mach/at91sam9x5_matrix.h> -#include <gpio_keys.h> +#include <input/qt1070.h> #include <readkey.h> #include <linux/w1-gpio.h> #include <w1_mac_address.h>
@@ -114,6 +114,24 @@ static void ek_add_device_eth(void)at91_add_device_eth (0 , &macb_pdata); } +struct qt1070_platform_data qt1070_pdata = { + .irq_pin =AT91_PIN_PA7 , +}; + +static struct i2c_board_info i2c_devices[] = { + { + .platform_data = &qt1070_pdata, +I2C_BOARD_INFO ("qt1070" ,0x1b ), + }, +}; + +static void ek_add_device_i2c (void ) +{ +at91_set_gpio_input (qt1070_pdata.irq_pin,0 ); +at91_set_deglitch (qt1070_pdata.irq_pin,1 ); +at91_add_device_i2c (0 , i2c_devices,ARRAY_SIZE (i2c_devices)); +} +/* * USB Host port */
@@ -172,6 +190,7 @@ static int at91sam9x5ek_devices_init(void)ek_add_device_eth ();at91_add_device_usbh_ohci (&ek_usbh_data);ek_add_led (); +ek_add_device_i2c ();armlinux_set_bootparams ((void *)(AT91_CHIPSELECT_1 +0x100 ));armlinux_set_architecture (CONFIG_MACH_AT91SAM9X5EK );
arch/arm/configs/at91sam9x5ek_defconfig +4 -1
@@ -41,6 +41,7 @@ CONFIG_CMD_OFTREE=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y CONFIG_CMD_LED=y CONFIG_CMD_LED_TRIGGER=y CONFIG_NET=y
@@ -52,6 +53,8 @@ CONFIG_FS_TFTP=y CONFIG_NET_NETCONSOLE=y CONFIG_DRIVER_NET_MACB=y # CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_GPIO=y CONFIG_MTD=y CONFIG_NAND=y # CONFIG_NAND_ECC_HW is not set
@@ -64,7 +67,7 @@ CONFIG_DISK_WRITE=y CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_LED_TRIGGERS=y -CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_QT1070=y CONFIG_W1=y CONFIG_W1_MASTER_GPIO=y CONFIG_W1_SLAVE_DS2431=y
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
This paatch serie add the i2c suport to at91 using the i2c-gpio as teh IP is broken until the sam9x5. For the sam9x5 untill we have the hw driver support use the i2c-gpio too
on the sam9x5ek enable the i2c and the qt1070
This patch serie depends on i2c qt1070 patch and the at91sam9x5ek 1-wire one
v2 rebase on i2c v2 patch series
The following changes since commit d3298969a9fcc5d95c2c4f8a39c1d4aa21780009:
i2c: add versatile support (2012-11-02 02:24:49 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/at91_i2c
for you to fetch changes up to 972103b8b146974e4d1ed6a5912f6b0172c40d02:
at91sam9x5ek: add i2c support (2012-11-02 02:24:59 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (7):
at91sam9x5: add i2c support
at91rm9200: add i2c support
at91sam9260/sam9g20: add i2c support
at91sam9263: add i2c support
at91sam9261/sam9g10: add i2c support
at91sam9g45: add i2c support
at91sam9x5ek: add i2c supportarch/arm/boards/at91sam9x5ek/init.c | 12 ++++++++++++ arch/arm/configs/at91sam9x5ek_defconfig | 3 +++ arch/arm/mach-at91/at91rm9200_devices.c | 28 ++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9260_devices.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9261_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9263_devices.c | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9g45_devices.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9x5_devices.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 +++ 9 files changed, 248 insertions(+)
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
This paatch serie add the i2c suport to at91 using the i2c-gpio as teh IP is broken until the sam9x5. For the sam9x5 untill we have the hw driver support use the i2c-gpio too
on the sam9x5ek enable the i2c and the qt1070
This patch serie depends on i2c qt1070 patch and the at91sam9x5ek 1-wire one
The following changes since commit
3a5609a37a19b0b6b5f4c61e3c561b7bf2d25b72:
Quoted 7 lines
i2c: add versatile support (2012-11-01 06:58:21 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.gitdelivery/at91_i2cfor you to fetch changes up to
2d2aee2451a0210cfb0d141db7729b648d0a32a4:
Applied up to 6/7 as the qt1070 driver needs some updates.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 16 lines · Sascha Hauer
Quoted 15 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
This paatch serie add the i2c suport to at91 using the i2c-gpio as teh IP is broken until the sam9x5. For the sam9x5 untill we have the hw driver support use the i2c-gpio too
on the sam9x5ek enable the i2c and the qt1070
This patch serie depends on i2c qt1070 patch and the at91sam9x5ek 1-wire one
The following changes since commit
3a5609a37a19b0b6b5f4c61e3c561b7bf2d25b72:i2c: add versatile support (2012-11-01 06:58:21 +0800)
Quoted 7 lines
Quoted 5 lines
are available in the git repository at:
git://git.jcrosoft.org/barebox.gitdelivery/at91_i2cfor you to fetch changes up to
2d2aee2451a0210cfb0d141db7729b648d0a32a4:Applied up to 6/7 as the qt1070 driver needs some updates.
You apply it too as the qt1070 is not in the defconfig
this will not break anything
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox