ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * drivers/input/keyboard/sunxi-ir-tx.h
 *
 * Copyright (c) 2013-2018 Allwinnertech Co., Ltd.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
 
#ifndef _SUNXI_IR_TX_H
#define _SUNXI_IR_TX_H
 
#include <asm/ioctl.h>
 
#define IR_TX_GLR        (0x00)
#define IR_TX_MCR        (0x04)
#define IR_TX_CR        (0x08)
#define IR_TX_IDC_H        (0x0c)
#define IR_TX_IDC_L        (0x10)
#define IR_TX_ICR_H        (0x14)
#define IR_TX_ICR_L        (0x18)
#define IR_TX_TELR        (0x20)
//#define IR_TX_INT_CR        (0x24)
#define IR_TX_INTC        (0x24)
#define IR_TX_TACR        (0x28)
#define IR_TX_STAR        (0x2c)
#define IR_TX_TR        (0x30)
//#define IR_TX_DMA_CR        (0x34)
#define IR_TX_DMAC        (0x34)
#define IR_TX_FIFO_DR        (0x80)
 
#define IR_TX_GL_VALUE        (0x27)
#define IR_TX_MC_VALUE        (0x9e)
#define IR_TX_CLK_VALUE        (0x07 << 1)
#define IR_TX_IDC_H_VALUE    (0x00)
#define IR_TX_IDC_L_VALUE    (0x50)
#define IR_TX_TEL_VALUE        (0x96 -  1)
#define IR_TX_INT_C_VALUE    (0x01)
#define IR_TX_STA_VALUE        (0x03)
#define IR_TX_T_VALUE        (0x64)
#define IR_TX_CLK               24000000
 
#define SUNXI_IR_TX_DRIVER_NAME "sunxi-ir-tx"
#define IR_TX_FIFO_SIZE        (128)
 
#define    IR_TX_RAW_BUF_SIZE    (256)
#define IR_TX_CYCLE_TYPE    (0)    /* 1:cycle 0:non-cycle */
#define IR_TX_CLK_Ts        (1)
 
 
enum {
   DEBUG_INIT    = 1U << 0,
   DEBUG_INFO    = 1U << 1,
   DEBUG_SUSPEND = 1U << 2,
};
 
struct cmd {
   unsigned char protocol, address, command;
};
 
#define IR_TX_IOCSEND _IOR(66, 1, struct cmd)
 
#endif /* _SUNXI_IR_TX_H */