]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge source.mvista.com:/home/git/linux-omap-2.6 v2.6.17-omap1
authorTony Lindgren <tony@atomide.com>
Tue, 4 Jul 2006 08:50:23 +0000 (01:50 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 4 Jul 2006 08:50:23 +0000 (01:50 -0700)
drivers/input/touchscreen/ads7846.c
drivers/pcmcia/omap_cf.c
drivers/usb/host/ohci-omap.c
sound/arm/omap/omap-alsa-aic23.c

index 436984532d486e31afdaf434581d1a98e6ac294d..4ec7875705206e33a9e0bb70e1a3f17293b8ad9c 100644 (file)
@@ -472,7 +472,8 @@ static void ads7846_debounce(void *ads)
        m = &ts->msg[ts->msg_idx];
        t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
        val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff;
-       if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) {
+       if (ts->debounce_max && (
+           !ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol))) {
                /* Repeat it, if this was the first read or the read
                 * wasn't consistent enough. */
                if (ts->read_cnt < ts->debounce_max) {
@@ -702,14 +703,9 @@ static int __devinit ads7846_probe(struct spi_device *spi)
        ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
        ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
        ts->pressure_max = pdata->pressure_max ? : ~0;
-       if (pdata->debounce_max) {
-               ts->debounce_max = pdata->debounce_max;
-               ts->debounce_tol = pdata->debounce_tol;
-               ts->debounce_rep = pdata->debounce_rep;
-               if (ts->debounce_rep > ts->debounce_max + 1)
-                       ts->debounce_rep = ts->debounce_max - 1;
-       } else
-               ts->debounce_tol = ~0;
+       ts->debounce_max = pdata->debounce_max;
+       ts->debounce_tol = pdata->debounce_tol;
+       ts->debounce_rep = pdata->debounce_rep;
        ts->get_pendown_state = pdata->get_pendown_state;
 
        snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
index 0fbcb7358f035a1d443e09eb4223e1c148f05b3d..df604b3a0a1acc434bd94c1a8a9ac201311cdb69 100644 (file)
@@ -203,7 +203,7 @@ static struct pccard_operations omap_cf_ops = {
  * "what chipselect is used".  Boards could want more.
  */
 
-static int __init omap_cf_probe(struct device *dev)
+static int __devinit omap_cf_probe(struct device *dev)
 {
        unsigned                seg;
        struct omap_cf_socket   *cf;
index b17f8f22ffa147f22f7bd6b35c66e4ca3a2e329c..7c3b46185d718d8c7395e642e7daa851543620b4 100644 (file)
@@ -4,7 +4,7 @@
  * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
  * (C) Copyright 2000-2005 David Brownell
  * (C) Copyright 2002 Hewlett-Packard Company
- * 
+ *
  * OMAP Bus Glue
  *
  * Modified for OMAP by Tony Lindgren <tony@atomide.com>
@@ -92,14 +92,14 @@ static int omap_ohci_transceiver_power(int on)
        if (on) {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
                        fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
-                               | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 
+                               | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
                        tps65010_set_gpio_out_value(GPIO1, LOW);
        } else {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
                        fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
-                               & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 
+                               & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
                        tps65010_set_gpio_out_value(GPIO1, HIGH);
@@ -127,8 +127,8 @@ static int omap_1510_local_bus_power(int on)
 /*
  * OMAP-1510 specific Local Bus initialization
  * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE.
- *       See also arch/mach-omap/memory.h for __virt_to_dma() and 
- *       __dma_to_virt() which need to match with the physical 
+ *       See also arch/mach-omap/memory.h for __virt_to_dma() and
+ *       __dma_to_virt() which need to match with the physical
  *       Local Bus address below.
  */
 static int omap_1510_local_bus_init(void)
@@ -136,7 +136,7 @@ static int omap_1510_local_bus_init(void)
        unsigned int tlb;
        unsigned long lbaddr, physaddr;
 
-       omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, 
+       omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4,
               OMAP1510_LB_CLOCK_DIV);
 
        /* Configure the Local Bus MMU table */
@@ -144,7 +144,7 @@ static int omap_1510_local_bus_init(void)
                lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET;
                physaddr = tlb * 0x00100000 + PHYS_OFFSET;
                omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H);
-               omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, 
+               omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc,
                       OMAP1510_LB_MMU_CAM_L);
                omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H);
                omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L);
@@ -183,13 +183,14 @@ static void start_hnp(struct ohci_hcd *ohci)
 
 /*-------------------------------------------------------------------------*/
 
-static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
+static int ohci_omap_init(struct usb_hcd *hcd)
 {
-       struct omap_usb_config  *config = pdev->dev.platform_data;
+       struct ohci_hcd         *ohci = hcd_to_ohci(hcd);
+       struct omap_usb_config  *config = hcd->self.controller->platform_data;
        int                     need_transceiver = (config->otg != 0);
        int                     ret;
 
-       dev_dbg(&pdev->dev, "starting USB Controller\n");
+       dev_dbg(hcd->self.controller, "starting USB Controller\n");
 
        if (config->otg) {
                ohci_to_hcd(ohci)->self.otg_port = config->otg;
@@ -210,7 +211,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
                if (ohci->transceiver) {
                        int     status = otg_set_host(ohci->transceiver,
                                                &ohci_to_hcd(ohci)->self);
-                       dev_dbg(&pdev->dev, "init %s transceiver, status %d\n",
+                       dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
                                        ohci->transceiver->label, status);
                        if (status) {
                                if (ohci->transceiver)
@@ -218,7 +219,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
                                return status;
                        }
                } else {
-                       dev_err(&pdev->dev, "can't find transceiver\n");
+                       dev_err(hcd->self.controller, "can't find transceiver\n");
                        return -ENODEV;
                }
        }
@@ -274,17 +275,15 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
        return 0;
 }
 
-static void omap_stop_hc(struct platform_device *pdev)
+static void ohci_omap_stop(struct usb_hcd *hcd)
 {
-       dev_dbg(&pdev->dev, "stopping USB Controller\n");
+       dev_dbg(hcd->self.controller, "stopping USB Controller\n");
        omap_ohci_clock_power(0);
 }
 
 
 /*-------------------------------------------------------------------------*/
 
-void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *);
-
 /**
  * usb_hcd_omap_probe - initialize OMAP-based HCDs
  * Context: !in_interrupt()
@@ -293,7 +292,7 @@ void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *);
  * then invokes the start() method for the HCD associated with it
  * through the hotplug entry's driver_data.
  */
-int usb_hcd_omap_probe (const struct hc_driver *driver,
+static int usb_hcd_omap_probe (const struct hc_driver *driver,
                          struct platform_device *pdev)
 {
        int retval, irq;
@@ -301,12 +300,12 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
        struct ohci_hcd *ohci;
 
        if (pdev->num_resources != 2) {
-               printk(KERN_ERR "hcd probe: invalid num_resources: %i\n", 
+               printk(KERN_ERR "hcd probe: invalid num_resources: %i\n",
                       pdev->num_resources);
                return -ENODEV;
        }
 
-       if (pdev->resource[0].flags != IORESOURCE_MEM 
+       if (pdev->resource[0].flags != IORESOURCE_MEM
                        || pdev->resource[1].flags != IORESOURCE_IRQ) {
                printk(KERN_ERR "hcd probe: invalid resource type\n");
                return -ENODEV;
@@ -349,10 +348,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
        host_initialized = 0;
        host_enabled = 1;
 
-       retval = omap_start_hc(ohci, pdev);
-       if (retval < 0)
-               goto err2;
-
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                retval = -ENXIO;
@@ -360,7 +355,7 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
        }
        retval = usb_add_hcd(hcd, irq, SA_INTERRUPT);
        if (retval)
-               goto err3;
+               goto err2;
 
        host_initialized = 1;
 
@@ -368,8 +363,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
                omap_ohci_clock_power(0);
 
        return 0;
-err3:
-       omap_stop_hc(pdev);
 err2:
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 err1:
@@ -391,14 +384,19 @@ err0:
  * Reverses the effect of usb_hcd_omap_probe(), first invoking
  * the HCD's stop() method.  It is always called from a thread
  * context, normally "rmmod", "apmd", or something similar.
- *
  */
-void usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
+static inline void
+usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
 {
+       struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
+
        usb_remove_hcd(hcd);
+       if (ohci->transceiver) {
+               (void) otg_set_host(ohci->transceiver, 0);
+               put_device(ohci->transceiver->dev);
+       }
        if (machine_is_omap_osk())
                omap_free_gpio(9);
-       omap_stop_hc(pdev);
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
        usb_put_hcd(hcd);
        clk_put(usb_dc_ck);
@@ -444,8 +442,9 @@ static const struct hc_driver ohci_omap_hc_driver = {
        /*
         * basic lifecycle operations
         */
+       .reset =                ohci_omap_init,
        .start =                ohci_omap_start,
-       .stop =                 ohci_stop,
+       .stop =                 ohci_omap_stop,
 
        /*
         * managing i/o requests and associated device resources
@@ -481,13 +480,8 @@ static int ohci_hcd_omap_drv_probe(struct platform_device *dev)
 static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
 {
        struct usb_hcd          *hcd = platform_get_drvdata(dev);
-       struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
 
        usb_hcd_omap_remove(hcd, dev);
-       if (ohci->transceiver) {
-               (void) otg_set_host(ohci->transceiver, 0);
-               put_device(ohci->transceiver->dev);
-       }
        platform_set_drvdata(dev, NULL);
 
        return 0;
index 293c2d467c472f303a8700dfb0d5cb73a9b49184..b48396176ed89ee679c19b6023e11a5640c11785 100644 (file)
@@ -271,7 +271,7 @@ int aic23_get_default_samplerate(void)
        return DEFAULT_SAMPLE_RATE;
 }
 
-static int __init snd_omap_alsa_aic23_probe(struct platform_device *pdev)
+static int __devinit snd_omap_alsa_aic23_probe(struct platform_device *pdev)
 {
        int     ret;
        struct  omap_alsa_codec_config *codec_cfg;