diff options
author | Guodong Xu <guodong.xu@linaro.org> | 2015-01-30 11:20:41 +0800 |
---|---|---|
committer | Fei Wang <w.f@huawei.com> | 2015-02-06 12:57:44 +0800 |
commit | dbf2be25b23d1a9da5b238cb8ee59ffc6e235073 (patch) | |
tree | 3ad3178432c9b6b4fede00b9628aca07d64b7e2f | |
parent | 9cc9f9c66f5574616c42d2d2ccd4a39ee76215d0 (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>
-rw-r--r-- | drivers/misc/hi6220-sysconfig.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/misc/hi6220-sysconfig.c b/drivers/misc/hi6220-sysconfig.c index 103691850ca8..9ea3777b8c8d 100644 --- a/drivers/misc/hi6220-sysconfig.c +++ b/drivers/misc/hi6220-sysconfig.c @@ -12,11 +12,13 @@ #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"); if (!node) @@ -28,6 +30,16 @@ static int __init hi6220_sysconf(void) return -ENOMEM; } + node1 = of_find_compatible_node(NULL, NULL, "hisilicon,hi6552-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 +59,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; } |