linux/drivers/media/rc/ir_toy.c

// SPDX-License-Identifier: GPL-2.0-or-later

/*
 * Infrared Toy and IR Droid RC core driver
 *
 * Copyright (C) 2020 Sean Young <[email protected]>
 *
 * http://dangerousprototypes.com/docs/USB_IR_Toy:_Sampling_mode
 *
 * This driver is based on the lirc driver which can be found here:
 * https://sourceforge.net/p/lirc/git/ci/master/tree/plugins/irtoy.c
 * Copyright (C) 2011 Peter Kooiman <[email protected]>
 */

#include <linux/unaligned.h>
#include <linux/completion.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/usb/input.h>

#include <media/rc-core.h>

static const u8 COMMAND_VERSION[] =;
// End transmit and repeat reset command so we exit sump mode
static const u8 COMMAND_RESET[] =;
static const u8 COMMAND_SMODE_ENTER[] =;
static const u8 COMMAND_SMODE_EXIT[] =;
static const u8 COMMAND_TXSTART[] =;

#define REPLY_XMITCOUNT
#define REPLY_XMITSUCCESS
#define REPLY_VERSION
#define REPLY_SAMPLEMODEPROTO

#define TIMEOUT

#define LEN_XMITRES
#define LEN_VERSION
#define LEN_SAMPLEMODEPROTO

#define MIN_FW_VERSION
#define UNIT_US
#define MAX_TIMEOUT_US

#define MAX_PACKET

enum state {};

struct irtoy {};

static void irtoy_response(struct irtoy *irtoy, u32 len)
{}

static void irtoy_out_callback(struct urb *urb)
{}

static void irtoy_in_callback(struct urb *urb)
{}

static int irtoy_command(struct irtoy *irtoy, const u8 *cmd, int cmd_len,
			 enum state state)
{}

static int irtoy_setup(struct irtoy *irtoy)
{}

/*
 * When sending IR, it is imperative that we send the IR data as quickly
 * as possible to the device, so it does not run out of IR data and
 * introduce gaps. Allocate the buffer here, and then feed the data from
 * the urb callback handler.
 */
static int irtoy_tx(struct rc_dev *rc, uint *txbuf, uint count)
{}

static int irtoy_tx_carrier(struct rc_dev *rc, uint32_t carrier)
{}

static int irtoy_probe(struct usb_interface *intf,
		       const struct usb_device_id *id)
{}

static void irtoy_disconnect(struct usb_interface *intf)
{}

static const struct usb_device_id irtoy_table[] =;

static struct usb_driver irtoy_driver =;

module_usb_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(usb, irtoy_table);