linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] input adxl34x: give a little love to the driver
@ 2012-12-20 13:51 Wolfram Sang
  2012-12-20 13:51 ` [PATCH 1/4] input: adxl34x: consistently use read/write encapsulation Wolfram Sang
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Wolfram Sang @ 2012-12-20 13:51 UTC (permalink / raw)
  To: linux-input
  Cc: Michael Hennerich, Dmitry Torokhov, device-drivers-devel,
	Wolfram Sang

Hi,

I needed this driver in a project and there were some minor hurdles in getting
it to run smoothly. These four patches are fixing them.

Kind regards,

   Wolfram


Wolfram Sang (4):
  input: adxl34x: consistently use read/write encapsulation
  input: adxl34x: don't set THRESH_TAP twice
  input: adxl34x: make platform_data include self contained
  input: adxl34x: default platform_data should not use defines from
    driver

 drivers/input/misc/adxl34x.c  |    7 +++----
 include/linux/input/adxl34x.h |    2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] input: adxl34x: consistently use read/write encapsulation
  2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
@ 2012-12-20 13:51 ` Wolfram Sang
  2012-12-20 13:51 ` [PATCH 2/4] input: adxl34x: don't set THRESH_TAP twice Wolfram Sang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2012-12-20 13:51 UTC (permalink / raw)
  To: linux-input
  Cc: Michael Hennerich, Dmitry Torokhov, device-drivers-devel,
	Wolfram Sang

Don't open code the AC_READ and AC_WRITE macros.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/input/misc/adxl34x.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index 1cf72fe..b18d3e2 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -732,7 +732,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
 	mutex_init(&ac->mutex);
 
 	input_dev->name = "ADXL34x accelerometer";
-	revid = ac->bops->read(dev, DEVID);
+	revid = AC_READ(ac, DEVID);
 
 	switch (revid) {
 	case ID_ADXL345:
@@ -809,7 +809,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
 	if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS)
 		ac->fifo_delay = false;
 
-	ac->bops->write(dev, POWER_CTL, 0);
+	AC_WRITE(ac, POWER_CTL, 0);
 
 	err = request_threaded_irq(ac->irq, NULL, adxl34x_irq,
 				   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] input: adxl34x: don't set THRESH_TAP twice
  2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
  2012-12-20 13:51 ` [PATCH 1/4] input: adxl34x: consistently use read/write encapsulation Wolfram Sang
@ 2012-12-20 13:51 ` Wolfram Sang
  2012-12-20 13:51 ` [PATCH 3/4] input: adxl34x: make platform_data include self contained Wolfram Sang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2012-12-20 13:51 UTC (permalink / raw)
  To: linux-input
  Cc: Michael Hennerich, Dmitry Torokhov, device-drivers-devel,
	Wolfram Sang

The datasheet doesn't say anything about writing twice, so this was
probably overlooked.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/input/misc/adxl34x.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index b18d3e2..6be8687 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -827,7 +827,6 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
 	if (err)
 		goto err_remove_attr;
 
-	AC_WRITE(ac, THRESH_TAP, pdata->tap_threshold);
 	AC_WRITE(ac, OFSX, pdata->x_axis_offset);
 	ac->hwcal.x = pdata->x_axis_offset;
 	AC_WRITE(ac, OFSY, pdata->y_axis_offset);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] input: adxl34x: make platform_data include self contained
  2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
  2012-12-20 13:51 ` [PATCH 1/4] input: adxl34x: consistently use read/write encapsulation Wolfram Sang
  2012-12-20 13:51 ` [PATCH 2/4] input: adxl34x: don't set THRESH_TAP twice Wolfram Sang
@ 2012-12-20 13:51 ` Wolfram Sang
  2012-12-20 13:51 ` [PATCH 4/4] input: adxl34x: default platform_data should not use defines from driver Wolfram Sang
  2012-12-20 14:00 ` [PATCH 0/4] input adxl34x: give a little love to the driver Michael Hennerich
  4 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2012-12-20 13:51 UTC (permalink / raw)
  To: linux-input
  Cc: Michael Hennerich, Dmitry Torokhov, device-drivers-devel,
	Wolfram Sang

Since it suggests to use defines from input.h (ABS_X, ...), also include
the file to make them available.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 include/linux/input/adxl34x.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h
index 57e01a7..010d981 100644
--- a/include/linux/input/adxl34x.h
+++ b/include/linux/input/adxl34x.h
@@ -13,6 +13,8 @@
 #ifndef __LINUX_INPUT_ADXL34X_H__
 #define __LINUX_INPUT_ADXL34X_H__
 
+#include <linux/input.h>
+
 struct adxl34x_platform_data {
 
 	/*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] input: adxl34x: default platform_data should not use defines from driver
  2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
                   ` (2 preceding siblings ...)
  2012-12-20 13:51 ` [PATCH 3/4] input: adxl34x: make platform_data include self contained Wolfram Sang
@ 2012-12-20 13:51 ` Wolfram Sang
  2012-12-20 14:00 ` [PATCH 0/4] input adxl34x: give a little love to the driver Michael Hennerich
  4 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2012-12-20 13:51 UTC (permalink / raw)
  To: linux-input
  Cc: Michael Hennerich, Dmitry Torokhov, device-drivers-devel,
	Wolfram Sang

Only use the defines which are defined in the platform_data include
file.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/input/misc/adxl34x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index 6be8687..0735de3 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -232,7 +232,7 @@ static const struct adxl34x_platform_data adxl34x_default_init = {
 
 	.ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY {x,y,z} */
 	.power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
-	.fifo_mode = FIFO_STREAM,
+	.fifo_mode = ADXL_FIFO_STREAM,
 	.watermark = 0,
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] input adxl34x: give a little love to the driver
  2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
                   ` (3 preceding siblings ...)
  2012-12-20 13:51 ` [PATCH 4/4] input: adxl34x: default platform_data should not use defines from driver Wolfram Sang
@ 2012-12-20 14:00 ` Michael Hennerich
  2012-12-24 17:53   ` Dmitry Torokhov
  4 siblings, 1 reply; 7+ messages in thread
From: Michael Hennerich @ 2012-12-20 14:00 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov,
	device-drivers-devel@blackfin.uclinux.org

On 12/20/2012 02:51 PM, Wolfram Sang wrote:
> Hi,
>
> I needed this driver in a project and there were some minor hurdles in getting
> it to run smoothly. These four patches are fixing them.
>
> Kind regards,
>
>     Wolfram
>
>
> Wolfram Sang (4):
>    input: adxl34x: consistently use read/write encapsulation
>    input: adxl34x: don't set THRESH_TAP twice
>    input: adxl34x: make platform_data include self contained
>    input: adxl34x: default platform_data should not use defines from
>      driver
>
>   drivers/input/misc/adxl34x.c  |    7 +++----
>   include/linux/input/adxl34x.h |    2 ++
>   2 files changed, 5 insertions(+), 4 deletions(-)
>
looks good to me -

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

-- 
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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] input adxl34x: give a little love to the driver
  2012-12-20 14:00 ` [PATCH 0/4] input adxl34x: give a little love to the driver Michael Hennerich
@ 2012-12-24 17:53   ` Dmitry Torokhov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2012-12-24 17:53 UTC (permalink / raw)
  To: Michael Hennerich
  Cc: Wolfram Sang, linux-input@vger.kernel.org,
	device-drivers-devel@blackfin.uclinux.org

On Thu, Dec 20, 2012 at 03:00:21PM +0100, Michael Hennerich wrote:
> On 12/20/2012 02:51 PM, Wolfram Sang wrote:
> >Hi,
> >
> >I needed this driver in a project and there were some minor hurdles in getting
> >it to run smoothly. These four patches are fixing them.
> >
> >Kind regards,
> >
> >    Wolfram
> >
> >
> >Wolfram Sang (4):
> >   input: adxl34x: consistently use read/write encapsulation
> >   input: adxl34x: don't set THRESH_TAP twice
> >   input: adxl34x: make platform_data include self contained
> >   input: adxl34x: default platform_data should not use defines from
> >     driver
> >
> >  drivers/input/misc/adxl34x.c  |    7 +++----
> >  include/linux/input/adxl34x.h |    2 ++
> >  2 files changed, 5 insertions(+), 4 deletions(-)
> >
> looks good to me -
> 
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>

Applied all 4, thanks everyone.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-24 17:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 13:51 [PATCH 0/4] input adxl34x: give a little love to the driver Wolfram Sang
2012-12-20 13:51 ` [PATCH 1/4] input: adxl34x: consistently use read/write encapsulation Wolfram Sang
2012-12-20 13:51 ` [PATCH 2/4] input: adxl34x: don't set THRESH_TAP twice Wolfram Sang
2012-12-20 13:51 ` [PATCH 3/4] input: adxl34x: make platform_data include self contained Wolfram Sang
2012-12-20 13:51 ` [PATCH 4/4] input: adxl34x: default platform_data should not use defines from driver Wolfram Sang
2012-12-20 14:00 ` [PATCH 0/4] input adxl34x: give a little love to the driver Michael Hennerich
2012-12-24 17:53   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).