aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-n8x0.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2012-11-18 11:36:19 -0500
committerWolfram Sang <w.sang@pengutronix.de>2012-11-19 03:57:16 -0500
commit0857ba3c24c308f42a242fe8a1894772750230ce (patch)
tree5f12dd96ad895126ac17aa5e65ad66e60463ae3b /arch/arm/mach-omap2/board-n8x0.c
parenta000b8c1e30115800d3de86b4b058cadd9cba59d (diff)
i2c: i2c-cbus-gpio: introduce driver
Add i2c driver to enable access to devices behind CBUS on Nokia Internet Tablets. The patch also adds CBUS I2C configuration for N8x0 which is one of the users of this driver. Acked-by: Felipe Balbi <balbi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap2/board-n8x0.c')
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index d95f727ca39a..bbfd74263c42 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -16,10 +16,12 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/irq.h>
19#include <linux/stddef.h> 20#include <linux/stddef.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
21#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
22#include <linux/usb/musb.h> 23#include <linux/usb/musb.h>
24#include <linux/platform_data/i2c-cbus-gpio.h>
23#include <linux/platform_data/spi-omap2-mcspi.h> 25#include <linux/platform_data/spi-omap2-mcspi.h>
24#include <linux/platform_data/mtd-onenand-omap2.h> 26#include <linux/platform_data/mtd-onenand-omap2.h>
25#include <sound/tlv320aic3x.h> 27#include <sound/tlv320aic3x.h>
@@ -39,6 +41,45 @@
39#define TUSB6010_GPIO_ENABLE 0 41#define TUSB6010_GPIO_ENABLE 0
40#define TUSB6010_DMACHAN 0x3f 42#define TUSB6010_DMACHAN 0x3f
41 43
44#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE)
45static struct i2c_cbus_platform_data n8x0_cbus_data = {
46 .clk_gpio = 66,
47 .dat_gpio = 65,
48 .sel_gpio = 64,
49};
50
51static struct platform_device n8x0_cbus_device = {
52 .name = "i2c-cbus-gpio",
53 .id = 3,
54 .dev = {
55 .platform_data = &n8x0_cbus_data,
56 },
57};
58
59static struct i2c_board_info n8x0_i2c_board_info_3[] __initdata = {
60 {
61 I2C_BOARD_INFO("retu-mfd", 0x01),
62 },
63};
64
65static void __init n8x0_cbus_init(void)
66{
67 const int retu_irq_gpio = 108;
68
69 if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ"))
70 return;
71 irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING);
72 n8x0_i2c_board_info_3[0].irq = gpio_to_irq(retu_irq_gpio);
73 i2c_register_board_info(3, n8x0_i2c_board_info_3,
74 ARRAY_SIZE(n8x0_i2c_board_info_3));
75 platform_device_register(&n8x0_cbus_device);
76}
77#else /* CONFIG_I2C_CBUS_GPIO */
78static void __init n8x0_cbus_init(void)
79{
80}
81#endif /* CONFIG_I2C_CBUS_GPIO */
82
42#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE) 83#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
43/* 84/*
44 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and 85 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
@@ -677,6 +718,7 @@ static void __init n8x0_init_machine(void)
677 gpmc_onenand_init(board_onenand_data); 718 gpmc_onenand_init(board_onenand_data);
678 n8x0_mmc_init(); 719 n8x0_mmc_init();
679 n8x0_usb_init(); 720 n8x0_usb_init();
721 n8x0_cbus_init();
680} 722}
681 723
682MACHINE_START(NOKIA_N800, "Nokia N800") 724MACHINE_START(NOKIA_N800, "Nokia N800")