mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PATCH 0/6] Input update for 2.6.16
@ 2006-02-15  6:01 Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 1/6] ixp4xx-beeper: fix compile error Dmitry Torokhov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

Hi Linus,

Please do a pull from:

	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/
or
	master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git


Changelog:

    Input: kill remnants of 98kbd{,-io} and 98spkr (Arthur Othieno)
    Input: ads7846 - assorted updates (David Brownell)
    Input: ads7846 - convert to to dynamic input_dev allocation
    Input: trackpoint - enable devices connected to external port
    Input: logips2pp - add new signature (99) (Meelis Roos)
    Input: ixp4xx-beeper - fix compile error (Alessandro Zummo)

Diffstat:

 keyboard/Makefile     |    1 
 misc/Makefile         |    1 
 misc/ixp4xx-beeper.c  |    1 
 mouse/logips2pp.c     |    1 
 mouse/trackpoint.c    |   20 ++++--
 mouse/trackpoint.h    |    4 -
 serio/Makefile        |    1 
 touchscreen/ads7846.c |  149 ++++++++++++++++++++++++++++++--------------------
 8 files changed, 110 insertions(+), 68 deletions(-)

--
Dmitry


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

* [GIT PATCH 1/6] ixp4xx-beeper: fix compile error
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 2/6] logips2pp: add new signature (99) Dmitry Torokhov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: ixp4xx-beeper-compile-fix.patch --]
[-- Type: text/plain, Size: 716 bytes --]

From: Alessandro Zummo <alessandro.zummo@towertech.it>

Input: ixp4xx-beeper - fix compile error

Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/misc/ixp4xx-beeper.c |    1 +
 1 files changed, 1 insertion(+)

Index: work/drivers/input/misc/ixp4xx-beeper.c
===================================================================
--- work.orig/drivers/input/misc/ixp4xx-beeper.c
+++ work/drivers/input/misc/ixp4xx-beeper.c
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/interrupt.h>
 #include <asm/hardware.h>
 
 MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");


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

* [GIT PATCH 2/6] logips2pp: add new signature (99)
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 1/6] ixp4xx-beeper: fix compile error Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 3/6] trackpoint: enable devices connected to external port Dmitry Torokhov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: logips2pp-add-signature-99.patch --]
[-- Type: text/plain, Size: 1029 bytes --]

From: Meelis Roos <mroos@linux.ee>

Input: logips2pp - add new signature (99)

Add Logitech mouse type 99 (Premium Optical Wheel Mouse, model M-BT58,
plain 3 buttons + wheel) to cure the following message: logips2pp: Detected
unknown logitech mouse model 99

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/mouse/logips2pp.c |    1 +
 1 files changed, 1 insertion(+)

Index: work/drivers/input/mouse/logips2pp.c
===================================================================
--- work.orig/drivers/input/mouse/logips2pp.c
+++ work/drivers/input/mouse/logips2pp.c
@@ -232,6 +232,7 @@ static struct ps2pp_info *get_model_info
 		{ 88,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
 		{ 96,	0,			0 },
 		{ 97,	PS2PP_KIND_TP3,		PS2PP_WHEEL | PS2PP_HWHEEL },
+		{ 99,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
 		{ 100,	PS2PP_KIND_MX,					/* MX510 */
 				PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
 				PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },


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

* [GIT PATCH 3/6] trackpoint: enable devices connected to external port
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 1/6] ixp4xx-beeper: fix compile error Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 2/6] logips2pp: add new signature (99) Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 4/6] ads7846: convert to to dynamic input_dev allocation Dmitry Torokhov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: trackpint-ext-dev.patch --]
[-- Type: text/plain, Size: 3436 bytes --]

Input: trackpoint - enable devices connected to external port

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/mouse/trackpoint.c |   20 ++++++++++++++------
 drivers/input/mouse/trackpoint.h |    4 ++--
 2 files changed, 16 insertions(+), 8 deletions(-)

Index: work/drivers/input/mouse/trackpoint.c
===================================================================
--- work.orig/drivers/input/mouse/trackpoint.c
+++ work/drivers/input/mouse/trackpoint.c
@@ -68,15 +68,19 @@ struct trackpoint_attr_data {
 	size_t field_offset;
 	unsigned char command;
 	unsigned char mask;
+	unsigned char inverted;
 };
 
 static ssize_t trackpoint_show_int_attr(struct psmouse *psmouse, void *data, char *buf)
 {
 	struct trackpoint_data *tp = psmouse->private;
 	struct trackpoint_attr_data *attr = data;
-	unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
+	unsigned char value = *(unsigned char *)((char *)tp + attr->field_offset);
+
+	if (attr->inverted)
+		value = !value;
 
-	return sprintf(buf, "%u\n", *field);
+	return sprintf(buf, "%u\n", value);
 }
 
 static ssize_t trackpoint_set_int_attr(struct psmouse *psmouse, void *data,
@@ -120,6 +124,9 @@ static ssize_t trackpoint_set_bit_attr(s
 	if (*rest || value > 1)
 		return -EINVAL;
 
+	if (attr->inverted)
+		value = !value;
+
 	if (*field != value) {
 		*field = value;
 		trackpoint_toggle_bit(&psmouse->ps2dev, attr->command, attr->mask);
@@ -129,11 +136,12 @@ static ssize_t trackpoint_set_bit_attr(s
 }
 
 
-#define TRACKPOINT_BIT_ATTR(_name, _command, _mask)				\
+#define TRACKPOINT_BIT_ATTR(_name, _command, _mask, _inv)				\
 	static struct trackpoint_attr_data trackpoint_attr_##_name = {		\
 		.field_offset	= offsetof(struct trackpoint_data, _name),	\
 		.command	= _command,					\
 		.mask		= _mask,					\
+		.inverted	= _inv,						\
 	};									\
 	PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO,				\
 			    &trackpoint_attr_##_name,				\
@@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRE
 TRACKPOINT_INT_ATTR(ztime, TP_Z_TIME);
 TRACKPOINT_INT_ATTR(jenks, TP_JENKS_CURV);
 
-TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON);
-TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK);
-TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV);
+TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON, 0);
+TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK, 0);
+TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV, 1);
 
 static struct attribute *trackpoint_attrs[] = {
 	&psmouse_attr_sensitivity.dattr.attr,
Index: work/drivers/input/mouse/trackpoint.h
===================================================================
--- work.orig/drivers/input/mouse/trackpoint.h
+++ work/drivers/input/mouse/trackpoint.h
@@ -78,7 +78,7 @@
 
 #define TP_TOGGLE_MB		0x23	/* Disable/Enable Middle Button */
 #define TP_MASK_MB			0x01
-#define TP_TOGGLE_EXT_DEV	0x23	/* Toggle external device */
+#define TP_TOGGLE_EXT_DEV	0x23	/* Disable external device */
 #define TP_MASK_EXT_DEV			0x02
 #define TP_TOGGLE_DRIFT		0x23	/* Drift Correction */
 #define TP_MASK_DRIFT			0x80
@@ -125,7 +125,7 @@
 #define TP_DEF_MB		0x00
 #define TP_DEF_PTSON		0x00
 #define TP_DEF_SKIPBACK		0x00
-#define TP_DEF_EXT_DEV		0x01
+#define TP_DEF_EXT_DEV		0x00	/* 0 means enabled */
 
 #define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
 


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

* [GIT PATCH 4/6] ads7846: convert to to dynamic input_dev allocation
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
                   ` (2 preceding siblings ...)
  2006-02-15  6:01 ` [GIT PATCH 3/6] trackpoint: enable devices connected to external port Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 5/6] ads7846: assorted updates Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 6/6] Kill remnants of 98kbd{,-io} and 98spkr Dmitry Torokhov
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: input-dynalloc-ads7846.patch --]
[-- Type: text/plain, Size: 5488 bytes --]

Input: ads7846 - convert to to dynamic input_dev allocation

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/touchscreen/ads7846.c |   81 +++++++++++++++++++++---------------
 1 files changed, 48 insertions(+), 33 deletions(-)

Index: work/drivers/input/touchscreen/ads7846.c
===================================================================
--- work.orig/drivers/input/touchscreen/ads7846.c
+++ work/drivers/input/touchscreen/ads7846.c
@@ -60,7 +60,7 @@ struct ts_event {
 };
 
 struct ads7846 {
-	struct input_dev	input;
+	struct input_dev	*input;
 	char			phys[32];
 
 	struct spi_device	*spi;
@@ -152,7 +152,7 @@ static int ads7846_read12_ser(struct dev
 	struct ser_req		*req = kzalloc(sizeof *req, SLAB_KERNEL);
 	int			status;
 	int			sample;
-	int 			i;
+	int			i;
 
 	if (!req)
 		return -ENOMEM;
@@ -236,11 +236,12 @@ SHOW(vbatt)
 
 static void ads7846_rx(void *ads)
 {
-	struct ads7846	*ts = ads;
-	unsigned	Rt;
-	unsigned	sync = 0;
-	u16		x, y, z1, z2;
-	unsigned long	flags;
+	struct ads7846		*ts = ads;
+	struct input_dev	*input_dev = ts->input;
+	unsigned		Rt;
+	unsigned		sync = 0;
+	u16			x, y, z1, z2;
+	unsigned long		flags;
 
 	/* adjust:  12 bit samples (left aligned), built from
 	 * two 8 bit values writen msb-first.
@@ -276,21 +277,21 @@ static void ads7846_rx(void *ads)
 	 * won't notice that, even if nPENIRQ never fires ...
 	 */
 	if (!ts->pendown && Rt != 0) {
-		input_report_key(&ts->input, BTN_TOUCH, 1);
+		input_report_key(input_dev, BTN_TOUCH, 1);
 		sync = 1;
 	} else if (ts->pendown && Rt == 0) {
-		input_report_key(&ts->input, BTN_TOUCH, 0);
+		input_report_key(input_dev, BTN_TOUCH, 0);
 		sync = 1;
 	}
 
 	if (Rt) {
-		input_report_abs(&ts->input, ABS_X, x);
-		input_report_abs(&ts->input, ABS_Y, y);
-		input_report_abs(&ts->input, ABS_PRESSURE, Rt);
+		input_report_abs(input_dev, ABS_X, x);
+		input_report_abs(input_dev, ABS_Y, y);
+		input_report_abs(input_dev, ABS_PRESSURE, Rt);
 		sync = 1;
 	}
 	if (sync)
-		input_sync(&ts->input);
+		input_sync(input_dev);
 
 #ifdef	VERBOSE
 	if (Rt || ts->pendown)
@@ -396,9 +397,11 @@ static int ads7846_resume(struct spi_dev
 static int __devinit ads7846_probe(struct spi_device *spi)
 {
 	struct ads7846			*ts;
+	struct input_dev		*input_dev;
 	struct ads7846_platform_data	*pdata = spi->dev.platform_data;
 	struct spi_transfer		*x;
 	int				i;
+	int				err;
 
 	if (!spi->irq) {
 		dev_dbg(&spi->dev, "no IRQ?\n");
@@ -423,13 +426,18 @@ static int __devinit ads7846_probe(struc
 	 * to discard the four garbage LSBs.
 	 */
 
-	if (!(ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL)))
-		return -ENOMEM;
+	ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL);
+	input_dev = input_allocate_device();
+	if (!ts || !input_dev) {
+		err = -ENOMEM;
+		goto err_free_mem;
+	}
 
 	dev_set_drvdata(&spi->dev, ts);
+	spi->dev.power.power_state = PMSG_ON;
 
 	ts->spi = spi;
-	spi->dev.power.power_state = PMSG_ON;
+	ts->input = input_dev;
 
 	init_timer(&ts->timer);
 	ts->timer.data = (unsigned long) ts;
@@ -439,28 +447,25 @@ static int __devinit ads7846_probe(struc
 	ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
 	ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
 
-	init_input_dev(&ts->input);
+	snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
 
-	ts->input.dev = &spi->dev;
-	ts->input.name = "ADS784x Touchscreen";
-	snprintf(ts->phys, sizeof ts->phys, "%s/input0", spi->dev.bus_id);
-	ts->input.phys = ts->phys;
-
-	ts->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-	ts->input.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
-	input_set_abs_params(&ts->input, ABS_X,
+	input_dev->name = "ADS784x Touchscreen";
+	input_dev->phys = ts->phys;
+	input_dev->cdev.dev = &spi->dev;
+
+	input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+	input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+	input_set_abs_params(input_dev, ABS_X,
 			pdata->x_min ? : 0,
 			pdata->x_max ? : MAX_12BIT,
 			0, 0);
-	input_set_abs_params(&ts->input, ABS_Y,
+	input_set_abs_params(input_dev, ABS_Y,
 			pdata->y_min ? : 0,
 			pdata->y_max ? : MAX_12BIT,
 			0, 0);
-	input_set_abs_params(&ts->input, ABS_PRESSURE,
+	input_set_abs_params(input_dev, ABS_PRESSURE,
 			pdata->pressure_min, pdata->pressure_max, 0, 0);
 
-	input_register_device(&ts->input);
-
 	/* set up the transfers to read touchscreen state; this assumes we
 	 * use formula #2 for pressure, not #3.
 	 */
@@ -510,9 +515,8 @@ static int __devinit ads7846_probe(struc
 			SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING,
 			spi->dev.bus_id, ts)) {
 		dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
-		input_unregister_device(&ts->input);
-		kfree(ts);
-		return -EBUSY;
+		err = -EBUSY;
+		goto err_free_mem;
 	}
 
 	dev_info(&spi->dev, "touchscreen, irq %d\n", spi->irq);
@@ -534,7 +538,18 @@ static int __devinit ads7846_probe(struc
 		device_create_file(&spi->dev, &dev_attr_vbatt);
 	device_create_file(&spi->dev, &dev_attr_vaux);
 
+	err = input_register_device(input_dev);
+	if (err)
+		goto err_free_irq;
+
 	return 0;
+
+ err_free_irq:
+	free_irq(spi->irq, ts);
+ err_free_mem:
+	input_free_device(input_dev);
+	kfree(ts);
+	return err;
 }
 
 static int __devexit ads7846_remove(struct spi_device *spi)
@@ -554,7 +569,7 @@ static int __devexit ads7846_remove(stru
 		device_remove_file(&spi->dev, &dev_attr_vbatt);
 	device_remove_file(&spi->dev, &dev_attr_vaux);
 
-	input_unregister_device(&ts->input);
+	input_unregister_device(ts->input);
 	kfree(ts);
 
 	dev_dbg(&spi->dev, "unregistered touchscreen\n");


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

* [GIT PATCH 5/6] ads7846: assorted updates
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
                   ` (3 preceding siblings ...)
  2006-02-15  6:01 ` [GIT PATCH 4/6] ads7846: convert to to dynamic input_dev allocation Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  2006-02-15  6:01 ` [GIT PATCH 6/6] Kill remnants of 98kbd{,-io} and 98spkr Dmitry Torokhov
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: ads7846.patch --]
[-- Type: text/plain, Size: 5706 bytes --]

From: David Brownell <dbrownell@users.sourceforge.net>

Input: ads7846 - assorted updates

This updates the ads7846 touchscreen driver:
  - to allow faster clocking (this driver doesn't push sample rates);
  - bugfixes the conversion of spi_transfer to lists;
  - some dma-unsafe command buffers are fixed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/touchscreen/ads7846.c |   68 +++++++++++++++++++++++-------------
 1 files changed, 44 insertions(+), 24 deletions(-)

Index: work/drivers/input/touchscreen/ads7846.c
===================================================================
--- work.orig/drivers/input/touchscreen/ads7846.c
+++ work/drivers/input/touchscreen/ads7846.c
@@ -48,10 +48,13 @@
 
 #define	TS_POLL_PERIOD	msecs_to_jiffies(10)
 
+/* this driver doesn't aim at the peak continuous sample rate */
+#define	SAMPLE_BITS	(8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */)
+
 struct ts_event {
 	/* For portability, we can't read 12 bit values using SPI (which
 	 * would make the controller deliver them as native byteorder u16
-	 * with msbs zeroed).  Instead, we read them as two 8-byte values,
+	 * with msbs zeroed).  Instead, we read them as two 8-bit values,
 	 * which need byteswapping then range adjustment.
 	 */
 	__be16 x;
@@ -68,6 +71,7 @@ struct ads7846 {
 	u16			vref_delay_usecs;
 	u16			x_plate_ohms;
 
+	u8			read_x, read_y, read_z1, read_z2;
 	struct ts_event		tc;
 
 	struct spi_transfer	xfer[8];
@@ -117,10 +121,10 @@ struct ads7846 {
 #define	READ_12BIT_DFR(x) (ADS_START | ADS_A2A1A0_d_ ## x \
 	| ADS_12_BIT | ADS_DFR)
 
-static const u8	read_y  = READ_12BIT_DFR(y)  | ADS_PD10_ADC_ON;
-static const u8	read_z1 = READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON;
-static const u8	read_z2 = READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON;
-static const u8	read_x  = READ_12BIT_DFR(x)  | ADS_PD10_PDOWN;	/* LAST */
+#define	READ_Y	(READ_12BIT_DFR(y)  | ADS_PD10_ADC_ON)
+#define	READ_Z1	(READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
+#define	READ_Z2	(READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
+#define	READ_X	(READ_12BIT_DFR(x)  | ADS_PD10_PDOWN)	/* LAST */
 
 /* single-ended samples need to first power up reference voltage;
  * we leave both ADC and VREF powered
@@ -128,8 +132,8 @@ static const u8	read_x  = READ_12BIT_DFR
 #define	READ_12BIT_SER(x) (ADS_START | ADS_A2A1A0_ ## x \
 	| ADS_12_BIT | ADS_SER)
 
-static const u8	ref_on = READ_12BIT_DFR(x) | ADS_PD10_ALL_ON;
-static const u8	ref_off = READ_12BIT_DFR(y) | ADS_PD10_PDOWN;
+#define	REF_ON	(READ_12BIT_DFR(x) | ADS_PD10_ALL_ON)
+#define	REF_OFF	(READ_12BIT_DFR(y) | ADS_PD10_PDOWN)
 
 /*--------------------------------------------------------------------------*/
 
@@ -138,7 +142,9 @@ static const u8	ref_off = READ_12BIT_DFR
  */
 
 struct ser_req {
+	u8			ref_on;
 	u8			command;
+	u8			ref_off;
 	u16			scratch;
 	__be16			sample;
 	struct spi_message	msg;
@@ -160,7 +166,8 @@ static int ads7846_read12_ser(struct dev
 	INIT_LIST_HEAD(&req->msg.transfers);
 
 	/* activate reference, so it has time to settle; */
-	req->xfer[0].tx_buf = &ref_on;
+	req->ref_on = REF_ON;
+	req->xfer[0].tx_buf = &req->ref_on;
 	req->xfer[0].len = 1;
 	req->xfer[1].rx_buf = &req->scratch;
 	req->xfer[1].len = 2;
@@ -182,7 +189,8 @@ static int ads7846_read12_ser(struct dev
 	/* REVISIT:  take a few more samples, and compare ... */
 
 	/* turn off reference */
-	req->xfer[4].tx_buf = &ref_off;
+	req->ref_off = REF_OFF;
+	req->xfer[4].tx_buf = &req->ref_off;
 	req->xfer[4].len = 1;
 	req->xfer[5].rx_buf = &req->scratch;
 	req->xfer[5].len = 2;
@@ -400,7 +408,6 @@ static int __devinit ads7846_probe(struc
 	struct input_dev		*input_dev;
 	struct ads7846_platform_data	*pdata = spi->dev.platform_data;
 	struct spi_transfer		*x;
-	int				i;
 	int				err;
 
 	if (!spi->irq) {
@@ -414,9 +421,9 @@ static int __devinit ads7846_probe(struc
 	}
 
 	/* don't exceed max specified sample rate */
-	if (spi->max_speed_hz > (125000 * 16)) {
+	if (spi->max_speed_hz > (125000 * SAMPLE_BITS)) {
 		dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
-				(spi->max_speed_hz/16)/1000);
+				(spi->max_speed_hz/SAMPLE_BITS)/1000);
 		return -EINVAL;
 	}
 
@@ -469,45 +476,58 @@ static int __devinit ads7846_probe(struc
 	/* set up the transfers to read touchscreen state; this assumes we
 	 * use formula #2 for pressure, not #3.
 	 */
+	INIT_LIST_HEAD(&ts->msg.transfers);
 	x = ts->xfer;
 
 	/* y- still on; turn on only y+ (and ADC) */
-	x->tx_buf = &read_y;
+	ts->read_y = READ_Y;
+	x->tx_buf = &ts->read_y;
 	x->len = 1;
+	spi_message_add_tail(x, &ts->msg);
+
 	x++;
 	x->rx_buf = &ts->tc.y;
 	x->len = 2;
-	x++;
+	spi_message_add_tail(x, &ts->msg);
 
 	/* turn y+ off, x- on; we'll use formula #2 */
 	if (ts->model == 7846) {
-		x->tx_buf = &read_z1;
+		x++;
+		ts->read_z1 = READ_Z1;
+		x->tx_buf = &ts->read_z1;
 		x->len = 1;
+		spi_message_add_tail(x, &ts->msg);
+
 		x++;
 		x->rx_buf = &ts->tc.z1;
 		x->len = 2;
-		x++;
+		spi_message_add_tail(x, &ts->msg);
 
-		x->tx_buf = &read_z2;
+		x++;
+		ts->read_z2 = READ_Z2;
+		x->tx_buf = &ts->read_z2;
 		x->len = 1;
+		spi_message_add_tail(x, &ts->msg);
+
 		x++;
 		x->rx_buf = &ts->tc.z2;
 		x->len = 2;
-		x++;
+		spi_message_add_tail(x, &ts->msg);
 	}
 
 	/* turn y- off, x+ on, then leave in lowpower */
-	x->tx_buf = &read_x;
+	x++;
+	ts->read_x = READ_X;
+	x->tx_buf = &ts->read_x;
 	x->len = 1;
+	spi_message_add_tail(x, &ts->msg);
+
 	x++;
 	x->rx_buf = &ts->tc.x;
 	x->len = 2;
-	x++;
-
-	CS_CHANGE(x[-1]);
+	CS_CHANGE(*x);
+	spi_message_add_tail(x, &ts->msg);
 
-	for (i = 0; i < x - ts->xfer; i++)
-		spi_message_add_tail(&ts->xfer[i], &ts->msg);
 	ts->msg.complete = ads7846_rx;
 	ts->msg.context = ts;
 


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

* [GIT PATCH 6/6] Kill remnants of 98kbd{,-io} and 98spkr
  2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
                   ` (4 preceding siblings ...)
  2006-02-15  6:01 ` [GIT PATCH 5/6] ads7846: assorted updates Dmitry Torokhov
@ 2006-02-15  6:01 ` Dmitry Torokhov
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2006-02-15  6:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: kill-pc98-remnants.patch --]
[-- Type: text/plain, Size: 2122 bytes --]

From: Arthur Othieno <apgo@patchbomb.org>

Input: kill remnants of 98kbd{,-io} and 98spkr

98kbd{,-io} and 98spkr all went out with PC98 subarch.  Remove stale Makefile
entries that remained.

Signed-off-by: Arthur Othieno <apgo@patchbomb.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/keyboard/Makefile |    1 -
 drivers/input/misc/Makefile     |    1 -
 drivers/input/serio/Makefile    |    1 -
 3 files changed, 3 deletions(-)

Index: work/drivers/input/keyboard/Makefile
===================================================================
--- work.orig/drivers/input/keyboard/Makefile
+++ work/drivers/input/keyboard/Makefile
@@ -11,7 +11,6 @@ obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
 obj-$(CONFIG_KEYBOARD_AMIGA)		+= amikbd.o
 obj-$(CONFIG_KEYBOARD_LOCOMO)		+= locomokbd.o
 obj-$(CONFIG_KEYBOARD_NEWTON)		+= newtonkbd.o
-obj-$(CONFIG_KEYBOARD_98KBD)		+= 98kbd.o
 obj-$(CONFIG_KEYBOARD_CORGI)		+= corgikbd.o
 obj-$(CONFIG_KEYBOARD_SPITZ)		+= spitzkbd.o
 obj-$(CONFIG_KEYBOARD_HIL)		+= hil_kbd.o
Index: work/drivers/input/misc/Makefile
===================================================================
--- work.orig/drivers/input/misc/Makefile
+++ work/drivers/input/misc/Makefile
@@ -7,7 +7,6 @@
 obj-$(CONFIG_INPUT_SPARCSPKR)		+= sparcspkr.o
 obj-$(CONFIG_INPUT_PCSPKR)		+= pcspkr.o
 obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
-obj-$(CONFIG_INPUT_98SPKR)		+= 98spkr.o
 obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)	+= wistron_btns.o
 obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
Index: work/drivers/input/serio/Makefile
===================================================================
--- work.orig/drivers/input/serio/Makefile
+++ work/drivers/input/serio/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_SERIO_RPCKBD)	+= rpckbd.o
 obj-$(CONFIG_SERIO_SA1111)	+= sa1111ps2.o
 obj-$(CONFIG_SERIO_AMBAKMI)	+= ambakmi.o
 obj-$(CONFIG_SERIO_Q40KBD)	+= q40kbd.o
-obj-$(CONFIG_SERIO_98KBD)	+= 98kbd-io.o
 obj-$(CONFIG_SERIO_GSCPS2)	+= gscps2.o
 obj-$(CONFIG_HP_SDC)		+= hp_sdc.o
 obj-$(CONFIG_HIL_MLC)		+= hp_sdc_mlc.o hil_mlc.o


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

end of thread, other threads:[~2006-02-15  6:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-15  6:01 [GIT PATCH 0/6] Input update for 2.6.16 Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 1/6] ixp4xx-beeper: fix compile error Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 2/6] logips2pp: add new signature (99) Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 3/6] trackpoint: enable devices connected to external port Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 4/6] ads7846: convert to to dynamic input_dev allocation Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 5/6] ads7846: assorted updates Dmitry Torokhov
2006-02-15  6:01 ` [GIT PATCH 6/6] Kill remnants of 98kbd{,-io} and 98spkr Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®