aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2015-01-30 11:20:41 +0800
committerGuodong Xu <guodong.xu@linaro.org>2015-10-21 20:53:30 +0800
commitbc6563cbd3e2a9c1feeab5aa2ca62d9a11cec2dd (patch)
treeac545a58e660d6724a204a56e1a5624ea5d97027
parent82b97194f5e8ae8cc499cb58cc145cbfe29f0fff (diff)
misc: hi6220: enable PMIC clock output CK32B
CK32B is a 32K clock output from PMIC Hi6553. This clock is used by TI WL1835MOD on HiKey board. Signed-off-by: Bintian Wang <bintian.wang@huawei.com> Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
-rw-r--r--drivers/misc/hi6220-sysconfig.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/misc/hi6220-sysconfig.c b/drivers/misc/hi6220-sysconfig.c
index 103691850ca8..db82b8a6ca43 100644
--- a/drivers/misc/hi6220-sysconfig.c
+++ b/drivers/misc/hi6220-sysconfig.c
@@ -7,18 +7,21 @@
*
*/
+#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
#define reset_offset 0x334
#define pclk_offset 0x230
+#define PMUSSI_REG_EX(pmu_base, reg_addr) (((reg_addr) << 2) + (char *)pmu_base)
static int __init hi6220_sysconf(void)
{
- static void __iomem *base = NULL;
- struct device_node *node;
+ static void __iomem *base = NULL, *base1 = NULL;
+ struct device_node *node, *node1;
+ unsigned char ret;
- node = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl");
+ node = of_find_compatible_node(NULL, NULL, "hisilicon,hi6220-sysctrl");
if (!node)
return -ENOENT;
@@ -28,6 +31,16 @@ static int __init hi6220_sysconf(void)
return -ENOMEM;
}
+ node1 = of_find_compatible_node(NULL, NULL, "hisilicon,hi655x-pmic-driver");
+ if (!node1)
+ return -ENOENT;
+
+ base1 = of_iomap(node1, 0);
+ if (base1 == NULL) {
+ printk(KERN_ERR "hi6220: pmic reg iomap failed!\n");
+ return -ENOMEM;
+ }
+
/*Disable UART1 reset and set pclk*/
writel(BIT(5), base + reset_offset);
writel(BIT(5), base + pclk_offset);
@@ -47,7 +60,13 @@ static int __init hi6220_sysconf(void)
/*unreset microSD*/
writel(readl(base+0x304) | 0x6, base + 0x304);
+ /*enable clk for BT/WIFI*/
+ ret = *(volatile unsigned char*)PMUSSI_REG_EX(base1, 0x1c);
+ ret |= 0x40;
+ *(volatile unsigned char*)PMUSSI_REG_EX(base1, 0x1c) = ret;
+
iounmap(base);
+ iounmap(base1);
return 0;
}