1/*	$NetBSD: tps65217pmicreg.h,v 1.6 2013/08/04 00:24:28 rkujawa Exp $ */
2
3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Radoslaw Kujawa.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*#include <sys/cdefs.h>*/
33
34#ifndef _TPS65217PMICREG_H_
35#define _TPS65217PMICREG_H_
36
37#define TPS65217PMIC_ADDR		0x24
38
39#define TPS65217PMIC_CHIPID		0x00
40#define TPS65217PMIC_CHIPID_VER_MASK	0xF0
41#define TPS65217PMIC_CHIPID_REV_MASK	0x0F
42#define TPS65217PMIC_CHIPID_VER_A		0x70
43#define TPS65217PMIC_CHIPID_VER_B		0xF0
44#define TPS65217PMIC_CHIPID_VER_C		0xE0
45#define TPS65217PMIC_CHIPID_VER_D		0x60
46
47#define TPS65217PMIC_PPATH		0x01
48#define TPS65217PMIC_PPATH_IUSB			__BITS(0,1)
49#define TPS65217PMIC_PPATH_IUSB_100MA			0
50#define TPS65217PMIC_PPATH_IUSB_500MA			1
51#define TPS65217PMIC_PPATH_IUSB_1300MA			2
52#define TPS65217PMIC_PPATH_IUSB_1800MA			3
53#define TPS65217PMIC_PPATH_IAC			__BITS(2,3)
54#define TPS65217PMIC_PPATH_IAC_RSHFIT		2
55#define TPS65217PMIC_PPATH_IAC_100MA			0
56#define TPS65217PMIC_PPATH_IAC_500MA			1
57#define TPS65217PMIC_PPATH_IAC_1300MA			2
58#define TPS65217PMIC_PPATH_IAC_2500MA			3
59#define TPS65217PMIC_PPATH_USB_EN		__BIT(4)
60#define TPS65217PMIC_PPATH_AC_EN		__BIT(5)
61
62#define TPS65217PMIC_INT		0x02
63#define TPS65217PMIC_INT_USBI			__BIT(0)
64#define TPS65217PMIC_INT_ACI			__BIT(1)
65#define TPS65217PMIC_INT_PBI			__BIT(2)
66#define TPS65217PMIC_INT_USBM			__BIT(4)
67#define TPS65217PMIC_INT_ACM			__BIT(5)
68#define TPS65217PMIC_INT_PBM			__BIT(6)
69
70#define TPS65217PMIC_WLEDCTRL1		0x07
71#define TPS65217PMIC_WLEDCTRL1_FDIM		__BITS(1,0)
72#define TPS65217PMIC_WLEDCTRL1_FDIM_100Hz		0
73#define TPS65217PMIC_WLEDCTRL1_FDIM_200Hz		1
74#define TPS65217PMIC_WLEDCTRL1_FDIM_500Hz		2
75#define TPS65217PMIC_WLEDCTRL1_FDIM_1000Hz		3
76#define TPS65217PMIC_WLEDCTRL1_ISEL		__BIT(2)
77#define TPS65217PMIC_WLEDCTRL1_ISINK_EN		__BIT(3)
78
79#define TPS65217PMIC_WLEDCTRL2		0x08
80#define TPS65217PMIC_WLEDCTRL2_DUTY		__BITS(6,0)
81
82#define TPS65217PMIC_STATUS		0x0A
83#define TPS65217PMIC_STATUS_USBPWR		__BIT(2)
84#define TPS65217PMIC_STATUS_ACPWR		__BIT(3)
85
86#define TPS65217PMIC_PASSWORD		0x0B
87#define TPS65217PMIC_PASSWORD_XOR		0x7d
88
89#define TPS65217PMIC_PGOOD		0x0C
90#define TPS65217PMIC_PGOOD_LDO3PG		__BIT(0)
91#define TPS65217PMIC_PGOOD_LDO4PG		__BIT(1)
92#define TPS65217PMIC_PGOOD_DC1PG		__BIT(2)
93#define TPS65217PMIC_PGOOD_DC2PG		__BIT(3)
94#define TPS65217PMIC_PGOOD_DC3PG		__BIT(4)
95#define TPS65217PMIC_PGOOD_LDO1PG		__BIT(5)
96#define TPS65217PMIC_PGOOD_LDO2PG		__BIT(6)
97
98#define TPS65217PMIC_DEFSLEW		0x11
99#define TPS65217PMIC_DEFSLEW_GO			__BIT(7)
100
101#define TPS65217PMIC_DEFLDO1		0x12
102#define TPS65217PMIC_DEFLDO2		0x13
103#define TPS65217PMIC_DEFLDO3		0x14
104#define TPS65217PMIC_DEFLDO4		0x15
105#define TPS65217PMIC_DEFDCDC1		0x0E
106#define TPS65217PMIC_DEFDCDC2		0x0F
107#define TPS65217PMIC_DEFDCDC3		0x10
108
109#define TPS65217PMIC_DEFX_VOLTAGE_16		__BITS(0,3)
110#define TPS65217PMIC_DEFX_VOLTAGE_32		__BITS(0,4)
111#define TPS65217PMIC_DEFX_VOLTAGE_64		__BITS(0,5)
112#define TPS65217PMIC_DEFX_TRACKING		__BIT(6)
113#define TPS65217PMIC_DEFX_XADJ			__BIT(7)
114#define TPS65217PMIC_DEFX_LS			__BIT(5)
115
116#define TPS65217PMIC_ENABLE		0x16
117#define TPS65217PMIC_ENABLE_LDO2		__BIT(0)
118#define TPS65217PMIC_ENABLE_LDO1		__BIT(1)
119#define TPS65217PMIC_ENABLE_DCDC3		__BIT(2)
120#define TPS65217PMIC_ENABLE_DCDC2		__BIT(3)
121#define TPS65217PMIC_ENABLE_DCDC1		__BIT(4)
122#define TPS65217PMIC_ENABLE_LDO4		__BIT(5)
123#define TPS65217PMIC_ENABLE_LDO3		__BIT(6)
124
125#endif /* _TPS65217PMICREG_H_ */
126