diff options
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index 00ce961c52a5..a51bb9fb3c89 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -9,6 +9,8 @@ | |||
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/irq.h> | ||
13 | #include <linux/i2c.h> | ||
12 | #include <linux/i2c-gpio.h> | 14 | #include <linux/i2c-gpio.h> |
13 | #include <linux/init.h> | 15 | #include <linux/init.h> |
14 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
@@ -147,6 +149,10 @@ static struct platform_device i2c_gpio_device = { | |||
147 | }, | 149 | }, |
148 | }; | 150 | }; |
149 | 151 | ||
152 | static struct i2c_board_info __initdata i2c_info[] = { | ||
153 | /* NOTE: original ATtiny24 firmware is at address 0x0b */ | ||
154 | }; | ||
155 | |||
150 | static int __init atngw100_init(void) | 156 | static int __init atngw100_init(void) |
151 | { | 157 | { |
152 | unsigned i; | 158 | unsigned i; |
@@ -172,12 +178,28 @@ static int __init atngw100_init(void) | |||
172 | } | 178 | } |
173 | platform_device_register(&ngw_gpio_leds); | 179 | platform_device_register(&ngw_gpio_leds); |
174 | 180 | ||
181 | /* all these i2c/smbus pins should have external pullups for | ||
182 | * open-drain sharing among all I2C devices. SDA and SCL do; | ||
183 | * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), | ||
184 | * but it's not available off-board. | ||
185 | */ | ||
186 | at32_select_periph(GPIO_PIN_PB(28), 0, AT32_GPIOF_PULLUP); | ||
175 | at32_select_gpio(i2c_gpio_data.sda_pin, | 187 | at32_select_gpio(i2c_gpio_data.sda_pin, |
176 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | 188 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); |
177 | at32_select_gpio(i2c_gpio_data.scl_pin, | 189 | at32_select_gpio(i2c_gpio_data.scl_pin, |
178 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | 190 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); |
179 | platform_device_register(&i2c_gpio_device); | 191 | platform_device_register(&i2c_gpio_device); |
192 | i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); | ||
180 | 193 | ||
181 | return 0; | 194 | return 0; |
182 | } | 195 | } |
183 | postcore_initcall(atngw100_init); | 196 | postcore_initcall(atngw100_init); |
197 | |||
198 | static int __init atngw100_arch_init(void) | ||
199 | { | ||
200 | /* set_irq_type() after the arch_initcall for EIC has run, and | ||
201 | * before the I2C subsystem could try using this IRQ. | ||
202 | */ | ||
203 | return set_irq_type(AT32_EXTINT(3), IRQ_TYPE_EDGE_FALLING); | ||
204 | } | ||
205 | arch_initcall(atngw100_arch_init); | ||