summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Qiu <joqiu@nvidia.com>2012-02-01 13:46:01 +0800
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-02-16 06:45:10 -0800
commit70f0df8fac0ca77355737d5e8614fa7ec174fc10 (patch)
tree59b9687ecec1cf13636a321e5e62bb54e2a6a369
parent94387e38ba0845643935cda2ddd6e22c498698b8 (diff)
regulator: max77663: add support for VDD_RTC tracking to VDD_CORE
Bug 920845 Change-Id: Id84218efaeebcc834fdac6e0e5c30adc60a13ebc Signed-off-by: Johnny Qiu <joqiu@nvidia.com> Signed-off-by: Hao Tang <htang@nvidia.com> Reviewed-on: http://git-master/r/83727 Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com> Reviewed-by: Liangchuan Mi <lmi@nvidia.com> Tested-by: Liangchuan Mi <lmi@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
-rw-r--r--drivers/regulator/max77663-regulator.c21
-rw-r--r--include/linux/regulator/max77663-regulator.h7
2 files changed, 24 insertions, 4 deletions
diff --git a/drivers/regulator/max77663-regulator.c b/drivers/regulator/max77663-regulator.c
index c961ab05d2b0..560475062888 100644
--- a/drivers/regulator/max77663-regulator.c
+++ b/drivers/regulator/max77663-regulator.c
@@ -2,8 +2,8 @@
* drivers/regulator/max77663-regulator.c
* Maxim LDO and Buck regulators driver
*
- * Copyright 2011 Maxim Integrated Products, Inc.
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright 2011-2012 Maxim Integrated Products, Inc.
+ * Copyright (C) 2011-2012 NVIDIA Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -64,6 +64,7 @@
#define MAX77663_REG_LDO7_CFG2 0x32
#define MAX77663_REG_LDO8_CFG 0x33
#define MAX77663_REG_LDO8_CFG2 0x34
+#define MAX77663_REG_LDO_CFG3 0x35
/* Power Mode */
#define POWER_MODE_NORMAL 3
@@ -91,6 +92,10 @@
#define SD_FSRADE_MASK 0x01
#define SD_FSRADE_SHIFT 0
+/* LDO Configuration 3 */
+#define TRACK4_MASK 0x20
+#define TRACK4_SHIFT 5
+
/* Voltage */
#define SDX_VOLT_MASK 0xFF
#define SD1_VOLT_MASK 0x3F
@@ -730,6 +735,18 @@ skip_init_apply:
}
}
+ if ((reg->id == MAX77663_REGULATOR_ID_LDO4)
+ && (pdata->flags & LDO4_EN_TRACKING)) {
+ val = TRACK4_MASK;
+ ret = max77663_write(_to_parent(reg), MAX77663_REG_LDO_CFG3, &val, 1, 0);
+ if (ret < 0) {
+ dev_err(reg->dev, "preinit: "
+ "Failed to set register 0x%x\n",
+ MAX77663_REG_LDO_CFG3);
+ return ret;
+ }
+ }
+
return 0;
}
diff --git a/include/linux/regulator/max77663-regulator.h b/include/linux/regulator/max77663-regulator.h
index 49ffee212f56..d8ab389c425c 100644
--- a/include/linux/regulator/max77663-regulator.h
+++ b/include/linux/regulator/max77663-regulator.h
@@ -2,8 +2,8 @@
* include/linux/regulator/max77663-regulator.h
* Maxim LDO and Buck regulators driver
*
- * Copyright 2011 Maxim Integrated Products, Inc.
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright 2011-2012 Maxim Integrated Products, Inc.
+ * Copyright (C) 2011-2012 NVIDIA Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -104,6 +104,9 @@ enum max77663_regulator_fps_src {
/* Group Low-Power Mode */
#define GLPM_ENABLE 0x80
+/* Tracking for LDO4 */
+#define LDO4_EN_TRACKING 0x100
+
struct max77663_regulator_fps_cfg {
enum max77663_regulator_fps_src src;
enum max77663_regulator_fps_en_src en_src;