Hi. This patch allow to use the device even if its interrupts lines aren't routed. I tried to minimize the impact of the patch on the original code, and if the CONFIG_INPUT_ADXL34X_ALLOW_POLLING option is disabled, the code should be unchanged. Please give me your opinion. Thanks. Paul. ======================================== Message du 12/04/11 08:23 De : "Dmitry Torokhov" A : paul.chavent@xxxxxxxx Copie à : michael.hennerich@xxxxxxxxxx, device-driver-devel@xxxxxxxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx Objet : Re: input_polling_devices design question + adxl34x polling mode patch Hi Paul, On Mon, Apr 11, 2011 at 06:21:02PM +0200, paul.chavent@xxxxxxxx wrote: > Hi. > > I have Âa board with an adxl34x (an accelerometer) on a two wire bus. > Its interrupt line aren't routed. > > So i would like to use the driver in polling mode. > > I submit this patch as a beta version of my work. > > I tried to reuse the input_polling structure but I'm facing some > problems. > > The driver has a "rate" attribute that i would like to control when i > setup the "interval" attribute of the input_pollling. > > And vice versa, when i setup the "interval" attribute i would like to > setup the "rate". > > So my questions : Â- Is it possible to reimplement a workqueue for > this driver only ? As it seems to have been done yet in other drivers, > i wonder if it's acceptable, or if we should avoid this practice.  - > I think it would be complicated to have hooks in input and > input_polling for calling each other. I wonder if i haven't any design > problem. > > I would need an advice in order to cleaning this patch please. > Yes, just use the system workqueue (now even dedicated workqueue is not really needed) and leave input_polldev alone - it makes sense to use for devices that are purely polled ones. The devices that may or may not be interrupt driven I think we should just hook workqueue handling in the driver. Note that I normally oppose supporting polling mode for devices that may be interrupt driven, since this normally increases power consumption. -- Dmitry
Attachment:
linux-2.6.38.2-adxl.patch
Description: Binary data