summaryrefslogtreecommitdiff
path: root/board/freescale/mx6sxsabresd
diff options
context:
space:
mode:
Diffstat (limited to 'board/freescale/mx6sxsabresd')
-rw-r--r--board/freescale/mx6sxsabresd/mx6sxsabresd.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
index 9c785e0..c0f35f3 100644
--- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c
+++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
@@ -625,6 +625,37 @@ int board_phy_config(struct phy_device *phydev)
#define PFUZE100_SW1ABC_SETP(x) ((x - 3000) / 250)
#define PFUZE100_VGEN5CTL 0x70
+/* set all switches APS in normal and PFM mode in standby */
+static int setup_pmic_mode(int chip)
+{
+ unsigned char offset, i, switch_num, value;
+
+ if (!chip) {
+ /* pfuze100 */
+ switch_num = 6;
+ offset = 0x31;
+ } else {
+ /* pfuze200 */
+ switch_num = 4;
+ offset = 0x38;
+ }
+
+ value = 0xc;
+ if (i2c_write(0x8, 0x23, 1, &value, 1)) {
+ printf("Set SW1AB mode error!\n");
+ return -1;
+ }
+
+ for (i = 0; i < switch_num - 1; i++) {
+ if (i2c_write(0x8, offset + i * 7, 1, &value, 1)) {
+ printf("Set switch%x mode error!\n", offset);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
static int setup_pmic_voltages(void)
{
unsigned char value, rev_id = 0;
@@ -643,6 +674,10 @@ static int setup_pmic_voltages(void)
}
printf("Found PFUZE100! deviceid 0x%x, revid 0x%x\n", value, rev_id);
+ if (setup_pmic_mode(value & 0xf)) {
+ printf("setup pmic mode error!\n");
+ return -1;
+ }
/* set SW1AB standby volatage 0.975V */
if (i2c_read(CONFIG_PMIC_I2C_SLAVE, PFUZE100_SW1ABSTBY, 1, &value, 1)) {
printf("Read SW1ABSTBY error!\n");