Skip to content

Commit

Permalink
Merge branch 'for-linus' into next
Browse files Browse the repository at this point in the history
Conflicts:

	drivers/input/mouse/appletouch.c
  • Loading branch information
Dmitry Torokhov committed Jun 17, 2008
2 parents 39ab9dd + 90d95ef commit 15439dd
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 56 deletions.
2 changes: 2 additions & 0 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ static int atkbd_activate(struct atkbd *atkbd)
static void atkbd_cleanup(struct serio *serio)
{
struct atkbd *atkbd = serio_get_drvdata(serio);

atkbd_disable(atkbd);
ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT);
}

Expand Down
38 changes: 25 additions & 13 deletions drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,31 @@ static void pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
set_bit(code, input_dev->keybit);
}

for (i = 0; i < pdata->direct_key_num; i++)
set_bit(pdata->direct_key_map[i], input_dev->keybit);

keypad->rotary_up_key[0] = pdata->rotary0_up_key;
keypad->rotary_up_key[1] = pdata->rotary1_up_key;
keypad->rotary_down_key[0] = pdata->rotary0_down_key;
keypad->rotary_down_key[1] = pdata->rotary1_down_key;
keypad->rotary_rel_code[0] = pdata->rotary0_rel_code;
keypad->rotary_rel_code[1] = pdata->rotary1_rel_code;

if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
set_bit(pdata->rotary0_up_key, input_dev->keybit);
set_bit(pdata->rotary0_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary0_rel_code, input_dev->relbit);

if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
set_bit(pdata->rotary1_up_key, input_dev->keybit);
set_bit(pdata->rotary1_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary1_rel_code, input_dev->relbit);
if (pdata->enable_rotary0) {
if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
set_bit(pdata->rotary0_up_key, input_dev->keybit);
set_bit(pdata->rotary0_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary0_rel_code, input_dev->relbit);
}

if (pdata->enable_rotary1) {
if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
set_bit(pdata->rotary1_up_key, input_dev->keybit);
set_bit(pdata->rotary1_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary1_rel_code, input_dev->relbit);
}
}

static inline unsigned int lookup_matrix_keycode(
Expand Down Expand Up @@ -493,8 +500,13 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
keypad->input_dev = input_dev;
input_set_drvdata(input_dev, keypad);

input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
BIT_MASK(EV_REL);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
if ((keypad->pdata->enable_rotary0 &&
keypad->pdata->rotary0_rel_code) ||
(keypad->pdata->enable_rotary1 &&
keypad->pdata->rotary1_rel_code)) {
input_dev->evbit[0] |= BIT_MASK(EV_REL);
}

pxa27x_keypad_build_keycode(keypad);
platform_set_drvdata(pdev, keypad);
Expand Down
1 change: 0 additions & 1 deletion drivers/input/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if INPUT_MISC
config INPUT_PCSPKR
tristate "PC Speaker support"
depends on PCSPKR_PLATFORM
depends on SND_PCSP=n
help
Say Y here if you want the standard PC Speaker to be used for
bells and whistles.
Expand Down
1 change: 0 additions & 1 deletion drivers/input/misc/apanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/input-polldev.h>
#include <linux/i2c.h>
#include <linux/workqueue.h>
Expand Down
49 changes: 41 additions & 8 deletions drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,21 @@ static void atp_close(struct input_dev *input)
dev->open = 0;
}

static int atp_handle_geyser(struct atp *dev)
{
struct usb_device *udev = dev->udev;

if (dev->type != ATP_FOUNTAIN) {
/* switch to raw sensor mode */
if (atp_geyser_init(udev))
return -EIO;

printk(KERN_INFO "appletouch: Geyser mode initialized.\n");
}

return 0;
}

static int atp_probe(struct usb_interface *iface,
const struct usb_device_id *id)
{
Expand Down Expand Up @@ -608,14 +623,6 @@ static int atp_probe(struct usb_interface *iface,
else
dev->datalen = 64;

if (dev->type != ATP_FOUNTAIN) {
/* switch to raw sensor mode */
if (atp_geyser_init(udev))
goto err_free_devs;

printk(KERN_INFO "appletouch: Geyser mode initialized.\n");
}

dev->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->urb)
goto err_free_devs;
Expand All @@ -629,6 +636,10 @@ static int atp_probe(struct usb_interface *iface,
usb_rcvintpipe(udev, int_in_endpointAddr),
dev->data, dev->datalen, atp_complete, dev, 1);

error = atp_handle_geyser(dev);
if (error)
goto err_free_buffer;

usb_make_path(udev, dev->phys, sizeof(dev->phys));
strlcat(dev->phys, "/input0", sizeof(dev->phys));

Expand Down Expand Up @@ -721,6 +732,20 @@ static void atp_disconnect(struct usb_interface *iface)
printk(KERN_INFO "input: appletouch disconnected\n");
}

static int atp_recover(struct atp *dev)
{
int error;

error = atp_handle_geyser(dev);
if (error)
return error;

if (dev->open && usb_submit_urb(dev->urb, GFP_ATOMIC))
return -EIO;

return 0;
}

static int atp_suspend(struct usb_interface *iface, pm_message_t message)
{
struct atp *dev = usb_get_intfdata(iface);
Expand All @@ -741,12 +766,20 @@ static int atp_resume(struct usb_interface *iface)
return 0;
}

static int atp_reset_resume(struct usb_interface *iface)
{
struct atp *dev = usb_get_intfdata(iface);

return atp_recover(dev);
}

static struct usb_driver atp_driver = {
.name = "appletouch",
.probe = atp_probe,
.disconnect = atp_disconnect,
.suspend = atp_suspend,
.resume = atp_resume,
.reset_resume = atp_reset_resume,
.id_table = atp_table,
};

Expand Down
14 changes: 14 additions & 0 deletions drivers/input/serio/i8042-x86ia64io.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
},
},
{
.ident = "Fujitsu-Siemens Amilo Pro 2030",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
},
},
{
/*
* No data is coming from the touchscreen unless KBC
Expand Down Expand Up @@ -335,6 +342,13 @@ static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
},
},
{
.ident = "Acer TravelMate 660",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
},
},
{
.ident = "Acer TravelMate 2490",
.matches = {
Expand Down
41 changes: 31 additions & 10 deletions drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,20 @@ static long i8042_panic_blink(long count)

#undef DELAY

#ifdef CONFIG_X86
static void i8042_dritek_enable(void)
{
char param = 0x90;
int error;

error = i8042_command(&param, 0x1059);
if (error)
printk(KERN_WARNING
"Failed to enable DRITEK extension: %d\n",
error);
}
#endif

#ifdef CONFIG_PM
/*
* Here we try to restore the original BIOS settings. We only want to
Expand Down Expand Up @@ -938,10 +952,20 @@ static int i8042_resume(struct platform_device *dev)
i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS;
i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT);
if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
printk(KERN_ERR "i8042: Can't write CTR to resume\n");
return -EIO;
printk(KERN_WARNING "i8042: Can't write CTR to resume, retrying...\n");
msleep(50);
if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
printk(KERN_ERR "i8042: CTR write retry failed\n");
return -EIO;
}
}


#ifdef CONFIG_X86
if (i8042_dritek)
i8042_dritek_enable();
#endif

if (i8042_mux_present) {
if (i8042_set_mux_mode(1, NULL) || i8042_enable_mux_ports())
printk(KERN_WARNING
Expand Down Expand Up @@ -1160,6 +1184,11 @@ static int __devinit i8042_probe(struct platform_device *dev)
if (error)
return error;

#ifdef CONFIG_X86
if (i8042_dritek)
i8042_dritek_enable();
#endif

if (!i8042_noaux) {
error = i8042_setup_aux();
if (error && error != -ENODEV && error != -EBUSY)
Expand All @@ -1171,14 +1200,6 @@ static int __devinit i8042_probe(struct platform_device *dev)
if (error)
goto out_fail;
}
#ifdef CONFIG_X86
if (i8042_dritek) {
char param = 0x90;
error = i8042_command(&param, 0x1059);
if (error)
goto out_fail;
}
#endif
/*
* Ok, everything is ready, let's register all serio ports
*/
Expand Down
17 changes: 7 additions & 10 deletions drivers/input/tablet/gtco.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
struct gtco *gtco;
struct input_dev *input_dev;
struct hid_descriptor *hid_desc;
char *report = NULL;
char *report;
int result = 0, retry;
int error;
struct usb_endpoint_descriptor *endpoint;
Expand Down Expand Up @@ -916,25 +916,23 @@ static int gtco_probe(struct usb_interface *usbinterface,
le16_to_cpu(hid_desc->wDescriptorLength),
5000); /* 5 secs */

if (result == le16_to_cpu(hid_desc->wDescriptorLength))
dbg("usb_control_msg result: %d", result);
if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
parse_hid_report_descriptor(gtco, report, result);
break;
}
}

kfree(report);

/* If we didn't get the report, fail */
dbg("usb_control_msg result: :%d", result);
if (result != le16_to_cpu(hid_desc->wDescriptorLength)) {
err("Failed to get HID Report Descriptor of size: %d",
hid_desc->wDescriptorLength);
error = -EIO;
goto err_free_urb;
}

/* Now we parse the report */
parse_hid_report_descriptor(gtco, report, result);

/* Now we delete it */
kfree(report);

/* Create a device file node */
usb_make_path(gtco->usbdev, gtco->usbpath, sizeof(gtco->usbpath));
strlcat(gtco->usbpath, "/input0", sizeof(gtco->usbpath));
Expand Down Expand Up @@ -988,7 +986,6 @@ static int gtco_probe(struct usb_interface *usbinterface,
usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
gtco->buffer, gtco->buf_dma);
err_free_devs:
kfree(report);
input_free_device(input_dev);
kfree(gtco);
return error;
Expand Down
22 changes: 22 additions & 0 deletions drivers/input/touchscreen/wm9713.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ static int delay = 4;
module_param(delay, int, 0);
MODULE_PARM_DESC(delay, "Set adc sample delay.");

/*
* Set five_wire = 1 to use a 5 wire touchscreen.
*
* NOTE: Five wire mode does not allow for readback of pressure.
*/
static int five_wire;
module_param(five_wire, int, 0);
MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");

/*
* Set adc mask function.
*
Expand Down Expand Up @@ -162,6 +171,19 @@ static void wm9713_phy_init(struct wm97xx *wm)
64000 / rpu);
}

/* Five wire panel? */
if (five_wire) {
dig3 |= WM9713_45W;
dev_info(wm->dev, "setting 5-wire touchscreen mode.");

if (pil) {
dev_warn(wm->dev,
"Pressure measurement not supported in 5 "
"wire mode, disabling\n");
pil = 0;
}
}

/* touchpanel pressure */
if (pil == 2) {
dig3 |= WM9712_PIL;
Expand Down
Loading

0 comments on commit 15439dd

Please sign in to comment.