[PATCHv2 04/12] PCM051: Add muxing for user led and btn

Teresa Gámez t.gamez at phytec.de
Tue Jul 9 05:23:14 EDT 2013


Signed-off-by: Teresa Gámez <t.gamez at phytec.de>
---
 arch/arm/boards/pcm051/board.c |    3 +++
 arch/arm/boards/pcm051/mux.c   |   22 ++++++++++++++++++++++
 arch/arm/boards/pcm051/mux.h   |    2 ++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index db371e5..cb8c1d9 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -171,6 +171,9 @@ static int pcm051_devices_init(void)
 	pcm051_i2c_init();
 	pcm051_nand_init();
 
+	pcm051_enable_user_led_pin_mux();
+	pcm051_enable_user_btn_pin_mux();
+
 	switch (bootsource_get()) {
 	case BOOTSOURCE_SPI:
 		devfs_add_partition("nor0", 0x00000, SZ_128K,
diff --git a/arch/arm/boards/pcm051/mux.c b/arch/arm/boards/pcm051/mux.c
index b8fb669..6ef5af1 100644
--- a/arch/arm/boards/pcm051/mux.c
+++ b/arch/arm/boards/pcm051/mux.c
@@ -14,7 +14,29 @@ static const struct module_pin_mux mmc0_pin_mux[] = {
 	{-1},
 };
 
+static const struct module_pin_mux user_led_pin_mux[] = {
+	{OFFSET(gpmc_csn1), MODE(7) | PULLUDEN}, /* USER LED1 */
+	{OFFSET(gpmc_csn2), MODE(7) | PULLUDEN}, /* USER LED2 */
+	{-1},
+};
+
+static const struct module_pin_mux user_btn_pin_mux[] = {
+	{OFFSET(emu0), MODE(7) | RXACTIVE | PULLUP_EN},
+	{OFFSET(emu1), MODE(7) | RXACTIVE | PULLUP_EN},
+	{-1},
+};
+
 void pcm051_enable_mmc0_pin_mux(void)
 {
 	configure_module_pin_mux(mmc0_pin_mux);
 }
+
+void pcm051_enable_user_led_pin_mux(void)
+{
+	configure_module_pin_mux(user_led_pin_mux);
+}
+
+void pcm051_enable_user_btn_pin_mux(void)
+{
+	configure_module_pin_mux(user_btn_pin_mux);
+}
diff --git a/arch/arm/boards/pcm051/mux.h b/arch/arm/boards/pcm051/mux.h
index f35bc9e..4008376 100644
--- a/arch/arm/boards/pcm051/mux.h
+++ b/arch/arm/boards/pcm051/mux.h
@@ -1 +1,3 @@
 extern void pcm051_enable_mmc0_pin_mux(void);
+extern void pcm051_enable_user_led_pin_mux(void);
+extern void pcm051_enable_user_btn_pin_mux(void);
-- 
1.7.0.4




More information about the barebox mailing list