linux/drivers/media/rc/ir-mce_kbd-decoder.c

// SPDX-License-Identifier: GPL-2.0-only
/* ir-mce_kbd-decoder.c - A decoder for the RC6-ish keyboard/mouse IR protocol
 * used by the Microsoft Remote Keyboard for Windows Media Center Edition,
 * referred to by Microsoft's Windows Media Center remote specification docs
 * as "an internal protocol called MCIR-2".
 *
 * Copyright (C) 2011 by Jarod Wilson <[email protected]>
 */
#include <linux/module.h>

#include "rc-core-priv.h"

/*
 * This decoder currently supports:
 * - MCIR-2 29-bit IR signals used for mouse movement and buttons
 * - MCIR-2 32-bit IR signals used for standard keyboard keys
 *
 * The media keys on the keyboard send RC-6 signals that are indistinguishable
 * from the keys of the same name on the stock MCE remote, and will be handled
 * by the standard RC-6 decoder, and be made available to the system via the
 * input device for the remote, rather than the keyboard/mouse one.
 */

#define MCIR2_UNIT
#define MCIR2_HEADER_NBITS
#define MCIR2_MOUSE_NBITS
#define MCIR2_KEYBOARD_NBITS
#define MCIR2_PREFIX_PULSE
#define MCIR2_PREFIX_SPACE
#define MCIR2_MAX_LEN
#define MCIR2_BIT_START
#define MCIR2_BIT_END
#define MCIR2_BIT_0
#define MCIR2_BIT_SET
#define MCIR2_MODE_MASK
#define MCIR2_KEYBOARD_HEADER
#define MCIR2_MOUSE_HEADER
#define MCIR2_MASK_KEYS_START

enum mce_kbd_mode {};

enum mce_kbd_state {};

static unsigned char kbd_keycodes[256] =;

static void mce_kbd_rx_timeout(struct timer_list *t)
{}

static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data)
{}

static void ir_mce_kbd_process_keyboard_data(struct rc_dev *dev, u32 scancode)
{}

static void ir_mce_kbd_process_mouse_data(struct rc_dev *dev, u32 scancode)
{}

/**
 * ir_mce_kbd_decode() - Decode one mce_kbd pulse or space
 * @dev:	the struct rc_dev descriptor of the device
 * @ev:		the struct ir_raw_event descriptor of the pulse/space
 *
 * This function returns -EINVAL if the pulse violates the state machine
 */
static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
{}

static int ir_mce_kbd_register(struct rc_dev *dev)
{}

static int ir_mce_kbd_unregister(struct rc_dev *dev)
{}

static const struct ir_raw_timings_manchester ir_mce_kbd_timings =;

/**
 * ir_mce_kbd_encode() - Encode a scancode as a stream of raw events
 *
 * @protocol:   protocol to encode
 * @scancode:   scancode to encode
 * @events:     array of raw ir events to write into
 * @max:        maximum size of @events
 *
 * Returns:     The number of events written.
 *              -ENOBUFS if there isn't enough space in the array to fit the
 *              encoding. In this case all @max events will have been written.
 */
static int ir_mce_kbd_encode(enum rc_proto protocol, u32 scancode,
			     struct ir_raw_event *events, unsigned int max)
{}

static struct ir_raw_handler mce_kbd_handler =;

static int __init ir_mce_kbd_decode_init(void)
{}

static void __exit ir_mce_kbd_decode_exit(void)
{}

module_init();
module_exit(ir_mce_kbd_decode_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();