linux/drivers/media/rc/sunxi-cir.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Allwinner sunXi IR controller
 *
 * Copyright (C) 2014 Alexsey Shestacov <[email protected]>
 * Copyright (C) 2014 Alexander Bersenev <[email protected]>
 *
 * Based on sun5i-ir.c:
 * Copyright (C) 2007-2012 Daniel Wang
 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
 */

#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <media/rc-core.h>

#define SUNXI_IR_DEV

/* Registers */
/* IR Control */
#define SUNXI_IR_CTL_REG
/* Global Enable */
#define REG_CTL_GEN
/* RX block enable */
#define REG_CTL_RXEN
/* CIR mode */
#define REG_CTL_MD

/* Rx Config */
#define SUNXI_IR_RXCTL_REG
/* Pulse Polarity Invert flag */
#define REG_RXCTL_RPPI

/* Rx Data */
#define SUNXI_IR_RXFIFO_REG

/* Rx Interrupt Enable */
#define SUNXI_IR_RXINT_REG
/* Rx FIFO Overflow Interrupt Enable */
#define REG_RXINT_ROI_EN
/* Rx Packet End Interrupt Enable */
#define REG_RXINT_RPEI_EN
/* Rx FIFO Data Available Interrupt Enable */
#define REG_RXINT_RAI_EN

/* Rx FIFO available byte level */
#define REG_RXINT_RAL(val)

/* Rx Interrupt Status */
#define SUNXI_IR_RXSTA_REG
/* Rx FIFO Overflow */
#define REG_RXSTA_ROI
/* Rx Packet End */
#define REG_RXSTA_RPE
/* Rx FIFO Data Available */
#define REG_RXSTA_RA
/* RX FIFO Get Available Counter */
#define REG_RXSTA_GET_AC(val)
/* Clear all interrupt status value */
#define REG_RXSTA_CLEARALL

/* IR Sample Config */
#define SUNXI_IR_CIR_REG
/* CIR_REG register noise threshold */
#define REG_CIR_NTHR(val)
/* CIR_REG register idle threshold */
#define REG_CIR_ITHR(val)

/* Required frequency for IR0 or IR1 clock in CIR mode (default) */
#define SUNXI_IR_BASE_CLK
/* Noise threshold in samples  */
#define SUNXI_IR_RXNOISE

/**
 * struct sunxi_ir_quirks - Differences between SoC variants.
 *
 * @has_reset: SoC needs reset deasserted.
 * @fifo_size: size of the fifo.
 */
struct sunxi_ir_quirks {};

struct sunxi_ir {};

static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id)
{}

/* Convert idle threshold to usec */
static unsigned int sunxi_ithr_to_usec(unsigned int base_clk, unsigned int ithr)
{}

/* Convert usec to idle threshold */
static unsigned int sunxi_usec_to_ithr(unsigned int base_clk, unsigned int usec)
{}

static int sunxi_ir_set_timeout(struct rc_dev *rc_dev, unsigned int timeout)
{}

static int sunxi_ir_hw_init(struct device *dev)
{}

static void sunxi_ir_hw_exit(struct device *dev)
{}

static int __maybe_unused sunxi_ir_suspend(struct device *dev)
{}

static int __maybe_unused sunxi_ir_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(sunxi_ir_pm_ops, sunxi_ir_suspend, sunxi_ir_resume);

static int sunxi_ir_probe(struct platform_device *pdev)
{}

static void sunxi_ir_remove(struct platform_device *pdev)
{}

static void sunxi_ir_shutdown(struct platform_device *pdev)
{}

static const struct sunxi_ir_quirks sun4i_a10_ir_quirks =;

static const struct sunxi_ir_quirks sun5i_a13_ir_quirks =;

static const struct sunxi_ir_quirks sun6i_a31_ir_quirks =;

static const struct of_device_id sunxi_ir_match[] =;
MODULE_DEVICE_TABLE(of, sunxi_ir_match);

static struct platform_driver sunxi_ir_driver =;

module_platform_driver();

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