From: <bal...@us...> - 2007-02-27 03:12:37
|
Revision: 878 http://svn.sourceforge.net/hackndev/?rev=878&view=rev Author: balrog-kun Date: 2007-02-26 19:12:35 -0800 (Mon, 26 Feb 2007) Log Message: ----------- TT3: tsc2101 and flash update and minor cleanup. Modified Paths: -------------- linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c linux4palm/linux/trunk/drivers/soc/tsc2101.c linux4palm/linux/trunk/include/linux/soc/tsc2101.h linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h Modified: linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c =================================================================== --- linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c 2007-02-27 03:12:35 UTC (rev 878) @@ -1465,7 +1465,7 @@ if (!host->irq) return; -#define UREG(x) free_irq(IRQ_GPIO(x), (void*) x); +#define UREG(x) free_irq(IRQ_GPIO(x), (void *) x) UREG(2); UREG(8); Modified: linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c 2007-02-27 03:12:35 UTC (rev 878) @@ -10,7 +10,6 @@ * Thomas Gleixner <tg...@li...> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> Modified: linux4palm/linux/trunk/drivers/soc/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/soc/tsc2101.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/soc/tsc2101.c 2007-02-27 03:12:35 UTC (rev 878) @@ -95,13 +95,14 @@ } } -static irqreturn_t tsc2101_headset_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tsc2101_headset_int(int irq, void *dev_id) { tsc2101_set_route(); return IRQ_HANDLED; } -static int tsc2101_snd_activate(void) { +static int tsc2101_snd_activate(void) +{ u32 data; if(snd_data == NULL) @@ -135,11 +136,16 @@ tsc2101_regwrite(snd_data, TSC2101_REG_MICAGC, TSC2101_MMPGA(0) | TSC2101_MDEBNS(0x03) | TSC2101_MDEBSN(0x03) ); - //Hack - PalmOS sets that, so cleaning it + /* + * Hack - PalmOS sets that, so cleaning it. + * + * XXX: shouldn't we be just resetting the chip instead? + */ tsc2101_regwrite(snd_data, TSC2101_REG_HEADSETPGA, 0x0000); - data = request_irq (IRQ_GPIO(55), tsc2101_headset_int, SA_SAMPLE_RANDOM, "TSC2101 Headphones", (void*)55); - set_irq_type (IRQ_GPIO(55), IRQT_RISING); + data = request_irq(IRQ_GPIO(55), tsc2101_headset_int, + SA_INTERRUPT | SA_TRIGGER_RISING, + "TSC2101 Headphones", (void *) 55); if(data) return data; @@ -148,12 +154,14 @@ return 0; } -static void tsc2101_snd_deactivate(void) { +static void tsc2101_snd_deactivate(void) +{ snd_pxa2xx_i2sound_i2slink_free(); - free_irq(IRQ_GPIO(55), (void*) 55); + free_irq(IRQ_GPIO(55), (void *) 55); } -static int tsc2101_snd_set_rate(unsigned int rate) { +static int tsc2101_snd_set_rate(unsigned int rate) +{ uint div, fs_44; u32 data; @@ -529,39 +537,54 @@ return 0; } +#ifdef CONFIG_PM +static int tsc2101_snd_suspend(pm_message_t state) +{ + tsc2101_snd_deactivate(); + return 0; +} + +static int tsc2101_snd_resume(void) +{ + return tsc2101_snd_activate(); +} +#else +# define tsc2101_snd_suspend 0 +# define tsc2101_snd_resume 0 +#endif + static struct snd_pxa2xx_i2sound_board tsc2101_audio = { - .name = "tsc2101 Audio", - .desc = "TI tsc2101 Audio driver", - .acard_id = "tsc2101", - .info = SND_PXA2xx_I2SOUND_INFO_CAN_CAPTURE | SND_PXA2xx_I2SOUND_INFO_CLOCK_FROM_PXA | - SND_PXA2xx_I2SOUND_INFO_SYSCLOCK_DISABLE, - .activate = tsc2101_snd_activate, - .deactivate = tsc2101_snd_deactivate, - .set_rate = tsc2101_snd_set_rate, - .open_stream = tsc2101_snd_open_stream, - .close_stream = tsc2101_snd_close_stream, - .add_mixer_controls = tsc2101_snd_add_mixer_controls, + .name = "tsc2101 Audio", + .desc = "TI tsc2101 Audio driver", + .acard_id = "tsc2101", + .info = SND_PXA2xx_I2SOUND_INFO_CAN_CAPTURE | + SND_PXA2xx_I2SOUND_INFO_CLOCK_FROM_PXA | + SND_PXA2xx_I2SOUND_INFO_SYSCLOCK_DISABLE, + .activate = tsc2101_snd_activate, + .deactivate = tsc2101_snd_deactivate, + .set_rate = tsc2101_snd_set_rate, + .open_stream = tsc2101_snd_open_stream, + .close_stream = tsc2101_snd_close_stream, + .add_mixer_controls = tsc2101_snd_add_mixer_controls, - .streams_hw = { - { - .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, + .streams_hw = { + { + .rates = SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rate_min = 8000, .rate_max = 48000, - }, - { - .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, + }, + { + .rates = SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rate_min = 8000, .rate_max = 48000, - } - }, -#ifdef CONFIG_PM - .suspend = tsc2101_snd_activate, - .resume = tsc2101_snd_deactivate -#endif + } + }, + .suspend = tsc2101_snd_suspend, + .resume = tsc2101_snd_resume, }; @@ -570,9 +593,11 @@ */ extern void tsc2101_ts_setup(struct device *dev); -extern void tsc2101_ts_report(struct tsc2101_data *devdata, int x, int y, int p, int pendown); +extern void tsc2101_ts_report(struct tsc2101_data *devdata, + int x, int y, int p, int pendown); -static void tsc2101_readdata(struct tsc2101_data *devdata, struct tsc2101_ts_event *ts_data) +static void tsc2101_readdata(struct tsc2101_data *devdata, + struct tsc2101_ts_event *ts_data) { int z1,z2,fixadc=0; u32 values[4],status; @@ -689,7 +714,7 @@ devdata->pendown = 0; - set_irq_type(devdata->platform->irq,IRQT_FALLING); + set_irq_type(devdata->platform->irq, IRQT_FALLING); /* This must be checked after set_irq_type() to make sure no data was missed */ if (devdata->platform->pendown()) { @@ -712,8 +737,8 @@ static irqreturn_t tsc2101_handler(int irq, void *dev_id, struct pt_regs *regs) { struct tsc2101_data *devdata = dev_id; - - set_irq_type(devdata->platform->irq,IRQT_NOEDGE); + + set_irq_type(devdata->platform->irq, IRQT_NOEDGE); ts_interrupt_main(devdata, 0, regs); return IRQ_HANDLED; } @@ -818,7 +843,7 @@ tsc2101_ts_setup(dev); tsc2101_ts_enable(devdata); - set_irq_type(devdata->platform->irq,IRQT_FALLING); + set_irq_type(devdata->platform->irq, IRQT_FALLING); /* Check there is no pending data */ tsc2101_readdata(devdata, &ts_data); Modified: linux4palm/linux/trunk/include/linux/soc/tsc2101.h =================================================================== --- linux4palm/linux/trunk/include/linux/soc/tsc2101.h 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/include/linux/soc/tsc2101.h 2007-02-27 03:12:35 UTC (rev 878) @@ -42,7 +42,3 @@ int irq; int (*pendown) (void); }; - - - - Modified: linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h =================================================================== --- linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h 2007-02-27 03:12:35 UTC (rev 878) @@ -55,8 +55,8 @@ #ifdef CONFIG_PM /* Power Management */ - int (*suspend) (pm_message_t state); - int (*resume) (void); + int (*suspend)(pm_message_t state); + int (*resume)(void); #endif }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |