/* * Copyright (C) 2010 Christian Glindkamp * taskit GmbH * 2010 Igor Plyatov * GeoSIG Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include "at91_aic.h" #include "board.h" #include "sam9_smc.h" #include "generic.h" #include "gsia18s.h" #include "stamp9g20.h" static void __init gsia18s_init_early(void) { stamp9g20_init_early(); } /* * Two USB Host ports */ static struct at91_usbh_data __initdata usbh_data = { .ports = 2, .vbus_pin = {-EINVAL, -EINVAL}, .overcurrent_pin= {-EINVAL, -EINVAL}, }; /* * USB Device port */ static struct at91_udc_data __initdata udc_data = { .vbus_pin = AT91_PIN_PA22, .pullup_pin = -EINVAL, /* pull-up driven by UDC */ }; /* * MACB Ethernet device */ static struct macb_platform_data __initdata macb_data = { .phy_irq_pin = AT91_PIN_PA28, .is_rmii = 1, }; /* * LEDs and GPOs */ static struct gpio_led gpio_leds[] = { { .name = "gpo:spi1reset", .gpio = AT91_PIN_PC1, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "gpo:trig_net_out", .gpio = AT91_PIN_PB20, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "gpo:trig_net_dir", .gpio = AT91_PIN_PB19, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "gpo:charge_dis", .gpio = AT91_PIN_PC2, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "led:event", .gpio = AT91_PIN_PB17, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "led:lan", .gpio = AT91_PIN_PB18, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { .name = "led:error", .gpio = AT91_PIN_PB16, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_ON, } }; static struct gpio_led_platform_data gpio_led_info = { .leds = gpio_leds, .num_leds = ARRAY_SIZE(gpio_leds), }; static struct platform_device leds = { .name = "leds-gpio", .id = 0, .dev = { .platform_data = &gpio_led_info, } }; static void __init gsia18s_leds_init(void) { platform_device_register(&leds); } /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ static struct gpio_led pcf_gpio_leds1[] = { { /* bit 0 */ .name = "gpo:hdc_power", .gpio = PCF_GPIO_HDC_POWER, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { /* bit 1 */ .name = "gpo:wifi_setup", .gpio = PCF_GPIO_WIFI_SETUP, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { /* bit 2 */ .name = "gpo:wifi_enable", .gpio = PCF_GPIO_WIFI_ENABLE, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { /* bit 3 */ .name = "gpo:wifi_reset", .gpio = PCF_GPIO_WIFI_RESET, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_ON, }, /* bit 4 used as GPI */ { /* bit 5 */ .name = "gpo:gps_setup", .gpio = PCF_GPIO_GPS_SETUP, .active_low = 1, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, }, { /* bit 6 */ .name = "gpo:gps_standby", .gpio = PCF_GPIO_GPS_STANDBY, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_ON, }, { /* bit 7 */ .name = "gpo:gps_power", .gpio = PCF_GPIO_GPS_POWER, .active_low = 0, .default_trigger = "none", .default_state = LEDS_GPIO_DEFSTATE_OFF, } }; static struct gpio_led_platform_data pcf_gpio_led_info1 = { .leds = pcf_gpio_leds1, .num_leds = ARRAY_SIZE(pcf_gpio_leds1), }; static struct platform_device pcf_leds1 = { .name = "leds-gpio", /* GS_IA18-CB_board */ .id = 1, .dev = { .platform_data = &pcf_gpio_led_info1, } }; /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ static struct gpio_led pcf_gpio_leds2[] = { { /* bit 0 */ .name = "gpo:alarm_1", .gpio = PCF_GPIO_ALARM1, .active_low = 1, .default_trigger = "none",