aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-07-12 10:36:34 -0400
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-08-15 10:36:55 -0400
commit54bb69e25016a7b11d83f03feafafdfe2b4d0859 (patch)
tree31f1770defb30bedba78c443098d298d0b76b83b /arch/avr32
parentad93ab0a6ee20130fb8f719fc1860c20daa99a7b (diff)
[AVR32] Wire up i2c-gpio on the ATNGW100 board
The NGW100 has a board controller which is hooked up to the TWI lines on AP7000. Since the TWI driver isn't in mainline, use the i2c-gpio driver in the mean time. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/boards/atngw100/setup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 2edcecdea8bd..ef801563bbf5 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/etherdevice.h> 11#include <linux/etherdevice.h>
12#include <linux/i2c-gpio.h>
12#include <linux/init.h> 13#include <linux/init.h>
13#include <linux/linkage.h> 14#include <linux/linkage.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
@@ -123,6 +124,19 @@ static struct platform_device ngw_gpio_leds = {
123 } 124 }
124}; 125};
125 126
127static struct i2c_gpio_platform_data i2c_gpio_data = {
128 .sda_pin = GPIO_PIN_PA(6),
129 .scl_pin = GPIO_PIN_PA(7),
130};
131
132static struct platform_device i2c_gpio_device = {
133 .name = "i2c-gpio",
134 .id = 0,
135 .dev = {
136 .platform_data = &i2c_gpio_data,
137 },
138};
139
126static int __init atngw100_init(void) 140static int __init atngw100_init(void)
127{ 141{
128 unsigned i; 142 unsigned i;
@@ -147,6 +161,10 @@ static int __init atngw100_init(void)
147 } 161 }
148 platform_device_register(&ngw_gpio_leds); 162 platform_device_register(&ngw_gpio_leds);
149 163
164 at32_select_gpio(i2c_gpio_data.sda_pin, 0);
165 at32_select_gpio(i2c_gpio_data.scl_pin, 0);
166 platform_device_register(&i2c_gpio_device);
167
150 return 0; 168 return 0;
151} 169}
152postcore_initcall(atngw100_init); 170postcore_initcall(atngw100_init);