diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9263ek.c')
| -rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index b1d11960a735..8354015c6a23 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
| @@ -26,13 +26,14 @@ | |||
| 26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
| 28 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
| 29 | #include <linux/i2c/at24.h> | ||
| 29 | #include <linux/fb.h> | 30 | #include <linux/fb.h> |
| 30 | #include <linux/gpio_keys.h> | 31 | #include <linux/gpio_keys.h> |
| 31 | #include <linux/input.h> | 32 | #include <linux/input.h> |
| 33 | #include <linux/leds.h> | ||
| 32 | 34 | ||
| 33 | #include <video/atmel_lcdc.h> | 35 | #include <video/atmel_lcdc.h> |
| 34 | 36 | ||
| 35 | #include <mach/hardware.h> | ||
| 36 | #include <asm/setup.h> | 37 | #include <asm/setup.h> |
| 37 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
| 38 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
| @@ -41,6 +42,7 @@ | |||
| 41 | #include <asm/mach/map.h> | 42 | #include <asm/mach/map.h> |
| 42 | #include <asm/mach/irq.h> | 43 | #include <asm/mach/irq.h> |
| 43 | 44 | ||
| 45 | #include <mach/hardware.h> | ||
| 44 | #include <mach/board.h> | 46 | #include <mach/board.h> |
| 45 | #include <mach/gpio.h> | 47 | #include <mach/gpio.h> |
| 46 | #include <mach/at91sam9_smc.h> | 48 | #include <mach/at91sam9_smc.h> |
| @@ -172,11 +174,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
| 172 | { | 174 | { |
| 173 | .name = "Partition 1", | 175 | .name = "Partition 1", |
| 174 | .offset = 0, | 176 | .offset = 0, |
| 175 | .size = 64 * 1024 * 1024, | 177 | .size = SZ_64M, |
| 176 | }, | 178 | }, |
| 177 | { | 179 | { |
| 178 | .name = "Partition 2", | 180 | .name = "Partition 2", |
| 179 | .offset = 64 * 1024 * 1024, | 181 | .offset = MTDPART_OFS_NXTBLK, |
| 180 | .size = MTDPART_SIZ_FULL, | 182 | .size = MTDPART_SIZ_FULL, |
| 181 | }, | 183 | }, |
| 182 | }; | 184 | }; |
| @@ -203,12 +205,30 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
| 203 | 205 | ||
| 204 | 206 | ||
| 205 | /* | 207 | /* |
| 208 | * I2C devices | ||
| 209 | */ | ||
| 210 | static struct at24_platform_data at24c512 = { | ||
| 211 | .byte_len = SZ_512K / 8, | ||
| 212 | .page_size = 128, | ||
| 213 | .flags = AT24_FLAG_ADDR16, | ||
| 214 | }; | ||
| 215 | |||
| 216 | |||
| 217 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
| 218 | { | ||
| 219 | I2C_BOARD_INFO("24c512", 0x50), | ||
| 220 | .platform_data = &at24c512, | ||
| 221 | }, | ||
| 222 | /* more devices can be added using expansion connectors */ | ||
| 223 | }; | ||
| 224 | |||
| 225 | /* | ||
| 206 | * LCD Controller | 226 | * LCD Controller |
| 207 | */ | 227 | */ |
| 208 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | 228 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) |
| 209 | static struct fb_videomode at91_tft_vga_modes[] = { | 229 | static struct fb_videomode at91_tft_vga_modes[] = { |
| 210 | { | 230 | { |
| 211 | .name = "TX09D50VM1CCA @ 60", | 231 | .name = "TX09D50VM1CCA @ 60", |
| 212 | .refresh = 60, | 232 | .refresh = 60, |
| 213 | .xres = 240, .yres = 320, | 233 | .xres = 240, .yres = 320, |
| 214 | .pixclock = KHZ2PICOS(4965), | 234 | .pixclock = KHZ2PICOS(4965), |
| @@ -224,7 +244,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { | |||
| 224 | 244 | ||
| 225 | static struct fb_monspecs at91fb_default_monspecs = { | 245 | static struct fb_monspecs at91fb_default_monspecs = { |
| 226 | .manufacturer = "HIT", | 246 | .manufacturer = "HIT", |
| 227 | .monitor = "TX09D70VM1CCA", | 247 | .monitor = "TX09D70VM1CCA", |
| 228 | 248 | ||
| 229 | .modedb = at91_tft_vga_modes, | 249 | .modedb = at91_tft_vga_modes, |
| 230 | .modedb_len = ARRAY_SIZE(at91_tft_vga_modes), | 250 | .modedb_len = ARRAY_SIZE(at91_tft_vga_modes), |
| @@ -235,7 +255,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | |||
| 235 | }; | 255 | }; |
| 236 | 256 | ||
| 237 | #define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \ | 257 | #define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \ |
| 238 | | ATMEL_LCDC_DISTYPE_TFT \ | 258 | | ATMEL_LCDC_DISTYPE_TFT \ |
| 239 | | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) | 259 | | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) |
| 240 | 260 | ||
| 241 | static void at91_lcdc_power_control(int on) | 261 | static void at91_lcdc_power_control(int on) |
| @@ -277,7 +297,7 @@ static struct gpio_keys_button ek_buttons[] = { | |||
| 277 | .active_low = 1, | 297 | .active_low = 1, |
| 278 | .desc = "right_click", | 298 | .desc = "right_click", |
| 279 | .wakeup = 1, | 299 | .wakeup = 1, |
| 280 | }, | 300 | } |
| 281 | }; | 301 | }; |
| 282 | 302 | ||
| 283 | static struct gpio_keys_platform_data ek_button_data = { | 303 | static struct gpio_keys_platform_data ek_button_data = { |
| @@ -296,9 +316,9 @@ static struct platform_device ek_button_device = { | |||
| 296 | 316 | ||
| 297 | static void __init ek_add_device_buttons(void) | 317 | static void __init ek_add_device_buttons(void) |
| 298 | { | 318 | { |
| 299 | at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */ | 319 | at91_set_GPIO_periph(AT91_PIN_PC5, 1); /* left button */ |
| 300 | at91_set_deglitch(AT91_PIN_PC5, 1); | 320 | at91_set_deglitch(AT91_PIN_PC5, 1); |
| 301 | at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */ | 321 | at91_set_GPIO_periph(AT91_PIN_PC4, 1); /* right button */ |
| 302 | at91_set_deglitch(AT91_PIN_PC4, 1); | 322 | at91_set_deglitch(AT91_PIN_PC4, 1); |
| 303 | 323 | ||
| 304 | platform_device_register(&ek_button_device); | 324 | platform_device_register(&ek_button_device); |
| @@ -320,25 +340,32 @@ static struct atmel_ac97_data ek_ac97_data = { | |||
| 320 | * LEDs ... these could all be PWM-driven, for variable brightness | 340 | * LEDs ... these could all be PWM-driven, for variable brightness |
| 321 | */ | 341 | */ |
| 322 | static struct gpio_led ek_leds[] = { | 342 | static struct gpio_led ek_leds[] = { |
| 323 | { /* "left" led, green, userled1, pwm1 */ | 343 | { /* "right" led, green, userled2 (could be driven by pwm2) */ |
| 324 | .name = "ds1", | ||
| 325 | .gpio = AT91_PIN_PB8, | ||
| 326 | .active_low = 1, | ||
| 327 | .default_trigger = "mmc0", | ||
| 328 | }, | ||
| 329 | { /* "right" led, green, userled2, pwm2 */ | ||
| 330 | .name = "ds2", | 344 | .name = "ds2", |
| 331 | .gpio = AT91_PIN_PC29, | 345 | .gpio = AT91_PIN_PC29, |
| 332 | .active_low = 1, | 346 | .active_low = 1, |
| 333 | .default_trigger = "nand-disk", | 347 | .default_trigger = "nand-disk", |
| 334 | }, | 348 | }, |
| 335 | { /* "power" led, yellow, pwm0 */ | 349 | { /* "power" led, yellow (could be driven by pwm0) */ |
| 336 | .name = "ds3", | 350 | .name = "ds3", |
| 337 | .gpio = AT91_PIN_PB7, | 351 | .gpio = AT91_PIN_PB7, |
| 338 | .default_trigger = "heartbeat", | 352 | .default_trigger = "heartbeat", |
| 339 | } | 353 | } |
| 340 | }; | 354 | }; |
| 341 | 355 | ||
| 356 | /* | ||
| 357 | * PWM Leds | ||
| 358 | */ | ||
| 359 | static struct gpio_led ek_pwm_led[] = { | ||
| 360 | /* For now only DS1 is PWM-driven (by pwm1) */ | ||
| 361 | { | ||
| 362 | .name = "ds1", | ||
| 363 | .gpio = 1, /* is PWM channel number */ | ||
| 364 | .active_low = 1, | ||
| 365 | .default_trigger = "none", | ||
| 366 | } | ||
| 367 | }; | ||
| 368 | |||
| 342 | 369 | ||
| 343 | static void __init ek_board_init(void) | 370 | static void __init ek_board_init(void) |
| 344 | { | 371 | { |
| @@ -360,7 +387,7 @@ static void __init ek_board_init(void) | |||
| 360 | /* NAND */ | 387 | /* NAND */ |
| 361 | at91_add_device_nand(&ek_nand_data); | 388 | at91_add_device_nand(&ek_nand_data); |
| 362 | /* I2C */ | 389 | /* I2C */ |
| 363 | at91_add_device_i2c(NULL, 0); | 390 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); |
| 364 | /* LCD Controller */ | 391 | /* LCD Controller */ |
| 365 | at91_add_device_lcdc(&ek_lcdc_data); | 392 | at91_add_device_lcdc(&ek_lcdc_data); |
| 366 | /* Push Buttons */ | 393 | /* Push Buttons */ |
| @@ -369,6 +396,7 @@ static void __init ek_board_init(void) | |||
| 369 | at91_add_device_ac97(&ek_ac97_data); | 396 | at91_add_device_ac97(&ek_ac97_data); |
| 370 | /* LEDs */ | 397 | /* LEDs */ |
| 371 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 398 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
| 399 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); | ||
| 372 | } | 400 | } |
| 373 | 401 | ||
| 374 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") | 402 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |
