/* * touch_det sometimes get desasserted or just get stuck. This appears * to be a silicon bug, We still have to clarify this with the * manufacture. As a workaround We release the key anyway if the * touch_det keeps coming in after 4ms, while the FIFO contains no value * during the whole time.
*/ while ((int_sta & (1 << STMPE_IRQ_TOUCH_DET)) && (timeout > 0)) {
timeout--;
int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA);
udelay(100);
}
/* reset the FIFO before we report release event */
__stmpe_reset_fifo(ts->stmpe);
static irqreturn_t stmpe_ts_handler(int irq, void *data)
{
u8 data_set[4]; int x, y, z; struct stmpe_touch *ts = data;
/* * Cancel scheduled polling for release if we have new value * available. Wait if the polling is already running.
*/
cancel_delayed_work_sync(&ts->work);
/* * The FIFO sometimes just crashes and stops generating interrupts. This * appears to be a silicon bug. We still have to clarify this with * the manufacture. As a workaround we disable the TSC while we are * collecting data and flush the FIFO after reading
*/
stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL,
STMPE_TSC_CTRL_TSC_EN, 0);
ret = stmpe_enable(stmpe, STMPE_BLOCK_TOUCHSCREEN | STMPE_BLOCK_ADC); if (ret) {
dev_err(dev, "Could not enable clock for ADC and TS\n"); return ret;
}
ret = stmpe811_adc_common_init(stmpe); if (ret) {
stmpe_disable(stmpe, STMPE_BLOCK_TOUCHSCREEN | STMPE_BLOCK_ADC); return ret;
}
ret = stmpe_set_bits(stmpe, STMPE_REG_TSC_CFG, tsc_cfg_mask, tsc_cfg); if (ret) {
dev_err(dev, "Could not config touch\n"); return ret;
}
ret = stmpe_set_bits(stmpe, STMPE_REG_TSC_FRACTION_Z,
STMPE_FRACTION_Z(0xff), STMPE_FRACTION_Z(ts->fraction_z)); if (ret) {
dev_err(dev, "Could not config touch\n"); return ret;
}
ret = stmpe_set_bits(stmpe, STMPE_REG_TSC_I_DRIVE,
STMPE_I_DRIVE(0xff), STMPE_I_DRIVE(ts->i_drive)); if (ret) {
dev_err(dev, "Could not config touch\n"); return ret;
}
/* set FIFO to 1 for single point reading */
ret = stmpe_reg_write(stmpe, STMPE_REG_FIFO_TH, 1); if (ret) {
dev_err(dev, "Could not set FIFO\n"); return ret;
}
ret = stmpe_set_bits(stmpe, STMPE_REG_TSC_CTRL,
STMPE_OP_MODE(0xff), STMPE_OP_MODE(OP_MOD_XYZ)); if (ret) {
dev_err(dev, "Could not set mode\n"); return ret;
}
return 0;
}
staticint stmpe_ts_open(struct input_dev *dev)
{ struct stmpe_touch *ts = input_get_drvdata(dev); int ret = 0;
ret = __stmpe_reset_fifo(ts->stmpe); if (ret) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.