]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-sx1.c
ARM: OMAP: Fix gpio by switching to generic gpio calls
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-sx1.c
index 130bcc6fd082b4a7fa5745e3bb0d3c27b059f68b..c602729f622bd073345862670263a98f7f1dfc5d 100644 (file)
 #include <asm/mach/map.h>
 
 #include <mach/gpio.h>
+#include <mach/gpio-switch.h>
 #include <mach/mux.h>
 #include <mach/irda.h>
 #include <mach/usb.h>
 #include <mach/tc.h>
 #include <mach/board.h>
 #include <mach/common.h>
-#include <mach/mcbsp.h>
-#include <mach/omap-alsa.h>
 #include <mach/keypad.h>
 
 /* Write to I2C device */
@@ -254,35 +253,6 @@ static struct platform_device sx1_irda_device = {
        .resource       = sx1_irda_resources,
 };
 
-/*----------- McBSP & Sound -------------------------*/
-
-/* Playback interface - McBSP1 */
-static struct omap_mcbsp_reg_cfg mcbsp1_regs = {
-       .spcr2  = XINTM(3),     /* SPCR2=30 */
-       .spcr1  = RINTM(3),     /* SPCR1=30 */
-       .rcr2   = 0,    /* RCR2 =00 */
-       .rcr1   = RFRLEN1(1) | RWDLEN1(OMAP_MCBSP_WORD_16),     /* RCR1=140 */
-       .xcr2   = 0,    /* XCR2 = 0 */
-       .xcr1   = XFRLEN1(1) | XWDLEN1(OMAP_MCBSP_WORD_16),     /* XCR1 = 140 */
-       .srgr1  = FWID(15) | CLKGDV(12),        /* SRGR1=0f0c */
-       .srgr2  = FSGM | FPER(31),      /* SRGR2=101f */
-       .pcr0   = FSXM | FSRM | CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
-                                               /* PCR0 =0f0f */
-};
-
-static struct omap_alsa_codec_config sx1_alsa_config = {
-       .name                   = "SX1 EGold",
-       .mcbsp_regs_alsa        = &mcbsp1_regs,
-};
-
-static struct platform_device sx1_mcbsp1_device = {
-       .name   = "omap_alsa_mcbsp",
-       .id     = 1,
-       .dev = {
-               .platform_data  = &sx1_alsa_config,
-       },
-};
-
 /*----------- MTD -------------------------*/
 
 static struct mtd_partition sx1_partitions[] = {
@@ -378,15 +348,6 @@ static struct omap_usb_config sx1_usb_config __initdata = {
        .pins[2]        = 0,
 };
 
-/*----------- MMC -------------------------*/
-
-static struct omap_mmc_config sx1_mmc_config __initdata = {
-       .mmc [0] = {
-               .enabled        = 1,
-               .wire4          = 0,
-       },
-};
-
 /*----------- LCD -------------------------*/
 
 static struct platform_device sx1_lcd_device = {
@@ -403,7 +364,6 @@ static struct platform_device *sx1_devices[] __initdata = {
        &sx1_flash_device,
        &sx1_kp_device,
        &sx1_lcd_device,
-       &sx1_mcbsp1_device,
        &sx1_irda_device,
 };
 /*-----------------------------------------*/
@@ -414,7 +374,6 @@ static struct omap_uart_config sx1_uart_config __initdata = {
 
 static struct omap_board_config_kernel sx1_config[] __initdata = {
        { OMAP_TAG_USB, &sx1_usb_config },
-       { OMAP_TAG_MMC, &sx1_mmc_config },
        { OMAP_TAG_LCD, &sx1_lcd_config },
        { OMAP_TAG_UART,        &sx1_uart_config },
 };
@@ -433,17 +392,12 @@ static void __init omap_sx1_init(void)
 
        /* turn on USB power */
        /* sx1_setusbpower(1); cant do it here because i2c is not ready */
-       omap_request_gpio(1);   /* A_IRDA_OFF */
-       omap_request_gpio(11);  /* A_SWITCH */
-       omap_request_gpio(15);  /* A_USB_ON */
-       omap_set_gpio_direction(1, 0);/* gpio1 -> output */
-       omap_set_gpio_direction(11, 0);/* gpio11 -> output */
-       omap_set_gpio_direction(15, 0);/* gpio15 -> output */
-       /* set GPIO data */
-       omap_set_gpio_dataout(1, 1);/*A_IRDA_OFF = 1 */
-       omap_set_gpio_dataout(11, 0);/*A_SWITCH = 0 */
-       omap_set_gpio_dataout(15, 0);/*A_USB_ON = 0 */
-
+       gpio_request(1, "A_IRDA_OFF");
+       gpio_request(11, "A_SWITCH");
+       gpio_request(15, "A_USB_ON");
+       gpio_direction_output(1, 1);    /*A_IRDA_OFF = 1 */
+       gpio_direction_output(11, 0);   /*A_SWITCH = 0 */
+       gpio_direction_output(15, 0);   /*A_USB_ON = 0 */
 }
 /*----------------------------------------*/
 static void __init omap_sx1_init_irq(void)