All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Josh Wu <josh.wu@atmel.com>, Bo Shen <voice.shen@atmel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-serial@vger.kernel.org,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] tty/serial: at91: fix uart/usart selection for older products
Date: Tue, 15 Oct 2013 11:10:51 +0200	[thread overview]
Message-ID: <525D069B.6000908@atmel.com> (raw)
In-Reply-To: <20131014135809.GF11420@ns203013.ovh.net>

On 14/10/2013 15:58, Jean-Christophe PLAGNIOL-VILLARD :
> On 10:43 Thu 10 Oct     , Nicolas Ferre wrote:
>> Since commit 055560b04a8cd063aea916fd083b7aec02c2adb8 (serial: at91:
>> distinguish usart and uart) the older products which do not have a
>> name field in their register map are unable to use their serial output.
>> As the main console output is usually the serial interface (aka DBGU) it
>> is pretty unfortunate.
>> So, instead of failing during probe() we just silently configure the serial
>> peripheral as an uart. It allows us to use these serial outputs.
>> The proper solution is proposed in another patch.
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>>   drivers/tty/serial/atmel_serial.c | 9 ++-------
>>   1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
>> index d067285..6b0f75e 100644
>> --- a/drivers/tty/serial/atmel_serial.c
>> +++ b/drivers/tty/serial/atmel_serial.c
>> @@ -1499,7 +1499,7 @@ static void atmel_set_ops(struct uart_port *port)
>>   /*
>>    * Get ip name usart or uart
>>    */
>> -static int atmel_get_ip_name(struct uart_port *port)
>> +static void atmel_get_ip_name(struct uart_port *port)
>>   {
>>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>>   	int name = UART_GET_IP_NAME(port);
>> @@ -1518,10 +1518,7 @@ static int atmel_get_ip_name(struct uart_port *port)
>>   		atmel_port->is_usart = false;
>>   	} else {
> 		a dev_warn here maybe
>
> usefull to known when we will have a new ip name and not yet wupported

No, not here: next patch is oveloading this if/else directive.

>>   		dev_err(port->dev, "Not supported ip name, set to uart\n");
>> -		return -EINVAL;
>>   	}
>> -
>> -	return 0;
>>   }
>>
>>   /*
>> @@ -2405,9 +2402,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
>>   	/*
>>   	 * Get port name of usart or uart
>>   	 */
>> -	ret = atmel_get_ip_name(&port->uart);
>> -	if (ret < 0)
>> -		goto err_add_port;
>> +	atmel_get_ip_name(&port->uart);
>>
>>   	return 0;
>>
>> --
>> 1.8.2.2
>>
>
>


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] tty/serial: at91: fix uart/usart selection for older products
Date: Tue, 15 Oct 2013 11:10:51 +0200	[thread overview]
Message-ID: <525D069B.6000908@atmel.com> (raw)
In-Reply-To: <20131014135809.GF11420@ns203013.ovh.net>

On 14/10/2013 15:58, Jean-Christophe PLAGNIOL-VILLARD :
> On 10:43 Thu 10 Oct     , Nicolas Ferre wrote:
>> Since commit 055560b04a8cd063aea916fd083b7aec02c2adb8 (serial: at91:
>> distinguish usart and uart) the older products which do not have a
>> name field in their register map are unable to use their serial output.
>> As the main console output is usually the serial interface (aka DBGU) it
>> is pretty unfortunate.
>> So, instead of failing during probe() we just silently configure the serial
>> peripheral as an uart. It allows us to use these serial outputs.
>> The proper solution is proposed in another patch.
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>>   drivers/tty/serial/atmel_serial.c | 9 ++-------
>>   1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
>> index d067285..6b0f75e 100644
>> --- a/drivers/tty/serial/atmel_serial.c
>> +++ b/drivers/tty/serial/atmel_serial.c
>> @@ -1499,7 +1499,7 @@ static void atmel_set_ops(struct uart_port *port)
>>   /*
>>    * Get ip name usart or uart
>>    */
>> -static int atmel_get_ip_name(struct uart_port *port)
>> +static void atmel_get_ip_name(struct uart_port *port)
>>   {
>>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>>   	int name = UART_GET_IP_NAME(port);
>> @@ -1518,10 +1518,7 @@ static int atmel_get_ip_name(struct uart_port *port)
>>   		atmel_port->is_usart = false;
>>   	} else {
> 		a dev_warn here maybe
>
> usefull to known when we will have a new ip name and not yet wupported

No, not here: next patch is oveloading this if/else directive.

>>   		dev_err(port->dev, "Not supported ip name, set to uart\n");
>> -		return -EINVAL;
>>   	}
>> -
>> -	return 0;
>>   }
>>
>>   /*
>> @@ -2405,9 +2402,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
>>   	/*
>>   	 * Get port name of usart or uart
>>   	 */
>> -	ret = atmel_get_ip_name(&port->uart);
>> -	if (ret < 0)
>> -		goto err_add_port;
>> +	atmel_get_ip_name(&port->uart);
>>
>>   	return 0;
>>
>> --
>> 1.8.2.2
>>
>
>


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Josh Wu <josh.wu@atmel.com>, Bo Shen <voice.shen@atmel.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-serial@vger.kernel.org>,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] tty/serial: at91: fix uart/usart selection for older products
Date: Tue, 15 Oct 2013 11:10:51 +0200	[thread overview]
Message-ID: <525D069B.6000908@atmel.com> (raw)
In-Reply-To: <20131014135809.GF11420@ns203013.ovh.net>

On 14/10/2013 15:58, Jean-Christophe PLAGNIOL-VILLARD :
> On 10:43 Thu 10 Oct     , Nicolas Ferre wrote:
>> Since commit 055560b04a8cd063aea916fd083b7aec02c2adb8 (serial: at91:
>> distinguish usart and uart) the older products which do not have a
>> name field in their register map are unable to use their serial output.
>> As the main console output is usually the serial interface (aka DBGU) it
>> is pretty unfortunate.
>> So, instead of failing during probe() we just silently configure the serial
>> peripheral as an uart. It allows us to use these serial outputs.
>> The proper solution is proposed in another patch.
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>>   drivers/tty/serial/atmel_serial.c | 9 ++-------
>>   1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
>> index d067285..6b0f75e 100644
>> --- a/drivers/tty/serial/atmel_serial.c
>> +++ b/drivers/tty/serial/atmel_serial.c
>> @@ -1499,7 +1499,7 @@ static void atmel_set_ops(struct uart_port *port)
>>   /*
>>    * Get ip name usart or uart
>>    */
>> -static int atmel_get_ip_name(struct uart_port *port)
>> +static void atmel_get_ip_name(struct uart_port *port)
>>   {
>>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>>   	int name = UART_GET_IP_NAME(port);
>> @@ -1518,10 +1518,7 @@ static int atmel_get_ip_name(struct uart_port *port)
>>   		atmel_port->is_usart = false;
>>   	} else {
> 		a dev_warn here maybe
>
> usefull to known when we will have a new ip name and not yet wupported

No, not here: next patch is oveloading this if/else directive.

>>   		dev_err(port->dev, "Not supported ip name, set to uart\n");
>> -		return -EINVAL;
>>   	}
>> -
>> -	return 0;
>>   }
>>
>>   /*
>> @@ -2405,9 +2402,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
>>   	/*
>>   	 * Get port name of usart or uart
>>   	 */
>> -	ret = atmel_get_ip_name(&port->uart);
>> -	if (ret < 0)
>> -		goto err_add_port;
>> +	atmel_get_ip_name(&port->uart);
>>
>>   	return 0;
>>
>> --
>> 1.8.2.2
>>
>
>


-- 
Nicolas Ferre

  reply	other threads:[~2013-10-15  9:10 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10  8:43 [PATCH 1/2] tty/serial: at91: fix uart/usart selection for older products Nicolas Ferre
2013-10-10  8:43 ` Nicolas Ferre
2013-10-10  8:43 ` Nicolas Ferre
2013-10-10  8:43 ` [PATCH 2/2] tty/serial: at91: add a fallback option to determine uart/usart property Nicolas Ferre
2013-10-10  8:43   ` Nicolas Ferre
2013-10-10  8:43   ` Nicolas Ferre
2013-10-12 15:00   ` Thomas Petazzoni
2013-10-12 15:00     ` Thomas Petazzoni
2013-10-12 15:00     ` Thomas Petazzoni
2013-10-14 13:59   ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-14 13:59     ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-14 13:59     ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-15  9:19     ` Nicolas Ferre
2013-10-15  9:19       ` Nicolas Ferre
2013-10-15  9:19       ` Nicolas Ferre
2013-10-16 20:14       ` Greg Kroah-Hartman
2013-10-16 20:14         ` Greg Kroah-Hartman
2013-10-17  8:16         ` Nicolas Ferre
2013-10-17  8:16           ` Nicolas Ferre
2013-10-17  8:16           ` Nicolas Ferre
2013-10-17 14:13           ` Greg Kroah-Hartman
2013-10-17 14:13             ` Greg Kroah-Hartman
2013-10-17 15:33             ` Nicolas Ferre
2013-10-17 15:33               ` Nicolas Ferre
2013-10-17 15:33               ` Nicolas Ferre
2013-10-14 13:58 ` [PATCH 1/2] tty/serial: at91: fix uart/usart selection for older products Jean-Christophe PLAGNIOL-VILLARD
2013-10-14 13:58   ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-14 13:58   ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-15  9:10   ` Nicolas Ferre [this message]
2013-10-15  9:10     ` Nicolas Ferre
2013-10-15  9:10     ` Nicolas Ferre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525D069B.6000908@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=josh.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=voice.shen@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.