Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fcd5411 authored by David Lechner's avatar David Lechner Committed by Sekhar Nori
Browse files

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: default avatarDavid Lechner <david@lechnology.com>
[nsekhar@ti.com: minor commit message fixes]
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 766763db
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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)
+4 −0
Original line number Diff line number Diff line
@@ -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);
+28 −0
Original line number Diff line number Diff line
@@ -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);
}
Loading