linux/drivers/media/rc/serial_ir.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * serial_ir.c
 *
 * serial_ir - Device driver that records pulse- and pause-lengths
 *	       (space-lengths) between DDCD event on a serial port.
 *
 * Copyright (C) 1996,97 Ralph Metzler <[email protected]>
 * Copyright (C) 1998 Trent Piepho <[email protected]>
 * Copyright (C) 1998 Ben Pfaff <[email protected]>
 * Copyright (C) 1999 Christoph Bartelmus <[email protected]>
 * Copyright (C) 2007 Andrei Tanas <[email protected]> (suspend/resume support)
 * Copyright (C) 2016 Sean Young <[email protected]> (port to rc-core)
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/serial_reg.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <media/rc-core.h>

struct serial_ir_hw {};

#define IR_HOMEBREW
#define IR_IRDEO
#define IR_IRDEO_REMOTE
#define IR_ANIMAX
#define IR_IGOR

/* module parameters */
static int type;
static int io;
static int irq;
static ulong iommap;
static int ioshift;
static bool softcarrier =;
static bool share_irq;
static int sense =;	/* -1 = auto, 0 = active high, 1 = active low */
static bool txsense;	/* 0 = active high, 1 = active low */

/* forward declarations */
static void send_pulse_irdeo(unsigned int length, ktime_t edge);
static void send_space_irdeo(void);
#ifdef CONFIG_IR_SERIAL_TRANSMITTER
static void send_pulse_homebrew(unsigned int length, ktime_t edge);
static void send_space_homebrew(void);
#endif

static struct serial_ir_hw hardware[] =;

#define RS_ISR_PASS_LIMIT

struct serial_ir {};

static struct serial_ir serial_ir;

/* fetch serial input packet (1 byte) from register offset */
static u8 sinp(int offset)
{}

/* write serial output packet (1 byte) of value to register offset */
static void soutp(int offset, u8 value)
{}

static void on(void)
{}

static void off(void)
{}

static void send_pulse_irdeo(unsigned int length, ktime_t target)
{}

static void send_space_irdeo(void)
{}

#ifdef CONFIG_IR_SERIAL_TRANSMITTER
static void send_pulse_homebrew_softcarrier(unsigned int length, ktime_t edge)
{}

static void send_pulse_homebrew(unsigned int length, ktime_t edge)
{}

static void send_space_homebrew(void)
{}
#endif

static void frbwrite(unsigned int l, bool is_pulse)
{}

static irqreturn_t serial_ir_irq_handler(int i, void *blah)
{}

static int hardware_init_port(void)
{}

static void serial_ir_timeout(struct timer_list *unused)
{}

/* Needed by serial_ir_probe() */
static int serial_ir_tx(struct rc_dev *dev, unsigned int *txbuf,
			unsigned int count);
static int serial_ir_tx_duty_cycle(struct rc_dev *dev, u32 cycle);
static int serial_ir_tx_carrier(struct rc_dev *dev, u32 carrier);
static int serial_ir_open(struct rc_dev *rcdev);
static void serial_ir_close(struct rc_dev *rcdev);

static int serial_ir_probe(struct platform_device *dev)
{}

static int serial_ir_open(struct rc_dev *rcdev)
{}

static void serial_ir_close(struct rc_dev *rcdev)
{}

static int serial_ir_tx(struct rc_dev *dev, unsigned int *txbuf,
			unsigned int count)
{}

static int serial_ir_tx_duty_cycle(struct rc_dev *dev, u32 cycle)
{}

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

static int serial_ir_suspend(struct platform_device *dev,
			     pm_message_t state)
{}

static int serial_ir_resume(struct platform_device *dev)
{}

static struct platform_driver serial_ir_driver =;

static int __init serial_ir_init(void)
{}

static void serial_ir_exit(void)
{}

static int __init serial_ir_init_module(void)
{}

static void __exit serial_ir_exit_module(void)
{}

module_init();
module_exit(serial_ir_exit_module);

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

module_param(type, int, 0444);
MODULE_PARM_DESC();

module_param_hw(io, int, ioport, 0444);
MODULE_PARM_DESC();

/* some architectures (e.g. intel xscale) have memory mapped registers */
module_param_hw(iommap, ulong, other, 0444);
MODULE_PARM_DESC();

/*
 * some architectures (e.g. intel xscale) align the 8bit serial registers
 * on 32bit word boundaries.
 * See linux-kernel/drivers/tty/serial/8250/8250.c serial_in()/out()
 */
module_param_hw(ioshift, int, other, 0444);
MODULE_PARM_DESC();

module_param_hw(irq, int, irq, 0444);
MODULE_PARM_DESC();

module_param_hw(share_irq, bool, other, 0444);
MODULE_PARM_DESC();

module_param(sense, int, 0444);
MODULE_PARM_DESC();

#ifdef CONFIG_IR_SERIAL_TRANSMITTER
module_param(txsense, bool, 0444);
MODULE_PARM_DESC();
#endif

module_param(softcarrier, bool, 0444);
MODULE_PARM_DESC();