From: <sle...@us...> - 2007-06-22 01:43:24
|
Revision: 1043 http://svn.sourceforge.net/hackndev/?rev=1043&view=rev Author: sleep_walker Date: 2007-06-21 18:43:20 -0700 (Thu, 21 Jun 2007) Log Message: ----------- l4p: tsc2101 cleaning Modified Paths: -------------- linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 01:34:51 UTC (rev 1042) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 01:43:20 UTC (rev 1043) @@ -142,7 +142,7 @@ tsc2101_regwrite(devdata, TSC2101_REG_ADC, 0x4000); } -static void ts_interrupt_main(struct tsc2101_data *devdata, int isTimer, struct pt_regs *regs) +static void ts_interrupt_main(struct tsc2101_data *devdata, int isTimer) { unsigned long flags; struct tsc2101_ts_event ts_data; @@ -181,15 +181,15 @@ { struct tsc2101_data *devdata = (struct tsc2101_data *) data; - ts_interrupt_main(devdata, 1, NULL); + ts_interrupt_main(devdata, 1); } -static irqreturn_t tsc2101_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tsc2101_handler(int irq, void *dev_id) { struct tsc2101_data *devdata = dev_id; set_irq_type(devdata->platform->irq,IRQT_NOEDGE); - ts_interrupt_main(devdata, 0, regs); + ts_interrupt_main(devdata, 0); return IRQ_HANDLED; } @@ -238,9 +238,10 @@ printk(KERN_ERR "TSC2101 Temp2: %04x\n",devdata->miscdata.temp2); } -static int tsc2101_suspend(struct device *dev, u32 state, u32 level) +static int tsc2101_suspend(struct device *dev, pm_message_t state) { struct tsc2101_data *devdata = dev_get_drvdata(dev); + /* comment this out like in old driver, it's sick though */ /* if (level == SUSPEND_POWER_DOWN) { */ tsc2101_ts_disable(devdata); @@ -250,7 +251,7 @@ return 0; } -static int tsc2101_resume(struct device *dev, u32 level) +static int tsc2101_resume(struct device *dev) { struct tsc2101_data *devdata = dev_get_drvdata(dev); @@ -311,7 +312,7 @@ free_irq(devdata->platform->irq, devdata); del_timer_sync(&devdata->ts_timer); del_timer_sync(&devdata->misc_timer); - input_unregister_device(&devdata->inputdevice); + input_unregister_device(devdata->inputdevice); tsc2101_ts_disable(devdata); kfree(devdata); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-07-08 02:05:05
|
Revision: 1117 http://svn.sourceforge.net/hackndev/?rev=1117&view=rev Author: sleep_walker Date: 2007-07-07 19:05:01 -0700 (Sat, 07 Jul 2007) Log Message: ----------- palmtt3: ghost tap fixed, calibration works properly Modified Paths: -------------- linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-07-07 21:35:41 UTC (rev 1116) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-07-08 02:05:01 UTC (rev 1117) @@ -645,7 +645,7 @@ //tsc2101_regwrite(devdata, TSC2101_REG_RESETCTL, 0xbb00); /* PINTDAV is data available only */ - tsc2101_regwrite(devdata, TSC2101_REG_STATUS, 0x4000); + tsc2101_regwrite(devdata, TSC2101_REG_STATUS, 0x2000); /* disable buffer mode */ tsc2101_regwrite(devdata, TSC2101_REG_BUFMODE, 0x0); @@ -736,6 +736,7 @@ static int i=0; unsigned long flags; + if (devdata->pendown == 0) { i++; spin_lock_irqsave(&devdata->lock, flags); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-07-10 19:43:43
|
Revision: 1127 http://svn.sourceforge.net/hackndev/?rev=1127&view=rev Author: sleep_walker Date: 2007-07-10 12:43:40 -0700 (Tue, 10 Jul 2007) Log Message: ----------- palmtt3: fixed sound quality problem in tsc2101 ;) Modified Paths: -------------- linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-07-10 13:06:41 UTC (rev 1126) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-07-10 19:43:40 UTC (rev 1127) @@ -172,45 +172,46 @@ printk("Rate: %d ", rate); if (rate >= 48000) - { div = 7; fs_44 = 1; } + { div = 0; fs_44 = 0; } else if (rate >= 44100) - { div = 7; fs_44 = 0; } + { div = 0; fs_44 = 1; } else if (rate >= 32000) - { div = 6; fs_44 = 1; } + { div = 1; fs_44 = 0; } else if (rate >= 29400) - { div = 6; fs_44 = 0; } + { div = 1; fs_44 = 1; } else if (rate >= 24000) - { div = 5; fs_44 = 1; } + { div = 2; fs_44 = 0; } else if (rate >= 22050) - { div = 5; fs_44 = 0; } + { div = 2; fs_44 = 1; } else if (rate >= 16000) - { div = 4; fs_44 = 1; } + { div = 3; fs_44 = 0; } else if (rate >= 14700) + { div = 3; fs_44 = 1; } + else if (rate >= 12000) { div = 4; fs_44 = 0; } - else if (rate >= 12000) - { div = 3; fs_44 = 1; } else if (rate >= 11025) - { div = 3; fs_44 = 0; } + { div = 4; fs_44 = 1; } else if (rate >= 9600) - { div = 2; fs_44 = 1; } + { div = 5; fs_44 = 0; } else if (rate >= 8820) - { div = 2; fs_44 = 0; } + { div = 5; fs_44 = 1; } else if (rate >= 8727) - { div = 1; fs_44 = 1; } + { div = 6; fs_44 = 0; } else if (rate >= 8018) - { div = 1; fs_44 = 0; } + { div = 6; fs_44 = 1; } else if (rate >= 8000) - { div = 0; fs_44 = 1; } + { div = 7; fs_44 = 0; } else - { div = 0; fs_44 = 0; } + { div = 7; fs_44 = 1; } /* wait for any frame to complete */ udelay(125); /* Set AC1 */ data = tsc2101_regread(snd_data, TSC2101_REG_AUDIOCON1); - /*Clear prev settings */ + /* Clear prev settings */ data &= ~(TSC2101_DACFS(0xF) | TSC2101_ADCFS(0xF)); + data |= TSC2101_DACFS(div) | TSC2101_ADCFS(div); tsc2101_regwrite(snd_data, TSC2101_REG_AUDIOCON1, data); @@ -657,8 +658,8 @@ /* enable touch detection, 84usec precharge time, 32 usec sense time */ tsc2101_regwrite(devdata, TSC2101_REG_CONFIG, 0x08); - /* 3 msec conversion delays */ - tsc2101_regwrite(devdata, TSC2101_REG_DELAY, 0x0900); + /* 3 msec conversion delays, 12 MHz MClk */ + tsc2101_regwrite(devdata, TSC2101_REG_DELAY, 0x0900 | 0xc); /* * TSC2101-controlled conversions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-09-11 09:03:18
|
Revision: 1304 http://hackndev.svn.sourceforge.net/hackndev/?rev=1304&view=rev Author: sleep_walker Date: 2007-09-11 02:03:13 -0700 (Tue, 11 Sep 2007) Log Message: ----------- palmtt3: bugfix #41 candidate Modified Paths: -------------- linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-09-10 08:13:39 UTC (rev 1303) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-09-11 09:03:13 UTC (rev 1304) @@ -687,19 +687,22 @@ spin_lock_irqsave(&devdata->lock, flags); - //if (!tsc2101_ts_penup(devdata)) { if (devdata->platform->pendown()) { + /* if touchscreen is just touched */ devdata->pendown = 1; tsc2101_readdata(devdata, &ts_data); - tsc2101_ts_report(devdata, ts_data.x, ts_data.y, ts_data.p, 1); + tsc2101_ts_report(devdata, ts_data.x, ts_data.y, ts_data.p, /*1*/ !!ts_data.p); mod_timer(&(devdata->ts_timer), jiffies + HZ / 100); } else if (devdata->pendown > 0 && devdata->pendown < 3) { + /* if touchscreen was touched short time ago and it's possible that it's only surface indirectness */ mod_timer(&(devdata->ts_timer), jiffies + HZ / 100); devdata->pendown++; } else { - if (devdata->pendown) + /* if touchscreen was touched long time ago - it was probably released */ + if (devdata->pendown) { + tsc2101_readdata(devdata, &ts_data); tsc2101_ts_report(devdata, 0, 0, 0, 0); - + } devdata->pendown = 0; set_irq_type(devdata->platform->irq,IRQT_FALLING); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |