Merge branch 'pandora-27-omap1' into pandora-27-omap1_rework
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 7 May 2010 14:03:11 +0000 (17:03 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 7 May 2010 14:03:11 +0000 (17:03 +0300)
1  2 
drivers/acpi/thermal.c
drivers/misc/Kconfig
drivers/mmc/core/core.c
drivers/usb/musb/Kconfig
drivers/usb/musb/musb_core.c
sound/soc/omap/omap-pcm.c

diff --combined drivers/acpi/thermal.c
@@@ -246,18 -246,18 +246,18 @@@ static const struct file_operations acp
  static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
  {
        acpi_status status = AE_OK;
 -
 +      unsigned long long tmp;
  
        if (!tz)
                return -EINVAL;
  
        tz->last_temperature = tz->temperature;
  
 -      status =
 -          acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature);
 +      status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp);
        if (ACPI_FAILURE(status))
                return -ENODEV;
  
 +      tz->temperature = tmp;
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
                          tz->temperature));
  
  static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
  {
        acpi_status status = AE_OK;
 -
 +      unsigned long long tmp;
  
        if (!tz)
                return -EINVAL;
  
 -      status =
 -          acpi_evaluate_integer(tz->device->handle, "_TZP", NULL,
 -                                &tz->polling_frequency);
 +      status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp);
        if (ACPI_FAILURE(status))
                return -ENODEV;
  
 +      tz->polling_frequency = tmp;
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
                          tz->polling_frequency));
  
@@@ -355,7 -356,6 +355,7 @@@ do {       
  static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
  {
        acpi_status status = AE_OK;
 +      unsigned long long tmp;
        struct acpi_handle_list devices;
        int valid = 0;
        int i;
        /* Critical Shutdown (required) */
        if (flag & ACPI_TRIPS_CRITICAL) {
                status = acpi_evaluate_integer(tz->device->handle,
 -                              "_CRT", NULL, &tz->trips.critical.temperature);
 +                              "_CRT", NULL, &tmp);
 +              tz->trips.critical.temperature = tmp;
                /*
                 * Treat freezing temperatures as invalid as well; some
                 * BIOSes return really low values and cause reboots at startup.
-                * Below zero (Celcius) values clearly aren't right for sure..
+                * Below zero (Celsius) values clearly aren't right for sure..
                 * ... so lets discard those as invalid.
                 */
                if (ACPI_FAILURE(status) ||
        /* Critical Sleep (optional) */
        if (flag & ACPI_TRIPS_HOT) {
                status = acpi_evaluate_integer(tz->device->handle,
 -                              "_HOT", NULL, &tz->trips.hot.temperature);
 +                              "_HOT", NULL, &tmp);
                if (ACPI_FAILURE(status)) {
                        tz->trips.hot.flags.valid = 0;
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                        "No hot threshold\n"));
                } else {
 +                      tz->trips.hot.temperature = tmp;
                        tz->trips.hot.flags.valid = 1;
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                        "Found hot threshold [%lu]\n",
                if (psv == -1) {
                        status = AE_SUPPORT;
                } else if (psv > 0) {
 -                      tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv);
 +                      tmp = CELSIUS_TO_KELVIN(psv);
                        status = AE_OK;
                } else {
                        status = acpi_evaluate_integer(tz->device->handle,
 -                              "_PSV", NULL, &tz->trips.passive.temperature);
 +                              "_PSV", NULL, &tmp);
                }
  
                if (ACPI_FAILURE(status))
                        tz->trips.passive.flags.valid = 0;
                else {
 +                      tz->trips.passive.temperature = tmp;
                        tz->trips.passive.flags.valid = 1;
                        if (flag == ACPI_TRIPS_INIT) {
                                status = acpi_evaluate_integer(
                                                tz->device->handle, "_TC1",
 -                                              NULL, &tz->trips.passive.tc1);
 +                                              NULL, &tmp);
                                if (ACPI_FAILURE(status))
                                        tz->trips.passive.flags.valid = 0;
 +                              else
 +                                      tz->trips.passive.tc1 = tmp;
                                status = acpi_evaluate_integer(
                                                tz->device->handle, "_TC2",
 -                                              NULL, &tz->trips.passive.tc2);
 +                                              NULL, &tmp);
                                if (ACPI_FAILURE(status))
                                        tz->trips.passive.flags.valid = 0;
 +                              else
 +                                      tz->trips.passive.tc2 = tmp;
                                status = acpi_evaluate_integer(
                                                tz->device->handle, "_TSP",
 -                                              NULL, &tz->trips.passive.tsp);
 +                                              NULL, &tmp);
                                if (ACPI_FAILURE(status))
                                        tz->trips.passive.flags.valid = 0;
 +                              else
 +                                      tz->trips.passive.tsp = tmp;
                        }
                }
        }
  
                if (flag & ACPI_TRIPS_ACTIVE) {
                        status = acpi_evaluate_integer(tz->device->handle,
 -                              name, NULL, &tz->trips.active[i].temperature);
 +                                                      name, NULL, &tmp);
                        if (ACPI_FAILURE(status)) {
                                tz->trips.active[i].flags.valid = 0;
                                if (i == 0)
                                                tz->trips.active[i - 2].temperature :
                                                CELSIUS_TO_KELVIN(act));
                                break;
 -                      } else
 +                      } else {
 +                              tz->trips.active[i].temperature = tmp;
                                tz->trips.active[i].flags.valid = 1;
 +                      }
                }
  
                name[2] = 'L';
diff --combined drivers/misc/Kconfig
@@@ -321,7 -321,6 +321,7 @@@ config THINKPAD_ACPI_DOC
        bool "Legacy Docking Station Support"
        depends on THINKPAD_ACPI
        depends on ACPI_DOCK=n
 +      depends on BROKEN
        default n
        ---help---
          Allows the thinkpad_acpi driver to handle docking station events.
  config THINKPAD_ACPI_BAY
        bool "Legacy Removable Bay Support"
        depends on THINKPAD_ACPI
 -      default y
 +      depends on BROKEN
 +      default n
        ---help---
          Allows the thinkpad_acpi driver to handle removable bays.  It will
          electrically disable the device in the bay, and also generate
@@@ -439,6 -437,12 +439,12 @@@ config ENCLOSURE_SERVICE
          driver (SCSI/ATA) which supports enclosures
          or a SCSI enclosure device (SES) to use these services.
  
+ config PANDORA_GAME_CONSOLE
+       tristate "Pandora Game Console additional hardware control"
+       depends on MACH_OMAP3_PANDORA
+       ---help---
+       Currently only exports some stuff through /proc/pandora.
  config SGI_XP
        tristate "Support communication between SGI SSIs"
        depends on NET
diff --combined drivers/mmc/core/core.c
@@@ -280,11 -280,7 +280,11 @@@ void mmc_set_data_timeout(struct mmc_da
                        (card->host->ios.clock / 1000);
  
                if (data->flags & MMC_DATA_WRITE)
 -                      limit_us = 250000;
 +                      /*
 +                       * The limit is really 250 ms, but that is
 +                       * insufficient for some crappy cards.
 +                       */
 +                      limit_us = 300000;
                else
                        limit_us = 100000;
  
@@@ -816,6 -812,22 +816,22 @@@ EXPORT_SYMBOL(mmc_resume_host)
  
  #endif
  
+ #ifdef CONFIG_MMC_EMBEDDED_SDIO
+ void mmc_set_embedded_sdio_data(struct mmc_host *host,
+                               struct sdio_cis *cis,
+                               struct sdio_cccr *cccr,
+                               struct sdio_embedded_func *funcs,
+                               int num_funcs)
+ {
+       host->embedded_sdio_data.cis = cis;
+       host->embedded_sdio_data.cccr = cccr;
+       host->embedded_sdio_data.funcs = funcs;
+       host->embedded_sdio_data.num_funcs = num_funcs;
+ }
+ EXPORT_SYMBOL(mmc_set_embedded_sdio_data);
+ #endif
  static int __init mmc_init(void)
  {
        int ret;
diff --combined drivers/usb/musb/Kconfig
@@@ -33,6 -33,10 +33,6 @@@ config USB_MUSB_SO
        default y if ARCH_DAVINCI
        default y if ARCH_OMAP2430
        default y if ARCH_OMAP34XX
 -      help
 -        Use a static <asm/arch/hdrc_cnf.h> file to describe how the
 -        controller is configured (endpoints, mechanisms, etc) on the
 -        current iteration of a given system-on-chip.
  
  comment "DaVinci 644x USB support"
        depends on USB_MUSB_HDRC && ARCH_DAVINCI
@@@ -85,7 -89,7 +85,7 @@@ config USB_MUSB_PERIPHERA
          (With a "Mini-AB" connector, you should enable USB OTG.)
  
  config USB_MUSB_OTG
-       depends on USB && USB_GADGET && PM && EXPERIMENTAL
+       depends on USB && USB_GADGET && EXPERIMENTAL
        bool "Both host and peripheral:  USB OTG (On The Go) Device"
        select USB_GADGET_MUSB_HDRC
        select USB_OTG
@@@ -82,9 -82,9 +82,9 @@@
  /*
   * This gets many kinds of configuration information:
   *    - Kconfig for everything user-configurable
 - *    - <asm/arch/hdrc_cnf.h> for SOC or family details
   *    - platform_device for addressing, irq, and platform_data
   *    - platform_data is mostly for board-specific informarion
 + *      (plus recentrly, SOC or family details)
   *
   * Most of the conditional compilation will (someday) vanish.
   */
@@@ -968,15 -968,27 +968,27 @@@ static void musb_shutdown(struct platfo
        /* FIXME power down */
  }
  
+ /* HACK */
+ struct musb *g_musb;
+ extern void musb_kick_host(void)
+ {
+       unsigned long   flags;
+       if (g_musb) {
+               spin_lock_irqsave(&g_musb->lock, flags);
+               musb_platform_set_mode(g_musb, MUSB_HOST);
+               spin_unlock_irqrestore(&g_musb->lock, flags);
+       }
+ }
  
  /*-------------------------------------------------------------------------*/
  
  /*
   * The silicon either has hard-wired endpoint configurations, or else
   * "dynamic fifo" sizing.  The driver has support for both, though at this
 - * writing only the dynamic sizing is very well tested.   We use normal
 - * idioms to so both modes are compile-tested, but dead code elimination
 - * leaves only the relevant one in the object file.
 + * writing only the dynamic sizing is very well tested.   Since we switched
 + * away from compile-time hardware parameters, we can no longer rely on
 + * dead code elimination to leave only the relevant one in the object file.
   *
   * We don't currently use dynamic fifo setup capability to do anything
   * more than selecting one of a bunch of predefined configurations.
@@@ -2054,15 -2066,6 +2066,6 @@@ bad_config
  
        }
  
-       return 0;
- fail:
-       if (musb->clock)
-               clk_put(musb->clock);
-       device_init_wakeup(dev, 0);
-       musb_free(musb);
-       return status;
  #ifdef CONFIG_SYSFS
        status = device_create_file(dev, &dev_attr_mode);
        status = device_create_file(dev, &dev_attr_vbus);
  #endif /* CONFIG_USB_GADGET_MUSB_HDRC */
        status = 0;
  #endif
+       if (status)
+               goto fail2;
  
-       return status;
+       /* HACK */
+       g_musb = musb;
+       return 0;
  
  fail2:
+ #ifdef CONFIG_SYSFS
+       device_remove_file(musb->controller, &dev_attr_mode);
+       device_remove_file(musb->controller, &dev_attr_vbus);
+ #ifdef CONFIG_USB_MUSB_OTG
+       device_remove_file(musb->controller, &dev_attr_srp);
+ #endif
+ #endif
        musb_platform_exit(musb);
-       goto fail;
+ fail:
+       dev_err(musb->controller,
+               "musb_init_controller failed with status %d\n", status);
+       if (musb->clock)
+               clk_put(musb->clock);
+       device_init_wakeup(dev, 0);
+       musb_free(musb);
+       return status;
  }
  
  /*-------------------------------------------------------------------------*/
@@@ -97,7 -97,7 +97,7 @@@ static int omap_pcm_hw_params(struct sn
        prtd->dma_data = dma_data;
        err = omap_request_dma(dma_data->dma_req, dma_data->name,
                               omap_pcm_dma_irq, substream, &prtd->dma_ch);
-       if (!cpu_is_omap1510()) {
+       if (!err & !cpu_is_omap1510()) {
                /*
                 * Link channel with itself so DMA doesn't need any
                 * reprogramming while looping the buffer
@@@ -147,12 -147,14 +147,14 @@@ static int omap_pcm_prepare(struct snd_
                dma_params.src_or_dst_synch     = OMAP_DMA_DST_SYNC;
                dma_params.src_start            = runtime->dma_addr;
                dma_params.dst_start            = dma_data->port_addr;
+               dma_params.dst_port             = OMAP_DMA_PORT_MPUI;
        } else {
                dma_params.src_amode            = OMAP_DMA_AMODE_CONSTANT;
                dma_params.dst_amode            = OMAP_DMA_AMODE_POST_INC;
                dma_params.src_or_dst_synch     = OMAP_DMA_SRC_SYNC;
                dma_params.src_start            = dma_data->port_addr;
                dma_params.dst_start            = runtime->dma_addr;
+               dma_params.src_port             = OMAP_DMA_PORT_MPUI;
        }
        /*
         * Set DMA transfer frame size equal to ALSA period size and frame
@@@ -231,7 -233,7 +233,7 @@@ static int omap_pcm_open(struct snd_pcm
        if (ret < 0)
                goto out;
  
 -      prtd = kzalloc(sizeof(prtd), GFP_KERNEL);
 +      prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
        if (prtd == NULL) {
                ret = -ENOMEM;
                goto out;