1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
6 * (C) Copyright 2009 Freescale Semiconductor, Inc.
10 #define __FSL_PMIC_H__
13 * The registers of different PMIC has the same meaning
14 * but the bit positions of the fields can differ or
15 * some fields has a meaning only on some devices.
16 * You have to check with the internal SPI bitmap
17 * (see Freescale Documentation) to set the registers
18 * for the device you are using
51 REG_SETTING_0, /*30 */
89 #define GPO1EN (1 << 6)
90 #define GPO1STBY (1 << 7)
91 #define GPO2EN (1 << 8)
92 #define GPO2STBY (1 << 9)
93 #define GPO3EN (1 << 10)
94 #define GPO3STBY (1 << 11)
95 #define GPO4EN (1 << 12)
96 #define GPO4STBY (1 << 13)
97 #define PWGT1SPIEN (1 << 15)
98 #define PWGT2SPIEN (1 << 16)
99 #define PWUP (1 << 21)
101 /* Power Control 0 */
102 #define COINCHEN (1 << 23)
103 #define BATTDETEN (1 << 19)
105 /* Interrupt status 1 */
106 #define RTCRSTI (1 << 7)
108 /* MC34708 Definitions */
109 #define SWx_VOLT_MASK_MC34708 0x3F
110 #define SWx_1_110V_MC34708 0x24
111 #define SWx_1_250V_MC34708 0x30
112 #define SWx_1_300V_MC34708 0x34
113 #define TIMER_MASK_MC34708 0x300
114 #define TIMER_4S_MC34708 0x100
115 #define VUSBSEL_MC34708 (1 << 2)
116 #define VUSBEN_MC34708 (1 << 3)
117 #define SWBST_CTRL 31
118 #define SWBST_AUTO 0x8
120 #define MC34708_REG_SW12_OPMODE 28
122 #define MC34708_SW1AMODE_MASK 0x00000f
123 #define MC34708_SW1AMHMODE 0x000010
124 #define MC34708_SW1AUOMODE 0x000020
125 #define MC34708_SW1DVSSPEED 0x0000c0
126 #define MC34708_SW2MODE_MASK 0x03c000
127 #define MC34708_SW2MHMODE 0x040000
128 #define MC34708_SW2UOMODE 0x080000
129 #define MC34708_SW2DVSSPEED 0x300000
130 #define MC34708_PLLEN 0x400000
131 #define MC34708_PLLX 0x800000
133 #define MC34708_REG_SW345_OPMODE 29
135 #define MC34708_SW3MODE_MASK 0x00000f
136 #define MC34708_SW3MHMODE 0x000010
137 #define MC34708_SW3UOMODE 0x000020
138 #define MC34708_SW4AMODE_MASK 0x0003c0
139 #define MC34708_SW4AMHMODE 0x000400
140 #define MC34708_SW4AUOMODE 0x000800
141 #define MC34708_SW4BMODE_MASK 0x00f000
142 #define MC34708_SW4BMHMODE 0x010000
143 #define MC34708_SW4BUOMODE 0x020000
144 #define MC34708_SW5MODE_MASK 0x3c0000
145 #define MC34708_SW5MHMODE 0x400000
146 #define MC34708_SW5UOMODE 0x800000
148 #define SW_MODE_OFFOFF 0x00
149 #define SW_MODE_PWMOFF 0x01
150 #define SW_MODE_PFMOFF 0x03
151 #define SW_MODE_APSOFF 0x04
152 #define SW_MODE_PWMPWM 0x05
153 #define SW_MODE_PWMAPS 0x06
154 #define SW_MODE_APSAPS 0x08
155 #define SW_MODE_APSPFM 0x0c
156 #define SW_MODE_PWMPFM 0x0d
157 #define SW_MODE_PFMPFM 0x0f
159 #define MC34708_TRANSFER_SIZE 3