All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
@ 2011-05-12  8:45 michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 2/6] input: misc: AD714x: Fix up input configuration michael.hennerich
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

The interrupt status registers should be read in row to avoid invalid data.

Implement read sequence function for both bus options.
Always use it for reading the interrupt status registers.
Read sequence saves 50% of bus transactions compared to single register reads.
So use it also for the result registers, which are also located in row.
Update copyright notice.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x-i2c.c |   30 ++++++++++++++++++++++++++++--
 drivers/input/misc/ad714x-spi.c |   14 ++++++++++++--
 drivers/input/misc/ad714x.c     |   35 +++++++++++++++++------------------
 drivers/input/misc/ad714x.h     |    7 +++++--
 4 files changed, 62 insertions(+), 24 deletions(-)

diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
index e21deb1..fb6564e 100644
--- a/drivers/input/misc/ad714x-i2c.c
+++ b/drivers/input/misc/ad714x-i2c.c
@@ -1,7 +1,7 @@
 /*
  * AD714X CapTouch Programmable Controller driver (I2C bus)
  *
- * Copyright 2009 Analog Devices Inc.
+ * Copyright 2009-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -77,13 +77,39 @@ static int ad714x_i2c_read(struct device *dev, unsigned short reg,
 	return ret;
 }
 
+static int ad714x_i2c_read_seq(struct device *dev, unsigned short reg,
+				unsigned short *data, unsigned len)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	int ret = 0, i;
+	u8 *_reg = (u8 *)&reg;
+
+	u8 tx[2] = {
+		_reg[1],
+		_reg[0]
+	};
+
+	ret = i2c_master_send(client, tx, 2);
+	if (ret >= 0)
+		ret = i2c_master_recv(client, (u8 *)data, len * 2);
+
+	if (unlikely(ret < 0))
+		dev_err(&client->dev, "I2C read error\n");
+	else
+		for (i = 0; i < len; i++)
+			data[i] = be16_to_cpu(data[i]);
+
+	return ret;
+}
+
 static int __devinit ad714x_i2c_probe(struct i2c_client *client,
 					const struct i2c_device_id *id)
 {
 	struct ad714x_chip *chip;
 
 	chip = ad714x_probe(&client->dev, BUS_I2C, client->irq,
-			    ad714x_i2c_read, ad714x_i2c_write);
+			    ad714x_i2c_read, ad714x_i2c_read_seq,
+			    ad714x_i2c_write);
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index 4120dd5..d352aa5 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -1,7 +1,7 @@
 /*
  * AD714X CapTouch Programmable Controller driver (SPI bus)
  *
- * Copyright 2009 Analog Devices Inc.
+ * Copyright 2009-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -39,6 +39,15 @@ static int ad714x_spi_read(struct device *dev, unsigned short reg,
 	return spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, 2);
 }
 
+static int ad714x_spi_read_seq(struct device *dev, unsigned short reg,
+		unsigned short *data, unsigned len)
+{
+	struct spi_device *spi = to_spi_device(dev);
+	unsigned short tx = AD714x_SPI_CMD_PREFIX | AD714x_SPI_READ | reg;
+
+	return spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, len * 2);
+}
+
 static int ad714x_spi_write(struct device *dev, unsigned short reg,
 		unsigned short data)
 {
@@ -56,7 +65,8 @@ static int __devinit ad714x_spi_probe(struct spi_device *spi)
 	struct ad714x_chip *chip;
 
 	chip = ad714x_probe(&spi->dev, BUS_SPI, spi->irq,
-			    ad714x_spi_read, ad714x_spi_write);
+			    ad714x_spi_read, ad714x_spi_read_seq,
+			    ad714x_spi_write);
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index c431d09..eb352fb 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -1,7 +1,7 @@
 /*
  * AD714X CapTouch Programmable Controller driver supporting AD7142/3/7/8/7A
  *
- * Copyright 2009 Analog Devices Inc.
+ * Copyright 2009-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -131,8 +131,8 @@ struct ad714x_driver_data {
  * of spi/i2c device
  */
 struct ad714x_chip {
-	unsigned short h_state;
 	unsigned short l_state;
+	unsigned short h_state;
 	unsigned short c_state;
 	unsigned short adc_reg[STAGE_NUM];
 	unsigned short amb_reg[STAGE_NUM];
@@ -144,6 +144,7 @@ struct ad714x_chip {
 	int irq;
 	struct device *dev;
 	ad714x_read_t read;
+	ad714x_read_seq_t read_seq;
 	ad714x_write_t write;
 
 	struct mutex mutex;
@@ -279,9 +280,11 @@ static void ad714x_slider_cal_sensor_val(struct ad714x_chip *ad714x, int idx)
 	struct ad714x_slider_plat *hw = &ad714x->hw->slider[idx];
 	int i;
 
+	ad714x->read_seq(ad714x->dev, CDC_RESULT_S0 + hw->start_stage,
+			&ad714x->adc_reg[hw->start_stage],
+			hw->end_stage - hw->start_stage + 1);
+
 	for (i = hw->start_stage; i <= hw->end_stage; i++) {
-		ad714x->read(ad714x->dev, CDC_RESULT_S0 + i,
-			&ad714x->adc_reg[i]);
 		ad714x->read(ad714x->dev,
 				STAGE0_AMBIENT + i * PER_STAGE_REG_NUM,
 				&ad714x->amb_reg[i]);
@@ -451,9 +454,11 @@ static void ad714x_wheel_cal_sensor_val(struct ad714x_chip *ad714x, int idx)
 	struct ad714x_wheel_plat *hw = &ad714x->hw->wheel[idx];
 	int i;
 
+	ad714x->read_seq(ad714x->dev, CDC_RESULT_S0 + hw->start_stage,
+			&ad714x->adc_reg[hw->start_stage],
+			hw->end_stage - hw->start_stage + 1);
+
 	for (i = hw->start_stage; i <= hw->end_stage; i++) {
-		ad714x->read(ad714x->dev, CDC_RESULT_S0 + i,
-			&ad714x->adc_reg[i]);
 		ad714x->read(ad714x->dev,
 				STAGE0_AMBIENT + i * PER_STAGE_REG_NUM,
 				&ad714x->amb_reg[i]);
@@ -1025,9 +1030,7 @@ static void ad714x_hw_init(struct ad714x_chip *ad714x)
 	ad714x->write(ad714x->dev, AD714X_STG_CAL_EN_REG, 0xFFF);
 
 	/* clear all interrupts */
-	ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &data);
-	ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &data);
-	ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &data);
+	ad714x->read_seq(ad714x->dev, STG_LOW_INT_STA_REG, &ad714x->l_state, 3);
 }
 
 static irqreturn_t ad714x_interrupt_thread(int irq, void *data)
@@ -1037,9 +1040,7 @@ static irqreturn_t ad714x_interrupt_thread(int irq, void *data)
 
 	mutex_lock(&ad714x->mutex);
 
-	ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &ad714x->l_state);
-	ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &ad714x->h_state);
-	ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &ad714x->c_state);
+	ad714x->read_seq(ad714x->dev, STG_LOW_INT_STA_REG, &ad714x->l_state, 3);
 
 	for (i = 0; i < ad714x->hw->button_num; i++)
 		ad714x_button_state_machine(ad714x, i);
@@ -1057,7 +1058,8 @@ static irqreturn_t ad714x_interrupt_thread(int irq, void *data)
 
 #define MAX_DEVICE_NUM 8
 struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
-				 ad714x_read_t read, ad714x_write_t write)
+				 ad714x_read_t read, ad714x_read_seq_t read_seq,
+				 ad714x_write_t write)
 {
 	int i, alloc_idx;
 	int error;
@@ -1110,6 +1112,7 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 	drv_mem += sizeof(*bt_drv) * ad714x->hw->button_num;
 
 	ad714x->read = read;
+	ad714x->read_seq = read_seq;
 	ad714x->write = write;
 	ad714x->irq = irq;
 	ad714x->dev = dev;
@@ -1316,8 +1319,6 @@ EXPORT_SYMBOL(ad714x_disable);
 
 int ad714x_enable(struct ad714x_chip *ad714x)
 {
-	unsigned short data;
-
 	dev_dbg(ad714x->dev, "%s enter\n", __func__);
 
 	mutex_lock(&ad714x->mutex);
@@ -1331,9 +1332,7 @@ int ad714x_enable(struct ad714x_chip *ad714x)
 	 * otherwise we will get no chance to enter falling-edge irq again
 	 */
 
-	ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &data);
-	ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &data);
-	ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &data);
+	ad714x->read_seq(ad714x->dev, STG_LOW_INT_STA_REG, &ad714x->l_state, 3);
 
 	mutex_unlock(&ad714x->mutex);
 
diff --git a/drivers/input/misc/ad714x.h b/drivers/input/misc/ad714x.h
index 45c54fb..58d5e4e 100644
--- a/drivers/input/misc/ad714x.h
+++ b/drivers/input/misc/ad714x.h
@@ -1,7 +1,7 @@
 /*
  * AD714X CapTouch Programmable Controller driver (bus interfaces)
  *
- * Copyright 2009 Analog Devices Inc.
+ * Copyright 2009-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -15,12 +15,15 @@ struct device;
 struct ad714x_chip;
 
 typedef int (*ad714x_read_t)(struct device *, unsigned short, unsigned short *);
+typedef int (*ad714x_read_seq_t)(struct device *, unsigned short,
+				 unsigned short *, unsigned len);
 typedef int (*ad714x_write_t)(struct device *, unsigned short, unsigned short);
 
 int ad714x_disable(struct ad714x_chip *ad714x);
 int ad714x_enable(struct ad714x_chip *ad714x);
 struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
-				 ad714x_read_t read, ad714x_write_t write);
+				 ad714x_read_t read, ad714x_read_seq_t read_seq,
+				 ad714x_write_t write);
 void ad714x_remove(struct ad714x_chip *ad714x);
 
 #endif
-- 
1.6.0.2



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

* [PATCH v2 2/6] input: misc: AD714x: Fix up input configuration.
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
@ 2011-05-12  8:45 ` michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 3/6] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions michael.hennerich
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

Add missing input name, phys and parent dev.

Changes since V1:
input: misc: AD714x: Drop input phys completely

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index eb352fb..847d6d3 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -1152,6 +1152,8 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 			input[alloc_idx]->id.bustype = bus_type;
 			input[alloc_idx]->id.product = ad714x->product;
 			input[alloc_idx]->id.version = ad714x->version;
+			input[alloc_idx]->name = "ad714x_captouch_slider";
+			input[alloc_idx]->dev.parent = dev;
 
 			error = input_register_device(input[alloc_idx]);
 			if (error)
@@ -1182,6 +1184,8 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 			input[alloc_idx]->id.bustype = bus_type;
 			input[alloc_idx]->id.product = ad714x->product;
 			input[alloc_idx]->id.version = ad714x->version;
+			input[alloc_idx]->name = "ad714x_captouch_wheel";
+			input[alloc_idx]->dev.parent = dev;
 
 			error = input_register_device(input[alloc_idx]);
 			if (error)
@@ -1215,6 +1219,8 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 			input[alloc_idx]->id.bustype = bus_type;
 			input[alloc_idx]->id.product = ad714x->product;
 			input[alloc_idx]->id.version = ad714x->version;
+			input[alloc_idx]->name = "ad714x_captouch_pad";
+			input[alloc_idx]->dev.parent = dev;
 
 			error = input_register_device(input[alloc_idx]);
 			if (error)
@@ -1243,6 +1249,8 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 		input[alloc_idx]->id.bustype = bus_type;
 		input[alloc_idx]->id.product = ad714x->product;
 		input[alloc_idx]->id.version = ad714x->version;
+		input[alloc_idx]->name = "ad714x_captouch_button";
+		input[alloc_idx]->dev.parent = dev;
 
 		error = input_register_device(input[alloc_idx]);
 		if (error)
-- 
1.6.0.2



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

* [PATCH v2 3/6] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 2/6] input: misc: AD714x: Fix up input configuration michael.hennerich
@ 2011-05-12  8:45 ` michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 4/6] input: misc: AD714x: Add option to specify irqflags michael.hennerich
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

Fix two issues in the thresh and completion interrupt mask and unmask functions.
According to the AD714x datasheets the highest stage completion
interrupt should be enabled.
Fix mask computation.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index 847d6d3..438bf74 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -159,10 +159,10 @@ static void ad714x_use_com_int(struct ad714x_chip *ad714x,
 	unsigned short data;
 	unsigned short mask;
 
-	mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage);
+	mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
 
 	ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data);
-	data |= 1 << start_stage;
+	data |= 1 << end_stage;
 	ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data);
 
 	ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data);
@@ -176,10 +176,10 @@ static void ad714x_use_thr_int(struct ad714x_chip *ad714x,
 	unsigned short data;
 	unsigned short mask;
 
-	mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage);
+	mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
 
 	ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data);
-	data &= ~(1 << start_stage);
+	data &= ~(1 << end_stage);
 	ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data);
 
 	ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data);
-- 
1.6.0.2



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

* [PATCH v2 4/6] input: misc: AD714x: Add option to specify irqflags
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 2/6] input: misc: AD714x: Fix up input configuration michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 3/6] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions michael.hennerich
@ 2011-05-12  8:45 ` michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 5/6] input: misc: AD714x: Fix captouch wheel option algorithm michael.hennerich
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

Add option to specify irqflags.
Use IRQF_TRIGGER_LOW | IRQF_ONESHOT if not set otherwise.
Update copyright notice.

Changes since V1:
input: misc: AD714x: Revert to previous default irqflags

As per Dmitry's suggestion Rrevert to previous default irqflags

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x.c  |    4 +++-
 include/linux/input/ad714x.h |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index 438bf74..b4d95d5 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -1260,7 +1260,9 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
 	}
 
 	error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread,
-			IRQF_TRIGGER_FALLING, "ad714x_captouch", ad714x);
+			plat_data->irqflags ? plat_data->irqflags :
+			IRQF_TRIGGER_FALLING,
+			"ad714x_captouch", ad714x);
 	if (error) {
 		dev_err(dev, "can't allocate irq %d\n", ad714x->irq);
 		goto err_unreg_dev;
diff --git a/include/linux/input/ad714x.h b/include/linux/input/ad714x.h
index 0cbe5e8..d388d85 100644
--- a/include/linux/input/ad714x.h
+++ b/include/linux/input/ad714x.h
@@ -6,7 +6,7 @@
  * The platform_data for the device's "struct device" holds this
  * information.
  *
- * Copyright 2009 Analog Devices Inc.
+ * Copyright 2009-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -58,6 +58,7 @@ struct ad714x_platform_data {
 	struct ad714x_button_plat *button;
 	unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM];
 	unsigned short sys_cfg_reg[SYS_CFGREG_NUM];
+	unsigned long irqflags;
 };
 
 #endif
-- 
1.6.0.2



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

* [PATCH v2 5/6] input: misc: AD714x: Fix captouch wheel option algorithm
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
                   ` (2 preceding siblings ...)
  2011-05-12  8:45 ` [PATCH v2 4/6] input: misc: AD714x: Add option to specify irqflags michael.hennerich
@ 2011-05-12  8:45 ` michael.hennerich
  2011-05-12  8:45 ` [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues michael.hennerich
  2011-05-17 11:01 ` [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row Hennerich, Michael
  5 siblings, 0 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

As reported by Jean-Francois Dagenais, the wheel algorithm caused a
divide by zero exception due to missing variable pre-initialization.
In fact it turned out that the whole algorithm had several problems.
It is therefore replaced with something that is known working.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x.c |  109 ++++++++-----------------------------------
 1 files changed, 19 insertions(+), 90 deletions(-)

diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index b4d95d5..137c39a 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -79,13 +79,7 @@ struct ad714x_slider_drv {
 struct ad714x_wheel_drv {
 	int abs_pos;
 	int flt_pos;
-	int pre_mean_value;
 	int pre_highest_stage;
-	int pre_mean_value_no_offset;
-	int mean_value;
-	int mean_value_no_offset;
-	int pos_offset;
-	int pos_ratio;
 	int highest_stage;
 	enum ad714x_device_state state;
 	struct input_dev *input;
@@ -407,7 +401,6 @@ static void ad714x_slider_state_machine(struct ad714x_chip *ad714x, int idx)
 				ad714x_slider_cal_highest_stage(ad714x, idx);
 				ad714x_slider_cal_abs_pos(ad714x, idx);
 				ad714x_slider_cal_flt_pos(ad714x, idx);
-
 				input_report_abs(sw->input, ABS_X, sw->flt_pos);
 				input_report_key(sw->input, BTN_TOUCH, 1);
 			} else {
@@ -473,104 +466,41 @@ static void ad714x_wheel_cal_sensor_val(struct ad714x_chip *ad714x, int idx)
 /*
  * When the scroll wheel is activated, we compute the absolute position based
  * on the sensor values. To calculate the position, we first determine the
- * sensor that has the greatest response among the 8 sensors that constitutes
- * the scrollwheel. Then we determined the 2 sensors on either sides of the
+ * sensor that has the greatest response among the sensors that constitutes
+ * the scrollwheel. Then we determined the sensors on either sides of the
  * sensor with the highest response and we apply weights to these sensors. The
- * result of this computation gives us the mean value which defined by the
- * following formula:
- * For i= second_before_highest_stage to i= second_after_highest_stage
- *         v += Sensor response(i)*WEIGHT*(i+3)
- *         w += Sensor response(i)
- * Mean_Value=v/w
- * pos_on_scrollwheel = (Mean_Value - position_offset) / position_ratio
+ * result of this computation gives us the mean value.
  */
 
-#define WEIGHT_FACTOR 30
-/* This constant prevents the "PositionOffset" from reaching a big value */
-#define OFFSET_POSITION_CLAMP	120
 static void ad714x_wheel_cal_abs_pos(struct ad714x_chip *ad714x, int idx)
 {
 	struct ad714x_wheel_plat *hw = &ad714x->hw->wheel[idx];
 	struct ad714x_wheel_drv *sw = &ad714x->sw->wheel[idx];
 	int stage_num = hw->end_stage - hw->start_stage + 1;
-	int second_before, first_before, highest, first_after, second_after;
+	int first_before, highest, first_after;
 	int a_param, b_param;
 
-	/* Calculate Mean value */
-
-	second_before = (sw->highest_stage + stage_num - 2) % stage_num;
 	first_before = (sw->highest_stage + stage_num - 1) % stage_num;
 	highest = sw->highest_stage;
 	first_after = (sw->highest_stage + stage_num + 1) % stage_num;
-	second_after = (sw->highest_stage + stage_num + 2) % stage_num;
-
-	if (((sw->highest_stage - hw->start_stage) > 1) &&
-	    ((hw->end_stage - sw->highest_stage) > 1)) {
-		a_param = ad714x->sensor_val[second_before] *
-			(second_before - hw->start_stage + 3) +
-			ad714x->sensor_val[first_before] *
-			(second_before - hw->start_stage + 3) +
-			ad714x->sensor_val[highest] *
-			(second_before - hw->start_stage + 3) +
-			ad714x->sensor_val[first_after] *
-			(first_after - hw->start_stage + 3) +
-			ad714x->sensor_val[second_after] *
-			(second_after - hw->start_stage + 3);
-	} else {
-		a_param = ad714x->sensor_val[second_before] *
-			(second_before - hw->start_stage + 1) +
-			ad714x->sensor_val[first_before] *
-			(second_before - hw->start_stage + 2) +
-			ad714x->sensor_val[highest] *
-			(second_before - hw->start_stage + 3) +
-			ad714x->sensor_val[first_after] *
-			(first_after - hw->start_stage + 4) +
-			ad714x->sensor_val[second_after] *
-			(second_after - hw->start_stage + 5);
-	}
-	a_param *= WEIGHT_FACTOR;
 
-	b_param = ad714x->sensor_val[second_before] +
+	a_param = ad714x->sensor_val[highest] *
+		(highest - hw->start_stage) +
+		ad714x->sensor_val[first_before] *
+		(highest - hw->start_stage - 1) +
+		ad714x->sensor_val[first_after] *
+		(highest - hw->start_stage + 1);
+	b_param = ad714x->sensor_val[highest] +
 		ad714x->sensor_val[first_before] +
-		ad714x->sensor_val[highest] +
-		ad714x->sensor_val[first_after] +
-		ad714x->sensor_val[second_after];
-
-	sw->pre_mean_value = sw->mean_value;
-	sw->mean_value = a_param / b_param;
-
-	/* Calculate the offset */
-
-	if ((sw->pre_highest_stage == hw->end_stage) &&
-			(sw->highest_stage == hw->start_stage))
-		sw->pos_offset = sw->mean_value;
-	else if ((sw->pre_highest_stage == hw->start_stage) &&
-			(sw->highest_stage == hw->end_stage))
-		sw->pos_offset = sw->pre_mean_value;
-
-	if (sw->pos_offset > OFFSET_POSITION_CLAMP)
-		sw->pos_offset = OFFSET_POSITION_CLAMP;
-
-	/* Calculate the mean value without the offset */
-
-	sw->pre_mean_value_no_offset = sw->mean_value_no_offset;
-	sw->mean_value_no_offset = sw->mean_value - sw->pos_offset;
-	if (sw->mean_value_no_offset < 0)
-		sw->mean_value_no_offset = 0;
-
-	/* Calculate ratio to scale down to NUMBER_OF_WANTED_POSITIONS */
-
-	if ((sw->pre_highest_stage == hw->end_stage) &&
-			(sw->highest_stage == hw->start_stage))
-		sw->pos_ratio = (sw->pre_mean_value_no_offset * 100) /
-			hw->max_coord;
-	else if ((sw->pre_highest_stage == hw->start_stage) &&
-			(sw->highest_stage == hw->end_stage))
-		sw->pos_ratio = (sw->mean_value_no_offset * 100) /
-			hw->max_coord;
-	sw->abs_pos = (sw->mean_value_no_offset * 100) / sw->pos_ratio;
+		ad714x->sensor_val[first_after];
+
+	sw->abs_pos = ((hw->max_coord / (hw->end_stage - hw->start_stage)) *
+			a_param) / b_param;
+
 	if (sw->abs_pos > hw->max_coord)
 		sw->abs_pos = hw->max_coord;
+	else if (sw->abs_pos < 0)
+		sw->abs_pos = 0;
 }
 
 static void ad714x_wheel_cal_flt_pos(struct ad714x_chip *ad714x, int idx)
@@ -644,9 +574,8 @@ static void ad714x_wheel_state_machine(struct ad714x_chip *ad714x, int idx)
 				ad714x_wheel_cal_highest_stage(ad714x, idx);
 				ad714x_wheel_cal_abs_pos(ad714x, idx);
 				ad714x_wheel_cal_flt_pos(ad714x, idx);
-
 				input_report_abs(sw->input, ABS_WHEEL,
-					sw->abs_pos);
+					sw->flt_pos);
 				input_report_key(sw->input, BTN_TOUCH, 1);
 			} else {
 				/* When the user lifts off the sensor, configure
-- 
1.6.0.2



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

* [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
                   ` (3 preceding siblings ...)
  2011-05-12  8:45 ` [PATCH v2 5/6] input: misc: AD714x: Fix captouch wheel option algorithm michael.hennerich
@ 2011-05-12  8:45 ` michael.hennerich
  2011-05-17 11:01 ` [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row Hennerich, Michael
  5 siblings, 0 replies; 15+ messages in thread
From: michael.hennerich @ 2011-05-12  8:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, jeff.dagenais, drivers, device-drivers-devel,
	Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

Add support for Big Endian.
Force SPI bus into the default 8-bit mode.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x-i2c.c |   43 ++++++++++----------------------------
 drivers/input/misc/ad714x-spi.c |   33 +++++++++++++++++++++++------
 2 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
index fb6564e..9794b36 100644
--- a/drivers/input/misc/ad714x-i2c.c
+++ b/drivers/input/misc/ad714x-i2c.c
@@ -32,17 +32,12 @@ static int ad714x_i2c_write(struct device *dev, unsigned short reg,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret = 0;
-	u8 *_reg = (u8 *)&reg;
-	u8 *_data = (u8 *)&data;
-
-	u8 tx[4] = {
-		_reg[1],
-		_reg[0],
-		_data[1],
-		_data[0]
+	unsigned short tx[2] = {
+		cpu_to_be16(reg),
+		cpu_to_be16(data)
 	};
 
-	ret = i2c_master_send(client, tx, 4);
+	ret = i2c_master_send(client, (u8 *)tx, 4);
 	if (ret < 0)
 		dev_err(&client->dev, "I2C write error\n");
 
@@ -54,25 +49,16 @@ static int ad714x_i2c_read(struct device *dev, unsigned short reg,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret = 0;
-	u8 *_reg = (u8 *)&reg;
-	u8 *_data = (u8 *)data;
+	unsigned short tx = cpu_to_be16(reg);
 
-	u8 tx[2] = {
-		_reg[1],
-		_reg[0]
-	};
-	u8 rx[2];
-
-	ret = i2c_master_send(client, tx, 2);
+	ret = i2c_master_send(client, (u8 *)&tx, 2);
 	if (ret >= 0)
-		ret = i2c_master_recv(client, rx, 2);
+		ret = i2c_master_recv(client, (u8 *)data, 2);
 
-	if (unlikely(ret < 0)) {
+	if (unlikely(ret < 0))
 		dev_err(&client->dev, "I2C read error\n");
-	} else {
-		_data[0] = rx[1];
-		_data[1] = rx[0];
-	}
+	else
+		*data = be16_to_cpu(*data);
 
 	return ret;
 }
@@ -82,14 +68,9 @@ static int ad714x_i2c_read_seq(struct device *dev, unsigned short reg,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret = 0, i;
-	u8 *_reg = (u8 *)&reg;
-
-	u8 tx[2] = {
-		_reg[1],
-		_reg[0]
-	};
+	unsigned short tx = cpu_to_be16(reg);
 
-	ret = i2c_master_send(client, tx, 2);
+	ret = i2c_master_send(client, (u8 *)&tx, 2);
 	if (ret >= 0)
 		ret = i2c_master_recv(client, (u8 *)data, len * 2);
 
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index d352aa5..4418b5b 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -6,7 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
-#include <linux/input.h>	/* BUS_I2C */
+#include <linux/input.h>	/* BUS_SPI */
 #include <linux/module.h>
 #include <linux/spi/spi.h>
 #include <linux/pm.h>
@@ -34,18 +34,31 @@ static int ad714x_spi_read(struct device *dev, unsigned short reg,
 		unsigned short *data)
 {
 	struct spi_device *spi = to_spi_device(dev);
-	unsigned short tx = AD714x_SPI_CMD_PREFIX | AD714x_SPI_READ | reg;
+	int ret;
+	unsigned short tx = cpu_to_be16(AD714x_SPI_CMD_PREFIX |
+					AD714x_SPI_READ | reg);
 
-	return spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, 2);
+	ret = spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, 2);
+
+	*data = be16_to_cpu(*data);
+
+	return ret;
 }
 
 static int ad714x_spi_read_seq(struct device *dev, unsigned short reg,
 		unsigned short *data, unsigned len)
 {
 	struct spi_device *spi = to_spi_device(dev);
-	unsigned short tx = AD714x_SPI_CMD_PREFIX | AD714x_SPI_READ | reg;
+	int ret, i;
+	unsigned short tx = cpu_to_be16(AD714x_SPI_CMD_PREFIX |
+					AD714x_SPI_READ | reg);
+
+	ret = spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, len * 2);
 
-	return spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, len * 2);
+	for (i = 0; i < len; i++)
+		data[i] = be16_to_cpu(data[i]);
+
+	return ret;
 }
 
 static int ad714x_spi_write(struct device *dev, unsigned short reg,
@@ -53,8 +66,8 @@ static int ad714x_spi_write(struct device *dev, unsigned short reg,
 {
 	struct spi_device *spi = to_spi_device(dev);
 	unsigned short tx[2] = {
-		AD714x_SPI_CMD_PREFIX | reg,
-		data
+		cpu_to_be16(AD714x_SPI_CMD_PREFIX | reg),
+		cpu_to_be16(data)
 	};
 
 	return spi_write(spi, (u8 *)tx, 4);
@@ -63,6 +76,12 @@ static int ad714x_spi_write(struct device *dev, unsigned short reg,
 static int __devinit ad714x_spi_probe(struct spi_device *spi)
 {
 	struct ad714x_chip *chip;
+	int err;
+
+	spi->bits_per_word = 8;
+	err = spi_setup(spi);
+	if (err < 0)
+		return err;
 
 	chip = ad714x_probe(&spi->dev, BUS_SPI, spi->irq,
 			    ad714x_spi_read, ad714x_spi_read_seq,
-- 
1.6.0.2



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

* RE: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
                   ` (4 preceding siblings ...)
  2011-05-12  8:45 ` [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues michael.hennerich
@ 2011-05-17 11:01 ` Hennerich, Michael
  2011-05-18  7:14   ` Dmitry Torokhov
  5 siblings, 1 reply; 15+ messages in thread
From: Hennerich, Michael @ 2011-05-17 11:01 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

Hi Dmitry,

I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
But how about these ones?

[PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
[PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.

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] 15+ messages in thread

* Re: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-17 11:01 ` [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row Hennerich, Michael
@ 2011-05-18  7:14   ` Dmitry Torokhov
  2011-05-18 19:10     ` Hennerich, Michael
  0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Torokhov @ 2011-05-18  7:14 UTC (permalink / raw)
  To: Hennerich, Michael
  Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
> Hi Dmitry,
> 
> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
> But how about these ones?
> 
> [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
> [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
> 

Hi Michael,

Still pondering these two, give me a couple of days please...

Thanks.

-- 
Dmitry

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

* RE: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-18  7:14   ` Dmitry Torokhov
@ 2011-05-18 19:10     ` Hennerich, Michael
  2011-05-19  8:00       ` Dmitry Torokhov
  0 siblings, 1 reply; 15+ messages in thread
From: Hennerich, Michael @ 2011-05-18 19:10 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

Dmitry Torokhov wrote on 2011-05-18:
> On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
>> Hi Dmitry,
>>
>> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
>> But how about these ones?
>>
>> [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers
>> should be read in row. [PATCH v2 6/6] input: misc: AD714x: Fix
>> endianness issues.
>>
>
> Hi Michael,
>
> Still pondering these two, give me a couple of days please...
>
> Thanks.
>

Hi Dmitry,

No Problem - let me know in case you need some further clarification.
Both patches are tested on several platforms and addresses real issues.

BTW - are you going to merge the adp5589 driver anytime soon?
Are there open issues you like to get addressed first?


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] 15+ messages in thread

* Re: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-18 19:10     ` Hennerich, Michael
@ 2011-05-19  8:00       ` Dmitry Torokhov
  2011-07-13 11:10         ` Hennerich, Michael
  2011-08-03  8:40         ` Hennerich, Michael
  0 siblings, 2 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2011-05-19  8:00 UTC (permalink / raw)
  To: Hennerich, Michael
  Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
> Dmitry Torokhov wrote on 2011-05-18:
> > On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
> >> Hi Dmitry,
> >>
> >> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
> >> But how about these ones?
> >>
> >> [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers
> >> should be read in row. [PATCH v2 6/6] input: misc: AD714x: Fix
> >> endianness issues.
> >>
> >
> > Hi Michael,
> >
> > Still pondering these two, give me a couple of days please...
> >
> > Thanks.
> >
> 
> Hi Dmitry,
> 
> No Problem - let me know in case you need some further clarification.
> Both patches are tested on several platforms and addresses real issues.
> 
> BTW - are you going to merge the adp5589 driver anytime soon?
> Are there open issues you like to get addressed first?
> 

Oh, thanks for reminding me of it, I queued it for .40.

Thanks.

-- 
Dmitry

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

* RE: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-19  8:00       ` Dmitry Torokhov
@ 2011-07-13 11:10         ` Hennerich, Michael
  2011-08-03  8:40         ` Hennerich, Michael
  1 sibling, 0 replies; 15+ messages in thread
From: Hennerich, Michael @ 2011-07-13 11:10 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

Dmitry Torokhov wrote on 2011-05-19:
> On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
>> Dmitry Torokhov wrote on 2011-05-18:
>>> On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
>>>> Hi Dmitry,
>>>>
>>>> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
>>>> But how about these ones?
>>>>
>>>> [PATCH v2 1/6] input: misc: AD714x: The interrupt status
>>>> registers should be read in row. [PATCH v2 6/6] input: misc:
>>>> AD714x: Fix endianness issues.
>>>>
>>>
>>> Hi Michael,
>>>
>>> Still pondering these two, give me a couple of days please...
>>>
>>> Thanks.
>>>
>>
>> Hi Dmitry,
>>
>> No Problem - let me know in case you need some further clarification.
>> Both patches are tested on several platforms and addresses real issues.
>>
>> BTW - are you going to merge the adp5589 driver anytime soon?
>> Are there open issues you like to get addressed first?
>>
>
> Oh, thanks for reminding me of it, I queued it for .40.
>
> Thanks.
>

Hi Dmitry,

Still pondering these two?

[PATCH v2 1/6] input: misc: AD714x:
        The interrupt status registers should be read in row.
[PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.

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] 15+ messages in thread

* RE: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-05-19  8:00       ` Dmitry Torokhov
  2011-07-13 11:10         ` Hennerich, Michael
@ 2011-08-03  8:40         ` Hennerich, Michael
  2011-08-04  7:54           ` Dmitry Torokhov
  1 sibling, 1 reply; 15+ messages in thread
From: Hennerich, Michael @ 2011-08-03  8:40 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

Hennerich, Michael wrote on 2011-07-13:
> Dmitry Torokhov wrote on 2011-05-19:
>> On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
>>> Dmitry Torokhov wrote on 2011-05-18:
>>>> On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
>>>>> Hi Dmitry,
>>>>>
>>>>> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
>>>>> But how about these ones?
>>>>>
>>>>> [PATCH v2 1/6] input: misc: AD714x: The interrupt status
>>>>> registers should be read in row. [PATCH v2 6/6] input: misc:
>>>>> AD714x: Fix endianness issues.
>>>>>
>>>>
>>>> Hi Michael,
>>>>
>>>> Still pondering these two, give me a couple of days please...
>>>>
>>>> Thanks.
>>>>
>>>
>>> Hi Dmitry,
>>>
>>> No Problem - let me know in case you need some further clarification.
>>> Both patches are tested on several platforms and addresses real issues.
>>>
>>> BTW - are you going to merge the adp5589 driver anytime soon?
>>> Are there open issues you like to get addressed first?
>>>
>>
>> Oh, thanks for reminding me of it, I queued it for .40.
>>
>> Thanks.
>>
>
> Hi Dmitry,
>
> Still pondering these two?
>
> [PATCH v2 1/6] input: misc: AD714x:
>       The interrupt status registers should be read in row.
> [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
>
> Greetings,
> Michael
>

Hi Dmitry,

Are you going to apply these two missing patches?


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] 15+ messages in thread

* Re: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-08-03  8:40         ` Hennerich, Michael
@ 2011-08-04  7:54           ` Dmitry Torokhov
  2011-08-12  8:58             ` Michael Hennerich
  0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Torokhov @ 2011-08-04  7:54 UTC (permalink / raw)
  To: Hennerich, Michael
  Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

On Wed, Aug 03, 2011 at 09:40:22AM +0100, Hennerich, Michael wrote:
> Hennerich, Michael wrote on 2011-07-13:
> > Dmitry Torokhov wrote on 2011-05-19:
> >> On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
> >>> Dmitry Torokhov wrote on 2011-05-18:
> >>>> On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
> >>>>> Hi Dmitry,
> >>>>>
> >>>>> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
> >>>>> But how about these ones?
> >>>>>
> >>>>> [PATCH v2 1/6] input: misc: AD714x: The interrupt status
> >>>>> registers should be read in row. [PATCH v2 6/6] input: misc:
> >>>>> AD714x: Fix endianness issues.
> >>>>>
> >>>>
> >>>> Hi Michael,
> >>>>
> >>>> Still pondering these two, give me a couple of days please...
> >>>>
> >>>> Thanks.
> >>>>
> >>>
> >>> Hi Dmitry,
> >>>
> >>> No Problem - let me know in case you need some further clarification.
> >>> Both patches are tested on several platforms and addresses real issues.
> >>>
> >>> BTW - are you going to merge the adp5589 driver anytime soon?
> >>> Are there open issues you like to get addressed first?
> >>>
> >>
> >> Oh, thanks for reminding me of it, I queued it for .40.
> >>
> >> Thanks.
> >>
> >
> > Hi Dmitry,
> >
> > Still pondering these two?
> >
> > [PATCH v2 1/6] input: misc: AD714x:
> >       The interrupt status registers should be read in row.
> > [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
> >
> > Greetings,
> > Michael
> >
> 
> Hi Dmitry,
> 
> Are you going to apply these two missing patches?
> 

Hi Michael,

Yes, should be in the next pull (not todays one).

Thanks.

-- 
Dmitry

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

* Re: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-08-04  7:54           ` Dmitry Torokhov
@ 2011-08-12  8:58             ` Michael Hennerich
  2011-08-21 20:09               ` Dmitry Torokhov
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Hennerich @ 2011-08-12  8:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

On 08/04/2011 09:54 AM, Dmitry Torokhov wrote:
> On Wed, Aug 03, 2011 at 09:40:22AM +0100, Hennerich, Michael wrote:
>> Hennerich, Michael wrote on 2011-07-13:
>>> Dmitry Torokhov wrote on 2011-05-19:
>>>> On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
>>>>> Dmitry Torokhov wrote on 2011-05-18:
>>>>>> On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
>>>>>>> Hi Dmitry,
>>>>>>>
>>>>>>> I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
>>>>>>> But how about these ones?
>>>>>>>
>>>>>>> [PATCH v2 1/6] input: misc: AD714x: The interrupt status
>>>>>>> registers should be read in row. [PATCH v2 6/6] input: misc:
>>>>>>> AD714x: Fix endianness issues.
>>>>>>>
>>>>>> Hi Michael,
>>>>>>
>>>>>> Still pondering these two, give me a couple of days please...
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>> Hi Dmitry,
>>>>>
>>>>> No Problem - let me know in case you need some further clarification.
>>>>> Both patches are tested on several platforms and addresses real issues.
>>>>>
>>>>> BTW - are you going to merge the adp5589 driver anytime soon?
>>>>> Are there open issues you like to get addressed first?
>>>>>
>>>> Oh, thanks for reminding me of it, I queued it for .40.
>>>>
>>>> Thanks.
>>>>
>>> Hi Dmitry,
>>>
>>> Still pondering these two?
>>>
>>> [PATCH v2 1/6] input: misc: AD714x:
>>>        The interrupt status registers should be read in row.
>>> [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
>>>
>>> Greetings,
>>> Michael
>>>
>> Hi Dmitry,
>>
>> Are you going to apply these two missing patches?
>>
> Hi Michael,
>
> Yes, should be in the next pull (not todays one).
>
> Thanks.
>
Hi Dmitry,

Hmmm... Are you sure?
I can't find it.


-- 
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] 15+ messages in thread

* Re: [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row.
  2011-08-12  8:58             ` Michael Hennerich
@ 2011-08-21 20:09               ` Dmitry Torokhov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2011-08-21 20:09 UTC (permalink / raw)
  To: Michael Hennerich
  Cc: linux-input, jeff.dagenais, Drivers, device-drivers-devel

On Fri, Aug 12, 2011 at 10:58:27AM +0200, Michael Hennerich wrote:
> On 08/04/2011 09:54 AM, Dmitry Torokhov wrote:
> >On Wed, Aug 03, 2011 at 09:40:22AM +0100, Hennerich, Michael wrote:
> >>Hennerich, Michael wrote on 2011-07-13:
> >>>Dmitry Torokhov wrote on 2011-05-19:
> >>>>On Wed, May 18, 2011 at 08:10:09PM +0100, Hennerich, Michael wrote:
> >>>>>Dmitry Torokhov wrote on 2011-05-18:
> >>>>>>On Tue, May 17, 2011 at 12:01:27PM +0100, Hennerich, Michael wrote:
> >>>>>>>Hi Dmitry,
> >>>>>>>
> >>>>>>>I noticed you added patches 2/6, 3/6, 4/6 and 5/6 to your next tree.
> >>>>>>>But how about these ones?
> >>>>>>>
> >>>>>>>[PATCH v2 1/6] input: misc: AD714x: The interrupt status
> >>>>>>>registers should be read in row. [PATCH v2 6/6] input: misc:
> >>>>>>>AD714x: Fix endianness issues.
> >>>>>>>
> >>>>>>Hi Michael,
> >>>>>>
> >>>>>>Still pondering these two, give me a couple of days please...
> >>>>>>
> >>>>>>Thanks.
> >>>>>>
> >>>>>Hi Dmitry,
> >>>>>
> >>>>>No Problem - let me know in case you need some further clarification.
> >>>>>Both patches are tested on several platforms and addresses real issues.
> >>>>>
> >>>>>BTW - are you going to merge the adp5589 driver anytime soon?
> >>>>>Are there open issues you like to get addressed first?
> >>>>>
> >>>>Oh, thanks for reminding me of it, I queued it for .40.
> >>>>
> >>>>Thanks.
> >>>>
> >>>Hi Dmitry,
> >>>
> >>>Still pondering these two?
> >>>
> >>>[PATCH v2 1/6] input: misc: AD714x:
> >>>       The interrupt status registers should be read in row.
> >>>[PATCH v2 6/6] input: misc: AD714x: Fix endianness issues.
> >>>
> >>>Greetings,
> >>>Michael
> >>>
> >>Hi Dmitry,
> >>
> >>Are you going to apply these two missing patches?
> >>
> >Hi Michael,
> >
> >Yes, should be in the next pull (not todays one).
> >
> >Thanks.
> >
> Hi Dmitry,
> 
> Hmmm... Are you sure?
> I can't find it.

Hi Michael,

No, I haven't applied it yet, sorry. I was looking through the code and
realized that spi_write requires use of DMA-safe buffers. Also, if we
are concerned with performance we should not use spi_write_then_read,
but rather use the same buffer we'll be using for spi_write and avoid
locking and extra copying.

I'll be sending updated version out shortly and if I did not mess up and
it still works fro you then I swear I'll apply it ;)

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2011-08-21 20:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12  8:45 [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
2011-05-12  8:45 ` [PATCH v2 2/6] input: misc: AD714x: Fix up input configuration michael.hennerich
2011-05-12  8:45 ` [PATCH v2 3/6] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions michael.hennerich
2011-05-12  8:45 ` [PATCH v2 4/6] input: misc: AD714x: Add option to specify irqflags michael.hennerich
2011-05-12  8:45 ` [PATCH v2 5/6] input: misc: AD714x: Fix captouch wheel option algorithm michael.hennerich
2011-05-12  8:45 ` [PATCH v2 6/6] input: misc: AD714x: Fix endianness issues michael.hennerich
2011-05-17 11:01 ` [PATCH v2 1/6] input: misc: AD714x: The interrupt status registers should be read in row Hennerich, Michael
2011-05-18  7:14   ` Dmitry Torokhov
2011-05-18 19:10     ` Hennerich, Michael
2011-05-19  8:00       ` Dmitry Torokhov
2011-07-13 11:10         ` Hennerich, Michael
2011-08-03  8:40         ` Hennerich, Michael
2011-08-04  7:54           ` Dmitry Torokhov
2011-08-12  8:58             ` Michael Hennerich
2011-08-21 20:09               ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.