/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Driver for ITE Tech Inc. IT8712F/IT8512F CIR * * Copyright (C) 2010 Juan Jesús García de Soria <skandalfo@gmail.com>
*/
/* platform driver name to register */ #define ITE_DRIVER_NAME "ite-cir"
/* struct for storing the parameters of different recognized devices */ struct ite_dev_params { /* model of the device */ constchar *model;
/* size of the I/O region */ int io_region_size;
/* IR pnp I/O resource number */ int io_rsrc_no;
/* hw-specific operation function pointers; most of these must be * called while holding the spin lock, except for the TX FIFO length
* one */ /* get pending interrupt causes */ int (*get_irq_causes) (struct ite_dev *dev);
/* default carrier freq for when demodulator is off (Hz) */ #define ITE_DEFAULT_CARRIER_FREQ 38000
/* convert bits to us */ #define ITE_BITS_TO_US(bits, sample_period) \
((u32)((bits) * ITE_BAUDRATE_DIVISOR * (sample_period) / 1000))
/* * n in RDCR produces a tolerance of +/- n * 6.25% around the center * carrier frequency... * * From two limit frequencies, L (low) and H (high), we can get both the * center frequency F = (L + H) / 2 and the variation from the center * frequency A = (H - L) / (H + L). We can use this in order to honor the * s_rx_carrier_range() call in ir-core. We'll suppose that any request * setting L=0 means we must shut down the demodulator.
*/ #define ITE_RXDCR_PER_10000_STEP 625
/* * IT8512E/F * * Hardware data obtained from: * * IT8512E/F * Embedded Controller * Preliminary Specification V0.4.1 * * Note that the CIR registers are not directly available to the host, because * they only are accessible to the integrated microcontroller. Thus, in order * use it, some kind of bridging is required. As the bridging may depend on * the controller firmware in use, we are going to use the PNP ID in order to * determine the strategy and ports available. See after these generic * IT8512E/F register definitions for register definitions for those * strategies.
*/
/* C0WPS bits */ #define IT85_CIRPOSIE 0x01 /* power on/off status interrupt enable */ #define IT85_CIRPOIS 0x02 /* power on/off interrupt status */ #define IT85_CIRPOII 0x04 /* power on/off interrupt identification */ #define IT85_RCRST 0x10 /* wakeup code reading counter reset bit */ #define IT85_WCRST 0x20 /* wakeup code writing counter reset bit */
/* * ITE8708 * * Hardware data obtained from hacked driver for IT8512 in this forum post: * * http://ubuntuforums.org/showthread.php?t=1028640 * * Although there's no official documentation for that driver, analysis would * suggest that it maps the 16 registers of IT8512 onto two 8-register banks, * selectable by a single bank-select bit that's mapped onto both banks. The * IT8512 registers are mapped in a different order, so that the first bank * maps the ones that are used more often, and two registers that share a * reserved high-order bit are placed at the same offset in both banks in * order to reuse the reserved bit as the bank select bit.
*/
/* register offsets */
/* mapped onto both banks */ #define IT8708_BANKSEL 0x07 /* bank select register */ #define IT8708_HRAE 0x80 /* high registers access enable */
/* mapped onto the low bank */ #define IT8708_C0DR 0x00 /* data register */ #define IT8708_C0MSTCR 0x01 /* master control register */ #define IT8708_C0IER 0x02 /* interrupt enable register */ #define IT8708_C0IIR 0x03 /* interrupt identification register */ #define IT8708_C0RFSR 0x04 /* receiver FIFO status register */ #define IT8708_C0RCR 0x05 /* receiver control register */ #define IT8708_C0TFSR 0x06 /* transmitter FIFO status register */ #define IT8708_C0TCR 0x07 /* transmitter control register */
/* mapped onto the high bank */ #define IT8708_C0BDLR 0x01 /* baud rate divisor low byte register */ #define IT8708_C0BDHR 0x02 /* baud rate divisor high byte register */ #define IT8708_C0CFR 0x04 /* carrier frequency register */
/* registers whose bank mapping we don't know, since they weren't being used * in the hacked driver... most probably they belong to the high bank too,
* since they fit in the holes the other registers leave */ #define IT8708_C0SCK 0x03 /* slow clock control register */ #define IT8708_C0WCL 0x05 /* wakeup code length register */ #define IT8708_C0WCR 0x06 /* wakeup code read/write register */ #define IT8708_C0WPS 0x07 /* wakeup power control/status register */
#define IT8708_IOREG_LENGTH 0x08 /* length of register file */
/* two more registers that are defined in the hacked driver, but can't be * found in the data sheets; no idea what they are or how they are accessed,
* since the hacked driver doesn't seem to use them */ #define IT8708_CSCRR 0x00 #define IT8708_CGPINTR 0x01
/* * ITE8709 * * Hardware interfacing data obtained from the original lirc_ite8709 driver. * Verbatim from its sources: * * The ITE8709 device seems to be the combination of IT8512 superIO chip and * a specific firmware running on the IT8512's embedded micro-controller. * In addition of the embedded micro-controller, the IT8512 chip contains a * CIR module and several other modules. A few modules are directly accessible * by the host CPU, but most of them are only accessible by the * micro-controller. The CIR module is only accessible by the * micro-controller. * * The battery-backed SRAM module is accessible by the host CPU and the * micro-controller. So one of the MC's firmware role is to act as a bridge * between the host CPU and the CIR module. The firmware implements a kind of * communication protocol using the SRAM module as a shared memory. The IT8512 * specification is publicly available on ITE's web site, but the * communication protocol is not, so it was reverse-engineered.
*/
/* register offsets */ #define IT8709_RAM_IDX 0x00 /* index into the SRAM module bytes */ #define IT8709_RAM_VAL 0x01 /* read/write data to the indexed byte */
#define IT8709_IOREG_LENGTH 0x02 /* length of register file */
/* register offsets inside the SRAM module */ #define IT8709_MODE 0x1a /* request/ack byte */ #define IT8709_REG_IDX 0x1b /* index of the CIR register to access */ #define IT8709_REG_VAL 0x1c /* value read/to be written */ #define IT8709_IIR 0x1e /* interrupt identification register */ #define IT8709_RFSR 0x1f /* receiver FIFO status register */ #define IT8709_FIFO 0x20 /* start of in RAM RX FIFO copy */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.