diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-11-18 04:18:54 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-11-18 09:38:27 +0300 |
commit | 0ea95a4869e7df81227ccbccc46147d43ad5bd61 (patch) | |
tree | 6c88e6b31fa98446deb2225a1045733baa89bd41 /packages/linux/linux-rp-2.6.24 | |
parent | 2b3c7bc65fe2b13de52a520e46bf6487ba3fae55 (diff) |
linux-rp-2.6.24: fix tosa kernel
add two patches: one to correctly initialise the AC97 interface on PXA,
other to fixup the tosa-bl driver (most important thing is pxa_gpio_mode() setting).
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'packages/linux/linux-rp-2.6.24')
-rw-r--r-- | packages/linux/linux-rp-2.6.24/tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch | 56 | ||||
-rw-r--r-- | packages/linux/linux-rp-2.6.24/tosa/tosa-bl-fixup.diff | 103 |
2 files changed, 159 insertions, 0 deletions
diff --git a/packages/linux/linux-rp-2.6.24/tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch b/packages/linux/linux-rp-2.6.24/tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch new file mode 100644 index 0000000000..09f0cb946c --- /dev/null +++ b/packages/linux/linux-rp-2.6.24/tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch @@ -0,0 +1,56 @@ +From 688df15bb534519e0698cc8e4a4d9234afd32105 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov <dbaryshkov@gmail.com> +Date: Fri, 7 Nov 2008 15:50:39 +0300 +Subject: [PATCH] pxa2xx-ac97: switch AC unit to correct state before probing + +If AC97 unit is in partially enabled state, early request_irq can trigger +IRQ storm or even full hang up. Workaround this by forcibly switching ACLINK off +at the start of the probe. + +Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> +--- + sound/soc/pxa/pxa2xx-ac97.c | 30 +++++++++++++++++------------- + 1 files changed, 17 insertions(+), 13 deletions(-) + +Index: linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c +=================================================================== +--- linux-2.6.24.orig/sound/soc/pxa/pxa2xx-ac97.c 2008-01-25 01:58:37.000000000 +0300 ++++ linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c 2008-11-15 20:02:45.396976363 +0300 +@@ -284,10 +284,6 @@ static int pxa2xx_ac97_probe(struct plat + { + int ret; + +- ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL); +- if (ret < 0) +- goto err; +- + pxa_gpio_mode(GPIO31_SYNC_AC97_MD); + pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD); + pxa_gpio_mode(GPIO28_BITCLK_AC97_MD); +@@ -296,15 +292,23 @@ static int pxa2xx_ac97_probe(struct plat + /* Use GPIO 113 as AC97 Reset on Bulverde */ + pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); + #endif ++ GCR = GCR_ACLINK_OFF; ++ + pxa_set_cken(CKEN_AC97, 1); ++ ++ ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL); ++ if (ret < 0) ++ goto err; ++ ++ + return 0; + +- err: +- if (CKEN & (1 << CKEN_AC97)) { ++err: ++/* if (CKEN & (1 << CKEN_AC97)) {*/ + GCR |= GCR_ACLINK_OFF; + free_irq(IRQ_AC97, NULL); + pxa_set_cken(CKEN_AC97, 0); +- } ++/* }*/ + return ret; + } + diff --git a/packages/linux/linux-rp-2.6.24/tosa/tosa-bl-fixup.diff b/packages/linux/linux-rp-2.6.24/tosa/tosa-bl-fixup.diff new file mode 100644 index 0000000000..c4a23d1f49 --- /dev/null +++ b/packages/linux/linux-rp-2.6.24/tosa/tosa-bl-fixup.diff @@ -0,0 +1,103 @@ +Index: linux-2.6.24/drivers/video/backlight/tosa_bl.c +=================================================================== +--- linux-2.6.24.orig/drivers/video/backlight/tosa_bl.c 2008-11-15 22:59:51.592985003 +0300 ++++ linux-2.6.24/drivers/video/backlight/tosa_bl.c 2008-11-18 04:08:13.021416618 +0300 +@@ -76,6 +76,8 @@ static void pxa_nssp_output(struct tosa_ + + static void tosa_set_backlight(struct tosa_bl_data *data, int brightness) + { ++ pr_debug("tosa_set_backlight\n"); ++ + /* SetBacklightDuty */ + i2c_smbus_write_byte_data(&data->client, DAC_CH2, (unsigned char)brightness); + +@@ -91,7 +93,7 @@ static void tosa_set_backlight(struct to + + static void tosa_lcd_tg_init(struct tosa_bl_data *data) + { +- dev_dbg(&data->bl_dev->dev, "tosa_lcd_init\n"); ++ pr_debug("tosa_lcd_init\n"); + + /* L3V On */ + set_scoop_gpio( &tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC6393XB_L3V_ON); +@@ -116,7 +118,7 @@ static void tosa_lcd_tg_on(struct tosa_b + + tosa_lcd_tg_init(data); + +- dev_dbg(&data->bl_dev->dev, "tosa_lcd_on: %04x (%d)\n", value, mode->yres); ++ pr_debug("tosa_lcd_on: %04x (%d)\n", value, mode->yres); + pxa_nssp_output(data, TG_PNLCTL, value); + + /* TG LCD pannel power up */ +@@ -129,12 +131,15 @@ static void tosa_lcd_tg_on(struct tosa_b + + /* set common voltage */ + i2c_smbus_write_byte_data(&data->client, DAC_CH1, data->comadj); ++ ++ tosa_set_backlight(data, data->bl_dev->props.brightness); ++ + } + + static void tosa_lcd_tg_off(struct tosa_bl_data *data) + { + tosa_set_backlight(data, 0); +- dev_dbg(&data->bl_dev->dev, "tosa_lcd_off\n"); ++ pr_debug("tosa_lcd_off\n"); + /* TG LCD VHSA off */ + pxa_nssp_output(data, TG_PINICTL,0x4); + mdelay(50); +@@ -158,8 +163,6 @@ static int tosa_bl_update_status(struct + struct tosa_bl_data *data = dev_get_drvdata(&dev->dev); + int new_power = max(props->power, props->fb_blank); + +- tosa_set_backlight(data, props->brightness); +- + if (new_power) + tosa_lcd_tg_off(data); + else +@@ -223,22 +226,26 @@ static int tosa_bl_detect_client(struct + + err = gpio_request(TOSA_TC6393XB_BL_C20MA, "backlight"); + if (err) { +- dev_dbg(&data->bl_dev->dev, "Unable to request gpio!\n"); ++ printk(KERN_ERR "tosa-bl; Unable to request gpio!\n"); + goto err_gpio_bl; + } + + err = gpio_request(TOSA_TC6393XB_TG_ON, "tg"); + if (err) { +- dev_dbg(&data->bl_dev->dev, "Unable to request gpio!\n"); ++ printk(KERN_ERR "tosa-bl: Unable to request gpio!\n"); + goto err_gpio_tg; + } + + err = ssp_init(&data->nssp_dev,2,0); + if (err) { +- dev_err(&data->bl_dev->dev, "Unable to register NSSP handler!\n"); ++ printk(KERN_ERR "tosa-bl: Unable to register NSSP handler!\n"); + goto err_ssp_init; + } + ++ pxa_gpio_mode(GPIO83_NSSP_TX); ++ pxa_gpio_mode(GPIO81_NSSP_CLK_OUT); ++ pxa_gpio_mode(GPIO82_NSSP_FRM_OUT); ++ + /* Tell the i2c layer a new client has arrived */ + err = i2c_attach_client(client); + if (err) +@@ -269,7 +276,6 @@ static int tosa_bl_detect_client(struct + err_fb_register: + backlight_device_unregister(data->bl_dev); + err_bl_register: +- tosa_set_backlight(data, 0); + tosa_lcd_tg_off(data); + + err = i2c_detach_client(client); +@@ -296,7 +302,6 @@ static int tosa_bl_detach_client(struct + + backlight_device_unregister(data->bl_dev); + +- tosa_set_backlight(data, 0); + tosa_lcd_tg_off(data); + + /* Try to detach the client from i2c space */ |