xref: /freebsd/sys/dev/iicbus/pmic/act8846_reg.h (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2019 Michal Meloun <mmel@FreeBSD.org>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 
29 #ifndef _ACT8846_REG_H_
30 #define	 _ACT8846_REG_H_
31 
32 
33 /* ACT8846 registers. */
34 #define	ACT8846_SYS0		0x00
35 #define	ACT8846_SYS1		0x01
36 #define	ACT8846_REG1_CTRL	0x12
37 #define	ACT8846_REG2_VSET0	0x20
38 #define	ACT8846_REG2_VSET1	0x21
39 #define	ACT8846_REG2_CTRL	0x22
40 #define	ACT8846_REG3_VSET0	0x30
41 #define	ACT8846_REG3_VSET1	0x31
42 #define	ACT8846_REG3_CTRL	0x32
43 #define	ACT8846_REG4_VSET0	0x40
44 #define	ACT8846_REG4_VSET1	0x41
45 #define	ACT8846_REG4_CTRL	0x42
46 #define	ACT8846_REG5_VSET	0x50
47 #define	ACT8846_REG5_CTRL	0x51
48 #define	ACT8846_REG6_VSET	0x58
49 #define	ACT8846_REG6_CTRL	0x59
50 #define	ACT8846_REG7_VSET	0x60
51 #define	ACT8846_REG7_CTRL	0x61
52 #define	ACT8846_REG8_VSET	0x68
53 #define	ACT8846_REG8_CTRL	0x69
54 #define	ACT8846_REG9_VSET	0x70
55 #define	ACT8846_REG9_CTRL	0x71
56 #define	ACT8846_REG10_VSET	0x80
57 #define	ACT8846_REG10_CTRL	0x81
58 #define	ACT8846_REG11_VSET	0x90
59 #define	ACT8846_REG11_CTRL	0x91
60 #define	ACT8846_REG12_VSET	0xa0
61 #define	ACT8846_REG12_CTRL	0xa1
62 #define	ACT8846_REG13_CTRL	0xb1
63 #define	ACT8846_PB0		0xc0
64 #define	ACT8846_PB1		0xc1
65 #define	ACT8846_PB2		0xc2
66 #define	ACT8846_PB3		0xc3
67 #define	ACT8846_PB4		0xc4
68 #define	ACT8846_GPIO6		0xe3
69 #define	ACT8846_GPIO5		0xe4
70 #define	ACT8846_GPIO3		0xf4
71 #define	ACT8846_GPIO4		0xf5
72 
73 /* Common REGxx_CTRL bits */
74 #define	ACT8846_CTRL_ENA	0x80
75 #define	ACT8846_CTRL_OK		0x01
76 
77 /* Common REGxx_VSEL bits */
78 #define	ACT8846_VSEL_MASK	0x3f
79 
80 
81 #endif /* _ACT8846_REG_H_ */
82