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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Mediatek IR Receiver Controller
 *
 * Copyright (C) 2017 Sean Wang <[email protected]>
 */

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

#define MTK_IR_DEV

/* Register to enable PWM and IR */
#define MTK_CONFIG_HIGH_REG

/* Bit to enable IR pulse width detection */
#define MTK_PWM_EN

/*
 * Register to setting ok count whose unit based on hardware sampling period
 * indicating IR receiving completion and then making IRQ fires
 */
#define MTK_OK_COUNT_MASK
#define MTK_OK_COUNT(x)

/* Bit to enable IR hardware function */
#define MTK_IR_EN

/* Bit to restart IR receiving */
#define MTK_IRCLR

/* Fields containing pulse width data */
#define MTK_WIDTH_MASK

/* IR threshold */
#define MTK_IRTHD
#define MTK_DG_CNT_MASK
#define MTK_DG_CNT(x)

/* Bit to enable interrupt */
#define MTK_IRINT_EN

/* Bit to clear interrupt status */
#define MTK_IRINT_CLR

/* Maximum count of samples */
#define MTK_MAX_SAMPLES
/* Indicate the end of IR message */
#define MTK_IR_END(v, p)
/* Number of registers to record the pulse width */
#define MTK_CHKDATA_SZ
/* Sample period in us */
#define MTK_IR_SAMPLE

enum mtk_fields {};

enum mtk_regs {};

static const u32 mt7623_regs[] =;

static const u32 mt7622_regs[] =;

struct mtk_field_type {};

/*
 * struct mtk_ir_data -	This is the structure holding all differences among
			various hardwares
 * @regs:		The pointer to the array holding registers offset
 * @fields:		The pointer to the array holding fields location
 * @div:		The internal divisor for the based reference clock
 * @ok_count:		The count indicating the completion of IR data
 *			receiving when count is reached
 * @hw_period:		The value indicating the hardware sampling period
 */
struct mtk_ir_data {};

static const struct mtk_field_type mt7623_fields[] =;

static const struct mtk_field_type mt7622_fields[] =;

/*
 * struct mtk_ir -	This is the main datasructure for holding the state
 *			of the driver
 * @dev:		The device pointer
 * @rc:			The rc instrance
 * @base:		The mapped register i/o base
 * @irq:		The IRQ that we are using
 * @clk:		The clock that IR internal is using
 * @bus:		The clock that software decoder is using
 * @data:		Holding specific data for vaious platform
 */
struct mtk_ir {};

static inline u32 mtk_chkdata_reg(struct mtk_ir *ir, u32 i)
{}

static inline u32 mtk_chk_period(struct mtk_ir *ir)
{}

static void mtk_w32_mask(struct mtk_ir *ir, u32 val, u32 mask, unsigned int reg)
{}

static void mtk_w32(struct mtk_ir *ir, u32 val, unsigned int reg)
{}

static u32 mtk_r32(struct mtk_ir *ir, unsigned int reg)
{}

static inline void mtk_irq_disable(struct mtk_ir *ir, u32 mask)
{}

static inline void mtk_irq_enable(struct mtk_ir *ir, u32 mask)
{}

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

static const struct mtk_ir_data mt7623_data =;

static const struct mtk_ir_data mt7622_data =;

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

static int mtk_ir_probe(struct platform_device *pdev)
{}

static void mtk_ir_remove(struct platform_device *pdev)
{}

static struct platform_driver mtk_ir_driver =;

module_platform_driver();

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