All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] S3C: serial: Modify console initialization.
@ 2010-01-14  5:53 Thomas Abraham
  2010-01-14  6:23 ` Ben Dooks
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Abraham @ 2010-01-14  5:53 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: ben-linux, Thomas Abraham

This patch modifies s3c24xx_serial_initconsole function to accept multiple
platform UART information structures. This is required on platforms that have
differences among the instances of UART ports. As an example, the FIFO sizes
could be different for each UART instance and hence multiple platform UART
information structures would be needed.

This patch also modifies the s3c24xx_console_init macro since it wraps the
call to the s3c24xx_serial_initconsole function.
---
 drivers/serial/samsung.c |    6 +++---
 drivers/serial/samsung.h |   19 ++++++++++++-------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 52e3df1..6982243 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
  * data.
 */
 
-static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
+static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
 {
 	struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
 	struct platform_device **platdev_ptr;
@@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
 	platdev_ptr = s3c24xx_uart_devs;
 
 	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
-		s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
+		s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
 	}
 
 	return 0;
@@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
 };
 
 int s3c24xx_serial_initconsole(struct platform_driver *drv,
-			       struct s3c24xx_uart_info *info)
+			       struct s3c24xx_uart_info **info)
 
 {
 	struct platform_device *dev = s3c24xx_uart_devs[0];
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
index 1fb2234..0ac06a0 100644
--- a/drivers/serial/samsung.h
+++ b/drivers/serial/samsung.h
@@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
 extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
 
 extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
-				      struct s3c24xx_uart_info *uart);
+				      struct s3c24xx_uart_info **uart);
 
 extern int s3c24xx_serial_init(struct platform_driver *drv,
 			       struct s3c24xx_uart_info *info);
 
 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
 
-#define s3c24xx_console_init(__drv, __inf)			\
-static int __init s3c_serial_console_init(void)			\
-{								\
-	return s3c24xx_serial_initconsole(__drv, __inf);	\
-}								\
-								\
+#define s3c24xx_console_init(__drv, __inf)				\
+static int __init s3c_serial_console_init(void)				\
+{									\
+	struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS];	\
+	int i;								\
+									\
+	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)		\
+		uinfo[i] = __inf;					\
+	return s3c24xx_serial_initconsole(__drv, uinfo);		\
+}									\
+									\
 console_initcall(s3c_serial_console_init)
 
 #else
-- 
1.6.3.3

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

* [PATCH] S3C: serial: Modify console initialization.
@ 2010-01-14  6:05 Thomas Abraham
  2010-01-14  6:41 ` Ben Dooks
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Abraham @ 2010-01-14  6:05 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: ben-linux, Thomas Abraham

This patch modifies s3c24xx_serial_initconsole function to accept multiple
platform UART information structures. This is required on platforms that have
differences among the instances of UART ports. As an example, the FIFO sizes
could be different for each UART instance and hence multiple platform UART
information structures would be needed.

This patch also modifies the s3c24xx_console_init macro since it wraps the
call to the s3c24xx_serial_initconsole function.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
---
 drivers/serial/samsung.c |    6 +++---
 drivers/serial/samsung.h |   19 ++++++++++++-------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 52e3df1..6982243 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
  * data.
 */

-static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
+static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
 {
 	struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
 	struct platform_device **platdev_ptr;
@@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
 	platdev_ptr = s3c24xx_uart_devs;

 	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
-		s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
+		s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
 	}

 	return 0;
@@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
 };

 int s3c24xx_serial_initconsole(struct platform_driver *drv,
-			       struct s3c24xx_uart_info *info)
+			       struct s3c24xx_uart_info **info)

 {
 	struct platform_device *dev = s3c24xx_uart_devs[0];
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
index 1fb2234..0ac06a0 100644
--- a/drivers/serial/samsung.h
+++ b/drivers/serial/samsung.h
@@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
 extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);

 extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
-				      struct s3c24xx_uart_info *uart);
+				      struct s3c24xx_uart_info **uart);

 extern int s3c24xx_serial_init(struct platform_driver *drv,
 			       struct s3c24xx_uart_info *info);

 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE

-#define s3c24xx_console_init(__drv, __inf)			\
-static int __init s3c_serial_console_init(void)			\
-{								\
-	return s3c24xx_serial_initconsole(__drv, __inf);	\
-}								\
-								\
+#define s3c24xx_console_init(__drv, __inf)				\
+static int __init s3c_serial_console_init(void)				\
+{									\
+	struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS];	\
+	int i;								\
+									\
+	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)		\
+		uinfo[i] = __inf;					\
+	return s3c24xx_serial_initconsole(__drv, uinfo);		\
+}									\
+									\
 console_initcall(s3c_serial_console_init)

 #else
--
1.6.3.3

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

* Re: [PATCH] S3C: serial: Modify console initialization.
  2010-01-14  5:53 [PATCH] S3C: serial: Modify console initialization Thomas Abraham
@ 2010-01-14  6:23 ` Ben Dooks
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-01-14  6:23 UTC (permalink / raw)
  To: Thomas Abraham; +Cc: linux-samsung-soc, ben-linux

On Thu, Jan 14, 2010 at 02:53:35PM +0900, Thomas Abraham wrote:
> This patch modifies s3c24xx_serial_initconsole function to accept multiple
> platform UART information structures. This is required on platforms that have
> differences among the instances of UART ports. As an example, the FIFO sizes
> could be different for each UART instance and hence multiple platform UART
> information structures would be needed.

ok, will look at applying once this is needed.
 
> This patch also modifies the s3c24xx_console_init macro since it wraps the
> call to the s3c24xx_serial_initconsole function.
> ---
>  drivers/serial/samsung.c |    6 +++---
>  drivers/serial/samsung.h |   19 ++++++++++++-------
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
> index 52e3df1..6982243 100644
> --- a/drivers/serial/samsung.c
> +++ b/drivers/serial/samsung.c
> @@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
>   * data.
>  */
>  
> -static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
> +static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
>  {
>  	struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
>  	struct platform_device **platdev_ptr;
> @@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
>  	platdev_ptr = s3c24xx_uart_devs;
>  
>  	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
> -		s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
> +		s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
>  	}
>  
>  	return 0;
> @@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
>  };
>  
>  int s3c24xx_serial_initconsole(struct platform_driver *drv,
> -			       struct s3c24xx_uart_info *info)
> +			       struct s3c24xx_uart_info **info)
>  
>  {
>  	struct platform_device *dev = s3c24xx_uart_devs[0];
> diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
> index 1fb2234..0ac06a0 100644
> --- a/drivers/serial/samsung.h
> +++ b/drivers/serial/samsung.h
> @@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
>  extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
>  
>  extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
> -				      struct s3c24xx_uart_info *uart);
> +				      struct s3c24xx_uart_info **uart);
>  
>  extern int s3c24xx_serial_init(struct platform_driver *drv,
>  			       struct s3c24xx_uart_info *info);
>  
>  #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
>  
> -#define s3c24xx_console_init(__drv, __inf)			\
> -static int __init s3c_serial_console_init(void)			\
> -{								\
> -	return s3c24xx_serial_initconsole(__drv, __inf);	\
> -}								\
> -								\
> +#define s3c24xx_console_init(__drv, __inf)				\
> +static int __init s3c_serial_console_init(void)				\
> +{									\
> +	struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS];	\
> +	int i;								\
> +									\
> +	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)		\
> +		uinfo[i] = __inf;					\
> +	return s3c24xx_serial_initconsole(__drv, uinfo);		\
> +}									\
> +									\
>  console_initcall(s3c_serial_console_init)
>  
>  #else
> -- 
> 1.6.3.3
> 

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

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

* Re: [PATCH] S3C: serial: Modify console initialization.
  2010-01-14  6:05 Thomas Abraham
@ 2010-01-14  6:41 ` Ben Dooks
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-01-14  6:41 UTC (permalink / raw)
  To: Thomas Abraham; +Cc: linux-samsung-soc, ben-linux

On Thu, Jan 14, 2010 at 03:05:38PM +0900, Thomas Abraham wrote:
> This patch modifies s3c24xx_serial_initconsole function to accept multiple
> platform UART information structures. This is required on platforms that have
> differences among the instances of UART ports. As an example, the FIFO sizes
> could be different for each UART instance and hence multiple platform UART
> information structures would be needed.

I seem to have two copies of this?;
 
> This patch also modifies the s3c24xx_console_init macro since it wraps the
> call to the s3c24xx_serial_initconsole function.
> 
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> ---
>  drivers/serial/samsung.c |    6 +++---
>  drivers/serial/samsung.h |   19 ++++++++++++-------
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
> index 52e3df1..6982243 100644
> --- a/drivers/serial/samsung.c
> +++ b/drivers/serial/samsung.c
> @@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
>   * data.
>  */
> 
> -static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
> +static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
>  {
>  	struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
>  	struct platform_device **platdev_ptr;
> @@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
>  	platdev_ptr = s3c24xx_uart_devs;
> 
>  	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
> -		s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
> +		s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
>  	}
> 
>  	return 0;
> @@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
>  };
> 
>  int s3c24xx_serial_initconsole(struct platform_driver *drv,
> -			       struct s3c24xx_uart_info *info)
> +			       struct s3c24xx_uart_info **info)
> 
>  {
>  	struct platform_device *dev = s3c24xx_uart_devs[0];
> diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
> index 1fb2234..0ac06a0 100644
> --- a/drivers/serial/samsung.h
> +++ b/drivers/serial/samsung.h
> @@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
>  extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
> 
>  extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
> -				      struct s3c24xx_uart_info *uart);
> +				      struct s3c24xx_uart_info **uart);
> 
>  extern int s3c24xx_serial_init(struct platform_driver *drv,
>  			       struct s3c24xx_uart_info *info);
> 
>  #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
> 
> -#define s3c24xx_console_init(__drv, __inf)			\
> -static int __init s3c_serial_console_init(void)			\
> -{								\
> -	return s3c24xx_serial_initconsole(__drv, __inf);	\
> -}								\
> -								\
> +#define s3c24xx_console_init(__drv, __inf)				\
> +static int __init s3c_serial_console_init(void)				\
> +{									\
> +	struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS];	\
> +	int i;								\
> +									\
> +	for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)		\
> +		uinfo[i] = __inf;					\
> +	return s3c24xx_serial_initconsole(__drv, uinfo);		\
> +}									\
> +									\
>  console_initcall(s3c_serial_console_init)
> 
>  #else
> --
> 1.6.3.3
> 

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

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

end of thread, other threads:[~2010-01-14  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14  5:53 [PATCH] S3C: serial: Modify console initialization Thomas Abraham
2010-01-14  6:23 ` Ben Dooks
  -- strict thread matches above, loose matches on Subject: below --
2010-01-14  6:05 Thomas Abraham
2010-01-14  6:41 ` Ben Dooks

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.