Re: [PATCH 1/6] Core driver for WM97xx touchscreens

2008-02-13 Thread Mark Brown
On Tue, Feb 12, 2008 at 10:58:50PM +, Dmitry Baryshkov wrote:

 You used platform_device_register, but should be using platform_device_add,
 otherwise you get barfs with 2.6.25-rc1 (device is initialized twice). Also

Thanks for that.  I feel like I should knock up a patch to clarify the
platform API documentation here.

 as sound/driver.h got deprecated there is no point including it.

Indeed - this is bit rot due to the age of the driver.  Hopefully it
will make it into at least 2.6.26.

BTW, could you please keep at least me in the CC list when discussing
these patches?  It's easy to miss things on the lists and they're one of
the first things I stop reading when I'm busy.
-
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard fn key

2008-02-13 Thread Tobias Müller

Jiri Kosina schrieb:
Some part of the patch is already in 2.6.25-rc1 -- please see commit 
a45d82d19a6c2a717bcc33cff243199b77fa0082, which adds support for Apple 
Aluminium keyboards. So the patch would need some changes that it would 
apply on top of current tree.

It seems there is almost everything implemented except for some product ids.

Also, Tobias (added to CC) seems to be currently working on adding support 
for a subset of keyboards that this patch adds. Tobias -- it seems like 
this patch is handling a superset of what your patch does, right?

Yes

It would be great if you could put this all together into one condensated 
patch which I could merge into my tree.

I'm working on that, but I found a problem in the new 2.6.25-rc1 code.

Until 2.6.24 hidinput_apple_event which handles the apple specials was called by
hidinput_hid_event and if hidinput_apple_event changed some code, 
hidinput_hid_event
returned and didn't send any events.

In 2.6.25 hidinput_apple_event is called in hidinput_event_quirks which is called by 
hidinput_hid_event. But if hidinput_event_quirks sent events, hidinput_hid_event doesn't

know of this and send the events too! So if I press some keys on my keyboard, 
there are
2 keycodes sent.

This seems to be a greater change in 2.6.25 and I don't want to change this, 
because I think
someone made this change for some good reason.

Regards
 Tobias


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard fn key

2008-02-13 Thread Jiri Kosina
On Wed, 13 Feb 2008, Tobias Müller wrote:

 In 2.6.25 hidinput_apple_event is called in hidinput_event_quirks which 
 is called by hidinput_hid_event. But if hidinput_event_quirks sent 
 events, hidinput_hid_event doesn't know of this and send the events too! 
 So if I press some keys on my keyboard, there are 2 keycodes sent.

Hi Tobias,

yes, this is a bug, for which I already have fix in my tree -- see 
http://git.kernel.org/?p=linux/kernel/git/jikos/hid.git;a=commit;h=68a1f2cc8676f22a6fd49f344f99e326eb7f5117

This restores the previous behavior. I just haven't pushed this to Linus 
yet.

-- 
Jiri Kosina
SUSE Labs

[PATCH 5/6] Driver for WM97xx touchscreens in streaming mode on Mainstone

2008-02-13 Thread Mark Brown
Signed-off-by: Liam Girdwood [EMAIL PROTECTED]
Signed-off-by: Graeme Gregory [EMAIL PROTECTED]
Signed-off-by: Mike Arthur [EMAIL PROTECTED]
Signed-off-by: Mark Brown [EMAIL PROTECTED]
Cc: Dmitry Baryshkov [EMAIL PROTECTED]
Cc: Stanley Cai [EMAIL PROTECTED]
Cc: Rodolfo Giometti [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Cc: Marc Kleine-Budde [EMAIL PROTECTED]
Cc: Pete MacKay [EMAIL PROTECTED]
Cc: Ian Molton [EMAIL PROTECTED]
Cc: Vince Sanders [EMAIL PROTECTED]
Cc: Andrew Zabolotny [EMAIL PROTECTED]
---
 drivers/input/touchscreen/mainstone-wm97xx.c |  298 ++
 1 files changed, 298 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/mainstone-wm97xx.c

diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c 
b/drivers/input/touchscreen/mainstone-wm97xx.c
new file mode 100644
index 000..8e1c35d
--- /dev/null
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -0,0 +1,298 @@
+/*
+ * mainstone-wm97xx.c  --  Mainstone Continuous Touch screen driver for
+ * Wolfson WM97xx AC97 Codecs.
+ *
+ * Copyright 2004, 2007 Wolfson Microelectronics PLC.
+ * Author: Liam Girdwood
+ * [EMAIL PROTECTED] or [EMAIL PROTECTED]
+ * Parts Copyright : Ian Molton [EMAIL PROTECTED]
+ *   Andrew Zabolotny [EMAIL PROTECTED]
+ *
+ *  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 (at your
+ *  option) any later version.
+ *
+ * Notes:
+ * This is a wm97xx extended touch driver to capture touch
+ * data in a continuous manner on the Intel XScale archictecture
+ *
+ *  Features:
+ *   - codecs supported:- WM9705, WM9712, WM9713
+ *   - processors supported:- Intel XScale PXA25x, PXA26x, PXA27x
+ *
+ */
+
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/version.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/delay.h
+#include linux/irq.h
+#include linux/interrupt.h
+#include linux/wm97xx.h
+#include linux/io.h
+#include asm/arch/pxa-regs.h
+
+#define VERSION0.13
+
+struct continuous {
+   u16 id;/* codec id */
+   u8 code;   /* continuous code */
+   u8 reads;  /* number of coord reads per read cycle */
+   u32 speed; /* number of coords per second */
+};
+
+#define WM_READS(sp) ((sp / HZ) + 1)
+
+static const struct continuous cinfo[] = {
+   {WM9705_ID2, 0, WM_READS(94), 94},
+   {WM9705_ID2, 1, WM_READS(188), 188},
+   {WM9705_ID2, 2, WM_READS(375), 375},
+   {WM9705_ID2, 3, WM_READS(750), 750},
+   {WM9712_ID2, 0, WM_READS(94), 94},
+   {WM9712_ID2, 1, WM_READS(188), 188},
+   {WM9712_ID2, 2, WM_READS(375), 375},
+   {WM9712_ID2, 3, WM_READS(750), 750},
+   {WM9713_ID2, 0, WM_READS(94), 94},
+   {WM9713_ID2, 1, WM_READS(120), 120},
+   {WM9713_ID2, 2, WM_READS(154), 154},
+   {WM9713_ID2, 3, WM_READS(188), 188},
+};
+
+/* continuous speed index */
+static int sp_idx;
+static u16 last, tries;
+
+/*
+ * Pen sampling frequency (Hz) in continuous mode.
+ */
+static int cont_rate = 200;
+module_param(cont_rate, int, 0);
+MODULE_PARM_DESC(cont_rate, Sampling rate in continuous mode (Hz));
+
+/*
+ * Pen down detection.
+ *
+ * This driver can either poll or use an interrupt to indicate a pen down
+ * event. If the irq request fails then it will fall back to polling mode.
+ */
+static int pen_int;
+module_param(pen_int, int, 0);
+MODULE_PARM_DESC(pen_int, Pen down detection (1 = interrupt, 0 = polling));
+
+/*
+ * Pressure readback.
+ *
+ * Set to 1 to read back pen down pressure
+ */
+static int pressure;
+module_param(pressure, int, 0);
+MODULE_PARM_DESC(pressure, Pressure readback (1 = pressure, 0 = no 
pressure));
+
+/*
+ * AC97 touch data slot.
+ *
+ * Touch screen readback data ac97 slot
+ */
+static int ac97_touch_slot = 5;
+module_param(ac97_touch_slot, int, 0);
+MODULE_PARM_DESC(ac97_touch_slot, Touch screen data slot AC97 number);
+
+
+/* flush AC97 slot 5 FIFO on pxa machines */
+#ifdef CONFIG_PXA27x
+static void wm97xx_acc_pen_up(struct wm97xx *wm)
+{
+   set_current_state(TASK_INTERRUPTIBLE);
+   schedule_timeout(1);
+
+   while (MISR  (1  2))
+   MODR;
+}
+#else
+static void wm97xx_acc_pen_up(struct wm97xx *wm)
+{
+   int count = 16;
+   set_current_state(TASK_INTERRUPTIBLE);
+   schedule_timeout(1);
+
+   while (count  16) {
+   MODR;
+   count--;
+   }
+}
+#endif
+
+static int wm97xx_acc_pen_down(struct wm97xx *wm)
+{
+   u16 x, y, p = 0x100 | WM97XX_ADCSEL_PRES;
+   int reads = 0;
+
+   /* data is never immediately available after pen down irq */
+   set_current_state(TASK_INTERRUPTIBLE);
+   schedule_timeout(1);
+
+   if (tries  5) {
+   tries = 0;
+   return RC_PENUP;
+   }
+
+   x = 

[PATCH 1/6] Core driver for WM97xx touchscreens

2008-02-13 Thread Mark Brown
This patch series adds support for the touchscreen controllers provided
by Wolfson Microelectronics WM97xx series chips in both polled and
streaming modes.

These drivers have been maintained out of tree since 2003.  During that
time the driver the primary maintainer was Liam Girdwood and a number of
people have made contributions including Dmitry Baryshkov, Stanley Cai,
Rodolfo Giometti, Russell King, Marc Kleine-Budde, Ian Molton, Vincent
Sanders, Andrew Zabolotny, Graeme Gregory, Mike Arthur and myself.
Apologies to anyone I have omitted.

Signed-off-by: Liam Girdwood [EMAIL PROTECTED]
Signed-off-by: Graeme Gregory [EMAIL PROTECTED]
Signed-off-by: Mike Arthur [EMAIL PROTECTED]
Signed-off-by: Mark Brown [EMAIL PROTECTED]
Cc: Dmitry Baryshkov [EMAIL PROTECTED]
Cc: Stanley Cai [EMAIL PROTECTED]
Cc: Rodolfo Giometti [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Cc: Pete MacKay [EMAIL PROTECTED]
Cc: Marc Kleine-Budde [EMAIL PROTECTED]
Cc: Ian Molton [EMAIL PROTECTED]
Cc: Vincent Sanders [EMAIL PROTECTED]
Cc: Andrew Zabolotny [EMAIL PROTECTED]
---
 drivers/input/touchscreen/wm97xx-core.c |  731 +++
 include/linux/wm97xx.h  |  308 +
 2 files changed, 1039 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/wm97xx-core.c
 create mode 100644 include/linux/wm97xx.h

diff --git a/drivers/input/touchscreen/wm97xx-core.c 
b/drivers/input/touchscreen/wm97xx-core.c
new file mode 100644
index 000..84d9dc5
--- /dev/null
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -0,0 +1,731 @@
+/*
+ * wm97xx-core.c  --  Touch screen driver core for Wolfson WM9705, WM9712
+ *and WM9713 AC97 Codecs.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2007, 2008 Wolfson Microelectronics PLC.
+ * Author: Liam Girdwood
+ * [EMAIL PROTECTED] or [EMAIL PROTECTED]
+ * Parts Copyright : Ian Molton [EMAIL PROTECTED]
+ *   Andrew Zabolotny [EMAIL PROTECTED]
+ *   Russell King [EMAIL PROTECTED]
+ *
+ *  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 (at your
+ *  option) any later version.
+ *
+ * Notes:
+ *
+ *  Features:
+ *   - supports WM9705, WM9712, WM9713
+ *   - polling mode
+ *   - continuous mode (arch-dependent)
+ *   - adjustable rpu/dpp settings
+ *   - adjustable pressure current
+ *   - adjustable sample settle delay
+ *   - 4 and 5 wire touchscreens (5 wire is WM9712 only)
+ *   - pen down detection
+ *   - battery monitor
+ *   - sample AUX adcs
+ *   - power management
+ *   - codec GPIO
+ *   - codec event notification
+ * Todo
+ *   - Support for async sampling control for noisy LCDs.
+ *
+ */
+
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/version.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/delay.h
+#include linux/string.h
+#include linux/proc_fs.h
+#include linux/pm.h
+#include linux/interrupt.h
+#include linux/bitops.h
+#include linux/workqueue.h
+#include linux/wm97xx.h
+#include linux/uaccess.h
+#include linux/io.h
+
+#define TS_NAMEwm97xx
+#define WM_CORE_VERSION1.00
+#define DEFAULT_PRESSURE   0xb0c0
+
+
+/*
+ * Touchscreen absolute values
+ *
+ * These parameters are used to help the input layer discard out of
+ * range readings and reduce jitter etc.
+ *
+ *   o min, max:- indicate the min and max values your touch screen returns
+ *   o fuzz:- use a higher number to reduce jitter
+ *
+ * The default values correspond to Mainstone II in QVGA mode
+ *
+ * Please read
+ * Documentation/input/input-programming.txt for more details.
+ */
+
+static int abs_x[3] = {350, 3900, 5};
+module_param_array(abs_x, int, NULL, 0);
+MODULE_PARM_DESC(abs_x, Touchscreen absolute X min, max, fuzz);
+
+static int abs_y[3] = {320, 3750, 40};
+module_param_array(abs_y, int, NULL, 0);
+MODULE_PARM_DESC(abs_y, Touchscreen absolute Y min, max, fuzz);
+
+static int abs_p[3] = {0, 150, 4};
+module_param_array(abs_p, int, NULL, 0);
+MODULE_PARM_DESC(abs_p, Touchscreen absolute Pressure min, max, fuzz);
+
+/*
+ * wm97xx IO access, all IO locking done by AC97 layer
+ */
+int wm97xx_reg_read(struct wm97xx *wm, u16 reg)
+{
+   if (wm-ac97)
+   return wm-ac97-bus-ops-read(wm-ac97, reg);
+   else
+   return -1;
+}
+EXPORT_SYMBOL_GPL(wm97xx_reg_read);
+
+void wm97xx_reg_write(struct wm97xx *wm, u16 reg, u16 val)
+{
+   /* cache digitiser registers */
+   if (reg = AC97_WM9713_DIG1  reg = AC97_WM9713_DIG3)
+   wm-dig[(reg - AC97_WM9713_DIG1)  1] = val;
+
+   /* cache gpio regs */
+   if (reg = AC97_GPIO_CFG  reg = AC97_MISC_AFE)
+   wm-gpio[(reg - AC97_GPIO_CFG)  1] = val;
+
+   /* wm9713 irq reg */
+   if (reg == 

[PATCH 1/2] driver for Zhen Hua PCM-4CH RC transmitter v2

2008-02-13 Thread Kmarty
(again, now as attachments)

Hi,
this is a driver for Zhen Hua PCM-4CH RC transmitter (commonly used in
cheap Ready To Fly RC helicopters) which using Zhen Hua 5-byte
protocol for using them as a four axis joystick via serial port.

Transmitter connected to serial port (19200 8N1) sending periodically
5 bytes where first byte is for synchronization and next four bytes
are values of axis.


linux-2.6.24-zhenhua.diffstat
Description: Binary data
Signed-off-by: Martin Kebert [EMAIL PROTECTED]

diff -uprN -X linux-2.6.24-vanilla/Documentation/dontdiff linux-2.6.24-vanilla/drivers/input/joystick/Kconfig linux-2.6.24-zhenhua/drivers/input/joystick/Kconfig
--- linux-2.6.24-vanilla/drivers/input/joystick/Kconfig	2008-01-24 23:58:37.0 +0100
+++ linux-2.6.24-zhenhua/drivers/input/joystick/Kconfig	2008-02-08 22:48:34.0 +0100
@@ -193,6 +193,18 @@ config JOYSTICK_TWIDJOY
 	  To compile this driver as a module, choose M here: the
 	  module will be called twidjoy.
 
+config JOYSTICK_ZHENHUA
+	tristate 5-byte Zhenhua RC transmitter
+	select SERIO
+	help
+	  Say Y here if you have a Zhen Hua PCM-4CH transmitter which is
+	  supplied with a ready to fly micro electric indoor helicopters
+	  such as EasyCopter, Lama, MiniCopter, DragonFly or Jabo and want
+	  to use it via serial cable as a joystick.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called zhenhua.
+
 config JOYSTICK_DB9
 	tristate Multisystem, Sega Genesis, Saturn joysticks and gamepads
 	depends on PARPORT
diff -uprN -X linux-2.6.24-vanilla/Documentation/dontdiff linux-2.6.24-vanilla/drivers/input/joystick/Makefile linux-2.6.24-zhenhua/drivers/input/joystick/Makefile
--- linux-2.6.24-vanilla/drivers/input/joystick/Makefile	2008-01-24 23:58:37.0 +0100
+++ linux-2.6.24-zhenhua/drivers/input/joystick/Makefile	2008-02-08 19:45:36.0 +0100
@@ -27,5 +27,6 @@ obj-$(CONFIG_JOYSTICK_TURBOGRAFX)	+= tur
 obj-$(CONFIG_JOYSTICK_TWIDJOY)		+= twidjoy.o
 obj-$(CONFIG_JOYSTICK_WARRIOR)		+= warrior.o
 obj-$(CONFIG_JOYSTICK_XPAD)		+= xpad.o
+obj-$(CONFIG_JOYSTICK_ZHENHUA)		+= zhenhua.o
 
 obj-$(CONFIG_JOYSTICK_IFORCE)		+= iforce/
diff -uprN -X linux-2.6.24-vanilla/Documentation/dontdiff linux-2.6.24-vanilla/drivers/input/joystick/zhenhua.c linux-2.6.24-zhenhua/drivers/input/joystick/zhenhua.c
--- linux-2.6.24-vanilla/drivers/input/joystick/zhenhua.c	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.24-zhenhua/drivers/input/joystick/zhenhua.c	2008-02-08 19:27:40.0 +0100
@@ -0,0 +1,243 @@
+/*
+ *  derived from twidjoy.c
+ *
+ *  Copyright (c) 2008 Martin Kebert
+ *  Copyright (c) 2001 Arndt Schoenewald
+ *  Copyright (c) 2000-2001 Vojtech Pavlik
+ *  Copyright (c) 2000 Mark Fletcher
+ *
+ */
+
+/*
+ * Driver to use 4CH RC transmitter using Zhen Hua 5-byte protocol (Walkera Lama,
+ * EasyCopter etc.) as a joystick under Linux.
+ *
+ * RC transmitters using Zhen Hua 5-byte protocol are cheap four channels
+ * transmitters for control a RC planes or RC helicopters with possibility to
+ * connect on a serial port.
+ * Data coming from transmitter is in this order:
+ * 1. byte = synchronisation byte
+ * 2. byte = X axis
+ * 3. byte = Y axis
+ * 4. byte = RZ axis
+ * 5. byte = Z axis
+ * (and this is repeated)
+ *
+ * For questions or feedback regarding this driver module please contact:
+ * Martin Kebert [EMAIL PROTECTED] - but I am not a C-programmer nor kernel
+ * coder :-(
+ */
+
+/*
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/slab.h
+#include linux/input.h
+#include linux/serio.h
+#include linux/init.h
+
+#define DRIVER_DESC	RC transmitter with 5-byte Zhen Hua protocol joystick driver
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE(GPL);
+
+/*
+ * Constants.
+ */
+
+#define ZHENHUA_MAX_LENGTH 5
+
+/*
+ * Zhen Hua data.
+ */
+
+struct zhenhua {
+	struct input_dev *dev;
+	int idx;
+	unsigned char data[ZHENHUA_MAX_LENGTH];
+	char phys[32];
+};
+
+
+/* bits in all incoming bytes needs to be reversed */
+static int zhenhua_bitreverse(int x)
+{
+	x = ((x  0xaa)  1) | ((x  0x55)  1);
+	x = ((x  0xcc)  2) | ((x  0x33)  2);
+	x = ((x  0xf0)  4) | ((x  0x0f)  4);
+	return x;
+}
+
+/*
+ * zhenhua_process_packet() decodes packets the driver receives from the
+ * RC transmitter. 

Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard fn key

2008-02-13 Thread Tobias Müller

Jiri Kosina schrieb:
 On Tue, 12 Fe
 It would be great if you could put this all together into one
 condensated patch which I could merge into my tree.

So, this is the updated version. It only adds some product-ids and
some keyboards mappings.

Regards
  Tobias
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 5325d98..6a100e2 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -97,10 +97,11 @@ struct hidinput_key_translation {
 #define APPLE_FLAG_FKEY 0x01

 static struct hidinput_key_translation apple_fn_keys[] = {
+   { KEY_BACKSPACE, KEY_DELETE },  /* 
Needed for MacBook keyboards without delete */
{ KEY_F1,   KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
{ KEY_F2,   KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
-   { KEY_F3,   KEY_CYCLEWINDOWS,   APPLE_FLAG_FKEY }, /* Exposé */
-   { KEY_F4,   KEY_FN_F4,  APPLE_FLAG_FKEY }, /* Dashboard 
*/
+   { KEY_F3,   KEY_CYCLEWINDOWS,   APPLE_FLAG_FKEY },  /* 
Exposé */
+   { KEY_F4,   KEY_FN_F4,  APPLE_FLAG_FKEY },  /* 
Dashboard */
{ KEY_F5,   KEY_FN_F5 },
{ KEY_F6,   KEY_FN_F6 },
{ KEY_F7,   KEY_BACK,   APPLE_FLAG_FKEY },
@@ -109,6 +110,10 @@ static struct hidinput_key_translation apple_fn_keys[] = {
{ KEY_F10,  KEY_MUTE,   APPLE_FLAG_FKEY },
{ KEY_F11,  KEY_VOLUMEDOWN, APPLE_FLAG_FKEY },
{ KEY_F12,  KEY_VOLUMEUP,   APPLE_FLAG_FKEY },
+   { KEY_UP,   KEY_PAGEUP },   /* 
Needed for MacBook keyboards without page-up */
+   { KEY_DOWN, KEY_PAGEDOWN }, /* 
Needed for MacBook keyboards without page-down */
+   { KEY_LEFT, KEY_HOME }, /* 
Needed for MacBook keyboards without home */
+   { KEY_RIGHT,KEY_END },  /* 
Needed for MacBook keyboards without end */
{ }
 };

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index b77b61e..73a5aca 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -66,6 +66,12 @@
 #define USB_DEVICE_ID_APPLE_ALU_ANSI   0x0220
 #define USB_DEVICE_ID_APPLE_ALU_ISO0x0221
 #define USB_DEVICE_ID_APPLE_ALU_JIS0x0222
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI0x0229
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO 0x022a
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS 0x022b
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI  0x022c
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO   0x022d
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS   0x022e
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY   0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY0x030b
 #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
@@ -593,6 +599,12 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, 
HID_QUIRK_APPLE_HAS_FN },
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, 
HID_QUIRK_APPLE_HAS_FN },
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, 
HID_QUIRK_APPLE_HAS_FN},
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD},
+   { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, 
HID_QUIRK_APPLE_HAS_FN},
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, 
HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },


smime.p7s
Description: S/MIME Cryptographic Signature


[PATCH 2/2] driver for Zhen Hua PCM-4CH RC transmitter v2

2008-02-13 Thread Kmarty
(again, now as attachments)

Patch for inputattach from joystick-utils.


inputattach.c.diffstat
Description: Binary data
--- inputattach.c.orig	2008-02-06 10:35:22.0 +0100
+++ inputattach.c	2008-02-13 15:49:48.0 +0100
@@ -1,5 +1,4 @@
 /*
- * $Id: inputattach.c 2352 2006-02-08 12:19:31Z vojtech $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
@@ -315,6 +314,42 @@
 	return 0;
 }
 
+int zhenhua_init(int fd, long *id, long *extra)
+{
+	/* Zhen Hua 5 byte protokol: prvni (synchronizacni) byte obsahuje vzdy 0xF7,
+	 * nasledujici ctyri pak jednotlive osy ovladace v intervalu 50-200.
+	 * Pozor, nacitana data (jednotlive bajty) jsou bitove prevracene (nejnizsi
+	 * bit je nejvyssim bitem) - neco jako little-endian na bitove urovni.
+	 * Synchronizacni byte ma tedy bez prevraceni hodnotu 0xEF
+	 *
+	 * Inicializace je temer shodna s twiddlerem */
+
+	unsigned char c[10];
+	int count;
+
+	for (count=0 ; count  5 ; count++) {
+		if(readchar(fd, c+0, 500)) return -1;
+		if(c[0] == 0xef) break;
+	}
+
+	if (count == 5) {
+		/* Could not find header byte in data stream */
+		return -1;
+	}
+
+	/* Read remaining 4 bytes plus the full next data packet */
+	for (count = 1; count  10; count++) {
+		if (readchar(fd, c+count, 500)) return -1;
+	}
+
+	/* check if next sync byte exists */
+	if (c[5] != 0xef)
+		return -1;
+
+	return 0;
+		
+}
+
 int dump_init(int fd, long *id, long *extra)
 {
 	unsigned char c, o = 0;
@@ -376,6 +411,7 @@
 { --elo4002,		-elo6b,	B9600, CS8 | CRTSCTS,		SERIO_ELO,	1,	0,	0,	NULL },
 { --elo271-140,	-elo4b,	B9600, CS8 | CRTSCTS,		SERIO_ELO,	2,	0,	0,	NULL },
 { --elo261-280,	-elo3b,	B9600, CS8 | CRTSCTS,		SERIO_ELO,	3,	0,	0,	NULL },
+{ --zhen-hua,		-zhen,	B19200, CS8, 			SERIO_ZHENHUA,	0,	0,	0,	zhenhua_init },
 { --dump,		-dump,	B2400, CS8, 			0,		0,	0,	0,	dump_init },
 { , , 0, 0 }
 
@@ -416,6 +452,7 @@
 		puts(  --ps2serkbd -ps2ser PS/2 via serial keyboard);
 		puts(  --twiddler  -twid   Handykey Twiddler chording keyboard);
 		puts(  --twiddler-joy  -twidjoy  Handykey Twiddler used as a joystick);
+		puts(  --zhen-hua  -zhen  Zhen Hua 5-byte protocol);
 		puts();
 return 1;
 }