diff options
author | Guodong Xu <guodong.xu@linaro.org> | 2015-01-30 11:20:41 +0800 |
---|---|---|
committer | Guodong Xu <guodong.xu@linaro.org> | 2015-11-10 20:59:56 +0800 |
commit | 89de2b2d23e5f0c470e187aecce8340a53d84b41 (patch) | |
tree | 5dd5061bf8aa04b9eecb1c01e3621bf5cebc7e8d | |
parent | 5b4b080141dafc05445f64815c5422f92e3743a6 (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 75a9cf0bc016..12ee4e44787b 100644 --- a/drivers/misc/hi6220-sysconfig.c +++ b/drivers/misc/hi6220-sysconfig.c @@ -13,11 +13,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) @@ -29,6 +31,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); @@ -48,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; } |