Re: [PATCH] ili210x: Add support for Ilitek ILI210x based touchscreens

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 06, 2012 at 02:42:52PM +0100, Henrik Rydberg wrote:
> > I propose to change the handling of the interrupt by the code below.
> > 
> > #define POLL_PERIOD	msecs_to_jiffies(1)
> > 
> > static void ili210x_work(struct work_struct *work)
> > {
> > 	struct ili210x *priv = container_of(work, struct ili210x,
> > 					    dwork.work);
> > 	struct input_dev *input = priv->input;
> > 	struct i2c_client *client = priv->client;
> > 	struct device *dev = &client->dev;
> > 	struct touchdata touchdata;
> > 	int rc;
> > 
> > 	rc = ili210x_read_reg(client, REG_TOUCHDATA, &touchdata,
> > 			      sizeof(touchdata));
> > 	if (rc < 0) {
> > 		dev_err(dev, "Unable to get touchdata, err = %d\n",
> > 			rc);
> > 		return;
> > 	}
> > 
> > 	ili210x_report_events(input, &touchdata);
> > 
> > 	if ((touchdata.status & 0xf3) || get_pendown_state(priv))
> > 		schedule_delayed_work(&priv->dwork, POLL_PERIOD);
> > }
> > 
> > static irqreturn_t ili210x_irq(int irq, void *irq_data)
> > {
> > 	struct ili210x *priv = irq_data;
> > 
> > 	schedule_delayed_work(&priv->dwork, 0);
> > 
> > 	return IRQ_HANDLED;
> > }
> > 
> > It removes the timer and handle the case of level triggered and edge
> > triggered interrupts.
> > What do you think about that ?
> 
> Looks a lot nicer, thank you!

Ok thanks I'll send a new version of the patch including that and the
changes for the remarks you made before.

-- 
Olivier Sobrie
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux