Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93220
b: refs/heads/master
c: febf1df
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Dmitry Torokhov committed Apr 2, 2008
1 parent d4de08f commit 6ca7e8f
Show file tree
Hide file tree
Showing 10 changed files with 1,167 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f23c1d7579211c801494c7a8d6fca12905f7949f
refs/heads/master: febf1dff119ef27ee22a54d40f284d2454f00d8d
10 changes: 10 additions & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4343,6 +4343,16 @@ L: linux-wireless@vger.kernel.org
W: http://oops.ghostprotocols.net:81/blog
S: Maintained

WM97XX TOUCHSCREEN DRIVERS
P: Mark Brown
M: broonie@opensource.wolfsonmicro.com
P: Liam Girdwood
M: liam.girdwood@wolfsonmicro.com
L: linux-input@vger.kernel.org
T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
W: http://opensource.wolfsonmicro.com/node/7
S: Supported

X.25 NETWORK LAYER
P: Henner Eisen
M: eis@baty.hanse.de
Expand Down
73 changes: 25 additions & 48 deletions trunk/drivers/input/keyboard/locomokbd.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/*
* LoCoMo keyboard driver for Linux-based ARM PDAs:
* - SHARP Zaurus Collie (SL-5500)
* - SHARP Zaurus Poodle (SL-5600)
* Copyright (c) 2005 John Lenz
*
* Copyright (c) 2005 John Lenz
* Based on from xtkbd.c
*
*
*/

/*
* LoCoMo keyboard driver for Linux/ARM
*/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand Down Expand Up @@ -45,8 +47,7 @@ MODULE_LICENSE("GPL");
#define KEY_CONTACT KEY_F18
#define KEY_CENTER KEY_F15

static const unsigned char
locomokbd_keycode[LOCOMOKBD_NUMKEYS] __devinitconst = {
static unsigned char locomokbd_keycode[LOCOMOKBD_NUMKEYS] = {
0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */
0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_HOME, KEY_CONTACT, /* 10 - 19 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */
Expand All @@ -66,21 +67,22 @@ locomokbd_keycode[LOCOMOKBD_NUMKEYS] __devinitconst = {
#define KB_COLS 8
#define KB_ROWMASK(r) (1 << (r))
#define SCANCODE(c,r) ( ((c)<<4) + (r) + 1 )
#define NR_SCANCODES 128

#define KB_DELAY 8
#define SCAN_INTERVAL (HZ/10)
#define LOCOMOKBD_PRESSED 1

struct locomokbd {
unsigned char keycode[LOCOMOKBD_NUMKEYS];
struct input_dev *input;
char phys[32];

struct locomo_dev *ldev;
unsigned long base;
spinlock_t lock;

struct timer_list timer;
unsigned long suspend_jiffies;
unsigned int count_cancel;
};

/* helper functions for reading the keyboard matrix */
Expand Down Expand Up @@ -126,7 +128,7 @@ static inline void locomokbd_reset_col(unsigned long membase, int col)
/* Scan the hardware keyboard and push any changes up through the input layer */
static void locomokbd_scankeyboard(struct locomokbd *locomokbd)
{
unsigned int row, col, rowd;
unsigned int row, col, rowd, scancode;
unsigned long flags;
unsigned int num_pressed;
unsigned long membase = locomokbd->base;
Expand All @@ -143,33 +145,13 @@ static void locomokbd_scankeyboard(struct locomokbd *locomokbd)

rowd = ~locomo_readl(membase + LOCOMO_KIB);
for (row = 0; row < KB_ROWS; row++) {
unsigned int scancode, pressed, key;

scancode = SCANCODE(col, row);
pressed = rowd & KB_ROWMASK(row);
key = locomokbd->keycode[scancode];

input_report_key(locomokbd->input, key, pressed);
if (likely(!pressed))
continue;

num_pressed++;

/* The "Cancel/ESC" key is labeled "On/Off" on
* Collie and Poodle and should suspend the device
* if it was pressed for more than a second. */
if (unlikely(key == KEY_ESC)) {
if (!time_after(jiffies,
locomokbd->suspend_jiffies + HZ))
continue;
if (locomokbd->count_cancel++
!= (HZ/SCAN_INTERVAL + 1))
continue;
input_event(locomokbd->input, EV_PWR,
KEY_SUSPEND, 1);
locomokbd->suspend_jiffies = jiffies;
} else
locomokbd->count_cancel = 0;
if (rowd & KB_ROWMASK(row)) {
num_pressed += 1;
input_report_key(locomokbd->input, locomokbd->keycode[scancode], 1);
} else {
input_report_key(locomokbd->input, locomokbd->keycode[scancode], 0);
}
}
locomokbd_reset_col(membase, col);
}
Expand All @@ -180,8 +162,6 @@ static void locomokbd_scankeyboard(struct locomokbd *locomokbd)
/* if any keys are pressed, enable the timer */
if (num_pressed)
mod_timer(&locomokbd->timer, jiffies + SCAN_INTERVAL);
else
locomokbd->count_cancel = 0;

spin_unlock_irqrestore(&locomokbd->lock, flags);
}
Expand All @@ -206,11 +186,10 @@ static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
static void locomokbd_timer_callback(unsigned long data)
{
struct locomokbd *locomokbd = (struct locomokbd *) data;

locomokbd_scankeyboard(locomokbd);
}

static int __devinit locomokbd_probe(struct locomo_dev *dev)
static int locomokbd_probe(struct locomo_dev *dev)
{
struct locomokbd *locomokbd;
struct input_dev *input_dev;
Expand All @@ -232,6 +211,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
goto err_free_mem;
}

locomokbd->ldev = dev;
locomo_set_drvdata(dev, locomokbd);

locomokbd->base = (unsigned long) dev->mapbase;
Expand All @@ -242,8 +222,6 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
locomokbd->timer.function = locomokbd_timer_callback;
locomokbd->timer.data = (unsigned long) locomokbd;

locomokbd->suspend_jiffies = jiffies;

locomokbd->input = input_dev;
strcpy(locomokbd->phys, "locomokbd/input0");

Expand All @@ -255,10 +233,9 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
input_dev->id.version = 0x0100;
input_dev->dev.parent = &dev->dev;

input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
BIT_MASK(EV_PWR);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
input_dev->keycode = locomokbd->keycode;
input_dev->keycodesize = sizeof(locomokbd_keycode[0]);
input_dev->keycodesize = sizeof(unsigned char);
input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);

memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode));
Expand Down Expand Up @@ -291,7 +268,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
return err;
}

static int __devexit locomokbd_remove(struct locomo_dev *dev)
static int locomokbd_remove(struct locomo_dev *dev)
{
struct locomokbd *locomokbd = locomo_get_drvdata(dev);

Expand All @@ -315,7 +292,7 @@ static struct locomo_driver keyboard_driver = {
},
.devid = LOCOMO_DEVID_KEYBOARD,
.probe = locomokbd_probe,
.remove = __devexit_p(locomokbd_remove),
.remove = locomokbd_remove,
};

static int __init locomokbd_init(void)
Expand Down
13 changes: 1 addition & 12 deletions trunk/drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
#define GEYSER4_ISO_PRODUCT_ID 0x021B
#define GEYSER4_JIS_PRODUCT_ID 0x021C

#define GEYSER4_HF_ANSI_PRODUCT_ID 0x0229
#define GEYSER4_HF_ISO_PRODUCT_ID 0x022A
#define GEYSER4_HF_JIS_PRODUCT_ID 0x022B

#define ATP_DEVICE(prod) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_INT_CLASS | \
Expand Down Expand Up @@ -97,10 +93,6 @@ static struct usb_device_id atp_table [] = {
{ ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) },
{ ATP_DEVICE(GEYSER4_JIS_PRODUCT_ID) },

{ ATP_DEVICE(GEYSER4_HF_ANSI_PRODUCT_ID) },
{ ATP_DEVICE(GEYSER4_HF_ISO_PRODUCT_ID) },
{ ATP_DEVICE(GEYSER4_HF_JIS_PRODUCT_ID) },

/* Terminating entry */
{ }
};
Expand Down Expand Up @@ -225,10 +217,7 @@ static inline int atp_is_geyser_3(struct atp *dev)
(productId == GEYSER3_JIS_PRODUCT_ID) ||
(productId == GEYSER4_ANSI_PRODUCT_ID) ||
(productId == GEYSER4_ISO_PRODUCT_ID) ||
(productId == GEYSER4_JIS_PRODUCT_ID) ||
(productId == GEYSER4_HF_ANSI_PRODUCT_ID) ||
(productId == GEYSER4_HF_ISO_PRODUCT_ID) ||
(productId == GEYSER4_HF_JIS_PRODUCT_ID);
(productId == GEYSER4_JIS_PRODUCT_ID);
}

/*
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ config TOUCHSCREEN_UCB1400
To compile this driver as a module, choose M here: the
module will be called ucb1400_ts.

config TOUCHSCREEN_WM97XX
tristate "Support for WM97xx AC97 touchscreen controllers"
depends on AC97_BUS
help
Say Y here if you have a Wolfson Microelectronics WM97xx
touchscreen connected to your system. Note that this option
only enables core driver, you will also need to select
support for appropriate chip below.

If unsure, say N.

To compile this driver as a module, choose M here: the
module will be called wm97xx-ts.

config TOUCHSCREEN_USB_COMPOSITE
tristate "USB Touchscreen Driver"
depends on USB_ARCH_HAS_HCD
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/input/touchscreen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Each configuration option enables a list of files.

wm97xx-ts-y := wm97xx-core.o

obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
obj-$(CONFIG_TOUCHSCREEN_CORGI) += corgi_ts.o
Expand All @@ -19,3 +21,4 @@ obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o
22 changes: 12 additions & 10 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ struct ads7846 {
#endif

u16 model;
u16 vref_mv;
u16 vref_delay_usecs;
u16 x_plate_ohms;
u16 pressure_max;
Expand Down Expand Up @@ -185,6 +184,9 @@ struct ads7846 {
* The range is GND..vREF. The ads7843 and ads7835 must use external vREF;
* ads7846 lets that pin be unconnected, to use internal vREF.
*/
static unsigned vREF_mV;
module_param(vREF_mV, uint, 0);
MODULE_PARM_DESC(vREF_mV, "external vREF voltage, in milliVolts");

struct ser_req {
u8 ref_on;
Expand All @@ -211,6 +213,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
struct ads7846 *ts = dev_get_drvdata(dev);
struct ser_req *req = kzalloc(sizeof *req, GFP_KERNEL);
int status;
int uninitialized_var(sample);
int use_internal;

if (!req)
Expand Down Expand Up @@ -267,13 +270,13 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)

if (status == 0) {
/* on-wire is a must-ignore bit, a BE12 value, then padding */
status = be16_to_cpu(req->sample);
status = status >> 3;
status &= 0x0fff;
sample = be16_to_cpu(req->sample);
sample = sample >> 3;
sample &= 0x0fff;
}

kfree(req);
return status;
return status ? status : sample;
}

#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
Expand Down Expand Up @@ -314,7 +317,7 @@ static inline unsigned vaux_adjust(struct ads7846 *ts, ssize_t v)
unsigned retval = v;

/* external resistors may scale vAUX into 0..vREF */
retval *= ts->vref_mv;
retval *= vREF_mV;
retval = retval >> 12;
return retval;
}
Expand Down Expand Up @@ -372,14 +375,14 @@ static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts)
/* hwmon sensors need a reference voltage */
switch (ts->model) {
case 7846:
if (!ts->vref_mv) {
if (!vREF_mV) {
dev_dbg(&spi->dev, "assuming 2.5V internal vREF\n");
ts->vref_mv = 2500;
vREF_mV = 2500;
}
break;
case 7845:
case 7843:
if (!ts->vref_mv) {
if (!vREF_mV) {
dev_warn(&spi->dev,
"external vREF for ADS%d not specified\n",
ts->model);
Expand Down Expand Up @@ -872,7 +875,6 @@ static int __devinit ads7846_probe(struct spi_device *spi)

ts->spi = spi;
ts->input = input_dev;
ts->vref_mv = pdata->vref_mv;

hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ts->timer.function = ads7846_timer;
Expand Down
Loading

0 comments on commit 6ca7e8f

Please sign in to comment.