diff options
author | David Lechner <david@lechnology.com> | 2016-10-26 05:06:48 +0200 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2016-10-31 12:28:21 +0100 |
commit | 0fcd54112a9f7902b05741ab493173ee71210458 (patch) | |
tree | e97b36547d0535e371ffaaa9eadaf760004c2d9b /arch/arm/mach-davinci/devices-da8xx.c | |
parent | ARM: davinci: da8xx: Remove duplicated defines (diff) | |
download | linux-0fcd54112a9f7902b05741ab493173ee71210458.tar.xz linux-0fcd54112a9f7902b05741ab493173ee71210458.zip |
ARM: davinci: da8xx: Add CFGCHIP syscon platform device
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>
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index dbdfe02b4174..c2457b3fdb5f 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -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); +} |