[PATCH 6/8] animeo_ip: update to use console_open/close for rs485 crossed detection

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Sep 27 03:14:16 EDT 2013


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/boards/animeo_ip/init.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/animeo_ip/init.c b/arch/arm/boards/animeo_ip/init.c
index 2fee1ff..e6d2745 100644
--- a/arch/arm/boards/animeo_ip/init.c
+++ b/arch/arm/boards/animeo_ip/init.c
@@ -343,8 +343,6 @@ static void animeo_ip_shutdown(void)
 	 * and use it for decompress
 	 */
 	animeo_ip_shutdown_uart(IOMEM(AT91_DBGU + AT91_BASE_SYS));
-	animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US0));
-	animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US1));
 }
 
 static int animeo_ip_console_init(void)
@@ -397,8 +395,10 @@ static int animeo_ip_cross_detect_init(void)
 		return -EINVAL;
 
 	at91_set_gpio_input(AT91_PIN_PC16, 0);
+	console_open(cs0);
 	cs0->set_mode(cs0, CONSOLE_MODE_RS485);
 	cs0->setbrg(cs0, 38400);
+	console_open(cs1);
 	cs1->set_mode(cs1, CONSOLE_MODE_RS485);
 	cs1->setbrg(cs1, 38400);
 
@@ -426,6 +426,9 @@ err:
 
 	pr_info("rs485 ports %scrossed\n", crossed ? "" : "not ");
 
+	console_close(cs0);
+	console_close(cs1);
+
 	return 0;
 }
 late_initcall(animeo_ip_cross_detect_init);
-- 
1.8.4.rc3




More information about the barebox mailing list