Skip to contentSkip to conversation

Armadillo500 patches to support various devices.

PATCH New Alberto Panizzo 2 participants 7 messages Oct 15, 2009 – Oct 21, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Armadillo500 patches to support various devices.

In this series of patches I introduce support for:

1 GPIO Buttons with GPIO Keyboard.
2 Correct SMSC9118 Bus width flag to 16 bit instead of 32.
3 Add support for the second i2c device where is connected the onboard RTC module. 4 Add support for Seiko Instruments S-35390A RTC module.

#1 lore raw

PATCH 1/4 Armadillo500 Add support for onboard GPIO Buttons.

There are two low active Buttons on boards.
This patch connect those to the Input Subsystem over gpio-keys driver.

---
 arch/arm/mach-mx3/armadillo5x0.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/armadillo5x0.c +33 -0
index 776c0ee..309fa7a 100644
@@ -33,6 +33,8 @@
 #include <linux/irq.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -98,6 +100,36 @@ static int armadillo5x0_pins[] = {
 	MX31_PIN_DRDY0__DRDY0,
 	IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
 };
+/* GPIO BUTTONS */
+static struct gpio_keys_button armadillo5x0_buttons[] = {
+	{
+		.code		= KEY_ENTER, /*28*/
+		.gpio		= IOMUX_TO_GPIO(MX31_PIN_SCLK0),
+		.active_low	= 1,
+		.desc		= "menu",
+		.wakeup		= 1,
+	}, {
+		.code		= KEY_BACK, /*158*/
+		.gpio		= IOMUX_TO_GPIO(MX31_PIN_SRST0),
+		.active_low	= 1,
+		.desc		= "back",
+		.wakeup		= 1,
+	}
+};
+
+static struct gpio_keys_platform_data armadillo5x0_button_data = {
+	.buttons	= armadillo5x0_buttons,
+	.nbuttons	= ARRAY_SIZE(armadillo5x0_buttons),
+};
+
+static struct platform_device armadillo5x0_button_device = {
+	.name		= "gpio-keys",
+	.id		= -1,
+	.num_resources	= 0,
+	.dev		= {
+		.platform_data	= &armadillo5x0_button_data,
+	}
+};
 
 /*
  * NAND Flash
@@ -300,6 +332,7 @@ static struct imxuart_platform_data uart_pdata = {
 
 static struct platform_device *devices[] __initdata = {
 	&armadillo5x0_smc911x_device,
+	&armadillo5x0_button_device,
 };
 
 /*
Signature · 1 line
1.5.4.3
#2 lore raw

PATCH 2/4 Armadillo500 Correct bus length for SMSC9118 on board chip.

Armadillo500 Correct bus length for SMSC9118 on board chip.

The SMSC9118 network chip is connected to the data bus with a 16 bit interface, not 32 as early suggested.

---
 arch/arm/mach-mx3/armadillo5x0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mx3/armadillo5x0.c +1 -1
index 309fa7a..bd4a0f9 100644
@@ -310,7 +310,7 @@ static struct resource armadillo5x0_smc911x_resources[] = {
 };
 
 static struct smsc911x_platform_config smsc911x_info = {
-	.flags		= SMSC911X_USE_32BIT,
+	.flags		= SMSC911X_USE_16BIT,
 	.irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 	.irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
 };
Signature · 1 line
1.5.4.3
#3 lore raw

PATCH 3/4 Armadillo500 Add i2c second bus support.

[PATCH] Armadillo500 Add i2c second bus support.

This add pin allocation an device registration for the second bus i2c.

---
 arch/arm/mach-mx3/armadillo5x0.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/armadillo5x0.c +5 -0
index bd4a0f9..fa973e4 100644
@@ -99,7 +99,11 @@ static int armadillo5x0_pins[] = {
 	MX31_PIN_FPSHIFT__FPSHIFT,
 	MX31_PIN_DRDY0__DRDY0,
 	IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
+	/* I2C2 */
+	MX31_PIN_CSPI2_MOSI__SCL,
+	MX31_PIN_CSPI2_MISO__SDA,
 };
+
 /* GPIO BUTTONS */
 static struct gpio_keys_button armadillo5x0_buttons[] = {
 	{
@@ -332,6 +336,7 @@ static struct imxuart_platform_data uart_pdata = {
 
 static struct platform_device *devices[] __initdata = {
 	&armadillo5x0_smc911x_device,
+	&mxc_i2c_device1,
 	&armadillo5x0_button_device,
 };
 
Signature · 1 line
1.5.4.3
#4 lore raw

PATCH 4/4 Armadillo500 Add support for Seiko Instruments S-35390A rtc over i2c.

[PATCH] Armadillo500 Add support for Seiko Instruments S-35390A rtc over i2c.

The RTC chip Seiko Instruments S-35390A is connected to the Application Processor over the second bus i2c with the hard coded address 0x30.

---
 arch/arm/mach-mx3/armadillo5x0.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/armadillo5x0.c +20 -0
index fa973e4..d10ee27 100644
@@ -35,6 +35,7 @@
 #include <linux/io.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/i2c.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -104,6 +105,13 @@ static int armadillo5x0_pins[] = {
 	MX31_PIN_CSPI2_MISO__SDA,
 };
 
+/* RTC over I2C*/
+#define ARMADILLO5X0_RTC_GPIO	IOMUX_TO_GPIO(MX31_PIN_SRXD4)
+
+static struct i2c_board_info armadillo5x0_i2c_rtc = {
+	I2C_BOARD_INFO("s35390a", 0x30),
+};
+
 /* GPIO BUTTONS */
 static struct gpio_keys_button armadillo5x0_buttons[] = {
 	{
@@ -373,6 +381,18 @@ static void __init armadillo5x0_init(void)
 
 	/* set NAND page size to 2k if not configured via boot mode pins */
 	__raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
+
+	/* RTC */
+	/* Get RTC IRQ and register the chip */
+	if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) {
+		if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0)
+			armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO);
+		else
+			gpio_free(ARMADILLO5X0_RTC_GPIO);
+	}
+	if (armadillo5x0_i2c_rtc.irq == 0)
+		pr_warning("armadillo5x0_init: failed to get RTC IRQ\n");
+	i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1);
 }
 
 static void __init armadillo5x0_timer_init(void)
Signature · 1 line
1.5.4.3
#5 lore raw

PATCH 2/4 Armadillo500 Correct bus length for SMSC9118 on board chip.

In reply to Alberto Panizzo

Hi Alberto,

Quoted 4 lines · Alberto Panizzo

Armadillo500 Correct bus length for SMSC9118 on board chip.

The SMSC9118 network chip is connected to the data bus with a 16 bit interface, not 32 as early suggested.

This one looks like it should go into 2.6.32, right?

The other patches are ok. Please let me know what I should do with this one.

Sascha

Quoted 23 lines
---
 arch/arm/mach-mx3/armadillo5x0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mx3/armadillo5x0.c +1 -1
index 309fa7a..bd4a0f9 100644
@@ -310,7 +310,7 @@ static struct resource armadillo5x0_smc911x_resources[] = {
 };
 
 static struct smsc911x_platform_config smsc911x_info = {
-	.flags		= SMSC911X_USE_32BIT,
+	.flags		= SMSC911X_USE_16BIT,
 	.irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 	.irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
 };
Signature · 1 line
1.5.4.3
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

PATCH 2/4 Armadillo500 Correct bus length for SMSC9118 on board chip.

Il giorno Mon, 19 Oct 2009 16:27:57 +0200
Sascha Hauer <[email protected]> ha scritto:

Quoted 8 lines

Hi Alberto,

Quoted 4 lines · Alberto Panizzo

Armadillo500 Correct bus length for SMSC9118 on board chip.

The SMSC9118 network chip is connected to the data bus with a 16 bit interface, not 32 as early suggested.

Quoted 6 lines

This one looks like it should go into 2.6.32, right?

The other patches are ok. Please let me know what I should do with this one.

Sascha

If it is possible, yes thanks.

Alberto.