linux/drivers/media/rc/img-ir/img-ir.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * ImgTec IR Decoder found in PowerDown Controller.
 *
 * Copyright 2010-2014 Imagination Technologies Ltd.
 */

#ifndef _IMG_IR_H_
#define _IMG_IR_H_

#include <linux/io.h>
#include <linux/spinlock.h>

#include "img-ir-raw.h"
#include "img-ir-hw.h"

/* registers */

/* relative to the start of the IR block of registers */
#define IMG_IR_CONTROL
#define IMG_IR_STATUS
#define IMG_IR_DATA_LW
#define IMG_IR_DATA_UP
#define IMG_IR_LEAD_SYMB_TIMING
#define IMG_IR_S00_SYMB_TIMING
#define IMG_IR_S01_SYMB_TIMING
#define IMG_IR_S10_SYMB_TIMING
#define IMG_IR_S11_SYMB_TIMING
#define IMG_IR_FREE_SYMB_TIMING
#define IMG_IR_POW_MOD_PARAMS
#define IMG_IR_POW_MOD_ENABLE
#define IMG_IR_IRQ_MSG_DATA_LW
#define IMG_IR_IRQ_MSG_DATA_UP
#define IMG_IR_IRQ_MSG_MASK_LW
#define IMG_IR_IRQ_MSG_MASK_UP
#define IMG_IR_IRQ_ENABLE
#define IMG_IR_IRQ_STATUS
#define IMG_IR_IRQ_CLEAR
#define IMG_IR_IRCORE_ID
#define IMG_IR_CORE_REV
#define IMG_IR_CORE_DES1
#define IMG_IR_CORE_DES2


/* field masks */

/* IMG_IR_CONTROL */
#define IMG_IR_DECODEN
#define IMG_IR_CODETYPE
#define IMG_IR_CODETYPE_SHIFT
#define IMG_IR_HDRTOG
#define IMG_IR_LDRDEC
#define IMG_IR_DECODINPOL
#define IMG_IR_BITORIEN
#define IMG_IR_D1VALIDSEL
#define IMG_IR_BITINV
#define IMG_IR_DECODEND2
#define IMG_IR_BITORIEND2
#define IMG_IR_BITINVD2

/* IMG_IR_STATUS */
#define IMG_IR_RXDVALD2
#define IMG_IR_IRRXD
#define IMG_IR_TOGSTATE
#define IMG_IR_RXDVAL
#define IMG_IR_RXDLEN
#define IMG_IR_RXDLEN_SHIFT

/* IMG_IR_LEAD_SYMB_TIMING, IMG_IR_Sxx_SYMB_TIMING */
#define IMG_IR_PD_MAX
#define IMG_IR_PD_MAX_SHIFT
#define IMG_IR_PD_MIN
#define IMG_IR_PD_MIN_SHIFT
#define IMG_IR_W_MAX
#define IMG_IR_W_MAX_SHIFT
#define IMG_IR_W_MIN
#define IMG_IR_W_MIN_SHIFT

/* IMG_IR_FREE_SYMB_TIMING */
#define IMG_IR_MAXLEN
#define IMG_IR_MAXLEN_SHIFT
#define IMG_IR_MINLEN
#define IMG_IR_MINLEN_SHIFT
#define IMG_IR_FT_MIN
#define IMG_IR_FT_MIN_SHIFT

/* IMG_IR_POW_MOD_PARAMS */
#define IMG_IR_PERIOD_LEN
#define IMG_IR_PERIOD_LEN_SHIFT
#define IMG_IR_PERIOD_DUTY
#define IMG_IR_PERIOD_DUTY_SHIFT
#define IMG_IR_STABLE_STOP
#define IMG_IR_STABLE_STOP_SHIFT
#define IMG_IR_STABLE_START
#define IMG_IR_STABLE_START_SHIFT

/* IMG_IR_POW_MOD_ENABLE */
#define IMG_IR_POWER_OUT_EN
#define IMG_IR_POWER_MOD_EN

/* IMG_IR_IRQ_ENABLE, IMG_IR_IRQ_STATUS, IMG_IR_IRQ_CLEAR */
#define IMG_IR_IRQ_DEC2_ERR
#define IMG_IR_IRQ_DEC_ERR
#define IMG_IR_IRQ_ACT_LEVEL
#define IMG_IR_IRQ_FALL_EDGE
#define IMG_IR_IRQ_RISE_EDGE
#define IMG_IR_IRQ_DATA_MATCH
#define IMG_IR_IRQ_DATA2_VALID
#define IMG_IR_IRQ_DATA_VALID
#define IMG_IR_IRQ_ALL
#define IMG_IR_IRQ_EDGE

/* IMG_IR_CORE_ID */
#define IMG_IR_CORE_ID
#define IMG_IR_CORE_ID_SHIFT
#define IMG_IR_CORE_CONFIG
#define IMG_IR_CORE_CONFIG_SHIFT

/* IMG_IR_CORE_REV */
#define IMG_IR_DESIGNER
#define IMG_IR_DESIGNER_SHIFT
#define IMG_IR_MAJOR_REV
#define IMG_IR_MAJOR_REV_SHIFT
#define IMG_IR_MINOR_REV
#define IMG_IR_MINOR_REV_SHIFT
#define IMG_IR_MAINT_REV
#define IMG_IR_MAINT_REV_SHIFT

struct device;
struct clk;

/**
 * struct img_ir_priv - Private driver data.
 * @dev:		Platform device.
 * @irq:		IRQ number.
 * @clk:		Input clock.
 * @sys_clk:		System clock.
 * @reg_base:		Iomem base address of IR register block.
 * @lock:		Protects IR registers and variables in this struct.
 * @raw:		Driver data for raw decoder.
 * @hw:			Driver data for hardware decoder.
 */
struct img_ir_priv {};

/* Hardware access */

static inline void img_ir_write(struct img_ir_priv *priv,
				unsigned int reg_offs, unsigned int data)
{}

static inline unsigned int img_ir_read(struct img_ir_priv *priv,
				       unsigned int reg_offs)
{}

#endif /* _IMG_IR_H_ */