From 13c25be35e5527ae9833fe17da54d9c022e2c9e8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 2 Dec 2011 14:03:57 -0800 Subject: [PATCH] 3.1 patches added patches: alsa-hda-fix-jack-detection-control-of-vt1708.patch alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch alsa-lx6464es-fix-device-communication-via-command-bus.patch arm-7161-1-errata-no-automatic-store-buffer-drain.patch arm-mx28-fix-bit-operation-in-clock-setting.patch arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch arm-omap-smartreflex-fix-irq-handling-bug.patch arm-pxa-fix-inconsistent-config_usb_pxa27x.patch asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch asoc-sta32x-preserve-coefficient-ram.patch asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch --- ...fix-jack-detection-control-of-vt1708.patch | 202 ++++++++++++++++++ ...g-inits-of-item-indices-for-auto-mic.patch | 50 +++++ ...device-communication-via-command-bus.patch | 58 +++++ ...rata-no-automatic-store-buffer-drain.patch | 62 ++++++ ...8-fix-bit-operation-in-clock-setting.patch | 35 +++ ...ix-the-addr-space-irq-dma-count-apis.patch | 71 ++++++ ...voltage-layer-when-device-is-present.patch | 92 ++++++++ ...map-smartreflex-fix-irq-handling-bug.patch | 33 +++ ...ect-arm_amba-if-omap3_emu-is-defined.patch | 62 ++++++ ...a-fix-inconsistent-config_usb_pxa27x.patch | 157 ++++++++++++++ ...s-synced-when-resuming-from-disabled.patch | 26 +++ ...nitialize-the-sysfs-attribute-object.patch | 30 +++ ...asoc-sta32x-preserve-coefficient-ram.patch | 139 ++++++++++++ ...kip-noop-reconfiguration-of-dai-mode.patch | 39 ++++ queue-3.1/series | 14 ++ 15 files changed, 1070 insertions(+) create mode 100644 queue-3.1/alsa-hda-fix-jack-detection-control-of-vt1708.patch create mode 100644 queue-3.1/alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch create mode 100644 queue-3.1/alsa-lx6464es-fix-device-communication-via-command-bus.patch create mode 100644 queue-3.1/arm-7161-1-errata-no-automatic-store-buffer-drain.patch create mode 100644 queue-3.1/arm-mx28-fix-bit-operation-in-clock-setting.patch create mode 100644 queue-3.1/arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch create mode 100644 queue-3.1/arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch create mode 100644 queue-3.1/arm-omap-smartreflex-fix-irq-handling-bug.patch create mode 100644 queue-3.1/arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch create mode 100644 queue-3.1/arm-pxa-fix-inconsistent-config_usb_pxa27x.patch create mode 100644 queue-3.1/asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch create mode 100644 queue-3.1/asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch create mode 100644 queue-3.1/asoc-sta32x-preserve-coefficient-ram.patch create mode 100644 queue-3.1/asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch diff --git a/queue-3.1/alsa-hda-fix-jack-detection-control-of-vt1708.patch b/queue-3.1/alsa-hda-fix-jack-detection-control-of-vt1708.patch new file mode 100644 index 00000000000..bf920f57340 --- /dev/null +++ b/queue-3.1/alsa-hda-fix-jack-detection-control-of-vt1708.patch @@ -0,0 +1,202 @@ +From 187d333edc0a8e1bb507900ce89853ffe3bd2c84 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 24 Nov 2011 16:33:09 +0100 +Subject: ALSA: hda - Fix jack-detection control of VT1708 + +From: Takashi Iwai + +commit 187d333edc0a8e1bb507900ce89853ffe3bd2c84 upstream. + +VT1708 has no support for unsolicited events per jack-plug, the driver +implements the workq for polling the jack-detection. The mixer element +"Jack Detect" was supposed to control this behavior on/off, but this +doesn't work properly as is now. The workq is always started and the +HP automute is always enabled. + +This patch fixes the jack-detect control behavior by triggering / stopping +the work appropriately at the state change. Also the work checks the +internal state to continue scheduling or not. + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_via.c | 76 ++++++++++++++++++++++++++-------------------- + 1 file changed, 43 insertions(+), 33 deletions(-) + +--- a/sound/pci/hda/patch_via.c ++++ b/sound/pci/hda/patch_via.c +@@ -207,6 +207,7 @@ struct via_spec { + /* work to check hp jack state */ + struct hda_codec *codec; + struct delayed_work vt1708_hp_work; ++ int hp_work_active; + int vt1708_jack_detect; + int vt1708_hp_present; + +@@ -304,27 +305,35 @@ enum { + static void analog_low_current_mode(struct hda_codec *codec); + static bool is_aa_path_mute(struct hda_codec *codec); + +-static void vt1708_start_hp_work(struct via_spec *spec) ++#define hp_detect_with_aa(codec) \ ++ (snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1 && \ ++ !is_aa_path_mute(codec)) ++ ++static void vt1708_stop_hp_work(struct via_spec *spec) + { + if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) + return; +- snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, +- !spec->vt1708_jack_detect); +- if (!delayed_work_pending(&spec->vt1708_hp_work)) +- schedule_delayed_work(&spec->vt1708_hp_work, +- msecs_to_jiffies(100)); ++ if (spec->hp_work_active) { ++ snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 1); ++ cancel_delayed_work_sync(&spec->vt1708_hp_work); ++ spec->hp_work_active = 0; ++ } + } + +-static void vt1708_stop_hp_work(struct via_spec *spec) ++static void vt1708_update_hp_work(struct via_spec *spec) + { + if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) + return; +- if (snd_hda_get_bool_hint(spec->codec, "analog_loopback_hp_detect") == 1 +- && !is_aa_path_mute(spec->codec)) +- return; +- snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, +- !spec->vt1708_jack_detect); +- cancel_delayed_work_sync(&spec->vt1708_hp_work); ++ if (spec->vt1708_jack_detect && ++ (spec->active_streams || hp_detect_with_aa(spec->codec))) { ++ if (!spec->hp_work_active) { ++ snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 0); ++ schedule_delayed_work(&spec->vt1708_hp_work, ++ msecs_to_jiffies(100)); ++ spec->hp_work_active = 1; ++ } ++ } else if (!hp_detect_with_aa(spec->codec)) ++ vt1708_stop_hp_work(spec); + } + + static void set_widgets_power_state(struct hda_codec *codec) +@@ -342,12 +351,7 @@ static int analog_input_switch_put(struc + + set_widgets_power_state(codec); + analog_low_current_mode(snd_kcontrol_chip(kcontrol)); +- if (snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1) { +- if (is_aa_path_mute(codec)) +- vt1708_start_hp_work(codec->spec); +- else +- vt1708_stop_hp_work(codec->spec); +- } ++ vt1708_update_hp_work(codec->spec); + return change; + } + +@@ -1153,7 +1157,7 @@ static int via_playback_multi_pcm_prepar + spec->cur_dac_stream_tag = stream_tag; + spec->cur_dac_format = format; + mutex_unlock(&spec->config_mutex); +- vt1708_start_hp_work(spec); ++ vt1708_update_hp_work(spec); + return 0; + } + +@@ -1173,7 +1177,7 @@ static int via_playback_hp_pcm_prepare(s + spec->cur_hp_stream_tag = stream_tag; + spec->cur_hp_format = format; + mutex_unlock(&spec->config_mutex); +- vt1708_start_hp_work(spec); ++ vt1708_update_hp_work(spec); + return 0; + } + +@@ -1187,7 +1191,7 @@ static int via_playback_multi_pcm_cleanu + snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); + spec->active_streams &= ~STREAM_MULTI_OUT; + mutex_unlock(&spec->config_mutex); +- vt1708_stop_hp_work(spec); ++ vt1708_update_hp_work(spec); + return 0; + } + +@@ -1202,7 +1206,7 @@ static int via_playback_hp_pcm_cleanup(s + snd_hda_codec_setup_stream(codec, spec->hp_dac_nid, 0, 0, 0); + spec->active_streams &= ~STREAM_INDEP_HP; + mutex_unlock(&spec->config_mutex); +- vt1708_stop_hp_work(spec); ++ vt1708_update_hp_work(spec); + return 0; + } + +@@ -1632,7 +1636,8 @@ static void via_hp_automute(struct hda_c + int nums; + struct via_spec *spec = codec->spec; + +- if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0]) ++ if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0] && ++ (spec->codec_type != VT1708 || spec->vt1708_jack_detect)) + present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); + + if (spec->smart51_enabled) +@@ -2599,8 +2604,6 @@ static int vt1708_jack_detect_get(struct + + if (spec->codec_type != VT1708) + return 0; +- spec->vt1708_jack_detect = +- !((snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8) & 0x1); + ucontrol->value.integer.value[0] = spec->vt1708_jack_detect; + return 0; + } +@@ -2610,18 +2613,22 @@ static int vt1708_jack_detect_put(struct + { + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct via_spec *spec = codec->spec; +- int change; ++ int val; + + if (spec->codec_type != VT1708) + return 0; +- spec->vt1708_jack_detect = ucontrol->value.integer.value[0]; +- change = (0x1 & (snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8)) +- == !spec->vt1708_jack_detect; +- if (spec->vt1708_jack_detect) { ++ val = !!ucontrol->value.integer.value[0]; ++ if (spec->vt1708_jack_detect == val) ++ return 0; ++ spec->vt1708_jack_detect = val; ++ if (spec->vt1708_jack_detect && ++ snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") != 1) { + mute_aa_path(codec, 1); + notify_aa_path_ctls(codec); + } +- return change; ++ via_hp_automute(codec); ++ vt1708_update_hp_work(spec); ++ return 1; + } + + static const struct snd_kcontrol_new vt1708_jack_detect_ctl = { +@@ -2758,6 +2765,7 @@ static int via_init(struct hda_codec *co + via_auto_init_unsol_event(codec); + + via_hp_automute(codec); ++ vt1708_update_hp_work(spec); + + return 0; + } +@@ -2774,7 +2782,9 @@ static void vt1708_update_hp_jack_state( + spec->vt1708_hp_present ^= 1; + via_hp_automute(spec->codec); + } +- vt1708_start_hp_work(spec); ++ if (spec->vt1708_jack_detect) ++ schedule_delayed_work(&spec->vt1708_hp_work, ++ msecs_to_jiffies(100)); + } + + static int get_mux_nids(struct hda_codec *codec) diff --git a/queue-3.1/alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch b/queue-3.1/alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch new file mode 100644 index 00000000000..079e2f4aa72 --- /dev/null +++ b/queue-3.1/alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch @@ -0,0 +1,50 @@ +From 6759dc323826c2c806c998cd93945c5476688dd2 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 23 Nov 2011 07:38:59 +0100 +Subject: ALSA: hda/realtek - Fix missing inits of item indices for auto-mic + +From: Takashi Iwai + +commit 6759dc323826c2c806c998cd93945c5476688dd2 upstream. + +When the imux entries are rebuilt in alc_rebuild_imux_for_auto_mic(), +the initialization of index field is missing. It may work without it +casually when the original imux was created by the auto-parser, but +it's definitely broken in the case of static configs where no imux was +parsed beforehand. Because of this, the auto-mic switching doesn't +work properly on some model options. + +This patch adds the missing initialization of index field. + +Reported-by: Dmitry Nezhevenko +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -1023,8 +1023,20 @@ static bool alc_rebuild_imux_for_auto_mi + spec->imux_pins[2] = spec->dock_mic_pin; + for (i = 0; i < 3; i++) { + strcpy(imux->items[i].label, texts[i]); +- if (spec->imux_pins[i]) ++ if (spec->imux_pins[i]) { ++ hda_nid_t pin = spec->imux_pins[i]; ++ int c; ++ for (c = 0; c < spec->num_adc_nids; c++) { ++ hda_nid_t cap = spec->capsrc_nids ? ++ spec->capsrc_nids[c] : spec->adc_nids[c]; ++ int idx = get_connection_index(codec, cap, pin); ++ if (idx >= 0) { ++ imux->items[i].index = idx; ++ break; ++ } ++ } + imux->num_items = i + 1; ++ } + } + spec->num_mux_defs = 1; + spec->input_mux = imux; diff --git a/queue-3.1/alsa-lx6464es-fix-device-communication-via-command-bus.patch b/queue-3.1/alsa-lx6464es-fix-device-communication-via-command-bus.patch new file mode 100644 index 00000000000..1c9ed8abc96 --- /dev/null +++ b/queue-3.1/alsa-lx6464es-fix-device-communication-via-command-bus.patch @@ -0,0 +1,58 @@ +From a29878553a9a7b4c06f93c7e383527cf014d4ceb Mon Sep 17 00:00:00 2001 +From: Tim Blechmann +Date: Tue, 22 Nov 2011 11:15:45 +0100 +Subject: ALSA: lx6464es - fix device communication via command bus + +From: Tim Blechmann + +commit a29878553a9a7b4c06f93c7e383527cf014d4ceb upstream. + +commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io +functions that have been used to send commands to the device. these +optimizations somehow corrupted the communication with the lx6464es, +that resulted the device to be unusable with kernels after 2.6.33. + +this patch emulates the memcpy_*_io functions via a loop to avoid these +problems. + +Signed-off-by: Tim Blechmann +LKML-Reference: <4ECB5257.4040600@ladisch.de> +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/lx6464es/lx_core.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/sound/pci/lx6464es/lx_core.c ++++ b/sound/pci/lx6464es/lx_core.c +@@ -80,8 +80,12 @@ unsigned long lx_dsp_reg_read(struct lx6 + + void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len) + { +- void __iomem *address = lx_dsp_register(chip, port); +- memcpy_fromio(data, address, len*sizeof(u32)); ++ u32 __iomem *address = lx_dsp_register(chip, port); ++ int i; ++ ++ /* we cannot use memcpy_fromio */ ++ for (i = 0; i != len; ++i) ++ data[i] = ioread32(address + i); + } + + +@@ -94,8 +98,12 @@ void lx_dsp_reg_write(struct lx6464es *c + void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data, + u32 len) + { +- void __iomem *address = lx_dsp_register(chip, port); +- memcpy_toio(address, data, len*sizeof(u32)); ++ u32 __iomem *address = lx_dsp_register(chip, port); ++ int i; ++ ++ /* we cannot use memcpy_to */ ++ for (i = 0; i != len; ++i) ++ iowrite32(data[i], address + i); + } + + diff --git a/queue-3.1/arm-7161-1-errata-no-automatic-store-buffer-drain.patch b/queue-3.1/arm-7161-1-errata-no-automatic-store-buffer-drain.patch new file mode 100644 index 00000000000..89fad5bcb7b --- /dev/null +++ b/queue-3.1/arm-7161-1-errata-no-automatic-store-buffer-drain.patch @@ -0,0 +1,62 @@ +From 11ed0ba1754841316d4095478944300acf19acc3 Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Mon, 14 Nov 2011 17:24:58 +0100 +Subject: ARM: 7161/1: errata: no automatic store buffer drain + +From: Will Deacon + +commit 11ed0ba1754841316d4095478944300acf19acc3 upstream. + +This patch implements a workaround for PL310 erratum 769419. On +revisions of the PL310 prior to r3p2, the Store Buffer does not +automatically drain. This can cause normal, non-cacheable writes to be +retained when the memory system is idle, leading to suboptimal I/O +performance for drivers using coherent DMA. + +This patch adds an optional wmb() call to the cpu_idle loop. On systems +with an outer cache, this causes an explicit flush of the store buffer. + +Acked-by: Catalin Marinas +Tested-by: Marc Zyngier +Signed-off-by: Will Deacon +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/Kconfig | 12 ++++++++++++ + arch/arm/kernel/process.c | 3 +++ + 2 files changed, 15 insertions(+) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1297,6 +1297,18 @@ config ARM_ERRATA_764369 + relevant cache maintenance functions and sets a specific bit + in the diagnostic control register of the SCU. + ++config PL310_ERRATA_769419 ++ bool "PL310 errata: no automatic Store Buffer drain" ++ depends on CACHE_L2X0 ++ help ++ On revisions of the PL310 prior to r3p2, the Store Buffer does ++ not automatically drain. This can cause normal, non-cacheable ++ writes to be retained when the memory system is idle, leading ++ to suboptimal I/O performance for drivers using coherent DMA. ++ This option adds a write barrier to the cpu_idle loop so that, ++ on systems with an outer cache, the store buffer is drained ++ explicitly. ++ + endmenu + + source "arch/arm/common/Kconfig" +--- a/arch/arm/kernel/process.c ++++ b/arch/arm/kernel/process.c +@@ -192,6 +192,9 @@ void cpu_idle(void) + #endif + + local_irq_disable(); ++#ifdef CONFIG_PL310_ERRATA_769419 ++ wmb(); ++#endif + if (hlt_counter) { + local_irq_enable(); + cpu_relax(); diff --git a/queue-3.1/arm-mx28-fix-bit-operation-in-clock-setting.patch b/queue-3.1/arm-mx28-fix-bit-operation-in-clock-setting.patch new file mode 100644 index 00000000000..7f2c1319011 --- /dev/null +++ b/queue-3.1/arm-mx28-fix-bit-operation-in-clock-setting.patch @@ -0,0 +1,35 @@ +From c2735391fbc68feae10d6d14e60956c8106e725f Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Sat, 10 Sep 2011 12:26:07 +0200 +Subject: arm: mx28: fix bit operation in clock setting + +From: Wolfram Sang + +commit c2735391fbc68feae10d6d14e60956c8106e725f upstream. + +reg | (1 << clk->enable_shift) always evaluates to true. Switch it +to & which makes much more sense. Same fix as 13be9f00 (ARM i.MX28: fix +bit operation) at a different location. + +Signed-off-by: Wolfram Sang +Cc: Sascha Hauer +Cc: Shawn Guo +Signed-off-by: Shawn Guo +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-mxs/clock-mx28.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/mach-mxs/clock-mx28.c ++++ b/arch/arm/mach-mxs/clock-mx28.c +@@ -404,7 +404,7 @@ static int name##_set_rate(struct clk *c + reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ + reg &= ~BM_CLKCTRL_##dr##_DIV; \ + reg |= div << BP_CLKCTRL_##dr##_DIV; \ +- if (reg | (1 << clk->enable_shift)) { \ ++ if (reg & (1 << clk->enable_shift)) { \ + pr_err("%s: clock is gated\n", __func__); \ + return -EINVAL; \ + } \ diff --git a/queue-3.1/arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch b/queue-3.1/arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch new file mode 100644 index 00000000000..6a2054b183a --- /dev/null +++ b/queue-3.1/arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch @@ -0,0 +1,71 @@ +From cc1b0765da6078b906772b79ff211b88cc0ae958 Mon Sep 17 00:00:00 2001 +From: sricharan +Date: Wed, 23 Nov 2011 14:35:07 -0800 +Subject: ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs + +From: sricharan + +commit cc1b0765da6078b906772b79ff211b88cc0ae958 upstream. + +The address spaces, irqs and dma reqs count APIs return the +number of corresponding entries in a hwmod including a additional +null value or a -1 terminator in the structure introduced recently. +More information here: + +- 212738a4: omap_hwmod: use a terminator record with omap_hwmod_mpu_irqs + arrays + +- 78183f3f: omap_hwmod: use a null structure record to terminate + omap_hwmod_addr_space arrays + +- bc614958: omap_hwmod: use a terminator record with omap_hwmod_dma_info + arrays + +The issue with irqs and dma info was originally reported by Benoit Cousson. + +The devices which have multiple hwmods and use device_build_ss are +broken with this, as their resources are populated with a extra null +value, subsequently the probe fails. So fix the API not to include +the array terminator in the count. + +Reported-by: Benoit Cousson +Signed-off-by: Santosh Shilimkar +Signed-off-by: sricharan +Signed-off-by: Benoit Cousson +Cc: Paul Walmsley +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/omap_hwmod.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/mach-omap2/omap_hwmod.c ++++ b/arch/arm/mach-omap2/omap_hwmod.c +@@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_h + ohii = &oh->mpu_irqs[i++]; + } while (ohii->irq != -1); + +- return i; ++ return i-1; + } + + /** +@@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_ + ohdi = &oh->sdma_reqs[i++]; + } while (ohdi->dma_req != -1); + +- return i; ++ return i-1; + } + + /** +@@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(str + mem = &os->addr[i++]; + } while (mem->pa_start != mem->pa_end); + +- return i; ++ return i-1; + } + + /** diff --git a/queue-3.1/arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch b/queue-3.1/arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch new file mode 100644 index 00000000000..9f763edca86 --- /dev/null +++ b/queue-3.1/arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch @@ -0,0 +1,92 @@ +From 46232a3622c6e33605906ee6690dfef372925f53 Mon Sep 17 00:00:00 2001 +From: Kevin Hilman +Date: Wed, 23 Nov 2011 14:43:01 -0800 +Subject: ARM: OMAP: PM: only register TWL with voltage layer when device is present + +From: Kevin Hilman + +commit 46232a3622c6e33605906ee6690dfef372925f53 upstream. + +Current code registers voltage layer details for TWL PMIC even when a TWL +has not been registered. Fix this to only register the TWL with voltage +layer when the TWL PMIC is initialized by board-level code. + +Signed-off-by: Kevin Hilman +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/pm.c | 6 ++---- + arch/arm/mach-omap2/twl-common.c | 11 +++++++++++ + arch/arm/mach-omap2/twl-common.h | 3 +++ + 3 files changed, 16 insertions(+), 4 deletions(-) + +--- a/arch/arm/mach-omap2/pm.c ++++ b/arch/arm/mach-omap2/pm.c +@@ -23,6 +23,7 @@ + #include "powerdomain.h" + #include "clockdomain.h" + #include "pm.h" ++#include "twl-common.h" + + static struct omap_device_pm_latency *pm_lats; + +@@ -251,11 +252,8 @@ postcore_initcall(omap2_common_pm_init); + + static int __init omap2_common_pm_late_init(void) + { +- /* Init the OMAP TWL parameters */ +- omap3_twl_init(); +- omap4_twl_init(); +- + /* Init the voltage layer */ ++ omap_pmic_late_init(); + omap_voltage_late_init(); + + /* Initialize the voltages */ +--- a/arch/arm/mach-omap2/twl-common.c ++++ b/arch/arm/mach-omap2/twl-common.c +@@ -30,6 +30,7 @@ + #include + + #include "twl-common.h" ++#include "pm.h" + + static struct i2c_board_info __initdata pmic_i2c_board_info = { + .addr = 0x48, +@@ -48,6 +49,16 @@ void __init omap_pmic_init(int bus, u32 + omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); + } + ++void __init omap_pmic_late_init(void) ++{ ++ /* Init the OMAP TWL parameters (if PMIC has been registerd) */ ++ if (!pmic_i2c_board_info.irq) ++ return; ++ ++ omap3_twl_init(); ++ omap4_twl_init(); ++} ++ + #if defined(CONFIG_ARCH_OMAP3) + static struct twl4030_usb_data omap3_usb_pdata = { + .usb_mode = T2_USB_MODE_ULPI, +--- a/arch/arm/mach-omap2/twl-common.h ++++ b/arch/arm/mach-omap2/twl-common.h +@@ -1,6 +1,8 @@ + #ifndef __OMAP_PMIC_COMMON__ + #define __OMAP_PMIC_COMMON__ + ++#include ++ + #define TWL_COMMON_PDATA_USB (1 << 0) + #define TWL_COMMON_PDATA_BCI (1 << 1) + #define TWL_COMMON_PDATA_MADC (1 << 2) +@@ -30,6 +32,7 @@ struct twl4030_platform_data; + + void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, + struct twl4030_platform_data *pmic_data); ++void omap_pmic_late_init(void); + + static inline void omap2_pmic_init(const char *pmic_type, + struct twl4030_platform_data *pmic_data) diff --git a/queue-3.1/arm-omap-smartreflex-fix-irq-handling-bug.patch b/queue-3.1/arm-omap-smartreflex-fix-irq-handling-bug.patch new file mode 100644 index 00000000000..bd7ff9bdae0 --- /dev/null +++ b/queue-3.1/arm-omap-smartreflex-fix-irq-handling-bug.patch @@ -0,0 +1,33 @@ +From 5a4f1844c2ba21f804d7729306d9b16eaeb724a8 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Wed, 23 Nov 2011 14:43:37 -0800 +Subject: ARM: OMAP: smartreflex: fix IRQ handling bug + +From: Felipe Balbi + +commit 5a4f1844c2ba21f804d7729306d9b16eaeb724a8 upstream. + +Fix a bug which has been on this driver since +it was added by the original commit 984aa6db +which would never clear IRQSTATUS bits. + +Signed-off-by: Felipe Balbi +Signed-off-by: Kevin Hilman +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/smartreflex.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/mach-omap2/smartreflex.c ++++ b/arch/arm/mach-omap2/smartreflex.c +@@ -137,7 +137,7 @@ static irqreturn_t sr_interrupt(int irq, + sr_write_reg(sr_info, ERRCONFIG_V1, status); + } else if (sr_info->ip_type == SR_TYPE_V2) { + /* Read the status bits */ +- sr_read_reg(sr_info, IRQSTATUS); ++ status = sr_read_reg(sr_info, IRQSTATUS); + + /* Clear them by writing back */ + sr_write_reg(sr_info, IRQSTATUS, status); diff --git a/queue-3.1/arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch b/queue-3.1/arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch new file mode 100644 index 00000000000..563e7bbaaec --- /dev/null +++ b/queue-3.1/arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch @@ -0,0 +1,62 @@ +From a8a6565c7615cab3608d75af95b5c8a3522cd7c4 Mon Sep 17 00:00:00 2001 +From: Ming Lei +Date: Wed, 23 Nov 2011 14:44:50 -0800 +Subject: ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined + +From: Ming Lei + +commit a8a6565c7615cab3608d75af95b5c8a3522cd7c4 upstream. + +This patch selects ARM_AMBA if OMAP3_EMU is defined because +OC_ETM depends on ARM_AMBA, so fix the link failure[1]. + +[1], +arch/arm/kernel/built-in.o: In function `etm_remove': +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:609: undefined +reference to `amba_release_regions' +arch/arm/kernel/built-in.o: In function `etb_remove': +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:409: undefined +reference to `amba_release_regions' +arch/arm/kernel/built-in.o: In function `etm_init': +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:640: undefined +reference to `amba_driver_register' +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:646: undefined +reference to `amba_driver_register' +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:648: undefined +reference to `amba_driver_unregister' +arch/arm/kernel/built-in.o: In function `etm_probe': +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:545: undefined +reference to `amba_request_regions' +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:595: undefined +reference to `amba_release_regions' +arch/arm/kernel/built-in.o: In function `etb_probe': +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:347: undefined +reference to `amba_request_regions' +/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:392: undefined +reference to `amba_release_regions' +arch/arm/mach-omap2/built-in.o: In function `emu_init': +/home/tom/git/omap/linux-2.6-omap/arch/arm/mach-omap2/emu.c:62: +undefined reference to `amba_device_register' +/home/tom/git/omap/linux-2.6-omap/arch/arm/mach-omap2/emu.c:63: +undefined reference to `amba_device_register' +make: *** [.tmp_vmlinux1] Error 1 +making modules + +Signed-off-by: Ming Lei +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-omap2/Kconfig ++++ b/arch/arm/mach-omap2/Kconfig +@@ -329,6 +329,7 @@ config MACH_OMAP4_PANDA + config OMAP3_EMU + bool "OMAP3 debugging peripherals" + depends on ARCH_OMAP3 ++ select ARM_AMBA + select OC_ETM + help + Say Y here to enable debugging hardware of omap3 diff --git a/queue-3.1/arm-pxa-fix-inconsistent-config_usb_pxa27x.patch b/queue-3.1/arm-pxa-fix-inconsistent-config_usb_pxa27x.patch new file mode 100644 index 00000000000..7ae6b7570da --- /dev/null +++ b/queue-3.1/arm-pxa-fix-inconsistent-config_usb_pxa27x.patch @@ -0,0 +1,157 @@ +From c0a39151a4055332897cba615623d3de2f3896df Mon Sep 17 00:00:00 2001 +From: Haojian Zhuang +Date: Thu, 10 Nov 2011 07:13:07 +0800 +Subject: ARM: pxa: fix inconsistent CONFIG_USB_PXA27X + +From: Haojian Zhuang + +commit c0a39151a4055332897cba615623d3de2f3896df upstream. + +Since CONFIG_USB_GADGET_PXA27X and other macros are renamed to +CONFIG_USB_PXA27X. Update them in arch/arm/mach-pxa and arch/arm/configs +to keep consistent. + +Signed-off-by: Haojian Zhuang +Acked-by: Felipe Balbi +Signed-off-by: Eric Miao +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/configs/ezx_defconfig | 2 +- + arch/arm/configs/imote2_defconfig | 2 +- + arch/arm/configs/magician_defconfig | 2 +- + arch/arm/configs/zeus_defconfig | 2 +- + arch/arm/mach-pxa/balloon3.c | 2 +- + arch/arm/mach-pxa/colibri-pxa320.c | 2 +- + arch/arm/mach-pxa/gumstix.c | 2 +- + arch/arm/mach-pxa/include/mach/palm27x.h | 4 ++-- + arch/arm/mach-pxa/palm27x.c | 4 ++-- + arch/arm/mach-pxa/palmtc.c | 2 +- + arch/arm/mach-pxa/vpac270.c | 2 +- + 11 files changed, 13 insertions(+), 13 deletions(-) + +--- a/arch/arm/configs/ezx_defconfig ++++ b/arch/arm/configs/ezx_defconfig +@@ -287,7 +287,7 @@ CONFIG_USB=y + # CONFIG_USB_DEVICE_CLASS is not set + CONFIG_USB_OHCI_HCD=y + CONFIG_USB_GADGET=y +-CONFIG_USB_GADGET_PXA27X=y ++CONFIG_USB_PXA27X=y + CONFIG_USB_ETH=m + # CONFIG_USB_ETH_RNDIS is not set + CONFIG_MMC=y +--- a/arch/arm/configs/imote2_defconfig ++++ b/arch/arm/configs/imote2_defconfig +@@ -263,7 +263,7 @@ CONFIG_USB=y + # CONFIG_USB_DEVICE_CLASS is not set + CONFIG_USB_OHCI_HCD=y + CONFIG_USB_GADGET=y +-CONFIG_USB_GADGET_PXA27X=y ++CONFIG_USB_PXA27X=y + CONFIG_USB_ETH=m + # CONFIG_USB_ETH_RNDIS is not set + CONFIG_MMC=y +--- a/arch/arm/configs/magician_defconfig ++++ b/arch/arm/configs/magician_defconfig +@@ -132,7 +132,7 @@ CONFIG_USB_MON=m + CONFIG_USB_OHCI_HCD=y + CONFIG_USB_GADGET=y + CONFIG_USB_GADGET_VBUS_DRAW=500 +-CONFIG_USB_GADGET_PXA27X=y ++CONFIG_USB_PXA27X=y + CONFIG_USB_ETH=m + # CONFIG_USB_ETH_RNDIS is not set + CONFIG_USB_GADGETFS=m +--- a/arch/arm/configs/zeus_defconfig ++++ b/arch/arm/configs/zeus_defconfig +@@ -140,7 +140,7 @@ CONFIG_USB_SERIAL=m + CONFIG_USB_SERIAL_GENERIC=y + CONFIG_USB_SERIAL_MCT_U232=m + CONFIG_USB_GADGET=m +-CONFIG_USB_GADGET_PXA27X=y ++CONFIG_USB_PXA27X=y + CONFIG_USB_ETH=m + CONFIG_USB_GADGETFS=m + CONFIG_USB_FILE_STORAGE=m +--- a/arch/arm/mach-pxa/balloon3.c ++++ b/arch/arm/mach-pxa/balloon3.c +@@ -307,7 +307,7 @@ static inline void balloon3_mmc_init(voi + /****************************************************************************** + * USB Gadget + ******************************************************************************/ +-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) ++#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE) + static void balloon3_udc_command(int cmd) + { + if (cmd == PXA2XX_UDC_CMD_CONNECT) +--- a/arch/arm/mach-pxa/colibri-pxa320.c ++++ b/arch/arm/mach-pxa/colibri-pxa320.c +@@ -146,7 +146,7 @@ static void __init colibri_pxa320_init_e + static inline void __init colibri_pxa320_init_eth(void) {} + #endif /* CONFIG_AX88796 */ + +-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) ++#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE) + static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { + .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), + .gpio_pullup = -1, +--- a/arch/arm/mach-pxa/gumstix.c ++++ b/arch/arm/mach-pxa/gumstix.c +@@ -106,7 +106,7 @@ static void __init gumstix_mmc_init(void + } + #endif + +-#ifdef CONFIG_USB_GADGET_PXA25X ++#ifdef CONFIG_USB_PXA25X + static struct gpio_vbus_mach_info gumstix_udc_info = { + .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn, + .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx, +--- a/arch/arm/mach-pxa/include/mach/palm27x.h ++++ b/arch/arm/mach-pxa/include/mach/palm27x.h +@@ -37,8 +37,8 @@ extern void __init palm27x_lcd_init(int + static inline void palm27x_lcd_init(int power, struct pxafb_mode_info *mode) {} + #endif + +-#if defined(CONFIG_USB_GADGET_PXA27X) || \ +- defined(CONFIG_USB_GADGET_PXA27X_MODULE) ++#if defined(CONFIG_USB_PXA27X) || \ ++ defined(CONFIG_USB_PXA27X_MODULE) + extern void __init palm27x_udc_init(int vbus, int pullup, + int vbus_inverted); + #else +--- a/arch/arm/mach-pxa/palm27x.c ++++ b/arch/arm/mach-pxa/palm27x.c +@@ -164,8 +164,8 @@ void __init palm27x_lcd_init(int power, + /****************************************************************************** + * USB Gadget + ******************************************************************************/ +-#if defined(CONFIG_USB_GADGET_PXA27X) || \ +- defined(CONFIG_USB_GADGET_PXA27X_MODULE) ++#if defined(CONFIG_USB_PXA27X) || \ ++ defined(CONFIG_USB_PXA27X_MODULE) + static struct gpio_vbus_mach_info palm27x_udc_info = { + .gpio_vbus_inverted = 1, + }; +--- a/arch/arm/mach-pxa/palmtc.c ++++ b/arch/arm/mach-pxa/palmtc.c +@@ -338,7 +338,7 @@ static inline void palmtc_mkp_init(void) + /****************************************************************************** + * UDC + ******************************************************************************/ +-#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE) ++#if defined(CONFIG_USB_PXA25X)||defined(CONFIG_USB_PXA25X_MODULE) + static struct gpio_vbus_mach_info palmtc_udc_info = { + .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, + .gpio_vbus_inverted = 1, +--- a/arch/arm/mach-pxa/vpac270.c ++++ b/arch/arm/mach-pxa/vpac270.c +@@ -343,7 +343,7 @@ static inline void vpac270_uhc_init(void + /****************************************************************************** + * USB Gadget + ******************************************************************************/ +-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) ++#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE) + static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = { + .gpio_vbus = GPIO41_VPAC270_UDC_DETECT, + .gpio_pullup = -1, diff --git a/queue-3.1/asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch b/queue-3.1/asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch new file mode 100644 index 00000000000..7486fb07333 --- /dev/null +++ b/queue-3.1/asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch @@ -0,0 +1,26 @@ +From ed3e80c4c991a52f9fce3421536a78e331ae0949 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Mon, 21 Nov 2011 11:55:41 +0000 +Subject: ASoC: Ensure WM8731 register cache is synced when resuming from disabled + +From: Mark Brown + +commit ed3e80c4c991a52f9fce3421536a78e331ae0949 upstream. + +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm8731.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/codecs/wm8731.c ++++ b/sound/soc/codecs/wm8731.c +@@ -463,6 +463,7 @@ static int wm8731_set_bias_level(struct + snd_soc_write(codec, WM8731_PWR, 0xffff); + regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), + wm8731->supplies); ++ codec->cache_sync = 1; + break; + } + codec->dapm.bias_level = level; diff --git a/queue-3.1/asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch b/queue-3.1/asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch new file mode 100644 index 00000000000..746ef5866a4 --- /dev/null +++ b/queue-3.1/asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch @@ -0,0 +1,30 @@ +From 0f768a7235d3dfb6f4833030a95a06419df089cb Mon Sep 17 00:00:00 2001 +From: Timur Tabi +Date: Mon, 14 Nov 2011 16:35:26 -0600 +Subject: ASoC: fsl_ssi: properly initialize the sysfs attribute object + +From: Timur Tabi + +commit 0f768a7235d3dfb6f4833030a95a06419df089cb upstream. + +Commit 6992f533 ("sysfs: Use one lockdep class per sysfs attribute") +requires 'struct attribute' objects to be initialized with sysfs_attr_init(). + +Signed-off-by: Timur Tabi +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/fsl/fsl_ssi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/fsl/fsl_ssi.c ++++ b/sound/soc/fsl/fsl_ssi.c +@@ -703,6 +703,7 @@ static int __devinit fsl_ssi_probe(struc + + /* Initialize the the device_attribute structure */ + dev_attr = &ssi_private->dev_attr; ++ sysfs_attr_init(&dev_attr->attr); + dev_attr->attr.name = "statistics"; + dev_attr->attr.mode = S_IRUGO; + dev_attr->show = fsl_sysfs_ssi_show; diff --git a/queue-3.1/asoc-sta32x-preserve-coefficient-ram.patch b/queue-3.1/asoc-sta32x-preserve-coefficient-ram.patch new file mode 100644 index 00000000000..07fd74c8bc4 --- /dev/null +++ b/queue-3.1/asoc-sta32x-preserve-coefficient-ram.patch @@ -0,0 +1,139 @@ +From 54dc6cabe684375b3cf549c7b0545613d694aba8 Mon Sep 17 00:00:00 2001 +From: Johannes Stezenbach +Date: Mon, 14 Nov 2011 17:23:16 +0100 +Subject: ASoC: sta32x: preserve coefficient RAM + +From: Johannes Stezenbach + +commit 54dc6cabe684375b3cf549c7b0545613d694aba8 upstream. + +The coefficient RAM must be saved in a shadow so it can +be restored when the codec is powered on using +regulator_bulk_enable(). + +Signed-off-by: Johannes Stezenbach +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/sta32x.c | 63 +++++++++++++++++++++++++++++++++++++++++++++- + sound/soc/codecs/sta32x.h | 1 + 2 files changed, 63 insertions(+), 1 deletion(-) + +--- a/sound/soc/codecs/sta32x.c ++++ b/sound/soc/codecs/sta32x.c +@@ -76,6 +76,8 @@ struct sta32x_priv { + + unsigned int mclk; + unsigned int format; ++ ++ u32 coef_shadow[STA32X_COEF_COUNT]; + }; + + static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1); +@@ -227,6 +229,7 @@ static int sta32x_coefficient_put(struct + struct snd_ctl_elem_value *ucontrol) + { + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); ++ struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); + int numcoef = kcontrol->private_value >> 16; + int index = kcontrol->private_value & 0xffff; + unsigned int cfud; +@@ -239,6 +242,11 @@ static int sta32x_coefficient_put(struct + snd_soc_write(codec, STA32X_CFUD, cfud); + + snd_soc_write(codec, STA32X_CFADDR2, index); ++ for (i = 0; i < numcoef && (index + i < STA32X_COEF_COUNT); i++) ++ sta32x->coef_shadow[index + i] = ++ (ucontrol->value.bytes.data[3 * i] << 16) ++ | (ucontrol->value.bytes.data[3 * i + 1] << 8) ++ | (ucontrol->value.bytes.data[3 * i + 2]); + for (i = 0; i < 3 * numcoef; i++) + snd_soc_write(codec, STA32X_B1CF1 + i, + ucontrol->value.bytes.data[i]); +@@ -252,6 +260,48 @@ static int sta32x_coefficient_put(struct + return 0; + } + ++int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) ++{ ++ struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); ++ unsigned int cfud; ++ int i; ++ ++ /* preserve reserved bits in STA32X_CFUD */ ++ cfud = snd_soc_read(codec, STA32X_CFUD) & 0xf0; ++ ++ for (i = 0; i < STA32X_COEF_COUNT; i++) { ++ snd_soc_write(codec, STA32X_CFADDR2, i); ++ snd_soc_write(codec, STA32X_B1CF1, ++ (sta32x->coef_shadow[i] >> 16) & 0xff); ++ snd_soc_write(codec, STA32X_B1CF2, ++ (sta32x->coef_shadow[i] >> 8) & 0xff); ++ snd_soc_write(codec, STA32X_B1CF3, ++ (sta32x->coef_shadow[i]) & 0xff); ++ /* chip documentation does not say if the bits are ++ * self-clearing, so do it explicitly */ ++ snd_soc_write(codec, STA32X_CFUD, cfud); ++ snd_soc_write(codec, STA32X_CFUD, cfud | 0x01); ++ } ++ return 0; ++} ++ ++int sta32x_cache_sync(struct snd_soc_codec *codec) ++{ ++ unsigned int mute; ++ int rc; ++ ++ if (!codec->cache_sync) ++ return 0; ++ ++ /* mute during register sync */ ++ mute = snd_soc_read(codec, STA32X_MMUTE); ++ snd_soc_write(codec, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE); ++ sta32x_sync_coef_shadow(codec); ++ rc = snd_soc_cache_sync(codec); ++ snd_soc_write(codec, STA32X_MMUTE, mute); ++ return rc; ++} ++ + #define SINGLE_COEF(xname, index) \ + { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ + .info = sta32x_coefficient_info, \ +@@ -657,7 +707,7 @@ static int sta32x_set_bias_level(struct + return ret; + } + +- snd_soc_cache_sync(codec); ++ sta32x_cache_sync(codec); + } + + /* Power up to mute */ +@@ -792,6 +842,17 @@ static int sta32x_probe(struct snd_soc_c + STA32X_CxCFG_OM_MASK, + 2 << STA32X_CxCFG_OM_SHIFT); + ++ /* initialize coefficient shadow RAM with reset values */ ++ for (i = 4; i <= 49; i += 5) ++ sta32x->coef_shadow[i] = 0x400000; ++ for (i = 50; i <= 54; i++) ++ sta32x->coef_shadow[i] = 0x7fffff; ++ sta32x->coef_shadow[55] = 0x5a9df7; ++ sta32x->coef_shadow[56] = 0x7fffff; ++ sta32x->coef_shadow[59] = 0x7fffff; ++ sta32x->coef_shadow[60] = 0x400000; ++ sta32x->coef_shadow[61] = 0x400000; ++ + sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + /* Bias level configuration will have done an extra enable */ + regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); +--- a/sound/soc/codecs/sta32x.h ++++ b/sound/soc/codecs/sta32x.h +@@ -19,6 +19,7 @@ + /* STA326 register addresses */ + + #define STA32X_REGISTER_COUNT 0x2d ++#define STA32X_COEF_COUNT 62 + + #define STA32X_CONFA 0x00 + #define STA32X_CONFB 0x01 diff --git a/queue-3.1/asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch b/queue-3.1/asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch new file mode 100644 index 00000000000..5a098883b52 --- /dev/null +++ b/queue-3.1/asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch @@ -0,0 +1,39 @@ +From 2391a0e06789a3f1718dee30b282562f7ed28c87 Mon Sep 17 00:00:00 2001 +From: Timo Juhani Lindfors +Date: Thu, 17 Nov 2011 02:52:50 +0200 +Subject: ASoC: wm8753: Skip noop reconfiguration of DAI mode + +From: Timo Juhani Lindfors + +commit 2391a0e06789a3f1718dee30b282562f7ed28c87 upstream. + +This patch makes it possible to set DAI mode to its currently applied +value even if codec is active. This is necessary to allow + +aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom & +alsactl store -f backup.state +alsactl restore -f backup.state + +to work without returning errors. This patch is based on a patch sent +by Klaus Kurzmann . + +Signed-off-by: Timo Juhani Lindfors +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm8753.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/sound/soc/codecs/wm8753.c ++++ b/sound/soc/codecs/wm8753.c +@@ -189,6 +189,9 @@ static int wm8753_set_dai(struct snd_kco + struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); + u16 ioctl; + ++ if (wm8753->dai_func == ucontrol->value.integer.value[0]) ++ return 0; ++ + if (codec->active) + return -EBUSY; + diff --git a/queue-3.1/series b/queue-3.1/series index 3a0f0785257..c0e201a85ed 100644 --- a/queue-3.1/series +++ b/queue-3.1/series @@ -12,3 +12,17 @@ drm-i915-fix-inconsistent-backlight-level-during-disabled.patch pci-hotplug-shpchp-don-t-blindly-claim-non-amd-0x7450-device-ids.patch drm-radeon-kms-fix-up-gpio-i2c-mask-bits-for-r4xx.patch viafb-correct-sync-polarity-for-olpc-dcon.patch +arm-pxa-fix-inconsistent-config_usb_pxa27x.patch +arm-mx28-fix-bit-operation-in-clock-setting.patch +arm-omap-smartreflex-fix-irq-handling-bug.patch +arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch +arm-omap2-select-arm_amba-if-omap3_emu-is-defined.patch +arm-omap-pm-only-register-twl-with-voltage-layer-when-device-is-present.patch +arm-7161-1-errata-no-automatic-store-buffer-drain.patch +alsa-hda-fix-jack-detection-control-of-vt1708.patch +alsa-lx6464es-fix-device-communication-via-command-bus.patch +alsa-hda-realtek-fix-missing-inits-of-item-indices-for-auto-mic.patch +asoc-sta32x-preserve-coefficient-ram.patch +asoc-fsl_ssi-properly-initialize-the-sysfs-attribute-object.patch +asoc-wm8753-skip-noop-reconfiguration-of-dai-mode.patch +asoc-ensure-wm8731-register-cache-is-synced-when-resuming-from-disabled.patch -- 2.47.3