]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-palmz71.c
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-palmz71.c
index 34389b63b0ecc9f1c61a4cf931e8759aaed9021a..cc05257eb1cddd7720b182dd7fd52444e8510636 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 
-#include <asm/arch/mcbsp.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/mux.h>
-#include <asm/arch/usb.h>
-#include <asm/arch/dma.h>
-#include <asm/arch/tc.h>
-#include <asm/arch/board.h>
-#include <asm/arch/irda.h>
-#include <asm/arch/keypad.h>
-#include <asm/arch/common.h>
-#include <asm/arch/omap-alsa.h>
+#include <mach/mcbsp.h>
+#include <mach/gpio.h>
+#include <mach/mux.h>
+#include <mach/usb.h>
+#include <mach/dma.h>
+#include <mach/tc.h>
+#include <mach/board.h>
+#include <mach/irda.h>
+#include <mach/keypad.h>
+#include <mach/common.h>
+#include <mach/omap-alsa.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
@@ -239,7 +239,7 @@ static struct platform_device *devices[] __initdata = {
 static int
 palmz71_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(PALMZ71_PENIRQ_GPIO);
+       return !gpio_get_value(PALMZ71_PENIRQ_GPIO);
 }
 
 static const struct ads7846_platform_data palmz71_ts_info = {
@@ -267,16 +267,6 @@ static struct omap_usb_config palmz71_usb_config __initdata = {
        .pins[0]        = 2,
 };
 
-static struct omap_mmc_config palmz71_mmc_config __initdata = {
-       .mmc[0] = {
-               .enabled        = 1,
-               .wire4          = 0,
-               .wp_pin         = PALMZ71_MMC_WP_GPIO,
-               .power_pin      = -1,
-               .switch_pin     = PALMZ71_MMC_IN_GPIO,
-       },
-};
-
 static struct omap_lcd_config palmz71_lcd_config __initdata = {
        .ctrl_name = "internal",
 };
@@ -287,7 +277,6 @@ static struct omap_uart_config palmz71_uart_config __initdata = {
 
 static struct omap_board_config_kernel palmz71_config[] __initdata = {
        {OMAP_TAG_USB,  &palmz71_usb_config},
-       {OMAP_TAG_MMC,  &palmz71_mmc_config},
        {OMAP_TAG_LCD,  &palmz71_lcd_config},
        {OMAP_TAG_UART, &palmz71_uart_config},
 };
@@ -295,13 +284,13 @@ static struct omap_board_config_kernel palmz71_config[] __initdata = {
 static irqreturn_t
 palmz71_powercable(int irq, void *dev_id)
 {
-       if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) {
+       if (gpio_get_value(PALMZ71_USBDETECT_GPIO)) {
                printk(KERN_INFO "PM: Power cable connected\n");
-               set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
+               set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
                                IRQ_TYPE_EDGE_FALLING);
        } else {
                printk(KERN_INFO "PM: Power cable disconnected\n");
-               set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
+               set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
                                IRQ_TYPE_EDGE_RISING);
        }
        return IRQ_HANDLED;
@@ -323,29 +312,28 @@ palmz71_gpio_setup(int early)
 {
        if (early) {
                /* Only set GPIO1 so we have a working serial */
-               omap_set_gpio_dataout(1, 1);
-               omap_set_gpio_direction(1, 0);
+               gpio_direction_output(1, 1);
        } else {
                /* Set MMC/SD host WP pin as input */
-               if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) {
+               if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) {
                        printk(KERN_ERR "Could not reserve WP GPIO!\n");
                        return;
                }
-               omap_set_gpio_direction(PALMZ71_MMC_WP_GPIO, 1);
+               gpio_direction_input(PALMZ71_MMC_WP_GPIO);
 
                /* Monitor the Power-cable-connected signal */
-               if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) {
+               if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) {
                        printk(KERN_ERR
                                "Could not reserve cable signal GPIO!\n");
                        return;
                }
-               omap_set_gpio_direction(PALMZ71_USBDETECT_GPIO, 1);
-               if (request_irq(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
+               gpio_direction_input(PALMZ71_USBDETECT_GPIO);
+               if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
                                palmz71_powercable, IRQF_SAMPLE_RANDOM,
                                "palmz71-cable", 0))
                        printk(KERN_ERR
                                        "IRQ request for power cable failed!\n");
-               palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0);
+               palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
        }
 }