]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'omap-fixes'
authorTony Lindgren <tony@atomide.com>
Fri, 3 Apr 2009 23:18:11 +0000 (16:18 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 3 Apr 2009 23:18:11 +0000 (16:18 -0700)
17 files changed:
arch/arm/kernel/head.S
arch/arm/mach-omap1/board-h2-mmc.c
arch/arm/mach-omap1/board-h3-mmc.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/usb-tusb6010.c
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/gpio.c
arch/arm/plat-omap/include/mach/dma.h
arch/arm/plat-omap/include/mach/gpioexpander.h [deleted file]
arch/arm/plat-omap/include/mach/irda.h
arch/arm/plat-omap/include/mach/mmc.h
drivers/i2c/busses/i2c-omap.c
drivers/mmc/host/omap.c

index 21e17dc94cb56757f6f25f05b61ba4c2d6e095ca..1bc918cbdb189989878981ae375657b31f0e9b8e 100644 (file)
@@ -282,7 +282,7 @@ __create_page_tables:
        .endif
        str     r6, [r0]
 
-#ifdef CONFIG_DEBUG_LL
+#if defined(CONFIG_DEBUG_LL) || defined(CONFIG_DEBUG_SPINLOCK)
        ldr     r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
        /*
         * Map in IO space for serial debugging.
index 44d4a966bed9b3aa4c6ea06efa678396f641ae52..46098f546824853499151687cb1f7bd46fc45a83 100644 (file)
 static int mmc_set_power(struct device *dev, int slot, int power_on,
                                int vdd)
 {
-       if (power_on)
-               gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 1);
-       else
-               gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);
-
+       gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on);
        return 0;
 }
 
 static int mmc_late_init(struct device *dev)
 {
-       int ret;
-
-       ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
+       int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
        if (ret < 0)
                return ret;
 
@@ -47,7 +41,7 @@ static int mmc_late_init(struct device *dev)
        return ret;
 }
 
-static void mmc_shutdown(struct device *dev)
+static void mmc_cleanup(struct device *dev)
 {
        gpio_free(H2_TPS_GPIO_MMC_PWR_EN);
 }
@@ -60,7 +54,7 @@ static void mmc_shutdown(struct device *dev)
 static struct omap_mmc_platform_data mmc1_data = {
        .nr_slots                       = 1,
        .init                           = mmc_late_init,
-       .shutdown                       = mmc_shutdown,
+       .cleanup                        = mmc_cleanup,
        .dma_mask                       = 0xffffffff,
        .slots[0]       = {
                .set_power              = mmc_set_power,
index 0d8a3c195e2e01872efd43394e333dea2f7aa43d..5e8877ce35e09718f811578ffbcf93ee166bdf2c 100644 (file)
 static int mmc_set_power(struct device *dev, int slot, int power_on,
                                int vdd)
 {
-       if (power_on)
-               gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 1);
-       else
-               gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);
-
+       gpio_set_value(H3_TPS_GPIO_MMC_PWR_EN, power_on);
        return 0;
 }
 
index 4695965114c4e67e86456439fa4435149e0cf374..f597968733b4f2baa980419519edade5e0203961 100644 (file)
 #include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 
-#include <mach/gpioexpander.h>
 #include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/tc.h>
 #include <mach/nand.h>
-#include <mach/irda.h>
 #include <mach/usb.h>
 #include <mach/keypad.h>
 #include <mach/dma.h>
@@ -276,104 +274,6 @@ static struct platform_device h3_kp_device = {
        .resource       = h3_kp_resources,
 };
 
-
-/* Select between the IrDA and aGPS module
- */
-static int h3_select_irda(struct device *dev, int state)
-{
-       unsigned char expa;
-       int err = 0;
-
-       if ((err = read_gpio_expa(&expa, 0x26))) {
-               printk(KERN_ERR "Error reading from I/O EXPANDER \n");
-               return err;
-       }
-
-       /* 'P6' enable/disable IRDA_TX and IRDA_RX */
-       if (state & IR_SEL) { /* IrDA */
-               if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
-                       printk(KERN_ERR "Error writing to I/O EXPANDER \n");
-                       return err;
-               }
-       } else {
-               if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
-                       printk(KERN_ERR "Error writing to I/O EXPANDER \n");
-                       return err;
-               }
-       }
-       return err;
-}
-
-static void set_trans_mode(struct work_struct *work)
-{
-       struct omap_irda_config *irda_config =
-               container_of(work, struct omap_irda_config, gpio_expa.work);
-       int mode = irda_config->mode;
-       unsigned char expa;
-       int err = 0;
-
-       if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
-               printk(KERN_ERR "Error reading from I/O expander\n");
-       }
-
-       expa &= ~0x03;
-
-       if (mode & IR_SIRMODE) {
-               expa |= 0x01;
-       } else { /* MIR/FIR */
-               expa |= 0x03;
-       }
-
-       if ((err = write_gpio_expa(expa, 0x27)) != 0) {
-               printk(KERN_ERR "Error writing to I/O expander\n");
-       }
-}
-
-static int h3_transceiver_mode(struct device *dev, int mode)
-{
-       struct omap_irda_config *irda_config = dev->platform_data;
-
-       irda_config->mode = mode;
-       cancel_delayed_work(&irda_config->gpio_expa);
-       PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
-       schedule_delayed_work(&irda_config->gpio_expa, 0);
-
-       return 0;
-}
-
-static struct omap_irda_config h3_irda_data = {
-       .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
-       .transceiver_mode       = h3_transceiver_mode,
-       .select_irda            = h3_select_irda,
-       .rx_channel             = OMAP_DMA_UART3_RX,
-       .tx_channel             = OMAP_DMA_UART3_TX,
-       .dest_start             = UART3_THR,
-       .src_start              = UART3_RHR,
-       .tx_trigger             = 0,
-       .rx_trigger             = 0,
-};
-
-static struct resource h3_irda_resources[] = {
-       [0] = {
-               .start  = INT_UART3,
-               .end    = INT_UART3,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static u64 irda_dmamask = 0xffffffff;
-
-static struct platform_device h3_irda_device = {
-       .name           = "omapirda",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &h3_irda_data,
-               .dma_mask       = &irda_dmamask,
-       },
-       .num_resources  = ARRAY_SIZE(h3_irda_resources),
-       .resource       = h3_irda_resources,
-};
-
 static struct platform_device h3_lcd_device = {
        .name           = "lcd_h3",
        .id             = -1,
@@ -395,7 +295,6 @@ static struct platform_device *devices[] __initdata = {
        &nand_device,
         &smc91x_device,
        &intlat_device,
-       &h3_irda_device,
        &h3_kp_device,
        &h3_lcd_device,
 };
index 7bc7a3cb9c510459953bb45012f9c70653e55a6c..d1ed1365319e6abfe6397952bcb08a8c47090797 100644 (file)
@@ -181,11 +181,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = {
 static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on,
                                int vdd)
 {
-       if (power_on)
-               gpio_set_value(NOKIA770_GPIO_MMC_POWER, 1);
-       else
-               gpio_set_value(NOKIA770_GPIO_MMC_POWER, 0);
-
+       gpio_set_value(NOKIA770_GPIO_MMC_POWER, power_on);
        return 0;
 }
 
index a2c3fcc27a22990e4d1a2f3220b3d6a079100148..c49d9bfa3abde7694e261115e40424f586f1152f 100644 (file)
@@ -47,6 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP)               += board-3430sdp.o \
 
 obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51.o \
                                           board-rx51-peripherals.o \
+                                          mmc-twl4030.o
+
 # Platform specific device init code
 ifeq ($(CONFIG_USB_MUSB_SOC),y)
 obj-y                                  += usb-musb.o
index a0267a9ab466e9638b9bd74c1e045d2e1321c5de..e7d017cdc43851b63c1c8a7c88feb0fe05039236 100644 (file)
 
 #include <mach/control.h>
 #include <mach/gpio.h>
-#include <mach/gpioexpander.h>
 #include <mach/mux.h>
 #include <mach/usb.h>
-#include <mach/irda.h>
 #include <mach/board.h>
 #include <mach/common.h>
 #include <mach/keypad.h>
@@ -138,98 +136,6 @@ static struct platform_device h4_flash_device = {
        .resource       = &h4_flash_resource,
 };
 
-/* Select between the IrDA and aGPS module
- */
-static int h4_select_irda(struct device *dev, int state)
-{
-       unsigned char expa;
-       int err = 0;
-
-       if ((err = read_gpio_expa(&expa, 0x21))) {
-               printk(KERN_ERR "Error reading from I/O expander\n");
-               return err;
-       }
-
-       /* 'P6' enable/disable IRDA_TX and IRDA_RX */
-       if (state & IR_SEL) {   /* IrDa */
-               if ((err = write_gpio_expa(expa | 0x01, 0x21))) {
-                       printk(KERN_ERR "Error writing to I/O expander\n");
-                       return err;
-               }
-       } else {
-               if ((err = write_gpio_expa(expa & ~0x01, 0x21))) {
-                       printk(KERN_ERR "Error writing to I/O expander\n");
-                       return err;
-               }
-       }
-       return err;
-}
-
-static void set_trans_mode(struct work_struct *work)
-{
-       struct omap_irda_config *irda_config =
-               container_of(work, struct omap_irda_config, gpio_expa.work);
-       int mode = irda_config->mode;
-       unsigned char expa;
-       int err = 0;
-
-       if ((err = read_gpio_expa(&expa, 0x20)) != 0) {
-               printk(KERN_ERR "Error reading from I/O expander\n");
-       }
-
-       expa &= ~0x01;
-
-       if (!(mode & IR_SIRMODE)) { /* MIR/FIR */
-               expa |= 0x01;
-       }
-
-       if ((err = write_gpio_expa(expa, 0x20)) != 0) {
-               printk(KERN_ERR "Error writing to I/O expander\n");
-       }
-}
-
-static int h4_transceiver_mode(struct device *dev, int mode)
-{
-       struct omap_irda_config *irda_config = dev->platform_data;
-
-       irda_config->mode = mode;
-       cancel_delayed_work(&irda_config->gpio_expa);
-       PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
-       schedule_delayed_work(&irda_config->gpio_expa, 0);
-
-       return 0;
-}
-
-static struct omap_irda_config h4_irda_data = {
-       .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
-       .transceiver_mode       = h4_transceiver_mode,
-       .select_irda            = h4_select_irda,
-       .rx_channel             = OMAP24XX_DMA_UART3_RX,
-       .tx_channel             = OMAP24XX_DMA_UART3_TX,
-       .dest_start             = OMAP_UART3_BASE,
-       .src_start              = OMAP_UART3_BASE,
-       .tx_trigger             = OMAP24XX_DMA_UART3_TX,
-       .rx_trigger             = OMAP24XX_DMA_UART3_RX,
-};
-
-static struct resource h4_irda_resources[] = {
-       [0] = {
-               .start  = INT_24XX_UART3_IRQ,
-               .end    = INT_24XX_UART3_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device h4_irda_device = {
-       .name           = "omapirda",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &h4_irda_data,
-       },
-       .num_resources  = 1,
-       .resource       = h4_irda_resources,
-};
-
 static struct omap_kp_platform_data h4_kp_data = {
        .rows           = 6,
        .cols           = 7,
@@ -255,7 +161,6 @@ static struct platform_device h4_lcd_device = {
 
 static struct platform_device *h4_devices[] __initdata = {
        &h4_flash_device,
-       &h4_irda_device,
        &h4_kp_device,
        &h4_lcd_device,
 };
index 3a0daac6c8396740e10eca560514989c902596a6..374ff63c3eb2d0cc4d55d8b49f85c9413b8df6d1 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-#include <linux/delay.h>
 #include <linux/gpio.h>
 
 #include <mach/hardware.h>
index 15e509013def69cda9cf2ff4d431e70868d676c0..8df55f40f4c014b8bd44b2fc79e54ff46f485095 100644 (file)
@@ -187,7 +187,7 @@ int tusb6010_platform_retime(unsigned is_refclk)
        unsigned        sysclk_ps;
        int             status;
 
-       if (!refclk_psec)
+       if (!refclk_psec || sysclk_ps == 0)
                return -ENODEV;
 
        sysclk_ps = is_refclk ? refclk_psec : TUSB6010_OSCCLK_60;
index 21cc0142b97ad25293706acbb027fc32aa34d28b..9c71cbb498c90aaa1ad4b289a22a3b8f630d0872 100644 (file)
@@ -2424,6 +2424,19 @@ static int __init omap_init_dma(void)
        if (cpu_class_is_omap2())
                setup_irq(INT_24XX_SDMA_IRQ0, &omap24xx_dma_irq);
 
+       /* Enable smartidle idlemodes and autoidle */
+       if (cpu_is_omap34xx()) {
+               u32 v = dma_read(OCP_SYSCONFIG);
+               v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK |
+                               DMA_SYSCONFIG_SIDLEMODE_MASK |
+                               DMA_SYSCONFIG_AUTOIDLE);
+               v |= (DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
+                       DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
+                       DMA_SYSCONFIG_AUTOIDLE);
+               dma_write(v , OCP_SYSCONFIG);
+       }
+
+
        /* FIXME: Update LCD DMA to work on 24xx */
        if (cpu_class_is_omap1()) {
                r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
index d3fa41e3d8c5a79235eb687dc4dc9ae92f330b77..210a1c04555488cf9d4d39856557b9caac029b53 100644 (file)
@@ -921,13 +921,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
        case METHOD_MPUIO:
        case METHOD_GPIO_1610:
                spin_lock_irqsave(&bank->lock, flags);
-               if (enable) {
+               if (enable)
                        bank->suspend_wakeup |= (1 << gpio);
-                       enable_irq_wake(bank->irq);
-               } else {
-                       disable_irq_wake(bank->irq);
+               else
                        bank->suspend_wakeup &= ~(1 << gpio);
-               }
                spin_unlock_irqrestore(&bank->lock, flags);
                return 0;
 #endif
@@ -940,13 +937,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
                        return -EINVAL;
                }
                spin_lock_irqsave(&bank->lock, flags);
-               if (enable) {
+               if (enable)
                        bank->suspend_wakeup |= (1 << gpio);
-                       enable_irq_wake(bank->irq);
-               } else {
-                       disable_irq_wake(bank->irq);
+               else
                        bank->suspend_wakeup &= ~(1 << gpio);
-               }
                spin_unlock_irqrestore(&bank->lock, flags);
                return 0;
 #endif
index 54fe9665b1826f674b761685d443f54c48567864..224b0770ec2dcd41e461aadf49df797731153f30 100644 (file)
 #define DMA_THREAD_FIFO_25             (0x02 << 14)
 #define DMA_THREAD_FIFO_50             (0x03 << 14)
 
+/* DMA4_OCP_SYSCONFIG bits */
+#define DMA_SYSCONFIG_MIDLEMODE_MASK           (3 << 12)
+#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK       (3 << 8)
+#define DMA_SYSCONFIG_EMUFREE                  (1 << 5)
+#define DMA_SYSCONFIG_SIDLEMODE_MASK           (3 << 3)
+#define DMA_SYSCONFIG_SOFTRESET                        (1 << 2)
+#define DMA_SYSCONFIG_AUTOIDLE                 (1 << 0)
+
+#define DMA_SYSCONFIG_MIDLEMODE(n)             ((n) << 12)
+#define DMA_SYSCONFIG_SIDLEMODE(n)             ((n) << 3)
+
+#define DMA_IDLEMODE_SMARTIDLE                 0x2
+#define DMA_IDLEMODE_NO_IDLE                   0x1
+#define DMA_IDLEMODE_FORCE_IDLE                        0x0
+
 /* Chaining modes*/
 #ifndef CONFIG_ARCH_OMAP1
 #define OMAP_DMA_STATIC_CHAIN          0x1
diff --git a/arch/arm/plat-omap/include/mach/gpioexpander.h b/arch/arm/plat-omap/include/mach/gpioexpander.h
deleted file mode 100644 (file)
index 90444a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/gpioexpander.h
- *
- *
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H
-#define __ASM_ARCH_OMAP_GPIOEXPANDER_H
-
-/* Function Prototypes for GPIO Expander functions */
-
-#ifdef CONFIG_GPIOEXPANDER_OMAP
-int read_gpio_expa(u8 *, int);
-int write_gpio_expa(u8 , int);
-#else
-static inline int read_gpio_expa(u8 *val, int addr)
-{
-       return 0;
-}
-static inline int write_gpio_expa(u8 val, int addr)
-{
-       return 0;
-}
-#endif
-
-#endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */
index 8372a00d8e0badb3e4da7a631f03011655d11dc3..40f60339d1c6fbaf8c84109758d46f0b7b933ac3 100644 (file)
@@ -21,10 +21,6 @@ struct omap_irda_config {
        int transceiver_cap;
        int (*transceiver_mode)(struct device *dev, int mode);
        int (*select_irda)(struct device *dev, int state);
-       /* Very specific to the needs of some platforms (h3,h4)
-        * having calls which can sleep in irda_set_speed.
-        */
-       struct delayed_work gpio_expa;
        int rx_channel;
        int tx_channel;
        unsigned long dest_start;
index 4435bd434e179b995adfbec2944ac24436aa6119..81d5b36534b340680ffc36fde156e9cafbb70e2d 100644 (file)
@@ -79,7 +79,6 @@ struct omap_mmc_platform_data {
 
                /* use the internal clock */
                unsigned internal_clock:1;
-               s16 power_pin;
 
                int switch_pin;                 /* gpio (card detect) */
                int gpio_wp;                    /* gpio (write protect) */
index ece0125a1ee520710f1e4ac18cd7b8eea83f0422..9919c086ff5d8188edb034ec2b578bf8bce64932 100644 (file)
@@ -672,8 +672,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
                                if (stat & OMAP_I2C_STAT_RRDY)
                                        num_bytes = dev->fifo_size;
                                else
-                                       num_bytes = omap_i2c_read_reg(dev,
-                                                       OMAP_I2C_BUFSTAT_REG);
+                                       num_bytes = (omap_i2c_read_reg(dev,
+                                                       OMAP_I2C_BUFSTAT_REG)
+                                                       >> 8) & 0x3F;
                        }
                        while (num_bytes) {
                                num_bytes--;
@@ -711,8 +712,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
                                if (stat & OMAP_I2C_STAT_XRDY)
                                        num_bytes = dev->fifo_size;
                                else
-                                       num_bytes = omap_i2c_read_reg(dev,
-                                                       OMAP_I2C_BUFSTAT_REG);
+                                       num_bytes = (omap_i2c_read_reg(dev,
+                                                       OMAP_I2C_BUFSTAT_REG))
+                                                       & 0x3F;
                        }
                        while (num_bytes) {
                                num_bytes--;
index 5570849188cc806032cab4791ab3ce10706a51f2..bfa25c01c8722f17684520b1ab3adfee9bdef193 100644 (file)
@@ -157,8 +157,6 @@ struct mmc_omap_host {
        struct timer_list       dma_timer;
        unsigned                dma_len;
 
-       short                   power_pin;
-
        struct mmc_omap_slot    *slots[OMAP_MMC_MAX_SLOTS];
        struct mmc_omap_slot    *current_slot;
        spinlock_t              slot_lock;