]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: davinci: da8xx: Add CFGCHIP syscon platform device
authorDavid Lechner <david@lechnology.com>
Wed, 26 Oct 2016 03:06:48 +0000 (22:06 -0500)
committerSekhar Nori <nsekhar@ti.com>
Mon, 31 Oct 2016 11:28:21 +0000 (16:58 +0530)
The CFGCHIP registers are used by a number of devices, so use a syscon
device to share them. The first consumer of this will be the phy-da8xx-usb
driver.

Add the syscon device and register it.

Signed-off-by: David Lechner <david@lechnology.com>
[nsekhar@ti.com: minor commit message fixes]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/board-da830-evm.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-omapl138-hawk.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/da8xx.h

index df1f4091a8ae153c80c3efa4ed4e15c43cea5022..8b9d9053a98423e9b9aa2ae5ea858c245b766104 100644 (file)
@@ -589,6 +589,10 @@ static __init void da830_evm_init(void)
        struct davinci_soc_info *soc_info = &davinci_soc_info;
        int ret;
 
+       ret = da8xx_register_cfgchip();
+       if (ret)
+               pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
        ret = da830_register_gpio();
        if (ret)
                pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
index 8e4539f69fdc4d4722a8f3ff6493da599223cf32..ec5cb105e1d6157fa45388e549815052b793491d 100644 (file)
@@ -1345,6 +1345,10 @@ static __init void da850_evm_init(void)
 {
        int ret;
 
+       ret = da8xx_register_cfgchip();
+       if (ret)
+               pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
        ret = da850_register_gpio();
        if (ret)
                pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
index bc4e63fa9808932b451931d13906d69dbe2bd3ee..1a6d430742d4e6580d2d7f9f4605458b3d5b47e1 100644 (file)
@@ -514,6 +514,10 @@ static void __init mityomapl138_init(void)
 {
        int ret;
 
+       ret = da8xx_register_cfgchip();
+       if (ret)
+               pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
        /* for now, no special EDMA channels are reserved */
        ret = da850_register_edma(NULL);
        if (ret)
index e1efa1066c1e1cd4dd81266c645315a233171dba..a403ed9782c413706f4800b7f7496ff498b07699 100644 (file)
@@ -293,6 +293,10 @@ static __init void omapl138_hawk_init(void)
 {
        int ret;
 
+       ret = da8xx_register_cfgchip();
+       if (ret)
+               pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
        ret = da850_register_gpio();
        if (ret)
                pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
index dbdfe02b41744561c1a01a97e27332a3583ed590..c2457b3fdb5f0c2639d893379c1ed1b49d3b0296 100644 (file)
@@ -11,6 +11,7 @@
  * (at your option) any later version.
  */
 #include <linux/init.h>
+#include <linux/platform_data/syscon.h>
 #include <linux/platform_device.h>
 #include <linux/dma-contiguous.h>
 #include <linux/serial_8250.h>
@@ -1060,3 +1061,30 @@ int __init da850_register_sata(unsigned long refclkpn)
        return platform_device_register(&da850_sata_device);
 }
 #endif
+
+static struct syscon_platform_data da8xx_cfgchip_platform_data = {
+       .label  = "cfgchip",
+};
+
+static struct resource da8xx_cfgchip_resources[] = {
+       {
+               .start  = DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP0_REG,
+               .end    = DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP4_REG + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device da8xx_cfgchip_device = {
+       .name   = "syscon",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &da8xx_cfgchip_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(da8xx_cfgchip_resources),
+       .resource       = da8xx_cfgchip_resources,
+};
+
+int __init da8xx_register_cfgchip(void)
+{
+       return platform_device_register(&da8xx_cfgchip_device);
+}
index f9f9713aacdd605a35c7ca15dc350ded1380cef8..2f6fe2f0c733b95c45919ac91fb3c6ca97339fc9 100644 (file)
@@ -61,6 +61,7 @@ extern unsigned int da850_max_speed;
 #define DA8XX_CFGCHIP1_REG     0x180
 #define DA8XX_CFGCHIP2_REG     0x184
 #define DA8XX_CFGCHIP3_REG     0x188
+#define DA8XX_CFGCHIP4_REG     0x18c
 
 #define DA8XX_SYSCFG1_BASE     (IO_PHYS + 0x22C000)
 #define DA8XX_SYSCFG1_VIRT(x)  (da8xx_syscfg1_base + (x))
@@ -113,6 +114,7 @@ void da8xx_rproc_reserve_cma(void);
 int da8xx_register_rproc(void);
 int da850_register_gpio(void);
 int da830_register_gpio(void);
+int da8xx_register_cfgchip(void);
 
 extern struct platform_device da8xx_serial_device[];
 extern struct emac_platform_data da8xx_emac_pdata;