public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ARM: mach-shmobile: ag5evm: use gpio.
@ 2010-11-19  4:11 yoshii.takashi
  2011-06-30  7:30 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error caused by i2c function Kuninori Morimoto
  2011-06-30 10:34 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: yoshii.takashi @ 2010-11-19  4:11 UTC (permalink / raw)
  To: linux-sh

Ag5evm board now uses gpio api to initialize pins and peripherals.

Signed-off-by: Takashi YOSHII <takashi.yoshii.zj@renesas.com>
---
 arch/arm/mach-shmobile/Kconfig        |    1 +
 arch/arm/mach-shmobile/board-ag5evm.c |   17 ++++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 2910ba2..7d56e86 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -61,6 +61,7 @@ endchoice
 config MACH_AG5EVM
 	bool "AG5EVM board"
 	depends on ARCH_SH73A0
+	select ARCH_REQUIRE_GPIOLIB
 
 comment "SH-Mobile System Configuration"
 
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index bade04a..e0bc081 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -121,16 +121,19 @@ void __init ag5evm_init_irq(void)
 
 static void __init ag5evm_init(void)
 {
+	sh73a0_pinmux_init();
+
 	/* enable SCIFA2 */
-	__raw_writeb(0x12, PORT154CR); /* TXD */
-	__raw_writeb(0x22, PORT155CR); /* RXD */
-	__raw_writeb(0x12, PORT156CR); /* RTS */
-	__raw_writeb(0x22, PORT157CR); /* CTS */
+	gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
+	gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
+	gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
+	gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
 
 	/* enable SMSC911X */
-	__raw_writeb(0x20, PORT144CR); /* PINTA2 */
-	__raw_writeb(0x10, PORT145CR); /* RESET */
-	__raw_writel(__raw_readl(PORTR159_128DR) & ~(1 << 17), PORTR159_128DR);
+	gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
+	gpio_direction_input(GPIO_PORT144);
+	gpio_request(GPIO_PORT145, NULL); /* RESET */
+	gpio_direction_output(GPIO_PORT145, 1);
 
 #ifdef CONFIG_CACHE_L2X0
 	/* Shared attribute override enable, 64K*8way */
-- 
1.7.2.2


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

* [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error caused by i2c function
  2010-11-19  4:11 [PATCH 2/2] ARM: mach-shmobile: ag5evm: use gpio yoshii.takashi
@ 2011-06-30  7:30 ` Kuninori Morimoto
  2011-06-30 10:34 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2011-06-30  7:30 UTC (permalink / raw)
  To: linux-sh

ag5evm compile will be error if it doesn't have CONFIG_I2C.
this patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-ag5evm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 9761f80..1351c99 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -205,6 +205,7 @@ static struct platform_device irda_device = {
 	.num_resources  = ARRAY_SIZE(irda_resources),
 };
 
+#ifdef CONFIG_I2C
 static unsigned char lcd_backlight_seq[3][2] = {
 	{ 0x04, 0x07 },
 	{ 0x23, 0x80 },
@@ -227,6 +228,9 @@ static void lcd_backlight_on(void)
 			break;
 	}
 }
+#else
+#define lcd_backlight_on()
+#endif
 
 static void lcd_backlight_reset(void)
 {
-- 
1.7.4.1


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

* Re: [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error
  2010-11-19  4:11 [PATCH 2/2] ARM: mach-shmobile: ag5evm: use gpio yoshii.takashi
  2011-06-30  7:30 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error caused by i2c function Kuninori Morimoto
@ 2011-06-30 10:34 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2011-06-30 10:34 UTC (permalink / raw)
  To: linux-sh

On Thu, Jun 30, 2011 at 12:30:55AM -0700, Kuninori Morimoto wrote:
> ag5evm compile will be error if it doesn't have CONFIG_I2C.
> this patch fixup it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This does what is says on the wrapper.

Tested-by: Simon Horman <horms@verge.net.au>

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

end of thread, other threads:[~2011-06-30 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-19  4:11 [PATCH 2/2] ARM: mach-shmobile: ag5evm: use gpio yoshii.takashi
2011-06-30  7:30 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error caused by i2c function Kuninori Morimoto
2011-06-30 10:34 ` [PATCH 2/2] ARM: mach-shmobile: ag5evm: fixup compile error Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox