--- /dev/null
+From 41b645c8624df6ace020a8863ad1449d69140f7d Mon Sep 17 00:00:00 2001
+From: Mike Dunn <mikedunn@newsguy.com>
+Date: Mon, 7 Jan 2013 13:55:12 -0800
+Subject: ALSA: pxa27x: fix ac97 cold reset
+
+From: Mike Dunn <mikedunn@newsguy.com>
+
+commit 41b645c8624df6ace020a8863ad1449d69140f7d upstream.
+
+Cold reset on the pxa27x currently fails and
+
+ pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
+
+appears in the kernel log. Through trial-and-error (the pxa270 developer's
+manual is mostly incoherent on the topic of ac97 reset), I got cold reset to
+complete by setting the WARM_RST bit in the GCR register (and later noticed that
+pxa3xx does this for cold reset as well). Also, a timeout loop is needed to
+wait for the reset to complete.
+
+Tested on a palm treo 680 machine.
+
+Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
+Acked-by: Igor Grinberg <grinberg@compulab.co.il>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/arm/pxa2xx-ac97-lib.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/sound/arm/pxa2xx-ac97-lib.c
++++ b/sound/arm/pxa2xx-ac97-lib.c
+@@ -148,6 +148,8 @@ static inline void pxa_ac97_warm_pxa27x(
+
+ static inline void pxa_ac97_cold_pxa27x(void)
+ {
++ unsigned int timeout;
++
+ GCR &= GCR_COLD_RST; /* clear everything but nCRST */
+ GCR &= ~GCR_COLD_RST; /* then assert nCRST */
+
+@@ -157,8 +159,10 @@ static inline void pxa_ac97_cold_pxa27x(
+ clk_enable(ac97conf_clk);
+ udelay(5);
+ clk_disable(ac97conf_clk);
+- GCR = GCR_COLD_RST;
+- udelay(50);
++ GCR = GCR_COLD_RST | GCR_WARM_RST;
++ timeout = 100; /* wait for the codec-ready bit to be set */
++ while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
++ mdelay(1);
+ }
+ #endif
+
--- /dev/null
+From 3b4bc7bccc7857274705b05cf81a0c72cfd0b0dd Mon Sep 17 00:00:00 2001
+From: Mike Dunn <mikedunn@newsguy.com>
+Date: Mon, 7 Jan 2013 13:55:13 -0800
+Subject: ALSA: pxa27x: fix ac97 warm reset
+
+From: Mike Dunn <mikedunn@newsguy.com>
+
+commit 3b4bc7bccc7857274705b05cf81a0c72cfd0b0dd upstream.
+
+This patch fixes some code that implements a work-around to a hardware bug in
+the ac97 controller on the pxa27x. A bug in the controller's warm reset
+functionality requires that the mfp used by the controller as the AC97_nRESET
+line be temporarily reconfigured as a generic output gpio (AF0) and manually
+held high for the duration of the warm reset cycle. This is what was done in
+the original code, but it was broken long ago by commit fb1bf8cd
+ ([ARM] pxa: introduce processor specific pxa27x_assert_ac97reset())
+which changed the mfp to a GPIO input instead of a high output.
+
+The fix requires the ac97 controller to obtain the gpio via gpio_request_one(),
+with arguments that configure the gpio as an output initially driven high.
+
+Tested on a palm treo 680 machine. Reportedly, this broken code only prevents a
+warm reset on hardware that lacks a pull-up on the line, which appears to be the
+case for me.
+
+Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
+Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-pxa/include/mach/mfp-pxa27x.h | 3 +++
+ arch/arm/mach-pxa/pxa27x.c | 4 ++--
+ sound/arm/pxa2xx-ac97-lib.c | 18 +++++++++++++++++-
+ 3 files changed, 22 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
++++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+@@ -462,6 +462,9 @@
+ GPIO76_LCD_PCLK, \
+ GPIO77_LCD_BIAS
+
++/* these enable a work-around for a hw bug in pxa27x during ac97 warm reset */
++#define GPIO113_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO113, AF0, DEFAULT)
++#define GPIO95_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO95, AF0, DEFAULT)
+
+ extern int keypad_set_wake(unsigned int on);
+ #endif /* __ASM_ARCH_MFP_PXA27X_H */
+--- a/arch/arm/mach-pxa/pxa27x.c
++++ b/arch/arm/mach-pxa/pxa27x.c
+@@ -47,9 +47,9 @@ void pxa27x_clear_otgph(void)
+ EXPORT_SYMBOL(pxa27x_clear_otgph);
+
+ static unsigned long ac97_reset_config[] = {
+- GPIO113_GPIO,
++ GPIO113_AC97_nRESET_GPIO_HIGH,
+ GPIO113_AC97_nRESET,
+- GPIO95_GPIO,
++ GPIO95_AC97_nRESET_GPIO_HIGH,
+ GPIO95_AC97_nRESET,
+ };
+
+--- a/sound/arm/pxa2xx-ac97-lib.c
++++ b/sound/arm/pxa2xx-ac97-lib.c
+@@ -18,6 +18,7 @@
+ #include <linux/delay.h>
+ #include <linux/module.h>
+ #include <linux/io.h>
++#include <linux/gpio.h>
+
+ #include <sound/ac97_codec.h>
+ #include <sound/pxa2xx-lib.h>
+@@ -344,8 +345,21 @@ int __devinit pxa2xx_ac97_hw_probe(struc
+ }
+
+ if (cpu_is_pxa27x()) {
+- /* Use GPIO 113 as AC97 Reset on Bulverde */
++ /*
++ * This gpio is needed for a work-around to a bug in the ac97
++ * controller during warm reset. The direction and level is set
++ * here so that it is an output driven high when switching from
++ * AC97_nRESET alt function to generic gpio.
++ */
++ ret = gpio_request_one(reset_gpio, GPIOF_OUT_INIT_HIGH,
++ "pxa27x ac97 reset");
++ if (ret < 0) {
++ pr_err("%s: gpio_request_one() failed: %d\n",
++ __func__, ret);
++ goto err_conf;
++ }
+ pxa27x_assert_ac97reset(reset_gpio, 0);
++
+ ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
+ if (IS_ERR(ac97conf_clk)) {
+ ret = PTR_ERR(ac97conf_clk);
+@@ -388,6 +402,8 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
+
+ void pxa2xx_ac97_hw_remove(struct platform_device *dev)
+ {
++ if (cpu_is_pxa27x())
++ gpio_free(reset_gpio);
+ GCR |= GCR_ACLINK_OFF;
+ free_irq(IRQ_AC97, NULL);
+ if (ac97conf_clk) {
--- /dev/null
+From 267f8fa2e1eef0612b2007e1f1846bcbc35cc1fa Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Fri, 4 Jan 2013 21:18:12 +0000
+Subject: ASoC: wm2000: Fix sense of speech clarity enable
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 267f8fa2e1eef0612b2007e1f1846bcbc35cc1fa upstream.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm2000.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/codecs/wm2000.c
++++ b/sound/soc/codecs/wm2000.c
+@@ -190,9 +190,9 @@ static int wm2000_power_up(struct i2c_cl
+
+ ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY);
+ if (wm2000->speech_clarity)
+- ret &= ~WM2000_SPEECH_CLARITY;
+- else
+ ret |= WM2000_SPEECH_CLARITY;
++ else
++ ret &= ~WM2000_SPEECH_CLARITY;
+ wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret);
+
+ wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33);
--- /dev/null
+From 2a5f431592343b78896013b055582f94c12a5049 Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Fri, 21 Dec 2012 16:28:37 +0800
+Subject: ASoC: wm2200: Fix setting dai format in wm2200_set_fmt
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit 2a5f431592343b78896013b055582f94c12a5049 upstream.
+
+According to the defines in wm2200.h:
+/*
+ * R1284 (0x504) - Audio IF 1_5
+ */
+
+We should not left shift 1 bit for fmt_val when setting dai format.
+
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm2200.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wm2200.c
++++ b/sound/soc/codecs/wm2200.c
+@@ -1440,7 +1440,7 @@ static int wm2200_set_fmt(struct snd_soc
+ WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV,
+ lrclk);
+ snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5,
+- WM2200_AIF1_FMT_MASK << 1, fmt_val << 1);
++ WM2200_AIF1_FMT_MASK, fmt_val);
+
+ return 0;
+ }
--- /dev/null
+From 0cc411b934c4317b363d1af993549f391852b980 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Fri, 4 Jan 2013 10:48:10 +0000
+Subject: ASoC: wm2200: Remove DSP B and left justified AIF modes
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 0cc411b934c4317b363d1af993549f391852b980 upstream.
+
+These are not supported.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm2200.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/sound/soc/codecs/wm2200.c
++++ b/sound/soc/codecs/wm2200.c
+@@ -1380,15 +1380,9 @@ static int wm2200_set_fmt(struct snd_soc
+ case SND_SOC_DAIFMT_DSP_A:
+ fmt_val = 0;
+ break;
+- case SND_SOC_DAIFMT_DSP_B:
+- fmt_val = 1;
+- break;
+ case SND_SOC_DAIFMT_I2S:
+ fmt_val = 2;
+ break;
+- case SND_SOC_DAIFMT_LEFT_J:
+- fmt_val = 3;
+- break;
+ default:
+ dev_err(codec->dev, "Unsupported DAI format %d\n",
+ fmt & SND_SOC_DAIFMT_FORMAT_MASK);
--- /dev/null
+From 5f960294e2031d12f10c8488c3446fecbf59628d Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Fri, 4 Jan 2013 21:06:08 +0000
+Subject: ASoC: wm5100: Remove DSP B and left justified formats
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 5f960294e2031d12f10c8488c3446fecbf59628d upstream.
+
+These are not supported
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm5100.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/sound/soc/codecs/wm5100.c
++++ b/sound/soc/codecs/wm5100.c
+@@ -1296,15 +1296,9 @@ static int wm5100_set_fmt(struct snd_soc
+ case SND_SOC_DAIFMT_DSP_A:
+ mask = 0;
+ break;
+- case SND_SOC_DAIFMT_DSP_B:
+- mask = 1;
+- break;
+ case SND_SOC_DAIFMT_I2S:
+ mask = 2;
+ break;
+- case SND_SOC_DAIFMT_LEFT_J:
+- mask = 3;
+- break;
+ default:
+ dev_err(codec->dev, "Unsupported DAI format %d\n",
+ fmt & SND_SOC_DAIFMT_FORMAT_MASK);
regmap-debugfs-avoid-overflows-for-very-small-reads.patch
epoll-prevent-missed-events-on-epoll_ctl_mod.patch
hid-add-quirk-for-freescale-i.mx23-rom-recovery.patch
+asoc-wm2000-fix-sense-of-speech-clarity-enable.patch
+asoc-wm2200-fix-setting-dai-format-in-wm2200_set_fmt.patch
+asoc-wm2200-remove-dsp-b-and-left-justified-aif-modes.patch
+asoc-wm5100-remove-dsp-b-and-left-justified-formats.patch
+udldrmfb-fix-edid-not-working-with-monitors-with-edid.patch
+udldrmfb-udl_get_edid-usb_control_msg-buffer-must-not-be-on-the-stack.patch
+udldrmfb-udl_get_edid-drop-unneeded-i.patch
+alsa-pxa27x-fix-ac97-cold-reset.patch
+alsa-pxa27x-fix-ac97-warm-reset.patch
--- /dev/null
+From c930812fe5ebe725760422c9c351d1f6fde1502d Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 11 Jan 2013 12:08:56 +0100
+Subject: udldrmfb: Fix EDID not working with monitors with EDID
+ extension blocks
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit c930812fe5ebe725760422c9c351d1f6fde1502d upstream.
+
+udldrmfb only reads the main EDID block, and if that advertises extensions
+the drm_edid code expects them to be present, and starts reading beyond the
+buffer udldrmfb passes it.
+
+Although it may be possible to read more EDID info with the udl we simpy don't
+know how, and even if trial and error gets it working on one device, that is
+no guarantee it will work on other revisions. So this patch does a simple fix
+in the form of patching the EDID info to report 0 extension blocks, this
+fixes udldrmfb only doing 1024x768 on monitors with EDID extension blocks.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/udl/udl_connector.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/udl/udl_connector.c
++++ b/drivers/gpu/drm/udl/udl_connector.c
+@@ -59,6 +59,14 @@ static int udl_get_modes(struct drm_conn
+
+ connector->display_info.raw_edid = (char *)edid;
+
++ /*
++ * We only read the main block, but if the monitor reports extension
++ * blocks then the drm edid code expects them to be present, so patch
++ * the extension count to 0.
++ */
++ edid->checksum += edid->extensions;
++ edid->extensions = 0;
++
+ drm_mode_connector_update_edid_property(connector, edid);
+ ret = drm_add_edid_modes(connector, edid);
+ connector->display_info.raw_edid = NULL;
--- /dev/null
+From 7b4cf994e4c6ba48872bb25253cc393b7fb74c82 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 11 Jan 2013 12:08:58 +0100
+Subject: udldrmfb: udl_get_edid: drop unneeded i--
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 7b4cf994e4c6ba48872bb25253cc393b7fb74c82 upstream.
+
+This is a left-over from when udl_get_edid returned the amount of bytes
+successfully read, which it no longer does.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/udl/udl_connector.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/gpu/drm/udl/udl_connector.c
++++ b/drivers/gpu/drm/udl/udl_connector.c
+@@ -40,7 +40,6 @@ static u8 *udl_get_edid(struct udl_devic
+ HZ);
+ if (ret < 1) {
+ DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);
+- i--;
+ goto error;
+ }
+ block[i] = rbuf[1];
--- /dev/null
+From 242187b362555849e8c971dfbbfd55f8bd9fa717 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 11 Jan 2013 12:08:57 +0100
+Subject: udldrmfb: udl_get_edid: usb_control_msg buffer must not be on the stack
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 242187b362555849e8c971dfbbfd55f8bd9fa717 upstream.
+
+The buffer passed to usb_control_msg may end up in scatter-gather list, and
+may thus not be on the stack. Having it on the stack usually works on x86, but
+not on other archs.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/udl/udl_connector.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/udl/udl_connector.c
++++ b/drivers/gpu/drm/udl/udl_connector.c
+@@ -22,13 +22,17 @@
+ static u8 *udl_get_edid(struct udl_device *udl)
+ {
+ u8 *block;
+- char rbuf[3];
++ char *rbuf;
+ int ret, i;
+
+ block = kmalloc(EDID_LENGTH, GFP_KERNEL);
+ if (block == NULL)
+ return NULL;
+
++ rbuf = kmalloc(2, GFP_KERNEL);
++ if (rbuf == NULL)
++ goto error;
++
+ for (i = 0; i < EDID_LENGTH; i++) {
+ ret = usb_control_msg(udl->ddev->usbdev,
+ usb_rcvctrlpipe(udl->ddev->usbdev, 0), (0x02),
+@@ -42,10 +46,12 @@ static u8 *udl_get_edid(struct udl_devic
+ block[i] = rbuf[1];
+ }
+
++ kfree(rbuf);
+ return block;
+
+ error:
+ kfree(block);
++ kfree(rbuf);
+ return NULL;
+ }
+