Skip to contentSkip to conversation

Input: add appleir USB driver

PATCH In review Bastien Nocera 3 participants 18 messages Apr 16, 2010 – Sep 3, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: add appleir USB driver

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +
 drivers/input/misc/Kconfig      |   13 +
 drivers/input/misc/Makefile     |    1 +
 drivers/input/misc/appleir.c    |  477 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 540 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/input/appleir.txt
 create mode 100644 drivers/input/misc/appleir.c
Documentation/input/appleir.txt new file +45 -0
new file mode 100644
index 0000000..0267a4b
@@ -0,0 +1,45 @@
+Apple IR receiver Driver (appleir)
+----------------------------------
+	Copyright (C) 2009 Bastien Nocera <[email protected]>
+
+The appleir driver is a kernel input driver to handle Apple's IR
+receivers (and associated remotes) in the kernel.
+
+The driver is an input driver which only handles "official" remotes
+as built and sold by Apple.
+
+Authors
+-------
+
+James McKenzie (original driver)
+Alex Karpenko (05ac:8242 support)
+Greg Kroah-Hartman (cleanups and original submission)
+Bastien Nocera (further cleanups and suspend support)
+
+Supported hardware
+------------------
+
+- All Apple laptops and desktops from 2005 onwards, except:
+  - the unibody Macbook (2009)
+  - Mac Pro (all versions)
+- Apple TV (all revisions)
+
+The remote will only support the 6 buttons of the original remotes
+as sold by Apple. See the next section if you want to use other remotes
+or want to use lirc with the device instead of the kernel driver.
+
+Using lirc (native) instead of the kernel driver
+------------------------------------------------
+
+First, you will need to disable the kernel driver for the receiver.
+
+This can be achieved by passing quirks to the usbhid driver.
+The quirk line would be:
+usbhid.quirks=0x05ac:0x8242:0x40000010
+
+With 0x05ac being the vendor ID (Apple, you shouldn't need to change this)
+With 0x8242 being the product ID (check the output of lsusb for your hardware)
+And 0x10 being "HID_QUIRK_HIDDEV_FORCE" and 0x40000000 being "HID_QUIRK_NO_IGNORE"
+
+This should force the creation of a hiddev device for the receiver, and
+make it usable under lirc.
drivers/hid/hid-apple.c +0 -4
index 78286b1..5f2a731 100644
@@ -360,10 +360,6 @@ static void apple_remove(struct hid_device *hdev)
 }
 
 static const struct hid_device_id apple_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL),
-		.driver_data = APPLE_HIDDEV | APPLE_IGNORE_HIDINPUT },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4),
-		.driver_data = APPLE_HIDDEV | APPLE_IGNORE_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE),
 		.driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL },
 
drivers/hid/hid-core.c +3 -2
index 368fbb0..b57e5f7 100644
@@ -1253,8 +1253,6 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M1968) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) },
@@ -1553,6 +1551,9 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT)},
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)},
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)},
drivers/hid/hid-ids.h +1 -0
index 72c05f9..66a2ca8 100644
@@ -97,6 +97,7 @@
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS   0x023b
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY	0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY	0x030b
+#define USB_DEVICE_ID_APPLE_IRCONTROL	0x8240
 #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL	0x8241
 #define USB_DEVICE_ID_APPLE_IRCONTROL4	0x8242
 
drivers/input/misc/Kconfig +13 -0
index 23140a3..46614b2 100644
@@ -159,6 +159,19 @@ config INPUT_KEYSPAN_REMOTE
 	  To compile this driver as a module, choose M here: the module will
 	  be called keyspan_remote.
 
+config INPUT_APPLEIR
+	tristate "Apple infrared receiver (built in)"
+	depends on USB_ARCH_HAS_HCD
+	select USB
+	help
+	  Say Y here if you want to use a Apple infrared remote control. All
+	  the Apple computers from 2005 onwards include such a port, except
+	  the unibody Macbook (2009), and Mac Pros. This receiver is also
+	  used in the Apple TV set-top box.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called appleir.
+
 config INPUT_POWERMATE
 	tristate "Griffin PowerMate and Contour Jog support"
 	depends on USB_ARCH_HAS_HCD
drivers/input/misc/Makefile +1 -0
index 7e95a5d..3fa4404 100644
@@ -6,6 +6,7 @@
 
 obj-$(CONFIG_INPUT_88PM860X_ONKEY)	+= 88pm860x_onkey.o
 obj-$(CONFIG_INPUT_APANEL)		+= apanel.o
+obj-$(CONFIG_INPUT_APPLEIR)		+= appleir.o
 obj-$(CONFIG_INPUT_ATI_REMOTE)		+= ati_remote.o
 obj-$(CONFIG_INPUT_ATI_REMOTE2)		+= ati_remote2.o
 obj-$(CONFIG_INPUT_ATLAS_BTNS)		+= atlas_btns.o
drivers/input/misc/appleir.c new file +477 -0

477 lines not on this page · raw message

Signature · 1 line
1.6.6.1
maintainer
#1 lore raw

HI Bastien,

Quoted 9 lines · Bastien Nocera

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Quoted 276 lines
 drivers/input/misc/Kconfig      |   13 +
 drivers/input/misc/Makefile     |    1 +
 drivers/input/misc/appleir.c    |  477 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 540 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/input/appleir.txt
 create mode 100644 drivers/input/misc/appleir.c
Documentation/input/appleir.txt new file +45 -0
new file mode 100644
index 0000000..0267a4b
@@ -0,0 +1,45 @@
+Apple IR receiver Driver (appleir)
+----------------------------------
+	Copyright (C) 2009 Bastien Nocera <[email protected]>
+
+The appleir driver is a kernel input driver to handle Apple's IR
+receivers (and associated remotes) in the kernel.
+
+The driver is an input driver which only handles "official" remotes
+as built and sold by Apple.
+
+Authors
+-------
+
+James McKenzie (original driver)
+Alex Karpenko (05ac:8242 support)
+Greg Kroah-Hartman (cleanups and original submission)
+Bastien Nocera (further cleanups and suspend support)
+
+Supported hardware
+------------------
+
+- All Apple laptops and desktops from 2005 onwards, except:
+  - the unibody Macbook (2009)
+  - Mac Pro (all versions)
+- Apple TV (all revisions)
+
+The remote will only support the 6 buttons of the original remotes
+as sold by Apple. See the next section if you want to use other remotes
+or want to use lirc with the device instead of the kernel driver.
+
+Using lirc (native) instead of the kernel driver
+------------------------------------------------
+
+First, you will need to disable the kernel driver for the receiver.
+
+This can be achieved by passing quirks to the usbhid driver.
+The quirk line would be:
+usbhid.quirks=0x05ac:0x8242:0x40000010
+
+With 0x05ac being the vendor ID (Apple, you shouldn't need to change this)
+With 0x8242 being the product ID (check the output of lsusb for your hardware)
+And 0x10 being "HID_QUIRK_HIDDEV_FORCE" and 0x40000000 being "HID_QUIRK_NO_IGNORE"
+
+This should force the creation of a hiddev device for the receiver, and
+make it usable under lirc.
drivers/hid/hid-apple.c +0 -4
index 78286b1..5f2a731 100644
@@ -360,10 +360,6 @@ static void apple_remove(struct hid_device *hdev)
 }
 
 static const struct hid_device_id apple_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL),
-		.driver_data = APPLE_HIDDEV | APPLE_IGNORE_HIDINPUT },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4),
-		.driver_data = APPLE_HIDDEV | APPLE_IGNORE_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE),
 		.driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL },
 
drivers/hid/hid-core.c +3 -2
index 368fbb0..b57e5f7 100644
@@ -1253,8 +1253,6 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M1968) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) },
@@ -1553,6 +1551,9 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT)},
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)},
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)},
drivers/hid/hid-ids.h +1 -0
index 72c05f9..66a2ca8 100644
@@ -97,6 +97,7 @@
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS   0x023b
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY	0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY	0x030b
+#define USB_DEVICE_ID_APPLE_IRCONTROL	0x8240
 #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL	0x8241
 #define USB_DEVICE_ID_APPLE_IRCONTROL4	0x8242
 
drivers/input/misc/Kconfig +13 -0
index 23140a3..46614b2 100644
@@ -159,6 +159,19 @@ config INPUT_KEYSPAN_REMOTE
 	  To compile this driver as a module, choose M here: the module will
 	  be called keyspan_remote.
 
+config INPUT_APPLEIR
+	tristate "Apple infrared receiver (built in)"
+	depends on USB_ARCH_HAS_HCD
+	select USB
+	help
+	  Say Y here if you want to use a Apple infrared remote control. All
+	  the Apple computers from 2005 onwards include such a port, except
+	  the unibody Macbook (2009), and Mac Pros. This receiver is also
+	  used in the Apple TV set-top box.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called appleir.
+
 config INPUT_POWERMATE
 	tristate "Griffin PowerMate and Contour Jog support"
 	depends on USB_ARCH_HAS_HCD
drivers/input/misc/Makefile +1 -0
index 7e95a5d..3fa4404 100644
@@ -6,6 +6,7 @@
 
 obj-$(CONFIG_INPUT_88PM860X_ONKEY)	+= 88pm860x_onkey.o
 obj-$(CONFIG_INPUT_APANEL)		+= apanel.o
+obj-$(CONFIG_INPUT_APPLEIR)		+= appleir.o
 obj-$(CONFIG_INPUT_ATI_REMOTE)		+= ati_remote.o
 obj-$(CONFIG_INPUT_ATI_REMOTE2)		+= ati_remote2.o
 obj-$(CONFIG_INPUT_ATLAS_BTNS)		+= atlas_btns.o
drivers/input/misc/appleir.c new file +126 -0
new file mode 100644
index 0000000..138f4c8
@@ -0,0 +1,477 @@
+/*
+ * appleir: USB driver for the apple ir device
+ *
+ * Original driver written by James McKenzie
+ * Ported to recent 2.6 kernel versions by Greg Kroah-Hartman <[email protected]>
+ *
+ * Copyright (C) 2006 James McKenzie
+ * Copyright (C) 2008 Greg Kroah-Hartman <[email protected]>
+ * Copyright (C) 2008 Novell Inc.
+ *
+ * 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, version 2.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/input.h>
+#include <linux/usb/input.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/usb.h>
+#include <linux/usb/input.h>
+#include <asm/unaligned.h>
+#include <asm/byteorder.h>
+
+#define DRIVER_VERSION "v1.2"
+#define DRIVER_AUTHOR "James McKenzie"
+#define DRIVER_DESC "Apple infrared receiver driver"
+#define DRIVER_LICENSE "GPL"
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE(DRIVER_LICENSE);
+
+#define USB_VENDOR_ID_APPLE			0x05ac
+#define USB_DEVICE_ID_APPLE_IRCONTROL		0x8240
+#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL	0x8241
+#define USB_DEVICE_ID_APPLE_IRCONTROL4		0x8242
+
+#define URB_SIZE	32
+
+#define MAX_KEYS	8
+#define MAX_KEYS_MASK	(MAX_KEYS - 1)
+
+#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)
+
+static int debug;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
+
+struct appleir {
+	struct input_dev *input_dev;
+	u8 *data;
+	dma_addr_t dma_buf;
+	struct usb_device *usbdev;
+	unsigned int flags;
+	struct urb *urb;
+	int timer_initted;
+	struct timer_list key_up_timer;
+	int current_key;
+	char phys[32];
+};
+
+static DEFINE_MUTEX(appleir_mutex);
+
+enum {
+	APPLEIR_OPENED = 0x1,
+	APPLEIR_SUSPENDED = 0x2,
+};
+
+static struct usb_device_id appleir_ids[] = {
+	{ USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
+	{ USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
+	{ USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
+	{}
+};
+MODULE_DEVICE_TABLE(usb, appleir_ids);
+
+/* I have two devices both of which report the following */
+/* 25 87 ee 83 0a  	+  */
+/* 25 87 ee 83 0c  	-  */
+/* 25 87 ee 83 09	<< */
+/* 25 87 ee 83 06	>> */
+/* 25 87 ee 83 05	>" */
+/* 25 87 ee 83 03	menu */
+/* 26 00 00 00 00	for key repeat*/
+
+/* Thomas Glanzmann reports the following responses */
+/* 25 87 ee ca 0b	+  */
+/* 25 87 ee ca 0d	-  */
+/* 25 87 ee ca 08	<< */
+/* 25 87 ee ca 07	>> */
+/* 25 87 ee ca 04	>" */
+/* 25 87 ee ca 02 	menu */
+/* 26 00 00 00 00       for key repeat*/
+/* He also observes the following event sometimes */
+/* sent after a key is release, which I interpret */
+/* as a flat battery message */
+/* 25 87 e0 ca 06	flat battery */
+
+/* Alexandre Karpenko reports the following responses for Device ID 0x8242 */
+/* 25 87 ee 47 0b	+  */
+/* 25 87 ee 47 0d	-  */
+/* 25 87 ee 47 08	<< */
+/* 25 87 ee 47 07	>> */
+/* 25 87 ee 47 04	>" */
+/* 25 87 ee 47 02 	menu */
+/* 26 87 ee 47 ** 	for key repeat (** is the code of the key being held) */
+
+static int keymap[MAX_KEYS] = {
+	KEY_RESERVED,
+	KEY_MENU,
+	KEY_PLAYPAUSE,
+	KEY_FORWARD,
+	KEY_BACK,
+	KEY_VOLUMEUP,
+	KEY_VOLUMEDOWN,
+	KEY_RESERVED,
+};
+
+static void dump_packet(struct appleir *appleir, char *msg, u8 *data, int len)
+{
+	int i;
+

drivers/input/misc/appleir.c line 136

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+	printk(KERN_ERR "appleir: %s (%d bytes)", msg, len);
+
+	for (i = 0; i < len; ++i)
+		printk(" %02x", data[i]);
+	printk("\n");
+}
+
+static void key_up(struct appleir *appleir, int key)
+{
+	dbginfo (&appleir->input_dev->dev, "key %d up\n", key);

No space between function and opening parenthesis.

Quoted 171 lines
drivers/input/misc/appleir.c new file +171 -0
+	input_report_key(appleir->input_dev, key, 0);
+	input_sync(appleir->input_dev);
+}
+
+static void key_down(struct appleir *appleir, int key)
+{
+	dbginfo (&appleir->input_dev->dev, "key %d down\n", key);
+	input_report_key(appleir->input_dev, key, 1);
+	input_sync(appleir->input_dev);
+}
+
+static void battery_flat(struct appleir *appleir)
+{
+	dev_err(&appleir->input_dev->dev, "possible flat battery?\n");
+}
+
+static void key_up_tick(unsigned long data)
+{
+	struct appleir *appleir = (struct appleir *)data;
+
+	if (appleir->current_key) {
+		key_up(appleir, appleir->current_key);
+		appleir->current_key = 0;
+	}
+}
+
+static void new_data(struct appleir *appleir, u8 *data, int len)
+{
+	static const u8 keydown[] = { 0x25, 0x87, 0xee };
+	static const u8 keyrepeat[] = { 0x26, };
+	static const u8 flatbattery[] = { 0x25, 0x87, 0xe0 };
+
+	if (debug)
+		dump_packet(appleir, "received", data, len);
+
+	if (len != 5)
+		return;
+
+	if (!memcmp(data, keydown, sizeof(keydown))) {
+		/* If we already have a key down, take it up before marking
+		   this one down */
+		if (appleir->current_key)
+			key_up(appleir, appleir->current_key);
+		appleir->current_key = keymap[(data[4] >> 1) & MAX_KEYS_MASK];
+
+		key_down(appleir, appleir->current_key);
+		/* Remote doesn't do key up, either pull them up, in the test
+		   above, or here set a timer which pulls them up after 1/8 s */
+		mod_timer(&appleir->key_up_timer, jiffies + HZ / 8);
+
+		return;
+	}
+
+	if (!memcmp(data, keyrepeat, sizeof(keyrepeat))) {
+		key_down(appleir, appleir->current_key);
+		/* Remote doesn't do key up, either pull them up, in the test
+		   above, or here set a timer which pulls them up after 1/8 s */
+		mod_timer(&appleir->key_up_timer, jiffies + HZ / 8);
+		return;
+	}
+
+	if (!memcmp(data, flatbattery, sizeof(flatbattery))) {
+		battery_flat(appleir);
+		/* Fall through */
+	}
+
+	dump_packet(appleir, "unknown packet", data, len);
+}
+
+static void appleir_urb(struct urb *urb)
+{
+	struct appleir *appleir = urb->context;
+	int status = urb->status;
+	int retval;
+
+	switch (status) {
+	case 0:
+		new_data(appleir, urb->transfer_buffer, urb->actual_length);
+		break;
+	case -ECONNRESET:
+	case -ENOENT:
+	case -ESHUTDOWN:
+		/* This urb is terminated, clean up */
+		dbginfo(&appleir->input_dev->dev, "%s - urb shutting down with status: %d", __func__,
+			urb->status);
+		return;
+	default:
+		dbginfo(&appleir->input_dev->dev, "%s - nonzero urb status received: %d", __func__,
+			urb->status);
+	}
+
+	retval = usb_submit_urb(urb, GFP_ATOMIC);
+	if (retval)
+		err("%s - usb_submit_urb failed with result %d", __func__,
+		    retval);
+}
+
+static int appleir_open(struct input_dev *dev)
+{
+	struct appleir *appleir = input_get_drvdata(dev);
+	struct usb_interface *intf = usb_ifnum_to_if(appleir->usbdev, 0);
+	int r;
+
+	r = usb_autopm_get_interface(intf);
+	if (r) {
+		dev_err(&intf->dev,
+			"%s(): usb_autopm_get_interface() = %d\n", __func__, r);
+		return r;
+	}
+
+	mutex_lock(&appleir_mutex);
+
+	if (usb_submit_urb(appleir->urb, GFP_KERNEL)) {
+		r = -EIO;
+		goto fail;
+	}
+
+	appleir->flags |= APPLEIR_OPENED;
+
+	mutex_unlock(&appleir_mutex);
+
+	usb_autopm_put_interface(intf);
+
+	return 0;
+fail:
+	mutex_unlock(&appleir_mutex);
+	usb_autopm_put_interface(intf);
+	return r;
+}
+
+static void appleir_close(struct input_dev *dev)
+{
+	struct appleir *appleir = input_get_drvdata(dev);
+
+	mutex_lock(&appleir_mutex);
+
+	if (!(appleir->flags & APPLEIR_SUSPENDED)) {
+		usb_kill_urb(appleir->urb);
+		del_timer_sync(&appleir->key_up_timer);
+	}
+
+	appleir->flags &= ~APPLEIR_OPENED;
+
+	mutex_unlock(&appleir_mutex);
+}
+
+static int appleir_probe(struct usb_interface *intf,
+			 const struct usb_device_id *id)
+{
+	struct usb_device *dev = interface_to_usbdev(intf);
+	struct usb_endpoint_descriptor *endpoint;
+	struct appleir *appleir = NULL;
+	struct input_dev *input_dev;
+	int retval = -ENOMEM;
+	int i;
+
+	appleir = kzalloc(sizeof(struct appleir), GFP_KERNEL);
+	if (!appleir)
+		goto fail;
+
+	appleir->data = usb_buffer_alloc(dev, URB_SIZE, GFP_KERNEL,
+					 &appleir->dma_buf);
+	if (!appleir->data)
+		goto fail;
+
+	appleir->urb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!appleir->urb)
+		goto fail;
+
+	appleir->usbdev = dev;
+

drivers/input/misc/appleir.c line 317

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+	input_dev = input_allocate_device();
+	if (!input_dev)
+		goto fail;
+
+	appleir->input_dev = input_dev;
+
+	usb_make_path(dev, appleir->phys, sizeof(appleir->phys));
+	strlcpy(appleir->phys, "/input0", sizeof(appleir->phys));
+
+	input_dev->name = "Apple infrared remote control driver";

Device is not driver. So it should probably read:

"Apple Infrared Remote Controller"

drivers/input/misc/appleir.c line 324

Quoted 7 lines
drivers/input/misc/appleir.c new file +7 -0
+	input_dev->phys = appleir->phys;
+	usb_to_input_id(dev, &input_dev->id);
+	input_dev->dev.parent = &intf->dev;
+	input_set_drvdata(input_dev, appleir);
+
+	input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+	input_dev->ledbit[0] = 0;

Input device is zeroed out by input_allocate_device().

drivers/input/misc/appleir.c line 327

Quoted 3 lines
drivers/input/misc/appleir.c new file +3 -0
+
+	for (i = 0; i < MAX_KEYS; i++)
+		set_bit(keymap[i], input_dev->keybit);

Keymap should be part of appleir structure; also set up input_dev->keycode, keycodemax and keycodesize so that keymap can be adjusted from userspace on per-device basis.

drivers/input/misc/appleir.c line 329

Quoted 2 lines
drivers/input/misc/appleir.c new file +2 -0
+
+	clear_bit(0, input_dev->keybit);

Not needed anymore.

Quoted 5 lines
drivers/input/misc/appleir.c new file +5 -0
+
+	input_dev->open = appleir_open;
+	input_dev->close = appleir_close;
+
+	endpoint = &intf->cur_altsetting->endpoint[0].desc;

drivers/input/misc/appleir.c line 344

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+
+	usb_fill_int_urb(appleir->urb, dev,
+			 usb_rcvintpipe(dev, endpoint->bEndpointAddress),
+			 appleir->data, 8,
+			 appleir_urb, appleir, endpoint->bInterval);
+
+	appleir->urb->transfer_dma = appleir->dma_buf;
+	appleir->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+	usb_set_intfdata(intf, appleir);

Should go directly in front of "return 0;".

drivers/input/misc/appleir.c line 349

Quoted 5 lines
drivers/input/misc/appleir.c new file +5 -0
+
+	init_timer(&appleir->key_up_timer);
+
+	appleir->key_up_timer.function = key_up_tick;
+	appleir->key_up_timer.data = (unsigned long)appleir;

setup_timer()?

drivers/input/misc/appleir.c line 351

Quoted 2 lines
drivers/input/misc/appleir.c new file +2 -0
+
+	appleir->timer_initted++;

Pointless, really.

drivers/input/misc/appleir.c line 359

Quoted 8 lines
drivers/input/misc/appleir.c new file +8 -0
+
+	retval = input_register_device(appleir->input_dev);
+	if (retval)
+		goto fail;
+
+	return 0;
+
+fail:

Generally I prefer having multiple fail points instead of teting conditions in fail path.

drivers/input/misc/appleir.c line 360

Quoted 1 line
drivers/input/misc/appleir.c new file +1 -0
+	printk(KERN_WARNING "Failed to load appleir\n");

Not load but bind. And driver core will let us know already.

drivers/input/misc/appleir.c line 368

Quoted 8 lines
drivers/input/misc/appleir.c new file +8 -0
+	if (appleir) {
+		if (appleir->data)
+			usb_buffer_free(dev, URB_SIZE, appleir->data,
+					appleir->dma_buf);
+
+		if (appleir->timer_initted)
+			del_timer_sync(&appleir->key_up_timer);
+

No need (see comments in appleir_remove).

Quoted 5 lines
drivers/input/misc/appleir.c new file +5 -0
+		if (appleir->input_dev)
+			input_free_device(appleir->input_dev);
+
+		kfree(appleir);
+	}

drivers/input/misc/appleir.c line 383

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+
+	return retval;
+}
+
+static void appleir_disconnect(struct usb_interface *intf)
+{
+	struct appleir *appleir = usb_get_intfdata(intf);
+
+	usb_set_intfdata(intf, NULL);
+	if (appleir) {

Is it possible for appleir to be NULL at this point?

drivers/input/misc/appleir.c line 385

Quoted 2 lines
drivers/input/misc/appleir.c new file +2 -0
+		input_unregister_device(appleir->input_dev);
+		if (appleir->timer_initted)

How can this be possible?

drivers/input/misc/appleir.c line 386

Quoted 1 line
drivers/input/misc/appleir.c new file +1 -0
+			del_timer_sync(&appleir->key_up_timer);

If this is needed then you are doing it too late (input deviceis already gone). However this should not be needed since appleir_close is guaranteed to be called if you opened the device and it will cancel the timer for you.

drivers/input/misc/appleir.c line 387

Quoted 1 line
drivers/input/misc/appleir.c new file +1 -0
+		usb_kill_urb(appleir->urb);

NOt needed here either.

Quoted 23 lines
drivers/input/misc/appleir.c new file +23 -0
+		usb_free_urb(appleir->urb);
+		usb_buffer_free(interface_to_usbdev(intf), URB_SIZE,
+				appleir->data, appleir->dma_buf);
+		kfree(appleir);
+	}
+}
+
+static int appleir_suspend(struct usb_interface *interface,
+			   pm_message_t message)
+{
+	struct appleir *appleir;
+
+	appleir = usb_get_intfdata(interface);
+
+	mutex_lock(&appleir_mutex);
+
+	if (appleir->flags & APPLEIR_OPENED) {
+		usb_kill_urb(appleir->urb);
+		del_timer_sync(&appleir->key_up_timer);
+	}
+
+	appleir->flags |= APPLEIR_SUSPENDED;
+

drivers/input/misc/appleir.c line 420

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+	mutex_unlock(&appleir_mutex);
+
+	return 0;
+}
+
+static int appleir_resume(struct usb_interface *interface)
+{
+	struct appleir *appleir;
+
+	appleir = usb_get_intfdata(interface);

Combine definition with initialization?

Quoted 8 lines
drivers/input/misc/appleir.c new file +8 -0
+
+	mutex_lock(&appleir_mutex);
+
+	if (appleir->flags & APPLEIR_OPENED) {
+		struct usb_endpoint_descriptor *endpoint;
+
+		endpoint = &interface->cur_altsetting->endpoint[0].desc;
+		usb_fill_int_urb(appleir->urb, appleir->usbdev,

drivers/input/misc/appleir.c line 438

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+				 usb_rcvintpipe(appleir->usbdev, endpoint->bEndpointAddress),
+				 appleir->data, 8,
+				 appleir_urb, appleir, endpoint->bInterval);
+		appleir->urb->transfer_dma = appleir->dma_buf;
+		appleir->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+		init_timer(&appleir->key_up_timer);
+
+		appleir->key_up_timer.function = key_up_tick;
+		appleir->key_up_timer.data = (unsigned long)appleir;

Why do you need to re-initialize the timer?

Quoted 20 lines
drivers/input/misc/appleir.c new file +20 -0
+	}
+
+	appleir->flags &= ~APPLEIR_SUSPENDED;
+
+	mutex_unlock(&appleir_mutex);
+
+	return 0;
+}
+
+static struct usb_driver appleir_driver = {
+	.name                 = "appleir",
+	.probe                = appleir_probe,
+	.disconnect           = appleir_disconnect,
+	.suspend              = appleir_suspend,
+	.resume               = appleir_resume,
+	.reset_resume         = NULL,
+	.id_table             = appleir_ids,
+	.supports_autosuspend = 1,
+};
+

drivers/input/misc/appleir.c line 468

Quoted 10 lines
drivers/input/misc/appleir.c new file +10 -0
+static int __init appleir_init(void)
+{
+	int retval;
+
+	retval = usb_register(&appleir_driver);
+	if (retval)
+		goto out;
+	printk(KERN_INFO DRIVER_VERSION ":" DRIVER_DESC);
+out:
+	return retval;

How about

	return usb_register(&appleir_driver);

?

Boot is noisy enough.

drivers/input/misc/appleir.c line 477

Quoted 9 lines
drivers/input/misc/appleir.c new file +9 -0
+}
+
+static void __exit appleir_exit(void)
+{
+	usb_deregister(&appleir_driver);
+}
+
+module_init(appleir_init);
+module_exit(appleir_exit);

Thanks.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 7 lines · Dmitry Torokhov

HI Bastien,

Quoted 4 lines · Bastien Nocera

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

Quoted 7 lines
Quoted 5 lines

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

All fixed. I removed the suspend/resume code as it worked fine without it (I was working of an old patch).

Sent the new patch separately.

Quoted 9 lines
Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

The HID pieces are necessary to get the "lirc" part of the documentation working (in appleir.txt). The driver is fine without it, but it won't work with lirc until the HID patch is in.

Cheers

maintainer
#3 lore raw
Quoted 14 lines · Bastien Nocera
Quoted 13 lines · Dmitry Torokhov

HI Bastien,

Quoted 9 lines · Bastien Nocera

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

Quoted 6 lines
Quoted 1 line

A few comments...

All fixed. I removed the suspend/resume code as it worked fine without it (I was working of an old patch).

Sent the new patch separately.

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

But if suspend and resume are really not needed then you need to complete cleanup and get rid of APPLIEIR_OPENED and APPLEIR_SUSPENDED and their handling in applieir_open() and appleir_close().

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +
Quoted 7 lines
Quoted 2 lines

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

The HID pieces are necessary to get the "lirc" part of the documentation working (in appleir.txt). The driver is fine without it, but it won't work with lirc until the HID patch is in.

Right. I was just saying that Jiri needs to either take HID parts through his tree or give OK for me to take through mine.

Signature · 1 line
Dmitry
#4 lore raw
Quoted 17 lines · Dmitry Torokhov
Quoted 16 lines · Bastien Nocera
Quoted 14 lines · Dmitry Torokhov

HI Bastien,

Quoted 9 lines · Bastien Nocera

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

Quoted 8 lines
Quoted 4 lines

All fixed. I removed the suspend/resume code as it worked fine without it (I was working of an old patch).

Sent the new patch separately.

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Quoted 3 lines

But if suspend and resume are really not needed then you need to complete cleanup and get rid of APPLIEIR_OPENED and APPLEIR_SUSPENDED and their handling in applieir_open() and appleir_close().

My mistake. I'll clean that up now.

Quoted 2 lines

Right. I was just saying that Jiri needs to either take HID parts through his tree or give OK for me to take through mine.

OK.

maintainer
#5 lore raw
Quoted 20 lines · Bastien Nocera
Quoted 19 lines · Dmitry Torokhov
Quoted 18 lines · Bastien Nocera
Quoted 7 lines · Dmitry Torokhov

HI Bastien,

Quoted 4 lines · Bastien Nocera

This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by myself, with suspend support added.

Quoted 6 lines
Quoted 4 lines

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

All fixed. I removed the suspend/resume code as it worked fine without it (I was working of an old patch).

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Sent the new patch separately.

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Change the keymap (with keyfuzz or something similar), suspend. resume and see if the mapping persisted.

Quoted 11 lines
Quoted 4 lines

But if suspend and resume are really not needed then you need to complete cleanup and get rid of APPLIEIR_OPENED and APPLEIR_SUSPENDED and their handling in applieir_open() and appleir_close().

My mistake. I'll clean that up now.

Quoted 2 lines

Right. I was just saying that Jiri needs to either take HID parts through his tree or give OK for me to take through mine.

OK.

Signature · 1 line
Dmitry
#6 lore raw

On Sun, 2010-04-18 at 13:19 -0700, Dmitry Torokhov wrote:
<snip>

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Change the keymap (with keyfuzz or something similar), suspend. resume and see if the mapping persisted.

Tried using udev's keymap tool on it, but the default get function doesn't give me any output.

Am I supposed to implement get/setkeycode myself for this to work, or should the default input functions work? If the latter, is there anything missing in the driver for me to call to enable that?

Trying to set a keycode says that the "EVIOCSKEYCODE" ioctl returns EINVAL.

Cheers

maintainer
#7 lore raw
Quoted 14 lines · Bastien Nocera

On Sun, 2010-04-18 at 13:19 -0700, Dmitry Torokhov wrote:
<snip>

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Change the keymap (with keyfuzz or something similar), suspend. resume and see if the mapping persisted.

Tried using udev's keymap tool on it, but the default get function doesn't give me any output.

Quoted 7 lines

Am I supposed to implement get/setkeycode myself for this to work, or should the default input functions work? If the latter, is there anything missing in the driver for me to call to enable that?

Trying to set a keycode says that the "EVIOCSKEYCODE" ioctl returns EINVAL.

As I said in an earlier e-mail:

Quoted 2 lines

... also set up input_dev->keycode, keycodemax and keycodesize so that keymap can be adjusted from userspace on per-device basis.

Thanks.

Signature · 1 line
Dmitry
#8 lore raw
Quoted 19 lines · Dmitry Torokhov
Quoted 18 lines · Bastien Nocera

On Sun, 2010-04-18 at 13:19 -0700, Dmitry Torokhov wrote:
<snip>

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Change the keymap (with keyfuzz or something similar), suspend. resume and see if the mapping persisted.

Tried using udev's keymap tool on it, but the default get function doesn't give me any output.

Am I supposed to implement get/setkeycode myself for this to work, or should the default input functions work? If the latter, is there anything missing in the driver for me to call to enable that?

Quoted 8 lines
Quoted 3 lines

Trying to set a keycode says that the "EVIOCSKEYCODE" ioctl returns EINVAL.

As I said in an earlier e-mail:

Quoted 2 lines

... also set up input_dev->keycode, keycodemax and keycodesize so that keymap can be adjusted from userspace on per-device basis.

I missed that bit, sorry.

I tested udev's keymap, and the keymap isn't being saved across suspend/resume cycles. I re-added the _suspend() and _resume() calls (and their definitions in the usb_driver struct), but the keymap still disappears.

Is there anything else I would need to do in this case to keep the device (and its keymap) around during suspend?

I'm guessing that this problem wouldn't matter too much because udev would re-apply any keymaps it had for the device when it reappears, and in the lirc case, the keymap is in user-space.

Cheers

maintainer
#9 lore raw
Quoted 29 lines · Bastien Nocera
Quoted 19 lines · Dmitry Torokhov
Quoted 18 lines · Bastien Nocera

On Sun, 2010-04-18 at 13:19 -0700, Dmitry Torokhov wrote:
<snip>

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hmm, I am curious why suspend and resume is not necessary for this device... Are you relying on the USB core to tear down and re-create the device? Then you may lose user-applied settings (like changed keymap).

How could I test that?

Change the keymap (with keyfuzz or something similar), suspend. resume and see if the mapping persisted.

Tried using udev's keymap tool on it, but the default get function doesn't give me any output.

Am I supposed to implement get/setkeycode myself for this to work, or should the default input functions work? If the latter, is there anything missing in the driver for me to call to enable that?

Quoted 8 lines
Quoted 3 lines

Trying to set a keycode says that the "EVIOCSKEYCODE" ioctl returns EINVAL.

As I said in an earlier e-mail:

Quoted 2 lines

... also set up input_dev->keycode, keycodemax and keycodesize so that keymap can be adjusted from userspace on per-device basis.

Quoted 6 lines

I missed that bit, sorry.

I tested udev's keymap, and the keymap isn't being saved across suspend/resume cycles. I re-added the _suspend() and _resume() calls (and their definitions in the usb_driver struct), but the keymap still disappears.

Do you see another instance of the device appearing in dmesg?

Quoted 7 lines

Is there anything else I would need to do in this case to keep the device (and its keymap) around during suspend?

I'm guessing that this problem wouldn't matter too much because udev would re-apply any keymaps it had for the device when it reappears, and in the lirc case, the keymap is in user-space.

That assumes that user does use udev. Extremely likely, but still not certain.

Signature · 1 line
Dmitry
#10 lore raw

On Tue, 2010-04-20 at 23:31 -0700, Dmitry Torokhov wrote:
<snip>

Quoted 6 lines
Quoted 4 lines

I tested udev's keymap, and the keymap isn't being saved across suspend/resume cycles. I re-added the _suspend() and _resume() calls (and their definitions in the usb_driver struct), but the keymap still disappears.

Do you see another instance of the device appearing in dmesg?

The device was disappearing when a reset_resume wasn't present. I now use resume for both reset_resume and resume, and force a URB on resume, which should fix some cases of the device being dead on resume.

That also fixes the keymap disappearing on suspend.

Updated patch is now on the list

Cheers

#11 lore raw
In reply to Dmitry Torokhov
Quoted 15 lines · Dmitry Torokhov
Quoted 5 lines

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +
Quoted 2 lines

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#12 lore raw
Quoted 20 lines · Jiri Kosina
Quoted 15 lines · Dmitry Torokhov
Quoted 5 lines

More recent versions of the IR receiver are also supported through a patch by Alex Karpenko.

Tested on a MacbookAir1,1

A few comments...

Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +
Quoted 2 lines

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Quoted 6 lines

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Any comments on the additional quirks necessary to get lirc working?

#13 lore raw
Quoted 12 lines · Bastien Nocera
Quoted 12 lines
Quoted 11 lines

A few comments...

Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Quoted 8 lines
Quoted 6 lines

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Any comments on the additional quirks necessary to get lirc working?

Ouch, I thought that we have discussed previously that I am basically fine with adding those two quirks, but I haven't seen any patch doing that since then ... ?

So I'd suggest you either remove that part from the appleir documentation until this is implemented, or send me a patch adding those two flags.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#14 lore raw
Quoted 21 lines · Jiri Kosina
Quoted 19 lines · Bastien Nocera
Quoted 18 lines
Quoted 11 lines

A few comments...

Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Quoted 8 lines
Quoted 1 line

Any comments on the additional quirks necessary to get lirc working?

Ouch, I thought that we have discussed previously that I am basically fine with adding those two quirks, but I haven't seen any patch doing that since then ... ?

So I'd suggest you either remove that part from the appleir documentation until this is implemented, or send me a patch adding those two flags.

I sent it Friday with the subject:
[PATCH] Add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

The patch was also sent to the input list:
http://thread.gmane.org/gmane.linux.kernel.input/12176

Cheers

#15 lore raw
Quoted 23 lines · Bastien Nocera
Quoted 23 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Quoted 8 lines
Quoted 6 lines

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Any comments on the additional quirks necessary to get lirc working?

Ouch, I thought that we have discussed previously that I am basically fine with adding those two quirks, but I haven't seen any patch doing that since then ... ?

Quoted 8 lines
Quoted 2 lines

So I'd suggest you either remove that part from the appleir documentation until this is implemented, or send me a patch adding those two flags.

I sent it Friday with the subject:
[PATCH] Add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

The patch was also sent to the input list:
http://thread.gmane.org/gmane.linux.kernel.input/12176

Ah, now I see it. It somehow didn't reach my inbox, though your other mails do, odd.

Thanks, I will take it through my tree and queue it for next merge window (if Dmitry is not going to push the driver even for current -rcs ... ?).

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
maintainer
#16 lore raw
Quoted 31 lines · Jiri Kosina
Quoted 29 lines · Bastien Nocera
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 9 lines
Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Quoted 8 lines
Quoted 1 line

Any comments on the additional quirks necessary to get lirc working?

Ouch, I thought that we have discussed previously that I am basically fine with adding those two quirks, but I haven't seen any patch doing that since then ... ?

So I'd suggest you either remove that part from the appleir documentation until this is implemented, or send me a patch adding those two flags.

I sent it Friday with the subject:
[PATCH] Add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

Quoted 9 lines
Quoted 2 lines

The patch was also sent to the input list:
http://thread.gmane.org/gmane.linux.kernel.input/12176

Ah, now I see it. It somehow didn't reach my inbox, though your other mails do, odd.

Thanks, I will take it through my tree and queue it for next merge window (if Dmitry is not going to push the driver even for current -rcs ... ?).

No, even though it is a new driver it is gettign kind of late. I am going to put it in my 'next' branch.

Signature · 1 line
Dmitry
#17 lore raw
Quoted 38 lines · Dmitry Torokhov
Quoted 37 lines · Jiri Kosina
Quoted 23 lines · Bastien Nocera
Quoted 23 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 6 lines
---
 Documentation/input/appleir.txt |   45 ++++
 drivers/hid/hid-apple.c         |    4 -
 drivers/hid/hid-core.c          |    5 +-
 drivers/hid/hid-ids.h           |    1 +

HID pieces need to go through Jiri or he needs to ack them to go through my tree...

Quoted 8 lines
Quoted 6 lines

Please feel free to put

on the blakclist changes in drivers/hid once you merge the standalone appleir driver from Bastien.

Any comments on the additional quirks necessary to get lirc working?

Ouch, I thought that we have discussed previously that I am basically fine with adding those two quirks, but I haven't seen any patch doing that since then ... ?

Quoted 8 lines
Quoted 2 lines

So I'd suggest you either remove that part from the appleir documentation until this is implemented, or send me a patch adding those two flags.

I sent it Friday with the subject:
[PATCH] Add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

The patch was also sent to the input list:
http://thread.gmane.org/gmane.linux.kernel.input/12176

Ah, now I see it. It somehow didn't reach my inbox, though your other mails do, odd.

Quoted 6 lines
Quoted 3 lines

Thanks, I will take it through my tree and queue it for next merge window (if Dmitry is not going to push the driver even for current -rcs ... ?).

No, even though it is a new driver it is gettign kind of late. I am going to put it in my 'next' branch.

Could I please have this patch upstream somewhere?

The blocking patch has been merged for a long while now.

Cheers