linux/drivers/media/rc/ene_ir.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * driver for ENE KB3926 B/C/D/E/F CIR (pnp id: ENE0XXX)
 *
 * Copyright (C) 2010 Maxim Levitsky <[email protected]>
 *
 * Special thanks to:
 *   Sami R. <[email protected]> for lot of help in debugging and therefore
 *    bringing to life support for transmission & learning mode.
 *
 *   Charlie Andrews <[email protected]> for lots of help in
 *   bringing up the support of new firmware buffer that is popular
 *   on latest notebooks
 *
 *   ENE for partial device documentation
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pnp.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <media/rc-core.h>
#include "ene_ir.h"

static int sample_period;
static bool learning_mode_force;
static int debug;
static bool txsim;

static void ene_set_reg_addr(struct ene_device *dev, u16 reg)
{}

/* read a hardware register */
static u8 ene_read_reg(struct ene_device *dev, u16 reg)
{}

/* write a hardware register */
static void ene_write_reg(struct ene_device *dev, u16 reg, u8 value)
{}

/* Set bits in hardware register */
static void ene_set_reg_mask(struct ene_device *dev, u16 reg, u8 mask)
{}

/* Clear bits in hardware register */
static void ene_clear_reg_mask(struct ene_device *dev, u16 reg, u8 mask)
{}

/* A helper to set/clear a bit in register according to boolean variable */
static void ene_set_clear_reg_mask(struct ene_device *dev, u16 reg, u8 mask,
								bool set)
{}

/* detect hardware features */
static int ene_hw_detect(struct ene_device *dev)
{}

/* Read properties of hw sample buffer */
static void ene_rx_setup_hw_buffer(struct ene_device *dev)
{}


/* Restore the pointers to extra buffers - to make module reload work*/
static void ene_rx_restore_hw_buffer(struct ene_device *dev)
{}

/* Read hardware write pointer */
static void ene_rx_read_hw_pointer(struct ene_device *dev)
{}

/* Gets address of next sample from HW ring buffer */
static int ene_rx_get_sample_reg(struct ene_device *dev)
{}

/* Sense current received carrier */
static void ene_rx_sense_carrier(struct ene_device *dev)
{}

/* this enables/disables the CIR RX engine */
static void ene_rx_enable_cir_engine(struct ene_device *dev, bool enable)
{}

/* this selects input for CIR engine. Ether GPIO 0A or GPIO40*/
static void ene_rx_select_input(struct ene_device *dev, bool gpio_0a)
{}

/*
 * this enables alternative input via fan tachometer sensor and bypasses
 * the hw CIR engine
 */
static void ene_rx_enable_fan_input(struct ene_device *dev, bool enable)
{}

/* setup the receiver for RX*/
static void ene_rx_setup(struct ene_device *dev)
{}

/* Enable the device for receive */
static void ene_rx_enable_hw(struct ene_device *dev)
{}

/* Enable the device for receive - wrapper to track the state*/
static void ene_rx_enable(struct ene_device *dev)
{}

/* Disable the device receiver */
static void ene_rx_disable_hw(struct ene_device *dev)
{}

/* Disable the device receiver - wrapper to track the state */
static void ene_rx_disable(struct ene_device *dev)
{}

/* This resets the receiver. Useful to stop stream of spaces at end of
 * transmission
 */
static void ene_rx_reset(struct ene_device *dev)
{}

/* Set up the TX carrier frequency and duty cycle */
static void ene_tx_set_carrier(struct ene_device *dev)
{}

/* Enable/disable transmitters */
static void ene_tx_set_transmitters(struct ene_device *dev)
{}

/* prepare transmission */
static void ene_tx_enable(struct ene_device *dev)
{}

/* end transmission */
static void ene_tx_disable(struct ene_device *dev)
{}


/* TX one sample - must be called with dev->hw_lock*/
static void ene_tx_sample(struct ene_device *dev)
{}

/* timer to simulate tx done interrupt */
static void ene_tx_irqsim(struct timer_list *t)
{}


/* read irq status and ack it */
static int ene_irq_status(struct ene_device *dev)
{}

/* interrupt handler */
static irqreturn_t ene_isr(int irq, void *data)
{}

/* Initialize default settings */
static void ene_setup_default_settings(struct ene_device *dev)
{}

/* Upload all hardware settings at once. Used at load and resume time */
static void ene_setup_hw_settings(struct ene_device *dev)
{}

/* outside interface: called on first open*/
static int ene_open(struct rc_dev *rdev)
{}

/* outside interface: called on device close*/
static void ene_close(struct rc_dev *rdev)
{}

/* outside interface: set transmitter mask */
static int ene_set_tx_mask(struct rc_dev *rdev, u32 tx_mask)
{}

/* outside interface : set tx carrier */
static int ene_set_tx_carrier(struct rc_dev *rdev, u32 carrier)
{}

/*outside interface : set tx duty cycle */
static int ene_set_tx_duty_cycle(struct rc_dev *rdev, u32 duty_cycle)
{}

/* outside interface: enable learning mode */
static int ene_set_learning_mode(struct rc_dev *rdev, int enable)
{}

static int ene_set_carrier_report(struct rc_dev *rdev, int enable)
{}

/* outside interface: enable or disable idle mode */
static void ene_set_idle(struct rc_dev *rdev, bool idle)
{}

/* outside interface: transmit */
static int ene_transmit(struct rc_dev *rdev, unsigned *buf, unsigned n)
{}

/* probe entry */
static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
{}

/* main unload function */
static void ene_remove(struct pnp_dev *pnp_dev)
{}

/* enable wake on IR (wakes on specific button on original remote) */
static void ene_enable_wake(struct ene_device *dev, bool enable)
{}

#ifdef CONFIG_PM
static int ene_suspend(struct pnp_dev *pnp_dev, pm_message_t state)
{}

static int ene_resume(struct pnp_dev *pnp_dev)
{}
#endif

static void ene_shutdown(struct pnp_dev *pnp_dev)
{}

static const struct pnp_device_id ene_ids[] =;

static struct pnp_driver ene_driver =;

module_param(sample_period, int, S_IRUGO);
MODULE_PARM_DESC();

module_param(learning_mode_force, bool, S_IRUGO);
MODULE_PARM_DESC();

module_param(debug, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC();

module_param(txsim, bool, S_IRUGO);
MODULE_PARM_DESC();

MODULE_DEVICE_TABLE(pnp, ene_ids);
MODULE_DESCRIPTION();

MODULE_AUTHOR();
MODULE_LICENSE();

module_pnp_driver();