#include "cx23885.h"
#include "cx23888-ir.h"
#include <linux/kfifo.h>
#include <linux/slab.h>
#include <media/v4l2-device.h>
#include <media/rc-core.h>
static unsigned int ir_888_debug;
module_param(ir_888_debug, int, 0644);
MODULE_PARM_DESC(…) …;
#define CX23888_IR_REG_BASE …
#define CX23888_IR_CNTRL_REG …
#define CNTRL_WIN_3_3 …
#define CNTRL_WIN_4_3 …
#define CNTRL_WIN_3_4 …
#define CNTRL_WIN_4_4 …
#define CNTRL_WIN …
#define CNTRL_EDG_NONE …
#define CNTRL_EDG_FALL …
#define CNTRL_EDG_RISE …
#define CNTRL_EDG_BOTH …
#define CNTRL_EDG …
#define CNTRL_DMD …
#define CNTRL_MOD …
#define CNTRL_RFE …
#define CNTRL_TFE …
#define CNTRL_RXE …
#define CNTRL_TXE …
#define CNTRL_RIC …
#define CNTRL_TIC …
#define CNTRL_CPL …
#define CNTRL_LBM …
#define CNTRL_R …
#define CNTRL_IVO …
#define CX23888_IR_TXCLK_REG …
#define TXCLK_TCD …
#define CX23888_IR_RXCLK_REG …
#define RXCLK_RCD …
#define CX23888_IR_CDUTY_REG …
#define CDUTY_CDC …
#define CX23888_IR_STATS_REG …
#define STATS_RTO …
#define STATS_ROR …
#define STATS_RBY …
#define STATS_TBY …
#define STATS_RSR …
#define STATS_TSR …
#define CX23888_IR_IRQEN_REG …
#define IRQEN_RTE …
#define IRQEN_ROE …
#define IRQEN_RSE …
#define IRQEN_TSE …
#define CX23888_IR_FILTR_REG …
#define FILTR_LPF …
#define CX23888_IR_FIFO_REG …
#define FIFO_RXTX …
#define FIFO_RXTX_LVL …
#define FIFO_RXTX_RTO …
#define FIFO_RX_NDV …
#define FIFO_RX_DEPTH …
#define FIFO_TX_DEPTH …
#define CX23888_IR_SEEDP_REG …
#define CX23888_IR_TIMOL_REG …
#define CX23888_IR_WAKE0_REG …
#define CX23888_IR_WAKE1_REG …
#define CX23888_IR_WAKE2_REG …
#define CX23888_IR_MASK0_REG …
#define CX23888_IR_MASK1_REG …
#define CX23888_IR_MAKS2_REG …
#define CX23888_IR_DPIPG_REG …
#define CX23888_IR_LEARN_REG …
#define CX23888_VIDCLK_FREQ …
#define CX23888_IR_REFCLK_FREQ …
cx23888_ir_fifo_rec;
#define CX23888_IR_RX_KFIFO_SIZE …
#define CX23888_IR_TX_KFIFO_SIZE …
struct cx23888_ir_state { … };
static inline struct cx23888_ir_state *to_state(struct v4l2_subdev *sd)
{ … }
static
inline int cx23888_ir_write4(struct cx23885_dev *dev, u32 addr, u32 value)
{ … }
static inline u32 cx23888_ir_read4(struct cx23885_dev *dev, u32 addr)
{ … }
static inline int cx23888_ir_and_or4(struct cx23885_dev *dev, u32 addr,
u32 and_mask, u32 or_value)
{ … }
static inline u16 count_to_clock_divider(unsigned int d)
{ … }
static inline u16 carrier_freq_to_clock_divider(unsigned int freq)
{ … }
static inline unsigned int clock_divider_to_carrier_freq(unsigned int divider)
{ … }
static inline unsigned int clock_divider_to_freq(unsigned int divider,
unsigned int rollovers)
{ … }
static inline u16 count_to_lpf_count(unsigned int d)
{ … }
static inline u16 ns_to_lpf_count(unsigned int ns)
{ … }
static inline unsigned int lpf_count_to_ns(unsigned int count)
{ … }
static inline unsigned int lpf_count_to_us(unsigned int count)
{ … }
static u32 clock_divider_to_resolution(u16 divider)
{ … }
static u64 pulse_width_count_to_ns(u16 count, u16 divider)
{ … }
static unsigned int pulse_width_count_to_us(u16 count, u16 divider)
{ … }
static u64 ns_to_pulse_clocks(u32 ns)
{ … }
static u16 pulse_clocks_to_clock_divider(u64 count)
{ … }
enum tx_fifo_watermark { … };
enum rx_fifo_watermark { … };
static inline void control_tx_irq_watermark(struct cx23885_dev *dev,
enum tx_fifo_watermark level)
{ … }
static inline void control_rx_irq_watermark(struct cx23885_dev *dev,
enum rx_fifo_watermark level)
{ … }
static inline void control_tx_enable(struct cx23885_dev *dev, bool enable)
{ … }
static inline void control_rx_enable(struct cx23885_dev *dev, bool enable)
{ … }
static inline void control_tx_modulation_enable(struct cx23885_dev *dev,
bool enable)
{ … }
static inline void control_rx_demodulation_enable(struct cx23885_dev *dev,
bool enable)
{ … }
static inline void control_rx_s_edge_detection(struct cx23885_dev *dev,
u32 edge_types)
{ … }
static void control_rx_s_carrier_window(struct cx23885_dev *dev,
unsigned int carrier,
unsigned int *carrier_range_low,
unsigned int *carrier_range_high)
{ … }
static inline void control_tx_polarity_invert(struct cx23885_dev *dev,
bool invert)
{ … }
static inline void control_tx_level_invert(struct cx23885_dev *dev,
bool invert)
{ … }
static unsigned int txclk_tx_s_carrier(struct cx23885_dev *dev,
unsigned int freq,
u16 *divider)
{ … }
static unsigned int rxclk_rx_s_carrier(struct cx23885_dev *dev,
unsigned int freq,
u16 *divider)
{ … }
static u32 txclk_tx_s_max_pulse_width(struct cx23885_dev *dev, u32 ns,
u16 *divider)
{ … }
static u32 rxclk_rx_s_max_pulse_width(struct cx23885_dev *dev, u32 ns,
u16 *divider)
{ … }
static unsigned int cduty_tx_s_duty_cycle(struct cx23885_dev *dev,
unsigned int duty_cycle)
{ … }
static u32 filter_rx_s_min_width(struct cx23885_dev *dev, u32 min_width_ns)
{ … }
static inline void irqenable_rx(struct cx23885_dev *dev, u32 mask)
{ … }
static inline void irqenable_tx(struct cx23885_dev *dev, u32 mask)
{ … }
static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status,
bool *handled)
{ … }
static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
ssize_t *num)
{ … }
static int cx23888_ir_rx_g_parameters(struct v4l2_subdev *sd,
struct v4l2_subdev_ir_parameters *p)
{ … }
static int cx23888_ir_rx_shutdown(struct v4l2_subdev *sd)
{ … }
static int cx23888_ir_rx_s_parameters(struct v4l2_subdev *sd,
struct v4l2_subdev_ir_parameters *p)
{ … }
static int cx23888_ir_tx_write(struct v4l2_subdev *sd, u8 *buf, size_t count,
ssize_t *num)
{ … }
static int cx23888_ir_tx_g_parameters(struct v4l2_subdev *sd,
struct v4l2_subdev_ir_parameters *p)
{ … }
static int cx23888_ir_tx_shutdown(struct v4l2_subdev *sd)
{ … }
static int cx23888_ir_tx_s_parameters(struct v4l2_subdev *sd,
struct v4l2_subdev_ir_parameters *p)
{ … }
static int cx23888_ir_log_status(struct v4l2_subdev *sd)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int cx23888_ir_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{ … }
static int cx23888_ir_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static const struct v4l2_subdev_core_ops cx23888_ir_core_ops = …;
static const struct v4l2_subdev_ir_ops cx23888_ir_ir_ops = …;
static const struct v4l2_subdev_ops cx23888_ir_controller_ops = …;
static const struct v4l2_subdev_ir_parameters default_rx_params = …;
static const struct v4l2_subdev_ir_parameters default_tx_params = …;
int cx23888_ir_probe(struct cx23885_dev *dev)
{ … }
int cx23888_ir_remove(struct cx23885_dev *dev)
{ … }