aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-06-12 15:18:05 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-06-27 09:32:29 -0400
commit7ef31e9c4e711bfb817a15b54e428e5c4a7c0032 (patch)
tree672d3c41f57cda9f731c759a71b179fe9f80c61f /arch
parentd86d314f67191011e6f494f6517b8cbd7dd3dc39 (diff)
avr32: improve NGW100 I2C/PMBus setup
Basic I2C initialization for the NGW100 board: - Provide empty i2c device table. Daughtercards may add devices, and the ATtiny24 could do stuff too. - Set up EXTINT(3) so the ATtiny24 can interrupt the AP7000. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/avr32/boards/atngw100/setup.c22
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
152static struct i2c_board_info __initdata i2c_info[] = {
153 /* NOTE: original ATtiny24 firmware is at address 0x0b */
154};
155
150static int __init atngw100_init(void) 156static 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}
183postcore_initcall(atngw100_init); 196postcore_initcall(atngw100_init);
197
198static 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}
205arch_initcall(atngw100_arch_init);