Commit 99380825 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Merge branch 'next' into for-linus

Conflicts:
	drivers/input/tablet/wacom_sys.c
parents 10ce3cc9 131c713f
...@@ -159,11 +159,4 @@ struct kbd_platform_data { ...@@ -159,11 +159,4 @@ struct kbd_platform_data {
unsigned int mode; unsigned int mode;
}; };
/* This function is used to set platform data field of pdev->dev */
static inline void
kbd_set_plat_data(struct platform_device *pdev, struct kbd_platform_data *data)
{
pdev->dev.platform_data = data;
}
#endif /* __PLAT_KEYBOARD_H */ #endif /* __PLAT_KEYBOARD_H */
...@@ -108,6 +108,9 @@ static int __init amijoy_init(void) ...@@ -108,6 +108,9 @@ static int __init amijoy_init(void)
int i, j; int i, j;
int err; int err;
if (!MACH_IS_AMIGA)
return -ENODEV;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (!amijoy[i]) if (!amijoy[i])
continue; continue;
......
This diff is collapsed.
...@@ -630,6 +630,7 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev) ...@@ -630,6 +630,7 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev)
if (!np) if (!np)
return NULL; return NULL;
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata) if (!pdata)
return NULL; return NULL;
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Finger Sensing Pad PS/2 mouse driver. * Finger Sensing Pad PS/2 mouse driver.
* *
* Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd.
* Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation. * Copyright (C) 2005-2012 Tai-hwa Liang, Sentelic Corporation.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -55,6 +55,16 @@ ...@@ -55,6 +55,16 @@
#define FSP_BIT_FIX_HSCR BIT(5) #define FSP_BIT_FIX_HSCR BIT(5)
#define FSP_BIT_DRAG_LOCK BIT(6) #define FSP_BIT_DRAG_LOCK BIT(6)
#define FSP_REG_SWC1 (0x90)
#define FSP_BIT_SWC1_EN_ABS_1F BIT(0)
#define FSP_BIT_SWC1_EN_GID BIT(1)
#define FSP_BIT_SWC1_EN_ABS_2F BIT(2)
#define FSP_BIT_SWC1_EN_FUP_OUT BIT(3)
#define FSP_BIT_SWC1_EN_ABS_CON BIT(4)
#define FSP_BIT_SWC1_GST_GRP0 BIT(5)
#define FSP_BIT_SWC1_GST_GRP1 BIT(6)
#define FSP_BIT_SWC1_BX_COMPAT BIT(7)
/* Finger-sensing Pad packet formating related definitions */ /* Finger-sensing Pad packet formating related definitions */
/* absolute packet type */ /* absolute packet type */
...@@ -64,12 +74,32 @@ ...@@ -64,12 +74,32 @@
#define FSP_PKT_TYPE_NORMAL_OPC (0x03) #define FSP_PKT_TYPE_NORMAL_OPC (0x03)
#define FSP_PKT_TYPE_SHIFT (6) #define FSP_PKT_TYPE_SHIFT (6)
/* bit definitions for the first byte of report packet */
#define FSP_PB0_LBTN BIT(0)
#define FSP_PB0_RBTN BIT(1)
#define FSP_PB0_MBTN BIT(2)
#define FSP_PB0_MFMC_FGR2 FSP_PB0_MBTN
#define FSP_PB0_MUST_SET BIT(3)
#define FSP_PB0_PHY_BTN BIT(4)
#define FSP_PB0_MFMC BIT(5)
/* hardware revisions */
#define FSP_VER_STL3888_A4 (0xC1)
#define FSP_VER_STL3888_B0 (0xD0)
#define FSP_VER_STL3888_B1 (0xD1)
#define FSP_VER_STL3888_B2 (0xD2)
#define FSP_VER_STL3888_C0 (0xE0)
#define FSP_VER_STL3888_C1 (0xE1)
#define FSP_VER_STL3888_D0 (0xE2)
#define FSP_VER_STL3888_D1 (0xE3)
#define FSP_VER_STL3888_E0 (0xE4)
#ifdef __KERNEL__ #ifdef __KERNEL__
struct fsp_data { struct fsp_data {
unsigned char ver; /* hardware version */ unsigned char ver; /* hardware version */
unsigned char rev; /* hardware revison */ unsigned char rev; /* hardware revison */
unsigned char buttons; /* Number of buttons */ unsigned int buttons; /* Number of buttons */
unsigned int flags; unsigned int flags;
#define FSPDRV_FLAG_EN_OPC (0x001) /* enable on-pad clicking */ #define FSPDRV_FLAG_EN_OPC (0x001) /* enable on-pad clicking */
...@@ -78,6 +108,7 @@ struct fsp_data { ...@@ -78,6 +108,7 @@ struct fsp_data {
unsigned char last_reg; /* Last register we requested read from */ unsigned char last_reg; /* Last register we requested read from */
unsigned char last_val; unsigned char last_val;
unsigned int last_mt_fgr; /* Last seen finger(multitouch) */
}; };
#ifdef CONFIG_MOUSE_PS2_SENTELIC #ifdef CONFIG_MOUSE_PS2_SENTELIC
......
...@@ -76,6 +76,7 @@ config TABLET_USB_KBTAB ...@@ -76,6 +76,7 @@ config TABLET_USB_KBTAB
config TABLET_USB_WACOM config TABLET_USB_WACOM
tristate "Wacom Intuos/Graphire tablet support (USB)" tristate "Wacom Intuos/Graphire tablet support (USB)"
depends on USB_ARCH_HAS_HCD depends on USB_ARCH_HAS_HCD
select POWER_SUPPLY
select USB select USB
select NEW_LEDS select NEW_LEDS
select LEDS_CLASS select LEDS_CLASS
......
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/usb/input.h> #include <linux/usb/input.h>
#include <linux/power_supply.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
/* /*
...@@ -112,6 +113,7 @@ struct wacom { ...@@ -112,6 +113,7 @@ struct wacom {
struct urb *irq; struct urb *irq;
struct wacom_wac wacom_wac; struct wacom_wac wacom_wac;
struct mutex lock; struct mutex lock;
struct work_struct work;
bool open; bool open;
char phys[32]; char phys[32];
struct wacom_led { struct wacom_led {
...@@ -120,8 +122,15 @@ struct wacom { ...@@ -120,8 +122,15 @@ struct wacom {
u8 hlv; /* status led brightness button pressed (1..127) */ u8 hlv; /* status led brightness button pressed (1..127) */
u8 img_lum; /* OLED matrix display brightness */ u8 img_lum; /* OLED matrix display brightness */
} led; } led;
struct power_supply battery;
}; };
static inline void wacom_schedule_work(struct wacom_wac *wacom_wac)
{
struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);
schedule_work(&wacom->work);
}
extern const struct usb_device_id wacom_ids[]; extern const struct usb_device_id wacom_ids[];
void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len);
......
This diff is collapsed.
...@@ -1044,6 +1044,35 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) ...@@ -1044,6 +1044,35 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
return 0; return 0;
} }
static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
{
unsigned char *data = wacom->data;
int connected;
if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80)
return 0;
connected = data[1] & 0x01;
if (connected) {
int pid, battery;
pid = get_unaligned_be16(&data[6]);
battery = data[5] & 0x3f;
if (wacom->pid != pid) {
wacom->pid = pid;
wacom_schedule_work(wacom);
}
wacom->battery_capacity = battery;
} else if (wacom->pid != 0) {
/* disconnected while previously connected */
wacom->pid = 0;
wacom_schedule_work(wacom);
wacom->battery_capacity = 0;
}
return 0;
}
void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
{ {
bool sync; bool sync;
...@@ -1094,6 +1123,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) ...@@ -1094,6 +1123,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_bpt_irq(wacom_wac, len); sync = wacom_bpt_irq(wacom_wac, len);
break; break;
case WIRELESS:
sync = wacom_wireless_irq(wacom_wac, len);
break;
default: default:
sync = false; sync = false;
break; break;
...@@ -1155,7 +1188,7 @@ void wacom_setup_device_quirks(struct wacom_features *features) ...@@ -1155,7 +1188,7 @@ void wacom_setup_device_quirks(struct wacom_features *features)
/* these device have multiple inputs */ /* these device have multiple inputs */
if (features->type == TABLETPC || features->type == TABLETPC2FG || if (features->type == TABLETPC || features->type == TABLETPC2FG ||
features->type == BAMBOO_PT) features->type == BAMBOO_PT || features->type == WIRELESS)
features->quirks |= WACOM_QUIRK_MULTI_INPUT; features->quirks |= WACOM_QUIRK_MULTI_INPUT;
/* quirk for bamboo touch with 2 low res touches */ /* quirk for bamboo touch with 2 low res touches */
...@@ -1167,6 +1200,16 @@ void wacom_setup_device_quirks(struct wacom_features *features) ...@@ -1167,6 +1200,16 @@ void wacom_setup_device_quirks(struct wacom_features *features)
features->y_fuzz <<= 5; features->y_fuzz <<= 5;
features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
} }
if (features->type == WIRELESS) {
/* monitor never has input and pen/touch have delayed create */
features->quirks |= WACOM_QUIRK_NO_INPUT;
/* must be monitor interface if no device_type set */
if (!features->device_type)
features->quirks |= WACOM_QUIRK_MONITOR;
}
} }
static unsigned int wacom_calculate_touch_res(unsigned int logical_max, static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
...@@ -1640,6 +1683,9 @@ static const struct wacom_features wacom_features_0xEC = ...@@ -1640,6 +1683,9 @@ static const struct wacom_features wacom_features_0xEC =
static const struct wacom_features wacom_features_0x47 = static const struct wacom_features wacom_features_0x47 =
{ "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
static const struct wacom_features wacom_features_0x84 =
{ "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0,
0, WIRELESS, 0, 0 };
static const struct wacom_features wacom_features_0xD0 = static const struct wacom_features wacom_features_0xD0 =
{ "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
...@@ -1766,6 +1812,7 @@ const struct usb_device_id wacom_ids[] = { ...@@ -1766,6 +1812,7 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID,
USB_INTERFACE_SUBCLASS_BOOT, USB_INTERFACE_SUBCLASS_BOOT,
USB_INTERFACE_PROTOCOL_MOUSE) }, USB_INTERFACE_PROTOCOL_MOUSE) },
{ USB_DEVICE_WACOM(0x84) },
{ USB_DEVICE_WACOM(0xD0) }, { USB_DEVICE_WACOM(0xD0) },
{ USB_DEVICE_WACOM(0xD1) }, { USB_DEVICE_WACOM(0xD1) },
{ USB_DEVICE_WACOM(0xD2) }, { USB_DEVICE_WACOM(0xD2) },
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#define WACOM_PKGLEN_BBTOUCH 20 #define WACOM_PKGLEN_BBTOUCH 20
#define WACOM_PKGLEN_BBTOUCH3 64 #define WACOM_PKGLEN_BBTOUCH3 64
#define WACOM_PKGLEN_BBPEN 10 #define WACOM_PKGLEN_BBPEN 10
#define WACOM_PKGLEN_WIRELESS 32
/* device IDs */ /* device IDs */
#define STYLUS_DEVICE_ID 0x02 #define STYLUS_DEVICE_ID 0x02
...@@ -45,6 +46,8 @@ ...@@ -45,6 +46,8 @@
/* device quirks */ /* device quirks */
#define WACOM_QUIRK_MULTI_INPUT 0x0001 #define WACOM_QUIRK_MULTI_INPUT 0x0001
#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002 #define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002
#define WACOM_QUIRK_NO_INPUT 0x0004
#define WACOM_QUIRK_MONITOR 0x0008
enum { enum {
PENPARTNER = 0, PENPARTNER = 0,
...@@ -54,6 +57,7 @@ enum { ...@@ -54,6 +57,7 @@ enum {
PL, PL,
DTU, DTU,
BAMBOO_PT, BAMBOO_PT,
WIRELESS,
INTUOS, INTUOS,
INTUOS3S, INTUOS3S,
INTUOS3, INTUOS3,
...@@ -107,6 +111,8 @@ struct wacom_wac { ...@@ -107,6 +111,8 @@ struct wacom_wac {
struct wacom_features features; struct wacom_features features;
struct wacom_shared *shared; struct wacom_shared *shared;
struct input_dev *input; struct input_dev *input;
int pid;
int battery_capacity;
}; };
#endif #endif
...@@ -6,7 +6,7 @@ struct device; ...@@ -6,7 +6,7 @@ struct device;
struct gpio_keys_button { struct gpio_keys_button {
/* Configuration parameters */ /* Configuration parameters */
unsigned int code; /* input event code (KEY_*, SW_*) */ unsigned int code; /* input event code (KEY_*, SW_*) */
int gpio; int gpio; /* -1 if this key does not support gpio */
int active_low; int active_low;
const char *desc; const char *desc;
unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */ unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */
...@@ -14,6 +14,7 @@ struct gpio_keys_button { ...@@ -14,6 +14,7 @@ struct gpio_keys_button {
int debounce_interval; /* debounce ticks interval in msecs */ int debounce_interval; /* debounce ticks interval in msecs */
bool can_disable; bool can_disable;
int value; /* axis value for EV_ABS */ int value; /* axis value for EV_ABS */
unsigned int irq; /* Irq number in case of interrupt keys */
}; };
struct gpio_keys_platform_data { struct gpio_keys_platform_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment