Skip to contentSkip to conversation

ARM OMAP3530evm misc fixes

PATCH New Zumeng Chen 4 participants 13 messages Jun 20, 2012 – Jul 8, 2012

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

v3 cover ARM OMAP3530evm misc fixes

The series is based upon the latest linux-omap master branch from Tony (3.5-rc2).

V3 Changes :

1. [patch 5/5] Leave driver/input/touchscreen as-is. some changes on arch/arm/mach-omap2/common-board-devices.c, please see the shortlog for more information.
2. For the first patch, I noticed GPMC driver conversion v5, so this is decided by Tony, we can drop it, and I'll create a new one if needed, but obviously I'm not very proper candidate for it.

Thanks all comments :-)

Zumeng Chen (5):
ARM: OMAP3EVM: Add NAND flash definition
ARM: OMAP3EVM: Adding USB internal LDOs board file
ARM: omap3evm: enable VBUS switch for EHCI tranceiver
ARM: OMAP3EVM: cosmetic fixes for parent clk set
ARM: OMAP3530evm: set pendown_state and debounce time for ads7846

 arch/arm/mach-omap2/board-omap3evm.c       |   74 +++++++++++++++++++++++++++-
 arch/arm/mach-omap2/common-board-devices.c |   18 ++++++-
 arch/arm/mach-omap2/common-board-devices.h |    1 +
 arch/arm/plat-omap/clock.c                 |    4 ++
 drivers/mfd/omap-usb-host.c                |    2 +-
 5 files changed, 95 insertions(+), 4 deletions(-)
#1 lore raw

PATCH v3 1/5 ARM: OMAP3EVM: Add NAND flash definition

---
 arch/arm/mach-omap2/board-omap3evm.c |   39 ++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +39 -0
index 639bd07..0b83d0e 100644
@@ -24,6 +24,10 @@
 #include <linux/leds.h>
 #include <linux/interrupt.h>
 
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>
+
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl.h>
@@ -43,6 +47,7 @@
 
 #include <plat/board.h>
 #include <plat/usb.h>
+#include <plat/nand.h>
 #include "common.h"
 #include <plat/mcspi.h>
 #include <video/omapdss.h>
@@ -607,6 +612,37 @@ static struct regulator_consumer_supply dummy_supplies[] = {
 	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
+static struct mtd_partition omap3evm_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name           = "X-Loader",
+		.offset         = 0,
+		.size           = 4*(SZ_128K),
+		.mask_flags     = MTD_WRITEABLE
+	},
+	{
+		.name           = "U-Boot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 14*(SZ_128K),
+		.mask_flags     = MTD_WRITEABLE
+	},
+	{
+		.name           = "U-Boot Env",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 2*(SZ_128K)
+	},
+	{
+		.name           = "Kernel",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 40*(SZ_128K)
+	},
+	{
+		.name           = "File system",
+		.size           = MTDPART_SIZ_FULL,
+		.offset         = MTDPART_OFS_APPEND,
+	},
+};
+
 static void __init omap3_evm_init(void)
 {
 	struct omap_board_mux *obm;
@@ -656,6 +692,9 @@ static void __init omap3_evm_init(void)
 	}
 	usb_musb_init(&musb_board_data);
 	usbhs_init(&usbhs_bdata);
+	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
+			     ARRAY_SIZE(omap3evm_nand_partitions));
+
 	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
 	omap3evm_init_smsc911x();
 	omap3_evm_display_init();
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH v3 2/5 ARM: OMAP3EVM: Adding USB internal LDOs board file

In reply to Zumeng Chen

EHCI PHY requires these regulators:

        EVM Rev >=E  --> VAUX2
        EVM Rev < E  --> VUSB1V5, VUSB1V8

Adding USB internal LDOs (vusb1v5 & vusb1v8) and VAUX2 to omap3evm board file. Also removing vaux2_{1/2/3} supplies as they are not used on omap3 evm.

But we need not to add vaux2 in twl4030_platform_data since it will be added conditionally.

---
 arch/arm/mach-omap2/board-omap3evm.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +25 -0
index 0b83d0e..1bfbe42 100644
@@ -466,6 +466,28 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
 };
 #endif
 
+/* VAUX2 for USB */
+static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
+	REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"),	/* OMAP ISP */
+	REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"),	/* OMAP ISP */
+	REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"),
+	REGULATOR_SUPPLY("vaux2", NULL),
+};
+
+static struct regulator_init_data omap3evm_vaux2 = {
+	.constraints = {
+		.min_uV		= 2800000,
+		.max_uV		= 2800000,
+		.apply_uV	= true,
+		.valid_modes_mask	= REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask		= REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies		= ARRAY_SIZE(omap3evm_vaux2_supplies),
+	.consumer_supplies		= omap3evm_vaux2_supplies,
+};
+
 static struct twl4030_platform_data omap3evm_twldata = {
 	/* platform_data for children goes here */
 	.keypad		= &omap3evm_kp_data,
@@ -659,6 +681,9 @@ static void __init omap3_evm_init(void)
 	omap_mux_init_gpio(63, OMAP_PIN_INPUT);
 	omap_hsmmc_init(mmc);
 
+	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+		omap3evm_twldata.vaux2 = &omap3evm_vaux2;
+
 	omap3_evm_i2c_init();
 
 	omap_display_init(&omap3_evm_dss_data);
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH v3 3/5 ARM: omap3evm: enable VBUS switch for EHCI tranceiver

In reply to Zumeng Chen

This was chosen by following the trace on the schematic from component U131 and U134 to the CPEN pin on the USB3320 device.

TWL4030.GPIO2-...->(T2_GPIO2_3V3)U131-..>nUSB2_EN-..>U134-..>EXP_nUSB2_1V8 which starts EHCI tranceiver USB3320.

This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.

---
 arch/arm/mach-omap2/board-omap3evm.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +9 -0
index 1bfbe42..02d8047 100644
@@ -360,6 +360,15 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
 
 	platform_device_register(&leds_gpio);
 
+	/* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
+	 * for starting USB tranceiver
+	 */
+	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+		u8 val;
+		twl_i2c_read_u8(TWL4030_MODULE_GPIO, &val, REG_GPIODATADIR1);
+		val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */
+		twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1);
+	}
 	return 0;
 }
 
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 3/5 ARM: omap3evm: enable VBUS switch for EHCI tranceiver

Hello.

Quoted 18 lines · Zumeng Chen

This was chosen by following the trace on the schematic from component U131 and U134 to the CPEN pin on the USB3320 device.

TWL4030.GPIO2-...->(T2_GPIO2_3V3)U131-..>nUSB2_EN-..>U134-..>EXP_nUSB2_1V8 which starts EHCI tranceiver USB3320.

This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.

---
  arch/arm/mach-omap2/board-omap3evm.c |    9 +++++++++
  1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +0 -0
index 1bfbe42..02d8047 100644

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 367

Quoted 8 lines
arch/arm/mach-omap2/board-omap3evm.c +5 -0
@@ -360,6 +360,15 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
 
  	platform_device_register(&leds_gpio);
 
+	/* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
+	 * for starting USB tranceiver
+	 */
+	if (get_omap3_evm_rev()>= OMAP3EVM_BOARD_GEN_2) {
+		u8 val;

Empty line after declaration block wouldn't hurt...

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 373

Quoted 6 lines
arch/arm/mach-omap2/board-omap3evm.c +4 -0
+		twl_i2c_read_u8(TWL4030_MODULE_GPIO,&val, REG_GPIODATADIR1);
+		val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */
+		twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1);
+	}
  	return 0;
  }

WBR, Sergei

#5 lore raw

PATCH v3 3/5 ARM: omap3evm: enable VBUS switch for EHCI tranceiver

? 2012?06?20? 20:05, Sergei Shtylyov ??:

Quoted 29 lines

Hello.

Quoted 25 lines · Zumeng Chen

This was chosen by following the trace on the schematic from component U131
and U134 to the CPEN pin on the USB3320 device.

TWL4030.GPIO2-...->(T2_GPIO2_3V3)U131-..>nUSB2_EN-..>U134-..>EXP_nUSB2_1V8

which starts EHCI tranceiver USB3320.

This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.

---
arch/arm/mach-omap2/board-omap3evm.c | 9 +++++++++

1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +0 -0
index 1bfbe42..02d8047 100644
@@ -360,6 +360,15 @@ static int omap3evm_twl_gpio_setup(struct device 
 *dev,
 
 platform_device_register(&leds_gpio);
 
Quoted 7 lines

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 367

Quoted 5 lines
arch/arm/mach-omap2/board-omap3evm.c +5 -0
+ /* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
+ * for starting USB tranceiver
+ */
+ if (get_omap3_evm_rev()>= OMAP3EVM_BOARD_GEN_2) {
+ u8 val;

Empty line after declaration block wouldn't hurt...

Yes, Agreed.

Regards,
Zumeng

Quoted 9 lines

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 373

Quoted 7 lines
arch/arm/mach-omap2/board-omap3evm.c +4 -0
+ twl_i2c_read_u8(TWL4030_MODULE_GPIO,&val, REG_GPIODATADIR1);
+ val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */
+ twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1);
+ }
 return 0;
 }

WBR, Sergei

maintainer
#6 lore raw

PATCH 3/5 ARM: omap3evm: enable VBUS switch for EHCI tranceiver

In reply to Sergei Shtylyov
Quoted 3 lines · Sergei Shtylyov
Quoted 2 lines · Zumeng Chen

This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.

...

Quoted 8 lines

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 367

Quoted 5 lines
arch/arm/mach-omap2/board-omap3evm.c +5 -0
+	/* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
+	 * for starting USB tranceiver
+	 */
+	if (get_omap3_evm_rev()>= OMAP3EVM_BOARD_GEN_2) {
+		u8 val;

Empty line after declaration block wouldn't hurt...

I'll apply these into devel-board branch with the extra line added. Not taking the clock related patch 4/5 as that's something Paul should queue.

Also note that the board-*.c files are being phased out with devicetree support.

Regards,

Tony

#7 lore raw

PATCH v3 3/5 ARM: omap3evm: enable VBUS switch for EHCI tranceiver

? 2012?07?06? 16:41, Tony Lindgren ??:

Quoted 12 lines · Sergei Shtylyov
Quoted 2 lines · Zumeng Chen
Quoted 1 line

This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.

...

Quoted 7 lines

arch/arm/mach-omap2/board-omap3evm.c static int omap3evm_twl_gpio_setup(struct device *dev, · line 367

Quoted 5 lines
arch/arm/mach-omap2/board-omap3evm.c +5 -0
+	/* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
+	 * for starting USB tranceiver
+	 */
+	if (get_omap3_evm_rev()>= OMAP3EVM_BOARD_GEN_2) {
+		u8 val;

Empty line after declaration block wouldn't hurt...

Quoted 6 lines

I'll apply these into devel-board branch with the extra line added. Not taking the clock related patch 4/5 as that's something Paul should queue.

Also note that the board-*.c files are being phased out with devicetree support.

Thanks Tony for your comments, I understand all of them.

Regards,
Zumeng

Quoted 4 lines

Regards,

Tony

#8 lore raw

PATCH v3 4/5 ARM: OMAP3EVM: cosmetic fixes for parent clk set

In reply to Zumeng Chen

Since it's no more sense to set parent for dummy clock, so we can just ignore it to mute failed message.

---
 arch/arm/plat-omap/clock.c  |    4 ++++
 drivers/mfd/omap-usb-host.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -0
index 62ec5c4..c7e26e4 100644
@@ -149,6 +149,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	if (!arch_clock || !arch_clock->clk_set_parent)
 		return ret;
 
+	/* If the clock is a dummy clock just return */
+	if (clk == &dummy_ck)
+		return 0;
+
 	spin_lock_irqsave(&clockfw_lock, flags);
 	if (clk->usecount == 0) {
 		ret = arch_clock->clk_set_parent(clk, parent);
drivers/mfd/omap-usb-host.c +1 -1
index 7e96bb2..c9d27c4 100644
@@ -699,7 +699,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev)
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[0])) {
-		/* for OMAP3 , the clk set paretn fails */
+		/* for OMAP3 , the clk set parent fails */
 		ret = clk_set_parent(omap->utmi_p1_fck,
 					omap->xclk60mhsp1_ck);
 		if (ret != 0)
Signature · 1 line
1.7.5.4
#9 lore raw

PATCH 4/5 ARM: OMAP3EVM: cosmetic fixes for parent clk set

Quoted 30 lines · Zumeng Chen

Since it's no more sense to set parent for dummy clock, so we can just ignore it to mute failed message.

---
 arch/arm/plat-omap/clock.c  |    4 ++++
 drivers/mfd/omap-usb-host.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -0
index 62ec5c4..c7e26e4 100644
@@ -149,6 +149,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	if (!arch_clock || !arch_clock->clk_set_parent)
 		return ret;
 
+	/* If the clock is a dummy clock just return */
+	if (clk == &dummy_ck)
+		return 0;
+
 	spin_lock_irqsave(&clockfw_lock, flags);
 	if (clk->usecount == 0) {
 		ret = arch_clock->clk_set_parent(clk, parent);
drivers/mfd/omap-usb-host.c +0 -0
index 7e96bb2..c9d27c4 100644

drivers/mfd/omap-usb-host.c static int __devinit usbhs_omap_probe(struct platform_device *pdev) · line 702

Quoted 5 lines
drivers/mfd/omap-usb-host.c +1 -1
@@ -699,7 +699,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev)
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[0])) {
-		/* for OMAP3 , the clk set paretn fails */
+		/* for OMAP3 , the clk set parent fails */

Can't we remove this comment now with the above fix? It is no longer relevant, right?

Cheers
Jon

#10 lore raw

PATCH v3 4/5 ARM: OMAP3EVM: cosmetic fixes for parent clk set

? 2012?06?21? 00:00, Jon Hunter ??:

Quoted 33 lines · Zumeng Chen
Quoted 32 lines

Since it's no more sense to set parent for dummy clock, so we can just ignore it to mute failed message.

---
  arch/arm/plat-omap/clock.c  |    4 ++++
  drivers/mfd/omap-usb-host.c |    2 +-
  2 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -0
index 62ec5c4..c7e26e4 100644
@@ -149,6 +149,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
  	if (!arch_clock || !arch_clock->clk_set_parent)
  		return ret;
 
+	/* If the clock is a dummy clock just return */
+	if (clk ==&dummy_ck)
+		return 0;
+
  	spin_lock_irqsave(&clockfw_lock, flags);
  	if (clk->usecount == 0) {
  		ret = arch_clock->clk_set_parent(clk, parent);
drivers/mfd/omap-usb-host.c +0 -0
index 7e96bb2..c9d27c4 100644
@@ -699,7 +699,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev)
  	}
 
Quoted 5 lines

drivers/mfd/omap-usb-host.c static int __devinit usbhs_omap_probe(struct platform_device *pdev) · line 702

Quoted 3 lines
drivers/mfd/omap-usb-host.c +1 -1
  	if (is_ehci_phy_mode(pdata->port_mode[0])) {
-		/* for OMAP3 , the clk set paretn fails */
+		/* for OMAP3 , the clk set parent fails */

Can't we remove this comment now with the above fix? It is no longer relevant, right?

Yes, NP.

Regards,
Zumeng

Quoted 7 lines

Cheers
Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#11 lore raw

PATCH 4/5 ARM: OMAP3EVM: cosmetic fixes for parent clk set

In reply to Zumeng Chen
Quoted 2 lines · Zumeng Chen

Since it's no more sense to set parent for dummy clock, so we can just ignore it to mute failed message.

This is something Paul should look at.

Regards,

Tony

Quoted 38 lines
---
 arch/arm/plat-omap/clock.c  |    4 ++++
 drivers/mfd/omap-usb-host.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -0
index 62ec5c4..c7e26e4 100644
@@ -149,6 +149,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	if (!arch_clock || !arch_clock->clk_set_parent)
 		return ret;
 
+	/* If the clock is a dummy clock just return */
+	if (clk == &dummy_ck)
+		return 0;
+
 	spin_lock_irqsave(&clockfw_lock, flags);
 	if (clk->usecount == 0) {
 		ret = arch_clock->clk_set_parent(clk, parent);
drivers/mfd/omap-usb-host.c +1 -1
index 7e96bb2..c9d27c4 100644
@@ -699,7 +699,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev)
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[0])) {
-		/* for OMAP3 , the clk set paretn fails */
+		/* for OMAP3 , the clk set parent fails */
 		ret = clk_set_parent(omap->utmi_p1_fck,
 					omap->xclk60mhsp1_ck);
 		if (ret != 0)
Signature · 1 line
1.7.5.4
#12 lore raw

PATCH v3 5/5 ARM: OMAP3530evm: set pendown_state and debounce time for ads7846

In reply to Zumeng Chen

Currently most ads7846 config definitions for OMAP3 series boards have been moved to common-board-devices.c, and it is transparent for init. And it's no very proper to do gpio_request based on get_pendown_state since omap_ads7846_init knows everything about ads7846_config.

So it's more fit to request gpio according to the right gpio_pendown and set debounce time conditionally. If we don't set proper debouce time, there are flooded interrupt counters of ads7846 responding to one time touch on screen, then the driver couldn't work very well.

This patch has been validated on 3530evm.

---
 arch/arm/mach-omap2/board-omap3evm.c       |    1 -
 arch/arm/mach-omap2/common-board-devices.c |   18 ++++++++++++++++--
 arch/arm/mach-omap2/common-board-devices.h |    1 +
 3 files changed, 17 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +0 -1
index 02d8047..834cfc0 100644
@@ -58,7 +58,6 @@
 #include "hsmmc.h"
 #include "common-board-devices.h"
 
-#define OMAP3_EVM_TS_GPIO	175
 #define OMAP3_EVM_EHCI_VBUS	22
 #define OMAP3_EVM_EHCI_SELECT	61
 
arch/arm/mach-omap2/common-board-devices.c +16 -2
index 1706ebc..4ba070e 100644
@@ -35,6 +35,16 @@ static struct omap2_mcspi_device_config ads7846_mcspi_config = {
 	.turbo_mode	= 0,
 };
 
+/*
+ * ADS7846 driver maybe request a gpio according to the value
+ * of pdata->get_pendown_state, but we have done this. So set
+ * get_pendown_state to avoid twice gpio requesting.
+ */
+static int omap3_get_pendown_state(void)
+{
+	return !gpio_get_value(OMAP3_EVM_TS_GPIO);
+}
+
 static struct ads7846_platform_data ads7846_config = {
 	.x_max			= 0x0fff,
 	.y_max			= 0x0fff,
@@ -45,6 +55,7 @@ static struct ads7846_platform_data ads7846_config = {
 	.debounce_rep		= 1,
 	.gpio_pendown		= -EINVAL,
 	.keep_vref_on		= 1,
+	.get_pendown_state	= &omap3_get_pendown_state,
 };
 
 static struct spi_board_info ads7846_spi_board_info __initdata = {
@@ -63,14 +74,17 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 	struct spi_board_info *spi_bi = &ads7846_spi_board_info;
 	int err;
 
-	if (board_pdata && board_pdata->get_pendown_state) {
+	if (gpio_pendown) {
 		err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
 		if (err) {
 			pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
 			return;
 		}
-		gpio_export(gpio_pendown, 0);
 
+		/* TS GPIOPendown doesn't allow user to change the direction */
+		gpio_export(gpio_pendown, false);
+
+		/* Set proper debouce time for ads7846. */
 		if (gpio_debounce)
 			gpio_set_debounce(gpio_pendown, gpio_debounce);
 	}
arch/arm/mach-omap2/common-board-devices.h +1 -0
index a0b4a428..4c4ef6a 100644
@@ -4,6 +4,7 @@
 #include "twl-common.h"
 
 #define NAND_BLOCK_SIZE	SZ_128K
+#define OMAP3_EVM_TS_GPIO	175
 
 struct mtd_partition;
 struct ads7846_platform_data;
Signature · 1 line
1.7.5.4