paul.chavent@xxxxxxxx wrote on 2011-04-12: > 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. Hi Paul, Looks good to me. However I wouldn't do the CONFIG_INPUT_ADXL34X_ALLOW_POLLING ifdefery at all. In case no irq is given, dev_info about the switch to polling mode. Just in case no irq was not on purpose. Whatever Dmitry prefers most. Acked-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx> -Michael > > ======================================== > 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. > Greetings, Michael -- Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif ÿô.nÇ·®+%˱é¥wÿº{.nÇ·¥{±þ)éâ^nr¡öë¨è&£ûz¹Þúzf£¢·h§~Ûÿÿïÿê_èæ+v¨þ)ßø