···15491549 return error;15501550 list_add_tail_rcu(&handle->d_node, &dev->h_list);15511551 mutex_unlock(&dev->mutex);15521552- synchronize_rcu();1553155215541553 /*15551554 * Since we are supposed to be called from ->connect()
···214214215215config HP_SDC_RTC216216 tristate "HP SDC Real Time Clock"217217- depends on GSC || HP300217217+ depends on (GSC || HP300) && SERIO218218 select HP_SDC219219 help220220 Say Y here if you want to support the built-in real time clock
···712712static int i8042_controller_selftest(void)713713{714714 unsigned char param;715715+ int i = 0;715716716717 if (!i8042_reset)717718 return 0;718719719719- if (i8042_command(¶m, I8042_CMD_CTL_TEST)) {720720- printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");721721- return -ENODEV;722722- }720720+ /*721721+ * We try this 5 times; on some really fragile systems this does not722722+ * take the first time...723723+ */724724+ do {723725724724- if (param != I8042_RET_CTL_TEST) {726726+ if (i8042_command(¶m, I8042_CMD_CTL_TEST)) {727727+ printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");728728+ return -ENODEV;729729+ }730730+731731+ if (param == I8042_RET_CTL_TEST)732732+ return 0;733733+725734 printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",726726- param, I8042_RET_CTL_TEST);727727- return -EIO;728728- }735735+ param, I8042_RET_CTL_TEST);736736+ msleep(50);737737+ } while (i++ < 5);729738739739+#ifdef CONFIG_X86740740+ /*741741+ * On x86, we don't fail entire i8042 initialization if controller742742+ * reset fails in hopes that keyboard port will still be functional743743+ * and user will still get a working keyboard. This is especially744744+ * important on netbooks. On other arches we trust hardware more.745745+ */746746+ printk(KERN_INFO747747+ "i8042: giving up on controller selftest, continuing anyway...\n");730748 return 0;749749+#else750750+ return -EIO;751751+#endif731752}732753733754/*
···127127 void (*filter_cleanup)(void *data);128128 int (*get_pendown_state)(void);129129 int gpio_pendown;130130+131131+ void (*wait_for_sync)(void);130132};131133132134/* leave chip selected when we're done, for quicker re-select? */···513511 return !gpio_get_value(ts->gpio_pendown);514512}515513514514+static void null_wait_for_sync(void)515515+{516516+}517517+516518/*517519 * PENIRQ only kicks the timer. The timer only reissues the SPI transfer,518520 * to retrieve touchscreen status.···692686 default:693687 BUG();694688 }689689+ ts->wait_for_sync();695690 status = spi_async(ts->spi, m);696691 if (status)697692 dev_err(&ts->spi->dev, "spi_async --> %d\n",···730723 } else {731724 /* pen is still down, continue with the measurement */732725 ts->msg_idx = 0;726726+ ts->wait_for_sync();733727 status = spi_async(ts->spi, &ts->msg[0]);734728 if (status)735729 dev_err(&ts->spi->dev, "spi_async --> %d\n", status);···754746 * that here. (The "generic irq" framework may help...)755747 */756748 ts->irq_disabled = 1;757757- disable_irq(ts->spi->irq);749749+ disable_irq_nosync(ts->spi->irq);758750 ts->pending = 1;759751 hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),760752 HRTIMER_MODE_REL);···954946 if (pdata->penirq_recheck_delay_usecs)955947 ts->penirq_recheck_delay_usecs =956948 pdata->penirq_recheck_delay_usecs;949949+950950+ ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync;957951958952 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));959953
+18-11
drivers/input/touchscreen/da9034-ts.c
···33 *44 * Copyright (C) 2006-2008 Marvell International Ltd.55 * Fengwei Yin <fengwei.yin@marvell.com>66+ * Bin Yang <bin.yang@marvell.com>67 * Eric Miao <eric.miao@marvell.com>78 *89 * This program is free software; you can redistribute it and/or modify···176175 goto err_reset;177176178177 touch->state = STATE_STOP;178178+179179+ /* FIXME: PEN_{UP/DOWN} events are expected to be180180+ * available by stopping TSI, but this is found not181181+ * always true, delay and simulate such an event182182+ * here is more reliable183183+ */184184+ mdelay(1);185185+ da9034_event_handler(touch,186186+ is_pen_down(touch) ? EVENT_PEN_DOWN :187187+ EVENT_PEN_UP);179188 break;180189181190 case STATE_STOP:···200189 report_pen_up(touch);201190 touch->state = STATE_IDLE;202191 }203203-204204- input_sync(touch->input_dev);205192 break;206193207194 case STATE_WAIT:···209200 if (is_pen_down(touch)) {210201 start_tsi(touch);211202 touch->state = STATE_BUSY;212212- } else203203+ } else {204204+ report_pen_up(touch);213205 touch->state = STATE_IDLE;206206+ }214207 break;215208 }216209 return;···237226 struct da9034_touch *touch =238227 container_of(nb, struct da9034_touch, notifier);239228240240- if (event & DA9034_EVENT_PEN_DOWN) {241241- if (is_pen_down(touch))242242- da9034_event_handler(touch, EVENT_PEN_DOWN);243243- else244244- da9034_event_handler(touch, EVENT_PEN_UP);245245- }246246-247229 if (event & DA9034_EVENT_TSI_READY)248230 da9034_event_handler(touch, EVENT_TSI_READY);231231+232232+ if ((event & DA9034_EVENT_PEN_DOWN) && touch->state == STATE_IDLE)233233+ da9034_event_handler(touch, EVENT_PEN_DOWN);249234250235 return 0;251236}···392385module_exit(da9034_touch_exit);393386394387MODULE_DESCRIPTION("Touchscreen driver for Dialog Semiconductor DA9034");395395-MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>");388388+MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>, Bin Yang <bin.yang@marvell.com>");396389MODULE_LICENSE("GPL");397390MODULE_ALIAS("platform:da9034-touch");
+3-4
drivers/input/touchscreen/mainstone-wm97xx.c
···111111#else112112static void wm97xx_acc_pen_up(struct wm97xx *wm)113113{114114- int count = 16;114114+ unsigned int count;115115+115116 schedule_timeout_uninterruptible(1);116117117117- while (count < 16) {118118+ for (count = 0; count < 16; count++)118119 MODR;119119- count--;120120- }121120}122121#endif123122
+1-2
drivers/input/touchscreen/wm97xx-core.c
···370370 * provided. */371371 BUG_ON(!wm->mach_ops->irq_enable);372372373373- if (request_irq(wm->pen_irq, wm97xx_pen_interrupt,374374- IRQF_SHARED | IRQF_SAMPLE_RANDOM,373373+ if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, IRQF_SHARED,375374 "wm97xx-pen", wm)) {376375 dev_err(wm->dev,377376 "Failed to register pen down interrupt, polling");
+1
include/linux/spi/ads7846.h
···5151 void **filter_data);5252 int (*filter) (void *filter_data, int data_idx, int *val);5353 void (*filter_cleanup)(void *filter_data);5454+ void (*wait_for_sync)(void);5455};5556