All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-04-13 19:47 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, linux-serial, Jean-Christophe PLAGNIOL-VILLARD,
	Nicolas Ferre, Patrice Vilchez, Hans-Christian Egtvedt, Alan Cox,
	Greg Kroah-Hartman

specify the port num via platform_data this will allow to match the clock
with the plaform_dev staticly

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/arm/mach-at91/at572d940hf_devices.c    |    4 +++-
 arch/arm/mach-at91/at91cap9_devices.c       |    4 +++-
 arch/arm/mach-at91/at91rm9200_devices.c     |    4 +++-
 arch/arm/mach-at91/at91sam9260_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9261_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9263_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9g45_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9rl_devices.c     |    4 +++-
 arch/arm/mach-at91/include/mach/board.h     |    1 +
 arch/avr32/mach-at32ap/at32ap700x.c         |    4 +++-
 arch/avr32/mach-at32ap/include/mach/board.h |    1 +
 drivers/tty/serial/atmel_serial.c           |    2 +-
 12 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c
index 6e1b9a3..57ed4b7 100644
--- a/arch/arm/mach-at91/at572d940hf_devices.c
+++ b/arch/arm/mach-at91/at572d940hf_devices.c
@@ -822,6 +822,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -847,7 +848,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index e887632..ad41039 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -1199,6 +1199,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1224,7 +1225,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 5f873d5..f65f9d3 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -1109,6 +1109,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1139,7 +1140,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index e172b46..bb74c2a 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -1139,6 +1139,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1179,7 +1180,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 59fc483..8792f9b 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -989,6 +989,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1014,7 +1015,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 416613c..1fc6878 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -1370,6 +1370,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1395,7 +1396,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 0867343..fd031ce 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1527,6 +1527,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1557,7 +1558,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 53aaa94..2d8d519 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -1141,6 +1141,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1171,7 +1172,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index d970420..ef10f32 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -130,6 +130,7 @@ extern void __init at91_set_serial_console(unsigned portnr);
 extern struct platform_device *atmel_default_console_device;
 
 struct atmel_uart_data {
+	int			num;		/* port num */
 	short			use_dma_tx;	/* use transmit DMA? */
 	short			use_dma_rx;	/* use receive DMA? */
 	void __iomem		*regs;		/* virt. base address, if any */
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index bfc9d07..aa677e2 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;
 	at32_usarts[line] = pdev;
 }
 
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index 3d79356..dd61a24 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -34,6 +34,7 @@ extern struct platform_device *atmel_default_console_device;
 #define	ATMEL_USART_CLK		0x04
 
 struct atmel_uart_data {
+	int		num;		/* port num */
 	short		use_dma_tx;	/* use transmit DMA? */
 	short		use_dma_rx;	/* use receive DMA? */
 	void __iomem	*regs;		/* virtual base address, if any */
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 2dc8a66..57e294c 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1423,7 +1423,7 @@ static int __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
 	port->flags		= UPF_BOOT_AUTOCONF;
 	port->ops		= &atmel_pops;
 	port->fifosize		= 1;
-	port->line		= pdev->id;
+	port->line		= data->num;
 	port->dev		= &pdev->dev;
 	port->mapbase	= pdev->resource[0].start;
 	port->irq	= pdev->resource[1].start;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-04-13 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

specify the port num via platform_data this will allow to match the clock
with the plaform_dev staticly

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/arm/mach-at91/at572d940hf_devices.c    |    4 +++-
 arch/arm/mach-at91/at91cap9_devices.c       |    4 +++-
 arch/arm/mach-at91/at91rm9200_devices.c     |    4 +++-
 arch/arm/mach-at91/at91sam9260_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9261_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9263_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9g45_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9rl_devices.c     |    4 +++-
 arch/arm/mach-at91/include/mach/board.h     |    1 +
 arch/avr32/mach-at32ap/at32ap700x.c         |    4 +++-
 arch/avr32/mach-at32ap/include/mach/board.h |    1 +
 drivers/tty/serial/atmel_serial.c           |    2 +-
 12 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c
index 6e1b9a3..57ed4b7 100644
--- a/arch/arm/mach-at91/at572d940hf_devices.c
+++ b/arch/arm/mach-at91/at572d940hf_devices.c
@@ -822,6 +822,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -847,7 +848,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index e887632..ad41039 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -1199,6 +1199,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1224,7 +1225,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 5f873d5..f65f9d3 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -1109,6 +1109,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1139,7 +1140,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index e172b46..bb74c2a 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -1139,6 +1139,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1179,7 +1180,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 59fc483..8792f9b 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -989,6 +989,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1014,7 +1015,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 416613c..1fc6878 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -1370,6 +1370,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1395,7 +1396,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 0867343..fd031ce 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1527,6 +1527,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1557,7 +1558,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 53aaa94..2d8d519 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -1141,6 +1141,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1171,7 +1172,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index d970420..ef10f32 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -130,6 +130,7 @@ extern void __init at91_set_serial_console(unsigned portnr);
 extern struct platform_device *atmel_default_console_device;
 
 struct atmel_uart_data {
+	int			num;		/* port num */
 	short			use_dma_tx;	/* use transmit DMA? */
 	short			use_dma_rx;	/* use receive DMA? */
 	void __iomem		*regs;		/* virt. base address, if any */
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index bfc9d07..aa677e2 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;
 	at32_usarts[line] = pdev;
 }
 
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index 3d79356..dd61a24 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -34,6 +34,7 @@ extern struct platform_device *atmel_default_console_device;
 #define	ATMEL_USART_CLK		0x04
 
 struct atmel_uart_data {
+	int		num;		/* port num */
 	short		use_dma_tx;	/* use transmit DMA? */
 	short		use_dma_rx;	/* use receive DMA? */
 	void __iomem	*regs;		/* virtual base address, if any */
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 2dc8a66..57e294c 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1423,7 +1423,7 @@ static int __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
 	port->flags		= UPF_BOOT_AUTOCONF;
 	port->ops		= &atmel_pops;
 	port->fifosize		= 1;
-	port->line		= pdev->id;
+	port->line		= data->num;
 	port->dev		= &pdev->dev;
 	port->mapbase	= pdev->resource[0].start;
 	port->irq	= pdev->resource[1].start;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-04-13 21:58   ` Alan Cox
  -1 siblings, 0 replies; 29+ messages in thread
From: Alan Cox @ 2011-04-13 21:58 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Hans-Christian Egtvedt, Greg Kroah-Hartman

On Wed, 13 Apr 2011 21:47:18 +0200
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:

> specify the port num via platform_data this will allow to match the
> clock with the plaform_dev staticly
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

Ack for the serial side, its really an arch patch though as far as I
can see..

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-04-13 21:58   ` Alan Cox
  0 siblings, 0 replies; 29+ messages in thread
From: Alan Cox @ 2011-04-13 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 13 Apr 2011 21:47:18 +0200
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:

> specify the port num via platform_data this will allow to match the
> clock with the plaform_dev staticly
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

Ack for the serial side, its really an arch patch though as far as I
can see..

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-04-13 21:58   ` Alan Cox
@ 2011-04-15 19:02     ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-04-15 19:02 UTC (permalink / raw)
  To: Alan Cox
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Hans-Christian Egtvedt, Greg Kroah-Hartman

On 22:58 Wed 13 Apr     , Alan Cox wrote:
> On Wed, 13 Apr 2011 21:47:18 +0200
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> 
> > specify the port num via platform_data this will allow to match the
> > clock with the plaform_dev staticly
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD
> > <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> > Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> > Cc: Alan Cox <alan@linux.intel.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> Ack for the serial side, its really an arch patch though as far as I
> can see..
applied in at91-l2

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-04-15 19:02     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-04-15 19:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 22:58 Wed 13 Apr     , Alan Cox wrote:
> On Wed, 13 Apr 2011 21:47:18 +0200
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> 
> > specify the port num via platform_data this will allow to match the
> > clock with the plaform_dev staticly
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD
> > <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> > Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> > Cc: Alan Cox <alan@linux.intel.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> Ack for the serial side, its really an arch patch though as far as I
> can see..
applied in at91-l2

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-06-08  8:45   ` Hans-Christian Egtvedt
  -1 siblings, 0 replies; 29+ messages in thread
From: Hans-Christian Egtvedt @ 2011-06-08  8:45 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Alan Cox, Greg Kroah-Hartman

On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> specify the port num via platform_data this will allow to match the clock
> with the plaform_dev staticly

Sure this works as intended, now the platform device id is off, and at
least for my 3.0 testing it is no longer able to open the console,
unless I explicit set the id field again.

Example on NGW100 mkII I use USART instance 1 as serial console, if not
setting the platform device id to 0 (re-mapping), then I get a warning
about unable to open console.

Is you clock optimization an additional patch?

<snipp AT91 changes)

> diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> index bfc9d07..aa677e2 100644
> --- a/arch/avr32/mach-at32ap/at32ap700x.c
> +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
>  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
>  {
>  	struct platform_device *pdev;
> +	struct atmel_uart_data *pdata;
>  
>  	switch (hw_id) {
>  	case 0:
> @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
>  		data->regs = (void __iomem *)pdev->resource[0].start;
>  	}
>  
> -	pdev->id = line;

AVR32 needs this to be present to work independent of which USART
peripheral the user chooses to use for console.

> +	pdata = pdev->dev.platform_data;
> +	pdata->num = portnr;
>  	at32_usarts[line] = pdev;
>  }
>  

<snipp>

-- 
Hans-Christian Egtvedt


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-08  8:45   ` Hans-Christian Egtvedt
  0 siblings, 0 replies; 29+ messages in thread
From: Hans-Christian Egtvedt @ 2011-06-08  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> specify the port num via platform_data this will allow to match the clock
> with the plaform_dev staticly

Sure this works as intended, now the platform device id is off, and at
least for my 3.0 testing it is no longer able to open the console,
unless I explicit set the id field again.

Example on NGW100 mkII I use USART instance 1 as serial console, if not
setting the platform device id to 0 (re-mapping), then I get a warning
about unable to open console.

Is you clock optimization an additional patch?

<snipp AT91 changes)

> diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> index bfc9d07..aa677e2 100644
> --- a/arch/avr32/mach-at32ap/at32ap700x.c
> +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
>  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
>  {
>  	struct platform_device *pdev;
> +	struct atmel_uart_data *pdata;
>  
>  	switch (hw_id) {
>  	case 0:
> @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
>  		data->regs = (void __iomem *)pdev->resource[0].start;
>  	}
>  
> -	pdev->id = line;

AVR32 needs this to be present to work independent of which USART
peripheral the user chooses to use for console.

> +	pdata = pdev->dev.platform_data;
> +	pdata->num = portnr;
>  	at32_usarts[line] = pdev;
>  }
>  

<snipp>

-- 
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-06-08  8:45   ` Hans-Christian Egtvedt
  (?)
@ 2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-08 13:47 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Alan Cox, Greg Kroah-Hartman

On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > specify the port num via platform_data this will allow to match the clock
> > with the plaform_dev staticly
> 
> Sure this works as intended, now the platform device id is off, and at
> least for my 3.0 testing it is no longer able to open the console,
> unless I explicit set the id field again.
> 
> Example on NGW100 mkII I use USART instance 1 as serial console, if not
> setting the platform device id to 0 (re-mapping), then I get a warning
> about unable to open console.
> 
> Is you clock optimization an additional patch?
no but we can also switch the avr32 to clkdev
> 
> <snipp AT91 changes)
> 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > index bfc9d07..aa677e2 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  {
> >  	struct platform_device *pdev;
> > +	struct atmel_uart_data *pdata;
> >  
> >  	switch (hw_id) {
> >  	case 0:
> > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  		data->regs = (void __iomem *)pdev->resource[0].start;
> >  	}
> >  
> > -	pdev->id = line;
> 
> AVR32 needs this to be present to work independent of which USART
> peripheral the user chooses to use for console.
> 
> > +	pdata = pdev->dev.platform_data;
> > +	pdata->num = portnr;
here supposed to be
	pdata->num = line;

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-08 13:47 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: Nicolas Ferre, Greg Kroah-Hartman, Patrice Vilchez, linux-kernel,
	linux-serial, linux-arm-kernel, Alan Cox

On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > specify the port num via platform_data this will allow to match the clock
> > with the plaform_dev staticly
> 
> Sure this works as intended, now the platform device id is off, and at
> least for my 3.0 testing it is no longer able to open the console,
> unless I explicit set the id field again.
> 
> Example on NGW100 mkII I use USART instance 1 as serial console, if not
> setting the platform device id to 0 (re-mapping), then I get a warning
> about unable to open console.
> 
> Is you clock optimization an additional patch?
no but we can also switch the avr32 to clkdev
> 
> <snipp AT91 changes)
> 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > index bfc9d07..aa677e2 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  {
> >  	struct platform_device *pdev;
> > +	struct atmel_uart_data *pdata;
> >  
> >  	switch (hw_id) {
> >  	case 0:
> > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  		data->regs = (void __iomem *)pdev->resource[0].start;
> >  	}
> >  
> > -	pdev->id = line;
> 
> AVR32 needs this to be present to work independent of which USART
> peripheral the user chooses to use for console.
> 
> > +	pdata = pdev->dev.platform_data;
> > +	pdata->num = portnr;
here supposed to be
	pdata->num = line;

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-08 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > specify the port num via platform_data this will allow to match the clock
> > with the plaform_dev staticly
> 
> Sure this works as intended, now the platform device id is off, and at
> least for my 3.0 testing it is no longer able to open the console,
> unless I explicit set the id field again.
> 
> Example on NGW100 mkII I use USART instance 1 as serial console, if not
> setting the platform device id to 0 (re-mapping), then I get a warning
> about unable to open console.
> 
> Is you clock optimization an additional patch?
no but we can also switch the avr32 to clkdev
> 
> <snipp AT91 changes)
> 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > index bfc9d07..aa677e2 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  {
> >  	struct platform_device *pdev;
> > +	struct atmel_uart_data *pdata;
> >  
> >  	switch (hw_id) {
> >  	case 0:
> > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> >  		data->regs = (void __iomem *)pdev->resource[0].start;
> >  	}
> >  
> > -	pdev->id = line;
> 
> AVR32 needs this to be present to work independent of which USART
> peripheral the user chooses to use for console.
> 
> > +	pdata = pdev->dev.platform_data;
> > +	pdata->num = portnr;
here supposed to be
	pdata->num = line;

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-06-08 14:02       ` Hans-Christian Egtvedt
  -1 siblings, 0 replies; 29+ messages in thread
From: Hans-Christian Egtvedt @ 2011-06-08 14:02 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Alan Cox, Greg Kroah-Hartman

On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > wrote:

<snipp>

> > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > index bfc9d07..aa677e2 100644
> > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > >  {
> > >  	struct platform_device *pdev;
> > > +	struct atmel_uart_data *pdata;
> > >  
> > >  	switch (hw_id) {
> > >  	case 0:
> > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > >  	}
> > >  
> > > -	pdev->id = line;
> > 
> > AVR32 needs this to be present to work independent of which USART
> > peripheral the user chooses to use for console.
> > 
> > > +	pdata = pdev->dev.platform_data;
> > > +	pdata->num = portnr;
> here supposed to be
> 	pdata->num = line;

I know, but that doesn't fix the problem about not able to find a
console, the platform data id must also be 0 (if console is on ttyS0)
AFAICT.

-- 
Hans-Christian Egtvedt


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-08 14:02       ` Hans-Christian Egtvedt
  0 siblings, 0 replies; 29+ messages in thread
From: Hans-Christian Egtvedt @ 2011-06-08 14:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > wrote:

<snipp>

> > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > index bfc9d07..aa677e2 100644
> > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > >  {
> > >  	struct platform_device *pdev;
> > > +	struct atmel_uart_data *pdata;
> > >  
> > >  	switch (hw_id) {
> > >  	case 0:
> > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > >  	}
> > >  
> > > -	pdev->id = line;
> > 
> > AVR32 needs this to be present to work independent of which USART
> > peripheral the user chooses to use for console.
> > 
> > > +	pdata = pdev->dev.platform_data;
> > > +	pdata->num = portnr;
> here supposed to be
> 	pdata->num = line;

I know, but that doesn't fix the problem about not able to find a
console, the platform data id must also be 0 (if console is on ttyS0)
AFAICT.

-- 
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-06-08 14:02       ` Hans-Christian Egtvedt
  (?)
@ 2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-17  3:06 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Alan Cox, Greg Kroah-Hartman

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
will test this weekend on avr32

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-17  3:06 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: Nicolas Ferre, Greg Kroah-Hartman, Patrice Vilchez, linux-kernel,
	linux-serial, linux-arm-kernel, Alan Cox

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
will test this weekend on avr32

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-17  3:06 UTC (permalink / raw)
  To: linux-arm-kernel

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
will test this weekend on avr32

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
  2011-06-08 14:02       ` Hans-Christian Egtvedt
  (?)
@ 2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-21 14:28 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Nicolas Ferre,
	Patrice Vilchez, Alan Cox, Greg Kroah-Hartman

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
I found the issue
on at91 we always use the dbgu as console so I did not see it

please try to repling patch

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-21 14:28 UTC (permalink / raw)
  To: Hans-Christian Egtvedt
  Cc: Nicolas Ferre, Greg Kroah-Hartman, Patrice Vilchez, linux-kernel,
	linux-serial, linux-arm-kernel, Alan Cox

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
I found the issue
on at91 we always use the dbgu as console so I did not see it

please try to repling patch

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: keep the platform_device unchanged
@ 2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-21 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 16:02 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> On Wed, 2011-06-08 at 15:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> wrote:
> > On 10:45 Wed 08 Jun     , Hans-Christian Egtvedt wrote:
> > > On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD
> > > wrote:
> 
> <snipp>
> 
> > > > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > index bfc9d07..aa677e2 100644
> > > > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > > > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > > > @@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
> > > >  void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  {
> > > >  	struct platform_device *pdev;
> > > > +	struct atmel_uart_data *pdata;
> > > >  
> > > >  	switch (hw_id) {
> > > >  	case 0:
> > > > @@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
> > > >  		data->regs = (void __iomem *)pdev->resource[0].start;
> > > >  	}
> > > >  
> > > > -	pdev->id = line;
> > > 
> > > AVR32 needs this to be present to work independent of which USART
> > > peripheral the user chooses to use for console.
> > > 
> > > > +	pdata = pdev->dev.platform_data;
> > > > +	pdata->num = portnr;
> > here supposed to be
> > 	pdata->num = line;
> 
> I know, but that doesn't fix the problem about not able to find a
> console, the platform data id must also be 0 (if console is on ttyS0)
> AFAICT.
I found the issue
on at91 we always use the dbgu as console so I did not see it

please try to repling patch

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix internal port num
  2011-06-08 14:02       ` Hans-Christian Egtvedt
@ 2011-06-21 14:31         ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-21 14:31 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Nicolas Ferre, Jean-Christophe PLAGNIOL-VILLARD,
	Hans-Christian Egtvedt, linux-serial, Alan Cox

the atmel_ports is link to the console number and not the device id

this was not detected on at91 as we always register the dbgu on the console
as ttyS0

tested on at91sam9263 by setting the dbgu as ttyS1 and use as console

diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 70e5646..9b8a14f 100644
- a/arch/arm/mach-at91/board-sam9263ek.c
+ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -58,14 +58,14 @@ static void __init ek_init_early(void)
        /* Initialize processor: 16.367 MHz crystal */
        at91_initialize(16367660);

-       /* DBGU on ttyS0. (Rx & Tx only) */
-       at91_register_uart(0, 0, 0);
+       /* DBGU on ttyS1. (Rx & Tx only) */
+       at91_register_uart(0, 1, 0);

-       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
-       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+       /* USART0 on ttyS0. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 0, ATMEL_UART_CTS | ATMEL_UART_RTS);

-       /* set serial console to ttyS0 (ie, DBGU) */
-       at91_set_serial_console(0);
+       /* set serial console to ttyS1 (ie, DBGU) */
+       at91_set_serial_console(1);
 }

 /*

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
 drivers/tty/serial/atmel_serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6d5d6e6..af9b781 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1709,12 +1709,13 @@ static int atmel_serial_resume(struct platform_device *pdev)
 static int __devinit atmel_serial_probe(struct platform_device *pdev)
 {
 	struct atmel_uart_port *port;
+	struct atmel_uart_data *pdata = pdev->dev.platform_data;
 	void *data;
 	int ret;
 
 	BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
-	port = &atmel_ports[pdev->id];
+	port = &atmel_ports[pdata->num];
 	port->backup_imr = 0;
 
 	atmel_init_port(port, pdev);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix internal port num
@ 2011-06-21 14:31         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-06-21 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

the atmel_ports is link to the console number and not the device id

this was not detected on at91 as we always register the dbgu on the console
as ttyS0

tested on at91sam9263 by setting the dbgu as ttyS1 and use as console

diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 70e5646..9b8a14f 100644
- a/arch/arm/mach-at91/board-sam9263ek.c
+ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -58,14 +58,14 @@ static void __init ek_init_early(void)
        /* Initialize processor: 16.367 MHz crystal */
        at91_initialize(16367660);

-       /* DBGU on ttyS0. (Rx & Tx only) */
-       at91_register_uart(0, 0, 0);
+       /* DBGU on ttyS1. (Rx & Tx only) */
+       at91_register_uart(0, 1, 0);

-       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
-       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+       /* USART0 on ttyS0. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 0, ATMEL_UART_CTS | ATMEL_UART_RTS);

-       /* set serial console to ttyS0 (ie, DBGU) */
-       at91_set_serial_console(0);
+       /* set serial console to ttyS1 (ie, DBGU) */
+       at91_set_serial_console(1);
 }

 /*

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
 drivers/tty/serial/atmel_serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6d5d6e6..af9b781 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1709,12 +1709,13 @@ static int atmel_serial_resume(struct platform_device *pdev)
 static int __devinit atmel_serial_probe(struct platform_device *pdev)
 {
 	struct atmel_uart_port *port;
+	struct atmel_uart_data *pdata = pdev->dev.platform_data;
 	void *data;
 	int ret;
 
 	BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
-	port = &atmel_ports[pdev->id];
+	port = &atmel_ports[pdata->num];
 	port->backup_imr = 0;
 
 	atmel_init_port(port, pdev);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
  2011-06-21 14:31         ` Jean-Christophe PLAGNIOL-VILLARD
  (?)
@ 2011-08-08 15:10         ` Nikolaus Voss
  2011-08-09 11:41           ` Sergei Shtylyov
  -1 siblings, 1 reply; 29+ messages in thread
From: Nikolaus Voss @ 2011-08-08 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

Signed-off-by: Nikolaus Voss <n.voss@weinmannn.de>
 
---
 drivers/tty/serial/atmel_serial.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c \
	b/drivers/tty/serial/atmel_serial.c
index af9b781..29c7857 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,10 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
  2011-08-08 15:10         ` [PATCH] atmel_serial: fix atmel_default_console_device Nikolaus Voss
@ 2011-08-09 11:41           ` Sergei Shtylyov
  2011-08-09 14:16               ` Voss, Nikolaus
  2011-08-09 14:17             ` Voss, Nikolaus
  0 siblings, 2 replies; 29+ messages in thread
From: Sergei Shtylyov @ 2011-08-09 11:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 08-08-2011 19:10, Nikolaus Voss wrote:

> reflect new static uart platform ids introduced by patch
> http://article.gmane.org/gmane.linux.kernel/1126105

> Signed-off-by: Nikolaus Voss<n.voss@weinmannn.de>

> ---
>   drivers/tty/serial/atmel_serial.c |    7 ++++---
>   1 files changed, 4 insertions(+), 3 deletions(-)

> diff --git a/drivers/tty/serial/atmel_serial.c \
> 	b/drivers/tty/serial/atmel_serial.c
> index af9b781..29c7857 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1609,9 +1609,10 @@ static struct console atmel_console = {
>   static int __init atmel_console_init(void)
>   {
>   	if (atmel_default_console_device) {
> -		add_preferred_console(ATMEL_DEVICENAME,
> -				      atmel_default_console_device->id, NULL);
> -		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
> +		struct atmel_uart_data *pdata =
> +			atmel_default_console_device->dev.platform_data;

    Would be good to have empty line after the declaration...

> +		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
> +		atmel_init_port(&atmel_ports[pdata->num],
>   				atmel_default_console_device);
>   		register_console(&atmel_console);
>   	}

WBR, Sergei

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
  2011-08-09 11:41           ` Sergei Shtylyov
@ 2011-08-09 14:16               ` Voss, Nikolaus
  2011-08-09 14:17             ` Voss, Nikolaus
  1 sibling, 0 replies; 29+ messages in thread
From: Voss, Nikolaus @ 2011-08-09 14:16 UTC (permalink / raw)
  To: 'Jean-Christophe PLAGNIOL-VILLARD', 'Sergei Shtylyov'
  Cc: 'Nicolas Ferre', 'Greg Kroah-Hartman',
	'linux-arm-kernel@lists.infradead.org',
	'Linux Kernel'

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105
---
 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index af9b781..b922f5d 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
@ 2011-08-09 14:16               ` Voss, Nikolaus
  0 siblings, 0 replies; 29+ messages in thread
From: Voss, Nikolaus @ 2011-08-09 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105
---
 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index af9b781..b922f5d 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
  2011-08-09 11:41           ` Sergei Shtylyov
  2011-08-09 14:16               ` Voss, Nikolaus
@ 2011-08-09 14:17             ` Voss, Nikolaus
  2011-08-10 11:13               ` Sergei Shtylyov
  1 sibling, 1 reply; 29+ messages in thread
From: Voss, Nikolaus @ 2011-08-09 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Thanks, patch resent.

Niko

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov at mvista.com]
> Sent: Tuesday, August 09, 2011 1:42 PM
> To: Voss, Nikolaus
> Cc: linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH] atmel_serial: fix atmel_default_console_device
> 
> Hello.
> 
> On 08-08-2011 19:10, Nikolaus Voss wrote:
> 
> > reflect new static uart platform ids introduced by patch
> > http://article.gmane.org/gmane.linux.kernel/1126105
> 
> > Signed-off-by: Nikolaus Voss<n.voss@weinmannn.de>
> 
> > ---
> >   drivers/tty/serial/atmel_serial.c |    7 ++++---
> >   1 files changed, 4 insertions(+), 3 deletions(-)
> 
> > diff --git a/drivers/tty/serial/atmel_serial.c \
> > 	b/drivers/tty/serial/atmel_serial.c
> > index af9b781..29c7857 100644
> > --- a/drivers/tty/serial/atmel_serial.c
> > +++ b/drivers/tty/serial/atmel_serial.c
> > @@ -1609,9 +1609,10 @@ static struct console atmel_console = {
> >   static int __init atmel_console_init(void)
> >   {
> >   	if (atmel_default_console_device) {
> > -		add_preferred_console(ATMEL_DEVICENAME,
> > -				      atmel_default_console_device->id, NULL);
> > -		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
> > +		struct atmel_uart_data *pdata =
> > +			atmel_default_console_device->dev.platform_data;
> 
>     Would be good to have empty line after the declaration...
> 
> > +		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
> > +		atmel_init_port(&atmel_ports[pdata->num],
> >   				atmel_default_console_device);
> >   		register_console(&atmel_console);
> >   	}
> 
> WBR, Sergei

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] atmel_serial: fix atmel_default_console_device
  2011-08-09 14:17             ` Voss, Nikolaus
@ 2011-08-10 11:13               ` Sergei Shtylyov
  2011-08-10 12:02                   ` Voss, Nikolaus
  0 siblings, 1 reply; 29+ messages in thread
From: Sergei Shtylyov @ 2011-08-10 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 09-08-2011 18:17, Voss, Nikolaus wrote:

> Thanks, patch resent.

    You then should have marked the new version in the subject (like "[PATCH 
v2]"), and described the changes from the previous version under the --- tear 
line...

> Niko

WBR, Sergei

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2] atmel_serial: fix atmel_default_console_device
  2011-08-10 11:13               ` Sergei Shtylyov
@ 2011-08-10 12:02                   ` Voss, Nikolaus
  0 siblings, 0 replies; 29+ messages in thread
From: Voss, Nikolaus @ 2011-08-10 12:02 UTC (permalink / raw)
  To: 'Jean-Christophe PLAGNIOL-VILLARD', 'Sergei Shtylyov'
  Cc: 'linux-arm-kernel@lists.infradead.org',
	'Nicolas Ferre', 'Greg Kroah-Hartman',
	'Linux Kernel'

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
---
Updated with Sergei's comment.

 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index af9b781..b922f5d 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2] atmel_serial: fix atmel_default_console_device
@ 2011-08-10 12:02                   ` Voss, Nikolaus
  0 siblings, 0 replies; 29+ messages in thread
From: Voss, Nikolaus @ 2011-08-10 12:02 UTC (permalink / raw)
  To: linux-arm-kernel

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
---
Updated with Sergei's comment.

 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index af9b781..b922f5d 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2011-08-10 12:02 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13 19:47 [PATCH] atmel_serial: keep the platform_device unchanged Jean-Christophe PLAGNIOL-VILLARD
2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-13 21:58 ` Alan Cox
2011-04-13 21:58   ` Alan Cox
2011-04-15 19:02   ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-15 19:02     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08  8:45 ` Hans-Christian Egtvedt
2011-06-08  8:45   ` Hans-Christian Egtvedt
2011-06-08 13:47   ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 14:02     ` Hans-Christian Egtvedt
2011-06-08 14:02       ` Hans-Christian Egtvedt
2011-06-17  3:06       ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28       ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:31       ` [PATCH] atmel_serial: fix internal port num Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:31         ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-08 15:10         ` [PATCH] atmel_serial: fix atmel_default_console_device Nikolaus Voss
2011-08-09 11:41           ` Sergei Shtylyov
2011-08-09 14:16             ` Voss, Nikolaus
2011-08-09 14:16               ` Voss, Nikolaus
2011-08-09 14:17             ` Voss, Nikolaus
2011-08-10 11:13               ` Sergei Shtylyov
2011-08-10 12:02                 ` [PATCH v2] " Voss, Nikolaus
2011-08-10 12:02                   ` Voss, Nikolaus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.