1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2592f4aedSMax Krummenacher /* 3592f4aedSMax Krummenacher * Copyright (C) 2014-2016, Toradex AG 4592f4aedSMax Krummenacher */ 5592f4aedSMax Krummenacher 6592f4aedSMax Krummenacher /* 7592f4aedSMax Krummenacher * Helpers for Freescale PMIC PF0100 8592f4aedSMax Krummenacher */ 9592f4aedSMax Krummenacher 10592f4aedSMax Krummenacher #ifndef PF0100_H_ 11592f4aedSMax Krummenacher #define PF0100_H_ 12592f4aedSMax Krummenacher 13592f4aedSMax Krummenacher /* 7-bit I2C bus slave address */ 14592f4aedSMax Krummenacher #define PFUZE100_I2C_ADDR (0x08) 15592f4aedSMax Krummenacher /* Register Addresses */ 16592f4aedSMax Krummenacher #define PFUZE100_DEVICEID (0x0) 17592f4aedSMax Krummenacher #define PFUZE100_REVID (0x3) 18592f4aedSMax Krummenacher #define PFUZE100_SW1AMODE (0x23) 19592f4aedSMax Krummenacher #define PFUZE100_SW1ACON 36 20592f4aedSMax Krummenacher #define PFUZE100_SW1ACON_SPEED_VAL (0x1<<6) /*default */ 21592f4aedSMax Krummenacher #define PFUZE100_SW1ACON_SPEED_M (0x3<<6) 22592f4aedSMax Krummenacher #define PFUZE100_SW1CCON 49 23592f4aedSMax Krummenacher #define PFUZE100_SW1CCON_SPEED_VAL (0x1<<6) /*default */ 24592f4aedSMax Krummenacher #define PFUZE100_SW1CCON_SPEED_M (0x3<<6) 25592f4aedSMax Krummenacher #define PFUZE100_SW1AVOL 32 26592f4aedSMax Krummenacher #define PFUZE100_SW1AVOL_VSEL_M (0x3f<<0) 27592f4aedSMax Krummenacher #define PFUZE100_SW1CVOL 46 28592f4aedSMax Krummenacher #define PFUZE100_SW1CVOL_VSEL_M (0x3f<<0) 29592f4aedSMax Krummenacher #define PFUZE100_VGEN1CTL (0x6c) 30592f4aedSMax Krummenacher #define PFUZE100_VGEN1_VAL (0x30 + 0x08) /* Always ON, 1.2V */ 31592f4aedSMax Krummenacher #define PFUZE100_SWBSTCTL (0x66) 32592f4aedSMax Krummenacher /* Always ON, Auto Switching Mode, 5.0V */ 33592f4aedSMax Krummenacher #define PFUZE100_SWBST_VAL (0x40 + 0x08 + 0x00) 34592f4aedSMax Krummenacher 35592f4aedSMax Krummenacher /* chooses the extended page (registers 0x80..0xff) */ 36592f4aedSMax Krummenacher #define PFUZE100_PAGE_REGISTER 0x7f 37592f4aedSMax Krummenacher #define PFUZE100_PAGE_REGISTER_PAGE_M (0x1f << 0) 38592f4aedSMax Krummenacher #define PFUZE100_PAGE_REGISTER_PAGE1 (0x01 & PFUZE100_PAGE_REGISTER_PAGE_M) 39592f4aedSMax Krummenacher #define PFUZE100_PAGE_REGISTER_PAGE2 (0x02 & PFUZE100_PAGE_REGISTER_PAGE_M) 40592f4aedSMax Krummenacher 41592f4aedSMax Krummenacher /* extended page 1 */ 42592f4aedSMax Krummenacher #define PFUZE100_FUSE_POR1 0xe4 43592f4aedSMax Krummenacher #define PFUZE100_FUSE_POR2 0xe5 44592f4aedSMax Krummenacher #define PFUZE100_FUSE_POR3 0xe6 45592f4aedSMax Krummenacher #define PFUZE100_FUSE_POR_M (0x1 << 1) 46592f4aedSMax Krummenacher 47592f4aedSMax Krummenacher 48592f4aedSMax Krummenacher /* output some informational messages, return the number FUSE_POR=1 */ 49592f4aedSMax Krummenacher /* i.e. 0: unprogrammed, 3: programmed, other: undefined prog. state */ 50592f4aedSMax Krummenacher unsigned pmic_init(void); 51592f4aedSMax Krummenacher 52592f4aedSMax Krummenacher #endif /* PF0100_H_ */ 53