blob: c0efb79bbc987761b37dffcff84d4b6b214886e7 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Max Krummenacher592f4ae2016-11-30 19:43:08 +01002/*
3 * Copyright (C) 2014-2016, Toradex AG
Max Krummenacher592f4ae2016-11-30 19:43:08 +01004 */
5
6/*
7 * Helpers for Freescale PMIC PF0100
8*/
9
10#ifndef PF0100_H_
11#define PF0100_H_
12
13/* 7-bit I2C bus slave address */
14#define PFUZE100_I2C_ADDR (0x08)
15/* Register Addresses */
16#define PFUZE100_DEVICEID (0x0)
17#define PFUZE100_REVID (0x3)
18#define PFUZE100_SW1AMODE (0x23)
19#define PFUZE100_SW1ACON 36
20#define PFUZE100_SW1ACON_SPEED_VAL (0x1<<6) /*default */
21#define PFUZE100_SW1ACON_SPEED_M (0x3<<6)
22#define PFUZE100_SW1CCON 49
23#define PFUZE100_SW1CCON_SPEED_VAL (0x1<<6) /*default */
24#define PFUZE100_SW1CCON_SPEED_M (0x3<<6)
25#define PFUZE100_SW1AVOL 32
26#define PFUZE100_SW1AVOL_VSEL_M (0x3f<<0)
27#define PFUZE100_SW1CVOL 46
28#define PFUZE100_SW1CVOL_VSEL_M (0x3f<<0)
29#define PFUZE100_VGEN1CTL (0x6c)
30#define PFUZE100_VGEN1_VAL (0x30 + 0x08) /* Always ON, 1.2V */
31#define PFUZE100_SWBSTCTL (0x66)
32/* Always ON, Auto Switching Mode, 5.0V */
33#define PFUZE100_SWBST_VAL (0x40 + 0x08 + 0x00)
34
35/* chooses the extended page (registers 0x80..0xff) */
36#define PFUZE100_PAGE_REGISTER 0x7f
37#define PFUZE100_PAGE_REGISTER_PAGE_M (0x1f << 0)
38#define PFUZE100_PAGE_REGISTER_PAGE1 (0x01 & PFUZE100_PAGE_REGISTER_PAGE_M)
39#define PFUZE100_PAGE_REGISTER_PAGE2 (0x02 & PFUZE100_PAGE_REGISTER_PAGE_M)
40
41/* extended page 1 */
42#define PFUZE100_FUSE_POR1 0xe4
43#define PFUZE100_FUSE_POR2 0xe5
44#define PFUZE100_FUSE_POR3 0xe6
45#define PFUZE100_FUSE_POR_M (0x1 << 1)
46
47
48/* output some informational messages, return the number FUSE_POR=1 */
49/* i.e. 0: unprogrammed, 3: programmed, other: undefined prog. state */
50unsigned pmic_init(void);
51
Max Krummenacher592f4ae2016-11-30 19:43:08 +010052#endif /* PF0100_H_ */