Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
authorIliyan Malchev <malchev@google.com>
Fri, 5 Nov 2010 20:41:17 +0000 (13:41 -0700)
committerIliyan Malchev <malchev@google.com>
Fri, 5 Nov 2010 21:01:35 +0000 (14:01 -0700)
Conflicts:
arch/arm/mach-tegra/tegra_i2s_audio.c
arch/arm/mach-tegra/tegra_spdif_audio.c

Signed-off-by: Iliyan Malchev <malchev@google.com>
1  2 
arch/arm/mach-tegra/tegra_i2s_audio.c
arch/arm/mach-tegra/tegra_spdif_audio.c

index 9ac5cba7cd8c96be2ba3270a1e64394131b28cc2,d62bf234259190f87040464c416df0daedb06422..f8a67f1e2043aec7c91d15e49276068d4b0cd73e
@@@ -91,8 -92,7 +93,9 @@@ struct audio_stream 
        struct tegra_dma_req dma_req;
  
        struct pm_qos_request_list pm_qos;
+       struct work_struct allow_suspend_work;
 +      struct wake_lock wake_lock;
 +      char wake_lock_name[100];
  };
  
  struct i2s_pio_stats {
@@@ -221,17 -221,24 +224,26 @@@ static inline struct audio_driver_stat
  static inline void prevent_suspend(struct audio_stream *as)
  {
        pr_debug("%s\n", __func__);
+       cancel_work_sync(&as->allow_suspend_work);
 +      wake_lock(&as->wake_lock);
        pm_qos_update_request(&as->pm_qos, 0);
  }
  
- static inline void allow_suspend(struct audio_stream *as)
+ static void allow_suspend_worker(struct work_struct *w)
  {
+       struct audio_stream *as = container_of(w,
+                       struct audio_stream, allow_suspend_work);
        pr_debug("%s\n", __func__);
        pm_qos_update_request(&as->pm_qos, PM_QOS_DEFAULT_VALUE);
 +      wake_unlock(&as->wake_lock);
  }
  
+ static inline void allow_suspend(struct audio_stream *as)
+ {
+       schedule_work(&as->allow_suspend_work);
+ }
  #define I2S_I2S_FIFO_TX_BUSY  I2S_I2S_STATUS_FIFO1_BSY
  #define I2S_I2S_FIFO_TX_QS    I2S_I2S_STATUS_QS_FIFO1
  #define I2S_I2S_FIFO_TX_ERR   I2S_I2S_STATUS_FIFO1_ERR
index bd99440a0188aa2a3b7dcbfef3fa3817e4f129f9,1c22e4537876b0b751e26a672d44783b049d77f9..fd96f2abf5ebf46f00da1442a675599ee7fadf79
  #include <linux/ktime.h>
  #include <linux/sysfs.h>
  #include <linux/pm_qos_params.h>
 +#include <linux/wakelock.h>
  #include <linux/delay.h>
  #include <linux/tegra_audio.h>
+ #include <linux/workqueue.h>
  
  #include <mach/dma.h>
  #include <mach/iomap.h>
@@@ -89,8 -89,7 +90,9 @@@ struct audio_stream 
        struct tegra_dma_req dma_req;
  
        struct pm_qos_request_list pm_qos;
+       struct work_struct allow_suspend_work;
 +      struct wake_lock wake_lock;
 +      char wake_lock_name[100];
  };
  
  struct spdif_pio_stats {
@@@ -165,17 -164,24 +167,26 @@@ static inline struct audio_driver_stat
  static inline void prevent_suspend(struct audio_stream *as)
  {
        pr_debug("%s\n", __func__);
+       cancel_work_sync(&as->allow_suspend_work);
 +      wake_lock(&as->wake_lock);
        pm_qos_update_request(&as->pm_qos, 0);
  }
  
- static inline void allow_suspend(struct audio_stream *as)
+ static void allow_suspend_worker(struct work_struct *w)
  {
+       struct audio_stream *as = container_of(w,
+                       struct audio_stream, allow_suspend_work);
        pr_debug("%s\n", __func__);
        pm_qos_update_request(&as->pm_qos, PM_QOS_DEFAULT_VALUE);
 +      wake_unlock(&as->wake_lock);
  }
  
+ static inline void allow_suspend(struct audio_stream *as)
+ {
+       schedule_work(&as->allow_suspend_work);
+ }
  #define I2S_I2S_FIFO_TX_BUSY  I2S_I2S_STATUS_FIFO1_BSY
  #define I2S_I2S_FIFO_TX_QS    I2S_I2S_STATUS_QS_FIFO1
  #define I2S_I2S_FIFO_TX_ERR   I2S_I2S_STATUS_FIFO1_ERR
@@@ -1344,12 -1348,9 +1355,13 @@@ static int tegra_spdif_probe(struct pla
        if (rc < 0)
                return rc;
  
+       INIT_WORK(&state->out.allow_suspend_work, allow_suspend_worker);
        pm_qos_add_request(&state->out.pm_qos, PM_QOS_CPU_DMA_LATENCY,
                                PM_QOS_DEFAULT_VALUE);
 +      snprintf(state->out.wake_lock_name, sizeof(state->out.wake_lock_name),
 +              "tegra-audio-spdif");
 +      wake_lock_init(&state->out.wake_lock, WAKE_LOCK_SUSPEND,
 +                      state->out.wake_lock_name);
  
        if (request_irq(state->irq, spdif_interrupt,
                        IRQF_DISABLED, state->pdev->name, state) < 0) {