APPLE_IR(4)

NAME
apple_ir - Apple IR receiver driver

SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file:

device apple_ir

Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):

    apple_ir_load="YES"

DESCRIPTION
The apple_ir driver provides support for Apple IR receivers found in Mac computers (2006–2011 era). It supports both Apple Remote controls and generic IR remotes using the NEC infrared protocol.

The driver attaches to the USB HID interface of the receiver and delivers key events through an evdev input device at /dev/input/eventX.

The Apple Remote uses a proprietary 5-byte protocol. Button presses generate key-down reports; the hardware does not send key-up events, so the driver synthesizes them via a 125ms timer. Some buttons (Enter, Play/Pause via the middle button) use a two-packet sequence where the first packet sets a flag and the second completes the command.

Generic IR remotes using the NEC protocol are also supported. The driver validates the NEC checksum (code + ~code = 0xFF) and maps known codes to evdev key events.

  Apple Remote Keymap
Button | evdev Code
menu | KEY_MENU
play/pause | KEY_PLAYPAUSE
>> | KEY_FORWARD
<< | KEY_BACK
+ | KEY_VOLUMEUP
- | KEY_VOLUMEDOWN
center | KEY_ENTER

  Generic IR (NEC) Keymap
Code | evdev Code
0xe1 | KEY_VOLUMEUP
0xe9 | KEY_VOLUMEDOWN
0xed | KEY_CHANNELUP
0xf3 | KEY_CHANNELDOWN
0xf5 | KEY_PLAYPAUSE
0xf9 | KEY_POWER
0xfb | KEY_MUTE
0xfe | KEY_OK

A low-battery condition is reported once per attach as a kernel message.

HARDWARE
The apple_ir driver supports Apple IR receivers with USB vendor ID 0x05ac and the following product IDs:

0x8240
    Apple IR Receiver (first generation)
0x8241
    Apple IR Receiver
0x8242
    Apple IR Receiver (Mac Mini 2011, MacBook Pro 3,1)
0x8243
    Apple IR Receiver
0x1440
    Apple IR Receiver (slim)

FILES
/dev/input/eventX
    evdev input device node

SEE ALSO
apple_smc(4), usb(4), loader.conf(5), sysctl(8)

HISTORY
The apple_ir driver first appeared in DragonFly 6.5.

AUTHORS
The apple_ir driver and this manual page were written by Abdelkader Boudih <dragonflybsd@seuros.com>.

The Apple Remote protocol was reverse-engineered by James McKenzie and others.