diff options
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 229f48577d5e..1182b7988230 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -317,13 +317,8 @@ static struct ads7846_platform_data spitz_ads7846_info = { | |||
317 | .wait_for_sync = spitz_wait_for_hsync, | 317 | .wait_for_sync = spitz_wait_for_hsync, |
318 | }; | 318 | }; |
319 | 319 | ||
320 | static void spitz_ads7846_cs(u32 command) | ||
321 | { | ||
322 | gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT)); | ||
323 | } | ||
324 | |||
325 | static struct pxa2xx_spi_chip spitz_ads7846_chip = { | 320 | static struct pxa2xx_spi_chip spitz_ads7846_chip = { |
326 | .cs_control = spitz_ads7846_cs, | 321 | .gpio_cs = SPITZ_GPIO_ADS7846_CS, |
327 | }; | 322 | }; |
328 | 323 | ||
329 | static void spitz_bl_kick_battery(void) | 324 | static void spitz_bl_kick_battery(void) |
@@ -347,22 +342,12 @@ static struct corgi_lcd_platform_data spitz_lcdcon_info = { | |||
347 | .kick_battery = spitz_bl_kick_battery, | 342 | .kick_battery = spitz_bl_kick_battery, |
348 | }; | 343 | }; |
349 | 344 | ||
350 | static void spitz_lcdcon_cs(u32 command) | ||
351 | { | ||
352 | gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT)); | ||
353 | } | ||
354 | |||
355 | static struct pxa2xx_spi_chip spitz_lcdcon_chip = { | 345 | static struct pxa2xx_spi_chip spitz_lcdcon_chip = { |
356 | .cs_control = spitz_lcdcon_cs, | 346 | .gpio_cs = SPITZ_GPIO_LCDCON_CS, |
357 | }; | 347 | }; |
358 | 348 | ||
359 | static void spitz_max1111_cs(u32 command) | ||
360 | { | ||
361 | gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT)); | ||
362 | } | ||
363 | |||
364 | static struct pxa2xx_spi_chip spitz_max1111_chip = { | 349 | static struct pxa2xx_spi_chip spitz_max1111_chip = { |
365 | .cs_control = spitz_max1111_cs, | 350 | .gpio_cs = SPITZ_GPIO_MAX1111_CS, |
366 | }; | 351 | }; |
367 | 352 | ||
368 | static struct spi_board_info spitz_spi_devices[] = { | 353 | static struct spi_board_info spitz_spi_devices[] = { |
@@ -392,30 +377,6 @@ static struct spi_board_info spitz_spi_devices[] = { | |||
392 | 377 | ||
393 | static void __init spitz_init_spi(void) | 378 | static void __init spitz_init_spi(void) |
394 | { | 379 | { |
395 | int err; | ||
396 | |||
397 | err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS"); | ||
398 | if (err) | ||
399 | return; | ||
400 | |||
401 | err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS"); | ||
402 | if (err) | ||
403 | goto err_free_1; | ||
404 | |||
405 | err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS"); | ||
406 | if (err) | ||
407 | goto err_free_2; | ||
408 | |||
409 | err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1); | ||
410 | if (err) | ||
411 | goto err_free_3; | ||
412 | err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1); | ||
413 | if (err) | ||
414 | goto err_free_3; | ||
415 | err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1); | ||
416 | if (err) | ||
417 | goto err_free_3; | ||
418 | |||
419 | if (machine_is_akita()) { | 380 | if (machine_is_akita()) { |
420 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; | 381 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; |
421 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; | 382 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; |
@@ -423,14 +384,6 @@ static void __init spitz_init_spi(void) | |||
423 | 384 | ||
424 | pxa2xx_set_spi_info(2, &spitz_spi_info); | 385 | pxa2xx_set_spi_info(2, &spitz_spi_info); |
425 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); | 386 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); |
426 | return; | ||
427 | |||
428 | err_free_3: | ||
429 | gpio_free(SPITZ_GPIO_MAX1111_CS); | ||
430 | err_free_2: | ||
431 | gpio_free(SPITZ_GPIO_LCDCON_CS); | ||
432 | err_free_1: | ||
433 | gpio_free(SPITZ_GPIO_ADS7846_CS); | ||
434 | } | 387 | } |
435 | #else | 388 | #else |
436 | static inline void spitz_init_spi(void) {} | 389 | static inline void spitz_init_spi(void) {} |