Re: [PATCH 07/12] hwmon: lis3: New parameters to platform data

Previous thread: [PATCH 08/12] hwmon: lis3: Adjust fuzziness for 8 bit device by Samu Onkalo on Friday, October 22, 2010 - 4:57 am. (2 messages)

Next thread: [PATCH 11/12] hwmon: lis3: Short explanations of platform data fields by Samu Onkalo on Friday, October 22, 2010 - 4:57 am. (2 messages)
From: Samu Onkalo
Date: Friday, October 22, 2010 - 4:57 am

Added default output data rate setting to platform data.
If default rate is 0, reset default value is used.
Added control for duration via platform data.
Added possibility to configure interrupts to trig on
both rising and falling edge. The lis3 WU unit can be
configured quite many ways and with some configurations it
is quite handy to get coordinate refresh when some
event trigs and when it reason goes away.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
---
 drivers/hwmon/lis3lv02d.c |   21 ++++++++++++++-------
 include/linux/lis3lv02d.h |    6 +++++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index b44d4c5..d66cbe1 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -706,16 +706,16 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *dev,
 	if (p->wakeup_flags) {
 		dev->write(dev, FF_WU_CFG_1, p->wakeup_flags);
 		dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f);
-		/* default to 2.5ms for now */
-		dev->write(dev, FF_WU_DURATION_1, 1);
+		/* pdata value + 1 to keep this backward compatible*/
+		dev->write(dev, FF_WU_DURATION_1, p->duration1 + 1);
 		ctrl2 ^= HP_FF_WU1; /* Xor to keep compatible with old pdata*/
 	}
 
 	if (p->wakeup_flags2) {
 		dev->write(dev, FF_WU_CFG_2, p->wakeup_flags2);
 		dev->write(dev, FF_WU_THS_2, p->wakeup_thresh2 & 0x7f);
-		/* default to 2.5ms for now */
-		dev->write(dev, FF_WU_DURATION_2, 1);
+		/* pdata value + 1 to keep this backward compatible*/
+		dev->write(dev, FF_WU_DURATION_2, p->duration2 + 1);
 		ctrl2 ^= HP_FF_WU2; /* Xor to keep compatible with old pdata*/
 	}
 	/* Configure hipass filters */
@@ -725,8 +725,8 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *dev,
 		err = request_threaded_irq(p->irq2,
 					NULL,
 					lis302dl_interrupt_thread2_8b,
-					IRQF_TRIGGER_RISING |
-					IRQF_ONESHOT,
+					IRQF_TRIGGER_RISING | IRQF_ONESHOT |
+					(p->irq_flags2 & IRQF_TRIGGER_MASK),
 ...
From: Jonathan Cameron
Date: Friday, October 22, 2010 - 9:17 am

Per patch description of what changed would have made reviewing

--

From: Éric Piel
Date: Sunday, October 24, 2010 - 7:27 am

Previous thread: [PATCH 08/12] hwmon: lis3: Adjust fuzziness for 8 bit device by Samu Onkalo on Friday, October 22, 2010 - 4:57 am. (2 messages)

Next thread: [PATCH 11/12] hwmon: lis3: Short explanations of platform data fields by Samu Onkalo on Friday, October 22, 2010 - 4:57 am. (2 messages)