Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ads7846 - SPI_CPHA mode bugfix Input: ads7846 - document that it handles tsc2046 too Input: input-polldev - add module info Input: ucb1x00-ts - remove commented out code Input: ucb1400_ts - use sched_setscheduler() Input: ALPS - force stream mode Input: iforce - minor clean-ups Input: iforce - fix force feedback not working Input: adbhid - do not access input_dev->private directly Input: logips2pp - add type 72 (PS/2 TrackMan Marble)
This commit is contained in:
@@ -370,10 +370,8 @@ int iforce_init_device(struct iforce *iforce)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable spring, enable force feedback.
|
* Disable spring, enable force feedback.
|
||||||
* FIXME: We should use iforce_set_autocenter() et al here.
|
|
||||||
*/
|
*/
|
||||||
|
iforce_set_autocenter(input_dev, 0);
|
||||||
iforce_send_packet(iforce, FF_CMD_AUTOCENTER, "\004\000");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find appropriate device entry
|
* Find appropriate device entry
|
||||||
|
@@ -246,6 +246,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
|
|||||||
|
|
||||||
int iforce_get_id_packet(struct iforce *iforce, char *packet)
|
int iforce_get_id_packet(struct iforce *iforce, char *packet)
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
switch (iforce->bus) {
|
switch (iforce->bus) {
|
||||||
|
|
||||||
case IFORCE_USB:
|
case IFORCE_USB:
|
||||||
@@ -254,18 +256,22 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
|
|||||||
iforce->cr.bRequest = packet[0];
|
iforce->cr.bRequest = packet[0];
|
||||||
iforce->ctrl->dev = iforce->usbdev;
|
iforce->ctrl->dev = iforce->usbdev;
|
||||||
|
|
||||||
if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC))
|
status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
|
||||||
|
if (status) {
|
||||||
|
err("usb_submit_urb failed %d", status);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
wait_event_interruptible_timeout(iforce->wait,
|
wait_event_interruptible_timeout(iforce->wait,
|
||||||
iforce->ctrl->status != -EINPROGRESS, HZ);
|
iforce->ctrl->status != -EINPROGRESS, HZ);
|
||||||
|
|
||||||
if (iforce->ctrl->status) {
|
if (iforce->ctrl->status) {
|
||||||
|
dbg("iforce->ctrl->status = %d", iforce->ctrl->status);
|
||||||
usb_unlink_urb(iforce->ctrl);
|
usb_unlink_urb(iforce->ctrl);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
err("iforce_get_id_packet: iforce->bus = USB!");
|
dbg("iforce_get_id_packet: iforce->bus = USB!");
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -65,6 +65,7 @@ void iforce_usb_xmit(struct iforce *iforce)
|
|||||||
XMIT_INC(iforce->xmit.tail, n);
|
XMIT_INC(iforce->xmit.tail, n);
|
||||||
|
|
||||||
if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
|
if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
|
||||||
|
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||||
warn("usb_submit_urb failed %d\n", n);
|
warn("usb_submit_urb failed %d\n", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +164,8 @@ static int iforce_usb_probe(struct usb_interface *intf,
|
|||||||
usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
|
usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
|
||||||
iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
|
iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
|
||||||
|
|
||||||
usb_fill_bulk_urb(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress),
|
usb_fill_int_urb(iforce->out, dev, usb_sndintpipe(dev, epout->bEndpointAddress),
|
||||||
iforce + 1, 32, iforce_usb_out, iforce);
|
iforce + 1, 32, iforce_usb_out, iforce, epout->bInterval);
|
||||||
|
|
||||||
usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0),
|
usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0),
|
||||||
(void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
|
(void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
|
||||||
|
@@ -12,6 +12,11 @@
|
|||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/input-polldev.h>
|
#include <linux/input-polldev.h>
|
||||||
|
|
||||||
|
MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>");
|
||||||
|
MODULE_DESCRIPTION("Generic implementation of a polled input device");
|
||||||
|
MODULE_LICENSE("GPL v2");
|
||||||
|
MODULE_VERSION("0.1");
|
||||||
|
|
||||||
static DEFINE_MUTEX(polldev_mutex);
|
static DEFINE_MUTEX(polldev_mutex);
|
||||||
static int polldev_users;
|
static int polldev_users;
|
||||||
static struct workqueue_struct *polldev_wq;
|
static struct workqueue_struct *polldev_wq;
|
||||||
|
@@ -251,11 +251,15 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
|
|||||||
|
|
||||||
dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]);
|
dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++);
|
if (version) {
|
||||||
*version = (param[0] << 8) | (param[1] << 4) | i;
|
for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
|
||||||
|
/* empty */;
|
||||||
|
*version = (param[0] << 8) | (param[1] << 4) | i;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
|
for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
|
||||||
if (!memcmp(param, alps_model_data[i].signature, sizeof(alps_model_data[i].signature)))
|
if (!memcmp(param, alps_model_data[i].signature,
|
||||||
|
sizeof(alps_model_data[i].signature)))
|
||||||
return alps_model_data + i;
|
return alps_model_data + i;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -380,32 +384,46 @@ static int alps_poll(struct psmouse *psmouse)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int alps_reconnect(struct psmouse *psmouse)
|
static int alps_hw_init(struct psmouse *psmouse, int *version)
|
||||||
{
|
{
|
||||||
struct alps_data *priv = psmouse->private;
|
struct alps_data *priv = psmouse->private;
|
||||||
int version;
|
|
||||||
|
|
||||||
psmouse_reset(psmouse);
|
priv->i = alps_get_model(psmouse, version);
|
||||||
|
if (!priv->i)
|
||||||
if (!(priv->i = alps_get_model(psmouse, &version)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
|
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (alps_tap_mode(psmouse, 1)) {
|
if (alps_tap_mode(psmouse, 1)) {
|
||||||
printk(KERN_WARNING "alps.c: Failed to reenable hardware tapping\n");
|
printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alps_absolute_mode(psmouse)) {
|
if (alps_absolute_mode(psmouse)) {
|
||||||
printk(KERN_ERR "alps.c: Failed to reenable absolute mode\n");
|
printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
|
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* ALPS needs stream mode, otherwise it won't report any data */
|
||||||
|
if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) {
|
||||||
|
printk(KERN_ERR "alps.c: Failed to enable stream mode\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int alps_reconnect(struct psmouse *psmouse)
|
||||||
|
{
|
||||||
|
psmouse_reset(psmouse);
|
||||||
|
|
||||||
|
if (alps_hw_init(psmouse, NULL))
|
||||||
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,23 +448,9 @@ int alps_init(struct psmouse *psmouse)
|
|||||||
goto init_fail;
|
goto init_fail;
|
||||||
|
|
||||||
priv->dev2 = dev2;
|
priv->dev2 = dev2;
|
||||||
|
psmouse->private = priv;
|
||||||
|
|
||||||
priv->i = alps_get_model(psmouse, &version);
|
if (alps_hw_init(psmouse, &version))
|
||||||
if (!priv->i)
|
|
||||||
goto init_fail;
|
|
||||||
|
|
||||||
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
|
|
||||||
goto init_fail;
|
|
||||||
|
|
||||||
if (alps_tap_mode(psmouse, 1))
|
|
||||||
printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
|
|
||||||
|
|
||||||
if (alps_absolute_mode(psmouse)) {
|
|
||||||
printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
|
|
||||||
goto init_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
|
|
||||||
goto init_fail;
|
goto init_fail;
|
||||||
|
|
||||||
dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
|
dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
|
||||||
@@ -493,13 +497,13 @@ int alps_init(struct psmouse *psmouse)
|
|||||||
/* We are having trouble resyncing ALPS touchpads so disable it for now */
|
/* We are having trouble resyncing ALPS touchpads so disable it for now */
|
||||||
psmouse->resync_time = 0;
|
psmouse->resync_time = 0;
|
||||||
|
|
||||||
psmouse->private = priv;
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
init_fail:
|
init_fail:
|
||||||
psmouse_reset(psmouse);
|
psmouse_reset(psmouse);
|
||||||
input_free_device(dev2);
|
input_free_device(dev2);
|
||||||
kfree(priv);
|
kfree(priv);
|
||||||
|
psmouse->private = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -221,6 +221,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
|
|||||||
{ 66, PS2PP_KIND_MX, /* MX3100 reciver */
|
{ 66, PS2PP_KIND_MX, /* MX3100 reciver */
|
||||||
PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
|
PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
|
||||||
PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },
|
PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },
|
||||||
|
{ 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */
|
||||||
{ 73, 0, PS2PP_SIDE_BTN },
|
{ 73, 0, PS2PP_SIDE_BTN },
|
||||||
{ 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
{ 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
||||||
{ 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
{ 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
||||||
|
@@ -12,17 +12,17 @@ menuconfig INPUT_TOUCHSCREEN
|
|||||||
if INPUT_TOUCHSCREEN
|
if INPUT_TOUCHSCREEN
|
||||||
|
|
||||||
config TOUCHSCREEN_ADS7846
|
config TOUCHSCREEN_ADS7846
|
||||||
tristate "ADS 7846/7843 based touchscreens"
|
tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
|
||||||
depends on SPI_MASTER
|
depends on SPI_MASTER
|
||||||
depends on HWMON = n || HWMON
|
depends on HWMON = n || HWMON
|
||||||
help
|
help
|
||||||
Say Y here if you have a touchscreen interface using the
|
Say Y here if you have a touchscreen interface using the
|
||||||
ADS7846 or ADS7843 controller, and your board-specific setup
|
ADS7846/TSC2046 or ADS7843 controller, and your board-specific
|
||||||
code includes that in its table of SPI devices.
|
setup code includes that in its table of SPI devices.
|
||||||
|
|
||||||
If HWMON is selected, and the driver is told the reference voltage
|
If HWMON is selected, and the driver is told the reference voltage
|
||||||
on your board, you will also get hwmon interfaces for the voltage
|
on your board, you will also get hwmon interfaces for the voltage
|
||||||
(and on ads7846, temperature) sensors of this chip.
|
(and on ads7846/tsc2046, temperature) sensors of this chip.
|
||||||
|
|
||||||
If unsure, say N (but it's safe to say "Y").
|
If unsure, say N (but it's safe to say "Y").
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
/*
|
/*
|
||||||
* This code has been heavily tested on a Nokia 770, and lightly
|
* This code has been heavily tested on a Nokia 770, and lightly
|
||||||
* tested on other ads7846 devices (OSK/Mistral, Lubbock).
|
* tested on other ads7846 devices (OSK/Mistral, Lubbock).
|
||||||
|
* TSC2046 is just newer ads7846 silicon.
|
||||||
* Support for ads7843 tested on Atmel at91sam926x-EK.
|
* Support for ads7843 tested on Atmel at91sam926x-EK.
|
||||||
* Support for ads7845 has only been stubbed in.
|
* Support for ads7845 has only been stubbed in.
|
||||||
*
|
*
|
||||||
@@ -847,7 +848,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||||||
* may not. So we stick to very-portable 8 bit words, both RX and TX.
|
* may not. So we stick to very-portable 8 bit words, both RX and TX.
|
||||||
*/
|
*/
|
||||||
spi->bits_per_word = 8;
|
spi->bits_per_word = 8;
|
||||||
spi->mode = SPI_MODE_1;
|
spi->mode = SPI_MODE_0;
|
||||||
err = spi_setup(spi);
|
err = spi_setup(spi);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
@@ -288,9 +288,9 @@ static int ucb1400_ts_thread(void *_ucb)
|
|||||||
struct ucb1400 *ucb = _ucb;
|
struct ucb1400 *ucb = _ucb;
|
||||||
struct task_struct *tsk = current;
|
struct task_struct *tsk = current;
|
||||||
int valid = 0;
|
int valid = 0;
|
||||||
|
struct sched_param param = { .sched_priority = 1 };
|
||||||
|
|
||||||
tsk->policy = SCHED_FIFO;
|
sched_setscheduler(tsk, SCHED_FIFO, ¶m);
|
||||||
tsk->rt_priority = 1;
|
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
unsigned int x, y, p;
|
unsigned int x, y, p;
|
||||||
|
@@ -628,16 +628,16 @@ static void real_leds(unsigned char leds, int device)
|
|||||||
*/
|
*/
|
||||||
static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
||||||
{
|
{
|
||||||
struct adbhid *adbhid = dev->private;
|
struct adbhid *adbhid = input_get_drvdata(dev);
|
||||||
unsigned char leds;
|
unsigned char leds;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EV_LED:
|
case EV_LED:
|
||||||
leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0)
|
leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) |
|
||||||
| (test_bit(LED_NUML, dev->led) ? 1 : 0)
|
(test_bit(LED_NUML, dev->led) ? 1 : 0) |
|
||||||
| (test_bit(LED_CAPSL, dev->led) ? 2 : 0);
|
(test_bit(LED_CAPSL, dev->led) ? 2 : 0);
|
||||||
real_leds(leds, adbhid->id);
|
real_leds(leds, adbhid->id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -649,7 +649,7 @@ adb_message_handler(struct notifier_block *this, unsigned long code, void *x)
|
|||||||
switch (code) {
|
switch (code) {
|
||||||
case ADB_MSG_PRE_RESET:
|
case ADB_MSG_PRE_RESET:
|
||||||
case ADB_MSG_POWERDOWN:
|
case ADB_MSG_POWERDOWN:
|
||||||
/* Stop the repeat timer. Autopoll is already off at this point */
|
/* Stop the repeat timer. Autopoll is already off at this point */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; i < 16; i++) {
|
for (i = 1; i < 16; i++) {
|
||||||
@@ -699,7 +699,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
|
|||||||
hid->current_handler_id = current_handler_id;
|
hid->current_handler_id = current_handler_id;
|
||||||
hid->mouse_kind = mouse_kind;
|
hid->mouse_kind = mouse_kind;
|
||||||
hid->flags = 0;
|
hid->flags = 0;
|
||||||
input_dev->private = hid;
|
input_set_drvdata(input_dev, hid);
|
||||||
input_dev->name = hid->name;
|
input_dev->name = hid->name;
|
||||||
input_dev->phys = hid->phys;
|
input_dev->phys = hid->phys;
|
||||||
input_dev->id.bustype = BUS_ADB;
|
input_dev->id.bustype = BUS_ADB;
|
||||||
|
@@ -207,16 +207,7 @@ static int ucb1x00_thread(void *_ts)
|
|||||||
struct ucb1x00_ts *ts = _ts;
|
struct ucb1x00_ts *ts = _ts;
|
||||||
struct task_struct *tsk = current;
|
struct task_struct *tsk = current;
|
||||||
DECLARE_WAITQUEUE(wait, tsk);
|
DECLARE_WAITQUEUE(wait, tsk);
|
||||||
int valid;
|
int valid = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* We could run as a real-time thread. However, thus far
|
|
||||||
* this doesn't seem to be necessary.
|
|
||||||
*/
|
|
||||||
// tsk->policy = SCHED_FIFO;
|
|
||||||
// tsk->rt_priority = 1;
|
|
||||||
|
|
||||||
valid = 0;
|
|
||||||
|
|
||||||
add_wait_queue(&ts->irq_wait, &wait);
|
add_wait_queue(&ts->irq_wait, &wait);
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
|
Reference in New Issue
Block a user