diff options
Diffstat (limited to 'drivers/misc/hi6220-sysconfig.c')
-rw-r--r-- | drivers/misc/hi6220-sysconfig.c | 25 |
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; } |