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

Commit 19955c3d authored by Manjunathappa, Prakash's avatar Manjunathappa, Prakash Committed by Sekhar Nori
Browse files

ARM: davinci: uart: move to devid based clk_get



For modules having single clock, clk_get should be done with dev_id.
But current davinci implementation handles multiple instances
of the UART devices with single platform_device_register. Hence clk_get
is based on con_id rather than dev_id, this is not correct. Do
platform_device_register for each instance and clk_get on dev_id.

Signed-off-by: default avatarManjunathappa, Prakash <prakash.pm@ti.com>
[nsekhar@ti.com: actually stop using con_id in clk_get(), squash the
		 patch adding OF aux data into this one]
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 3b2f64d0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -395,9 +395,9 @@ static struct clk_lookup da830_clks[] = {
	CLK(NULL,		"tptc0",	&tptc0_clk),
	CLK(NULL,		"tptc1",	&tptc1_clk),
	CLK("da830-mmc.0",	NULL,		&mmcsd_clk),
	CLK(NULL,		"uart0",	&uart0_clk),
	CLK(NULL,		"uart1",	&uart1_clk),
	CLK(NULL,		"uart2",	&uart2_clk),
	CLK("serial8250.0",	NULL,		&uart0_clk),
	CLK("serial8250.1",	NULL,		&uart1_clk),
	CLK("serial8250.2",	NULL,		&uart2_clk),
	CLK("spi_davinci.0",	NULL,		&spi0_clk),
	CLK("spi_davinci.1",	NULL,		&spi1_clk),
	CLK(NULL,		"ecap0",	&ecap0_clk),
@@ -1199,7 +1199,7 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
	.gpio_base		= DA8XX_GPIO_BASE,
	.gpio_num		= 128,
	.gpio_irq		= IRQ_DA8XX_GPIO0,
	.serial_dev		= &da8xx_serial_device,
	.serial_dev		= da8xx_serial_device,
	.emac_pdata		= &da8xx_emac_pdata,
};

+4 −4
Original line number Diff line number Diff line
@@ -451,9 +451,9 @@ static struct clk_lookup da850_clks[] = {
	CLK(NULL,		"tpcc1",	&tpcc1_clk),
	CLK(NULL,		"tptc2",	&tptc2_clk),
	CLK("pruss_uio",	"pruss",	&pruss_clk),
	CLK(NULL,		"uart0",	&uart0_clk),
	CLK(NULL,		"uart1",	&uart1_clk),
	CLK(NULL,		"uart2",	&uart2_clk),
	CLK("serial8250.0",	NULL,		&uart0_clk),
	CLK("serial8250.1",	NULL,		&uart1_clk),
	CLK("serial8250.2",	NULL,		&uart2_clk),
	CLK(NULL,		"aintc",	&aintc_clk),
	CLK(NULL,		"gpio",		&gpio_clk),
	CLK("i2c_davinci.2",	NULL,		&i2c1_clk),
@@ -1301,7 +1301,7 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
	.gpio_base		= DA8XX_GPIO_BASE,
	.gpio_num		= 144,
	.gpio_irq		= IRQ_DA8XX_GPIO0,
	.serial_dev		= &da8xx_serial_device,
	.serial_dev		= da8xx_serial_device,
	.emac_pdata		= &da8xx_emac_pdata,
	.sram_dma		= DA8XX_SHARED_RAM_BASE,
	.sram_len		= SZ_128K,
+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
	OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL),
	OF_DEV_AUXDATA("ns16550a", 0x01c42000, "serial8250.0", NULL),
	OF_DEV_AUXDATA("ns16550a", 0x01d0c000, "serial8250.1", NULL),
	OF_DEV_AUXDATA("ns16550a", 0x01d0d000, "serial8250.2", NULL),
	{}
};

+35 −7
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@
void __iomem *da8xx_syscfg0_base;
void __iomem *da8xx_syscfg1_base;

static struct plat_serial8250_port da8xx_serial_pdata[] = {
static struct plat_serial8250_port da8xx_serial0_pdata[] = {
	{
		.mapbase	= DA8XX_UART0_BASE,
		.irq		= IRQ_DA8XX_UARTINT0,
@@ -77,6 +77,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
		.iotype		= UPIO_MEM,
		.regshift	= 2,
	},
	{
		.flags	= 0,
	}
};
static struct plat_serial8250_port da8xx_serial1_pdata[] = {
	{
		.mapbase	= DA8XX_UART1_BASE,
		.irq		= IRQ_DA8XX_UARTINT1,
@@ -85,6 +90,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
		.iotype		= UPIO_MEM,
		.regshift	= 2,
	},
	{
		.flags	= 0,
	}
};
static struct plat_serial8250_port da8xx_serial2_pdata[] = {
	{
		.mapbase	= DA8XX_UART2_BASE,
		.irq		= IRQ_DA8XX_UARTINT2,
@@ -95,15 +105,33 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
	},
	{
		.flags	= 0,
	},
	}
};

struct platform_device da8xx_serial_device = {
struct platform_device da8xx_serial_device[] = {
	{
		.name	= "serial8250",
		.id	= PLAT8250_DEV_PLATFORM,
		.dev	= {
		.platform_data	= da8xx_serial_pdata,
			.platform_data	= da8xx_serial0_pdata,
		}
	},
	{
		.name	= "serial8250",
		.id	= PLAT8250_DEV_PLATFORM1,
		.dev	= {
			.platform_data	= da8xx_serial1_pdata,
		}
	},
	{
		.name	= "serial8250",
		.id	= PLAT8250_DEV_PLATFORM2,
		.dev	= {
			.platform_data	= da8xx_serial2_pdata,
		}
	},
	{
	}
};

static s8 da8xx_queue_tc_mapping[][2] = {
+31 −6
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static struct platform_device edma_device = {
	.dev.platform_data = tnetv107x_edma_info,
};

static struct plat_serial8250_port serial_data[] = {
static struct plat_serial8250_port serial0_platform_data[] = {
	{
		.mapbase	= TNETV107X_UART0_BASE,
		.irq		= IRQ_TNETV107X_UART0,
@@ -136,6 +136,11 @@ static struct plat_serial8250_port serial_data[] = {
		.iotype		= UPIO_MEM32,
		.regshift	= 2,
	},
	{
		.flags	= 0,
	}
};
static struct plat_serial8250_port serial1_platform_data[] = {
	{
		.mapbase	= TNETV107X_UART1_BASE,
		.irq		= IRQ_TNETV107X_UART1,
@@ -145,6 +150,11 @@ static struct plat_serial8250_port serial_data[] = {
		.iotype		= UPIO_MEM32,
		.regshift	= 2,
	},
	{
		.flags	= 0,
	}
};
static struct plat_serial8250_port serial2_platform_data[] = {
	{
		.mapbase	= TNETV107X_UART2_BASE,
		.irq		= IRQ_TNETV107X_UART2,
@@ -156,13 +166,28 @@ static struct plat_serial8250_port serial_data[] = {
	},
	{
		.flags	= 0,
	},
	}
};

struct platform_device tnetv107x_serial_device = {

struct platform_device tnetv107x_serial_device[] = {
	{
		.name			= "serial8250",
		.id			= PLAT8250_DEV_PLATFORM,
	.dev.platform_data	= serial_data,
		.dev.platform_data	= serial0_platform_data,
	},
	{
		.name			= "serial8250",
		.id			= PLAT8250_DEV_PLATFORM1,
		.dev.platform_data	= serial1_platform_data,
	},
	{
		.name			= "serial8250",
		.id			= PLAT8250_DEV_PLATFORM2,
		.dev.platform_data	= serial2_platform_data,
	},
	{
	}
};

static struct resource mmc0_resources[] = {
Loading