linux/drivers/media/i2c/ir-kbd-i2c.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * keyboard input driver for i2c IR remote controls
 *
 * Copyright (c) 2000-2003 Gerd Knorr <[email protected]>
 * modified for PixelView (BT878P+W/FM) by
 *      Michal Kochanowicz <[email protected]>
 *      Christoph Bartelmus <[email protected]>
 * modified for KNC ONE TV Station/Anubis Typhoon TView Tuner by
 *      Ulrich Mueller <[email protected]>
 * modified for em2820 based USB TV tuners by
 *      Markus Rechberger <[email protected]>
 * modified for DViCO Fusion HDTV 5 RT GOLD by
 *      Chaogui Zhang <[email protected]>
 * modified for MSI TV@nywhere Plus by
 *      Henry Wong <[email protected]>
 *      Mark Schultz <[email protected]>
 *      Brian Rogers <[email protected]>
 * modified for AVerMedia Cardbus by
 *      Oldrich Jedlicka <[email protected]>
 * Zilog Transmitter portions/ideas were derived from GPLv2+ sources:
 *  - drivers/char/pctv_zilogir.[ch] from Hauppauge Broadway product
 *	Copyright 2011 Hauppauge Computer works
 *  - drivers/staging/media/lirc/lirc_zilog.c
 *	Copyright (c) 2000 Gerd Knorr <[email protected]>
 *	Michal Kochanowicz <[email protected]>
 *	Christoph Bartelmus <[email protected]>
 *	Ulrich Mueller <[email protected]>
 *	Stefan Jahn <[email protected]>
 *	Jerome Brock <[email protected]>
 *	Thomas Reitmayr ([email protected])
 *	Mark Weaver <[email protected]>
 *	Jarod Wilson <[email protected]>
 *	Copyright (C) 2011 Andy Walls <[email protected]>
 */

#include <linux/unaligned.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/workqueue.h>

#include <media/rc-core.h>
#include <media/i2c/ir-kbd-i2c.h>

#define FLAG_TX
#define FLAG_HDPVR

static bool enable_hdpvr;
module_param(enable_hdpvr, bool, 0644);

static int get_key_haup_common(struct IR_i2c *ir, enum rc_proto *protocol,
			       u32 *scancode, u8 *ptoggle, int size)
{}

static int get_key_haup(struct IR_i2c *ir, enum rc_proto *protocol,
			u32 *scancode, u8 *toggle)
{}

static int get_key_haup_xvr(struct IR_i2c *ir, enum rc_proto *protocol,
			    u32 *scancode, u8 *toggle)
{}

static int get_key_pixelview(struct IR_i2c *ir, enum rc_proto *protocol,
			     u32 *scancode, u8 *toggle)
{}

static int get_key_fusionhdtv(struct IR_i2c *ir, enum rc_proto *protocol,
			      u32 *scancode, u8 *toggle)
{}

static int get_key_knc1(struct IR_i2c *ir, enum rc_proto *protocol,
			u32 *scancode, u8 *toggle)
{}

static int get_key_geniatech(struct IR_i2c *ir, enum rc_proto *protocol,
			     u32 *scancode, u8 *toggle)
{}

static int get_key_avermedia_cardbus(struct IR_i2c *ir, enum rc_proto *protocol,
				     u32 *scancode, u8 *toggle)
{}

/* ----------------------------------------------------------------------- */

static int ir_key_poll(struct IR_i2c *ir)
{}

static void ir_work(struct work_struct *work)
{}

static int ir_open(struct rc_dev *dev)
{}

static void ir_close(struct rc_dev *dev)
{}

/* Zilog Transmit Interface */
#define XTAL_FREQ

#define ZILOG_SEND
#define ZILOG_UIR_END
#define ZILOG_INIT_END
#define ZILOG_LIR_END

#define ZILOG_STATUS_OK
#define ZILOG_STATUS_TX
#define ZILOG_STATUS_SET

/*
 * As you can see here, very few different lengths of pulse and space
 * can be encoded. This means that the hardware does not work well with
 * recorded IR. It's best to work with generated IR, like from ir-ctl or
 * the in-kernel encoders.
 */
struct code_block {} __packed;

static int send_data_block(struct IR_i2c *ir, int cmd,
			   struct code_block *code_block)
{}

static int zilog_init(struct IR_i2c *ir)
{}

/*
 * If the last slot for pulse is the same as the current slot for pulse,
 * then use slot no 7.
 */
static void copy_codes(u8 *dst, u8 *src, unsigned int count)
{}

/*
 * When looking for repeats, we don't care about the trailing space. This
 * is set to the shortest possible anyway.
 */
static int cmp_no_trail(u8 *a, u8 *b, unsigned int count)
{}

static int find_slot(u16 *array, unsigned int size, u16 val)
{}

static int zilog_ir_format(struct rc_dev *rcdev, unsigned int *txbuf,
			   unsigned int count, struct code_block *code_block)
{}

static int zilog_tx(struct rc_dev *rcdev, unsigned int *txbuf,
		    unsigned int count)
{}

static int zilog_tx_carrier(struct rc_dev *dev, u32 carrier)
{}

static int zilog_tx_duty_cycle(struct rc_dev *dev, u32 duty_cycle)
{}

static int ir_probe(struct i2c_client *client)
{}

static void ir_remove(struct i2c_client *client)
{}

static const struct i2c_device_id ir_kbd_id[] =;
MODULE_DEVICE_TABLE(i2c, ir_kbd_id);

static struct i2c_driver ir_kbd_driver =;

module_i2c_driver();

/* ----------------------------------------------------------------------- */

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