linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap
@ 2012-06-13  1:44 Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition Zumeng Chen
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

These patches fix misc problems when reflash ti-omap3530evm for
master branch on Linux-omap.

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

Changes vs V1:

 1. NAND flash definition changes as Jon's comments.
 2. Add more shortlog for VBUS switch from a kind people.
 3. Jon's cosmetic fix seems more fit.
 4. Debounce time I still leave a ugly hardcode in driver level
    with bracketing by ARCH_OMAP3. Anyway, Igor's comments are
    more sense.

 If you guy don't like patch 4 or 5, feel free to drop them :-)
 I'm OK for that, thanks all of your kind RR from Jon, Igor, and
 Tony.

 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
      Input: ads7846: set proper debounce time in driver level

 arch/arm/mach-omap2/board-omap3evm.c |   75 ++++++++++++++++++++++++++++++++++
 arch/arm/plat-omap/clock.c           |    4 ++
 drivers/input/touchscreen/ads7846.c  |    4 ++
 drivers/mfd/omap-usb-host.c          |    2 +-
 4 files changed, 84 insertions(+), 1 deletions(-)
 


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

* [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition
  2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
@ 2012-06-13  1:44 ` Zumeng Chen
  2012-06-13  7:57   ` Igor Grinberg
  2012-06-13  1:44 ` [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file Zumeng Chen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

From: Zumeng Chen <zumeng.chen@windriver.com>

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Tested-by: Zumeng Chen <zumeng.chen@windriver.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   39 ++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 639bd07..0b83d0e 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -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();
-- 
1.7.5.4


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

* [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file
  2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition Zumeng Chen
@ 2012-06-13  1:44 ` Zumeng Chen
  2012-06-13  8:16   ` Igor Grinberg
  2012-06-13  1:44 ` [PATCH V2 3/5] ARM: omap3evm: enable VBUS switch for EHCI tranceiver Zumeng Chen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

From: Zumeng Chen <zumeng.chen@windriver.com>

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.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 0b83d0e..3c91534 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -466,6 +466,30 @@ 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"),
+	{
+		.supply		= "vaux2",
+	}
+};
+
+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 +683,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);
-- 
1.7.5.4


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

* [PATCH V2 3/5] ARM: omap3evm: enable VBUS switch for EHCI tranceiver
  2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file Zumeng Chen
@ 2012-06-13  1:44 ` Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 4/5] ARM: OMAP3EVM: cosmetic fixes for parent clk set Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level Zumeng Chen
  4 siblings, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

From: Zumeng Chen <zumeng.chen@windriver.com>

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.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3c91534..63bb865 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -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;
 }
 
-- 
1.7.5.4


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

* [PATCH V2 4/5] ARM: OMAP3EVM: cosmetic fixes for parent clk set
  2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
                   ` (2 preceding siblings ...)
  2012-06-13  1:44 ` [PATCH V2 3/5] ARM: omap3evm: enable VBUS switch for EHCI tranceiver Zumeng Chen
@ 2012-06-13  1:44 ` Zumeng Chen
  2012-06-13  1:44 ` [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level Zumeng Chen
  4 siblings, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

From: Zumeng Chen <zumeng.chen@windriver.com>

Since set parent for dummy clock will dump failed message,
so we can just ignore to mute it.

Signed-off-by: Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Zumeng Chen <zumeng.chen@gmail.com>
---
 arch/arm/plat-omap/clock.c  |    4 ++++
 drivers/mfd/omap-usb-host.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 62ec5c4..c7e26e4 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -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);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 7e96bb2..c9d27c4 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -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)
-- 
1.7.5.4


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

* [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
                   ` (3 preceding siblings ...)
  2012-06-13  1:44 ` [PATCH V2 4/5] ARM: OMAP3EVM: cosmetic fixes for parent clk set Zumeng Chen
@ 2012-06-13  1:44 ` Zumeng Chen
  2012-06-13  7:51   ` Igor Grinberg
  2012-06-13 12:18   ` Hiremath, Vaibhav
  4 siblings, 2 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  1:44 UTC (permalink / raw)
  To: tony, jon-hunter, grinberg, linux-omap
  Cc: linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

From: Zumeng Chen <zumeng.chen@windriver.com>

If we don't set proper debouce time for ads7846, then there are
flooded interrupt counters of ads7846 responding to one time
touch on screen, so the driver couldn't work well.

And since most OMAP3 series boards pass NULL pointer of board_pdata
to omap_ads7846_init, so it's more proper to set it in driver level
after having gpio_request done.

This patch has been validated on 3530evm.

Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
---
 drivers/input/touchscreen/ads7846.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f02028e..459ff29 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
 		}
 
 		ts->gpio_pendown = pdata->gpio_pendown;
+#ifdef CONFIG_ARCH_OMAP3
+		/* 310 means about 10 microsecond for omap3 */
+		gpio_set_debounce(pdata->gpio_pendown, 310);
+#endif
 
 	} else {
 		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
-- 
1.7.5.4


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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13  1:44 ` [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level Zumeng Chen
@ 2012-06-13  7:51   ` Igor Grinberg
  2012-06-13  9:03     ` Zumeng Chen
  2012-06-13 12:18   ` Hiremath, Vaibhav
  1 sibling, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-13  7:51 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: khilman, tony, dmitry.torokhov, hvaibhav, ajay.gupta, khasim,
	jon-hunter, linux-input, linux-omap, linux-arm-kernel

On 06/13/12 04:44, Zumeng Chen wrote:
> From: Zumeng Chen <zumeng.chen@windriver.com>
> 
> If we don't set proper debouce time for ads7846, then there are
> flooded interrupt counters of ads7846 responding to one time
> touch on screen, so the driver couldn't work well.
> 
> And since most OMAP3 series boards pass NULL pointer of board_pdata
> to omap_ads7846_init, so it's more proper to set it in driver level
> after having gpio_request done.
> 
> This patch has been validated on 3530evm.
> 
> Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
> Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
> ---
>  drivers/input/touchscreen/ads7846.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index f02028e..459ff29 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>  		}
>  
>  		ts->gpio_pendown = pdata->gpio_pendown;
> +#ifdef CONFIG_ARCH_OMAP3
> +		/* 310 means about 10 microsecond for omap3 */
> +		gpio_set_debounce(pdata->gpio_pendown, 310);
> +#endif

Unless this concerns many boards/archs/platforms, I'd suggest you to implement
the get_pendown_state() method in the board file.
If more users will need this, it can be facilitated in the driver.
(and of course not with the ugly ifdefs...)

>  
>  	} else {
>  		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");

-- 
Regards,
Igor.

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

* Re: [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition
  2012-06-13  1:44 ` [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition Zumeng Chen
@ 2012-06-13  7:57   ` Igor Grinberg
  2012-06-13  8:16     ` Zumeng Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-13  7:57 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: tony, jon-hunter, linux-omap, linux-arm-kernel, khilman, khasim,
	ajay.gupta, hvaibhav, dmitry.torokhov, linux-input,
	Afzal Mohammed

On 06/13/12 04:44, Zumeng Chen wrote:
> From: Zumeng Chen <zumeng.chen@windriver.com>
> 
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Tested-by: Zumeng Chen <zumeng.chen@windriver.com>
> ---
>  arch/arm/mach-omap2/board-omap3evm.c |   39 ++++++++++++++++++++++++++++++++++
>  1 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index 639bd07..0b83d0e 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -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));
> +

I think, this will interfere with Afzal's patches [1]?

>  	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
>  	omap3evm_init_smsc911x();
>  	omap3_evm_display_init();

[1] http://www.spinics.net/lists/arm-kernel/msg178664.html

-- 
Regards,
Igor.

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

* Re: [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file
  2012-06-13  1:44 ` [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file Zumeng Chen
@ 2012-06-13  8:16   ` Igor Grinberg
  2012-06-13  8:23     ` Zumeng Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-13  8:16 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: tony, jon-hunter, linux-omap, linux-arm-kernel, khilman, khasim,
	ajay.gupta, hvaibhav, dmitry.torokhov, linux-input

On 06/13/12 04:44, Zumeng Chen wrote:
> From: Zumeng Chen <zumeng.chen@windriver.com>
> 
> 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.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
> ---
>  arch/arm/mach-omap2/board-omap3evm.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index 0b83d0e..3c91534 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -466,6 +466,30 @@ 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"),
> +	{
> +		.supply		= "vaux2",
> +	}

This too can use the REGULATOR_SUPPLY() macro, why not use it?

> +};
> +
> +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 +683,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);

-- 
Regards,
Igor.

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

* Re: [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition
  2012-06-13  7:57   ` Igor Grinberg
@ 2012-06-13  8:16     ` Zumeng Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  8:16 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Zumeng Chen, tony, jon-hunter, linux-omap, linux-arm-kernel,
	khilman, khasim, ajay.gupta, hvaibhav, dmitry.torokhov,
	linux-input, Afzal Mohammed

于 2012年06月13日 15:57, Igor Grinberg 写道:
> On 06/13/12 04:44, Zumeng Chen wrote:
>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>
>> Signed-off-by: Vaibhav Hiremath<hvaibhav@ti.com>
>> Tested-by: Zumeng Chen<zumeng.chen@windriver.com>
>> ---
>>   arch/arm/mach-omap2/board-omap3evm.c |   39 ++++++++++++++++++++++++++++++++++
>>   1 files changed, 39 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
>> index 639bd07..0b83d0e 100644
>> --- a/arch/arm/mach-omap2/board-omap3evm.c
>> +++ b/arch/arm/mach-omap2/board-omap3evm.c
>> @@ -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));
>> +
> I think, this will interfere with Afzal's patches [1]?
Yes, Igor, thanks for your kind reminder, I have already
noticed Afzal's GPMC patches when at [PATCH v4 00/39]

But I didn't read recently, I'll check them again to see if they
have been in Tony's queue :-)

Regards,
Zumeng

>>   	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
>>   	omap3evm_init_smsc911x();
>>   	omap3_evm_display_init();
> [1] http://www.spinics.net/lists/arm-kernel/msg178664.html
>

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

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

* Re: [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file
  2012-06-13  8:16   ` Igor Grinberg
@ 2012-06-13  8:23     ` Zumeng Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  8:23 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Zumeng Chen, tony, jon-hunter, linux-omap, linux-arm-kernel,
	khilman, khasim, ajay.gupta, hvaibhav, dmitry.torokhov,
	linux-input

于 2012年06月13日 16:16, Igor Grinberg 写道:
> On 06/13/12 04:44, Zumeng Chen wrote:
>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>
>> 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.
>>
>> Signed-off-by: Ajay Kumar Gupta<ajay.gupta@ti.com>
>> Signed-off-by: Vaibhav Hiremath<hvaibhav@ti.com>
>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>> ---
>>   arch/arm/mach-omap2/board-omap3evm.c |   27 +++++++++++++++++++++++++++
>>   1 files changed, 27 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
>> index 0b83d0e..3c91534 100644
>> --- a/arch/arm/mach-omap2/board-omap3evm.c
>> +++ b/arch/arm/mach-omap2/board-omap3evm.c
>> @@ -466,6 +466,30 @@ 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"),
>> +	{
>> +		.supply		= "vaux2",
>> +	}
> This too can use the REGULATOR_SUPPLY() macro, why not use it?
Yes, Of course from me, I'll try to see if there is other considerations
from the original patch. If no I'll change it.

Regards,
Zumeng
>> +};
>> +
>> +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 +683,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);

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

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13  7:51   ` Igor Grinberg
@ 2012-06-13  9:03     ` Zumeng Chen
  2012-06-13 10:13       ` Igor Grinberg
  0 siblings, 1 reply; 25+ messages in thread
From: Zumeng Chen @ 2012-06-13  9:03 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Zumeng Chen, tony, jon-hunter, linux-omap, linux-arm-kernel,
	khilman, khasim, ajay.gupta, hvaibhav, dmitry.torokhov,
	linux-input

于 2012年06月13日 15:51, Igor Grinberg 写道:
> On 06/13/12 04:44, Zumeng Chen wrote:
>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>
>> If we don't set proper debouce time for ads7846, then there are
>> flooded interrupt counters of ads7846 responding to one time
>> touch on screen, so the driver couldn't work well.
>>
>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>> to omap_ads7846_init, so it's more proper to set it in driver level
>> after having gpio_request done.
>>
>> This patch has been validated on 3530evm.
>>
>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>> ---
>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>> index f02028e..459ff29 100644
>> --- a/drivers/input/touchscreen/ads7846.c
>> +++ b/drivers/input/touchscreen/ads7846.c
>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>   		}
>>
>>   		ts->gpio_pendown = pdata->gpio_pendown;
>> +#ifdef CONFIG_ARCH_OMAP3
>> +		/* 310 means about 10 microsecond for omap3 */
>> +		gpio_set_debounce(pdata->gpio_pendown, 310);
>> +#endif
> Unless this concerns many boards/archs/platforms,
Yes, this is the case.
> I'd suggest you to implement
> the get_pendown_state() method in the board file.
it seems they are different way between gpio and
get_pendown_state, and gpio way is used for omap3
to drive ads7846, so I guess we may have to do like this.

Regards,
Zumeng
> If more users will need this, it can be facilitated in the driver.
> (and of course not with the ugly ifdefs...)
>
>>
>>   	} else {
>>   		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");

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

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13  9:03     ` Zumeng Chen
@ 2012-06-13 10:13       ` Igor Grinberg
  2012-06-16 13:27         ` Marek Vasut
  0 siblings, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-13 10:13 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: Zumeng Chen, tony, jon-hunter, linux-omap, linux-arm-kernel,
	khilman, khasim, ajay.gupta, hvaibhav, dmitry.torokhov,
	linux-input

On 06/13/12 12:03, Zumeng Chen wrote:
> 于 2012年06月13日 15:51, Igor Grinberg 写道:
>> On 06/13/12 04:44, Zumeng Chen wrote:
>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>
>>> If we don't set proper debouce time for ads7846, then there are
>>> flooded interrupt counters of ads7846 responding to one time
>>> touch on screen, so the driver couldn't work well.
>>>
>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>> after having gpio_request done.
>>>
>>> This patch has been validated on 3530evm.
>>>
>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>> ---
>>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>> index f02028e..459ff29 100644
>>> --- a/drivers/input/touchscreen/ads7846.c
>>> +++ b/drivers/input/touchscreen/ads7846.c
>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>           }
>>>
>>>           ts->gpio_pendown = pdata->gpio_pendown;
>>> +#ifdef CONFIG_ARCH_OMAP3
>>> +        /* 310 means about 10 microsecond for omap3 */
>>> +        gpio_set_debounce(pdata->gpio_pendown, 310);
>>> +#endif
>> Unless this concerns many boards/archs/platforms,
> Yes, this is the case.
>> I'd suggest you to implement
>> the get_pendown_state() method in the board file.
> it seems they are different way between gpio and
> get_pendown_state, and gpio way is used for omap3
> to drive ads7846, so I guess we may have to do like this.

No, this is not (and does not have to be) OMAP wide.
The decision for this is made on per-board basis.

> 
> Regards,
> Zumeng
>> If more users will need this, it can be facilitated in the driver.
>> (and of course not with the ugly ifdefs...)
>>
>>>
>>>       } else {
>>>           dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Regards,
Igor.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13  1:44 ` [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level Zumeng Chen
  2012-06-13  7:51   ` Igor Grinberg
@ 2012-06-13 12:18   ` Hiremath, Vaibhav
  2012-06-14  3:29     ` Zumeng Chen
  2012-06-14  4:46     ` Zumeng Chen
  1 sibling, 2 replies; 25+ messages in thread
From: Hiremath, Vaibhav @ 2012-06-13 12:18 UTC (permalink / raw)
  To: Zumeng Chen, tony@atomide.com, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org
  Cc: linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
> From: Zumeng Chen <zumeng.chen@windriver.com>
> 
> If we don't set proper debouce time for ads7846, then there are
> flooded interrupt counters of ads7846 responding to one time
> touch on screen, so the driver couldn't work well.
> 
> And since most OMAP3 series boards pass NULL pointer of board_pdata
> to omap_ads7846_init, so it's more proper to set it in driver level
> after having gpio_request done.
> 
> This patch has been validated on 3530evm.
> 
> Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
> Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
> ---
>  drivers/input/touchscreen/ads7846.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index f02028e..459ff29 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>  		}
>  
>  		ts->gpio_pendown = pdata->gpio_pendown;
> +#ifdef CONFIG_ARCH_OMAP3
> +		/* 310 means about 10 microsecond for omap3 */
> +		gpio_set_debounce(pdata->gpio_pendown, 310);
> +#endif
>  

Zumeng,

With my sign-off you are changing the original code, that too
without my sign-off and ack. 
I wouldn't mind you to submit patches from my tree, but the expectation is 
if you are changing the original code, it should be under your sign-off.

Coming to the patch, #ifdef in driver is not recommended, and this 10msec 
delay is specific to OMAP GPIO and driver should not be aware of this, 
that's where you will find the original patch handling it in board file.

Thanks,
Vaibhav
>  	} else {
>  		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
> -- 
> 1.7.5.4
> 
> 


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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13 12:18   ` Hiremath, Vaibhav
@ 2012-06-14  3:29     ` Zumeng Chen
  2012-06-14  4:46     ` Zumeng Chen
  1 sibling, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-14  3:29 UTC (permalink / raw)
  To: Hiremath, Vaibhav, mike
  Cc: Hilman, Kevin, tony@atomide.com, dmitry.torokhov@gmail.com,
	Gupta, Ajay Kumar, Syed Mohammed, Khasim, Hunter, Jon,
	linux-input@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, grinberg@compulab.co.il


[-- Attachment #1.1: Type: text/plain, Size: 2332 bytes --]

2012/6/13 Hiremath, Vaibhav <hvaibhav@ti.com>

> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
> > From: Zumeng Chen <zumeng.chen@windriver.com>
> >
> > If we don't set proper debouce time for ads7846, then there are
> > flooded interrupt counters of ads7846 responding to one time
> > touch on screen, so the driver couldn't work well.
> >
> > And since most OMAP3 series boards pass NULL pointer of board_pdata
> > to omap_ads7846_init, so it's more proper to set it in driver level
> > after having gpio_request done.
> >
> > This patch has been validated on 3530evm.
> >
> > Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
> > Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
> > ---
> >  drivers/input/touchscreen/ads7846.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/ads7846.c
> b/drivers/input/touchscreen/ads7846.c
> > index f02028e..459ff29 100644
> > --- a/drivers/input/touchscreen/ads7846.c
> > +++ b/drivers/input/touchscreen/ads7846.c
> > @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct
> spi_device *spi, struct ads784
> >               }
> >
> >               ts->gpio_pendown = pdata->gpio_pendown;
> > +#ifdef CONFIG_ARCH_OMAP3
> > +             /* 310 means about 10 microsecond for omap3 */
> > +             gpio_set_debounce(pdata->gpio_pendown, 310);
> > +#endif
> >
>
> Zumeng,
>
> With my sign-off you are changing the original code, that too
> without my sign-off and ack.
> I wouldn't mind you to submit patches from my tree, but the expectation is
> if you are changing the original code, it should be under your sign-off.
>
Many thanks for your information, good to learn. I'll remove too. Sorry for
inconvenience.

>
> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
> delay is specific to OMAP GPIO and driver should not be aware of this,
> that's where you will find the original patch handling it in board file.
>
Yes, I just went through again the board related codes, there is a commit
from
Mike, I think that's the basic thoughts for me to do this patch for all
omap3 about
ads7846 :-)

Regards,
Zumeng


>
> Thanks,
> Vaibhav
> >       } else {
> >               dev_err(&spi->dev, "no get_pendown_state nor
> gpio_pendown?\n");
> > --
> > 1.7.5.4
> >
> >
>
>

[-- Attachment #1.2: Type: text/html, Size: 3440 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13 12:18   ` Hiremath, Vaibhav
  2012-06-14  3:29     ` Zumeng Chen
@ 2012-06-14  4:46     ` Zumeng Chen
  2012-06-14  6:31       ` Hiremath, Vaibhav
  2012-06-14  6:44       ` Igor Grinberg
  1 sibling, 2 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-14  4:46 UTC (permalink / raw)
  To: Hiremath, Vaibhav, mike
  Cc: Zumeng Chen, tony@atomide.com, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>
>> If we don't set proper debouce time for ads7846, then there are
>> flooded interrupt counters of ads7846 responding to one time
>> touch on screen, so the driver couldn't work well.
>>
>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>> to omap_ads7846_init, so it's more proper to set it in driver level
>> after having gpio_request done.
>>
>> This patch has been validated on 3530evm.
>>
>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>> ---
>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>> index f02028e..459ff29 100644
>> --- a/drivers/input/touchscreen/ads7846.c
>> +++ b/drivers/input/touchscreen/ads7846.c
>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>   		}
>>
>>   		ts->gpio_pendown = pdata->gpio_pendown;
>> +#ifdef CONFIG_ARCH_OMAP3
>> +		/* 310 means about 10 microsecond for omap3 */
>> +		gpio_set_debounce(pdata->gpio_pendown, 310);
>> +#endif
>>
> Zumeng,
>
> With my sign-off you are changing the original code, that too
> without my sign-off and ack.
> I wouldn't mind you to submit patches from my tree, but the expectation is
> if you are changing the original code, it should be under your sign-off.
Thanks, good to learn. I'll remove in next time.
> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
> delay is specific to OMAP GPIO and driver should not be aware of this,
> that's where you will find the original patch handling it in board file.
According to the git blame of the board-omap3evm.c I think
96974a24 did a good thing to all the related codes for omap3
boards. So I think we can call board and driver as BSP level :-)

If #ifdef in driver can save many codes, I guess it's deserved.

Regards,
Zumeng
> Thanks,
> Vaibhav
>>   	} else {
>>   		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
>> -- 
>> 1.7.5.4
>>
>>

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

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

* RE: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  4:46     ` Zumeng Chen
@ 2012-06-14  6:31       ` Hiremath, Vaibhav
  2012-06-14  6:59         ` Zumeng Chen
  2012-06-14  6:44       ` Igor Grinberg
  1 sibling, 1 reply; 25+ messages in thread
From: Hiremath, Vaibhav @ 2012-06-14  6:31 UTC (permalink / raw)
  To: Zumeng Chen, mike@compulab.co.il
  Cc: Zumeng Chen, tony@atomide.com, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

On Thu, Jun 14, 2012 at 10:16:55, Zumeng Chen wrote:
> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
> > On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
> >> From: Zumeng Chen<zumeng.chen@windriver.com>
> >>
> >> If we don't set proper debouce time for ads7846, then there are
> >> flooded interrupt counters of ads7846 responding to one time
> >> touch on screen, so the driver couldn't work well.
> >>
> >> And since most OMAP3 series boards pass NULL pointer of board_pdata
> >> to omap_ads7846_init, so it's more proper to set it in driver level
> >> after having gpio_request done.
> >>
> >> This patch has been validated on 3530evm.
> >>
> >> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
> >> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
> >> ---
> >>   drivers/input/touchscreen/ads7846.c |    4 ++++
> >>   1 files changed, 4 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> >> index f02028e..459ff29 100644
> >> --- a/drivers/input/touchscreen/ads7846.c
> >> +++ b/drivers/input/touchscreen/ads7846.c
> >> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
> >>   		}
> >>
> >>   		ts->gpio_pendown = pdata->gpio_pendown;
> >> +#ifdef CONFIG_ARCH_OMAP3
> >> +		/* 310 means about 10 microsecond for omap3 */
> >> +		gpio_set_debounce(pdata->gpio_pendown, 310);
> >> +#endif
> >>
> > Zumeng,
> >
> > With my sign-off you are changing the original code, that too
> > without my sign-off and ack.
> > I wouldn't mind you to submit patches from my tree, but the expectation is
> > if you are changing the original code, it should be under your sign-off.
> Thanks, good to learn. I'll remove in next time.
> > Coming to the patch, #ifdef in driver is not recommended, and this 10msec
> > delay is specific to OMAP GPIO and driver should not be aware of this,
> > that's where you will find the original patch handling it in board file.
> According to the git blame of the board-omap3evm.c I think
> 96974a24 did a good thing to all the related codes for omap3
> boards. So I think we can call board and driver as BSP level :-)
> 
> If #ifdef in driver can save many codes, I guess it's deserved.
> 

No, not really.

In the same commit, the debounce time is already handled as an argument to 
the function omap_ads7846_init(), and that’s the way it should be.
So no need for #ifdefs in driver...

Thanks,
Vaibhav

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  4:46     ` Zumeng Chen
  2012-06-14  6:31       ` Hiremath, Vaibhav
@ 2012-06-14  6:44       ` Igor Grinberg
  2012-06-14  7:08         ` Zumeng Chen
  1 sibling, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-14  6:44 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: Hiremath, Vaibhav, mike, Zumeng Chen, tony@atomide.com,
	Hunter, Jon, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]

On 06/14/12 07:46, Zumeng Chen wrote:
> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>
>>> If we don't set proper debouce time for ads7846, then there are
>>> flooded interrupt counters of ads7846 responding to one time
>>> touch on screen, so the driver couldn't work well.
>>>
>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>> after having gpio_request done.
>>>
>>> This patch has been validated on 3530evm.
>>>
>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>> ---
>>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>> index f02028e..459ff29 100644
>>> --- a/drivers/input/touchscreen/ads7846.c
>>> +++ b/drivers/input/touchscreen/ads7846.c
>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>           }
>>>
>>>           ts->gpio_pendown = pdata->gpio_pendown;
>>> +#ifdef CONFIG_ARCH_OMAP3
>>> +        /* 310 means about 10 microsecond for omap3 */
>>> +        gpio_set_debounce(pdata->gpio_pendown, 310);
>>> +#endif
>>>
>> Zumeng,
>>
>> With my sign-off you are changing the original code, that too
>> without my sign-off and ack.
>> I wouldn't mind you to submit patches from my tree, but the expectation is
>> if you are changing the original code, it should be under your sign-off.
> Thanks, good to learn. I'll remove in next time.
>> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>> delay is specific to OMAP GPIO and driver should not be aware of this,
>> that's where you will find the original patch handling it in board file.
> According to the git blame of the board-omap3evm.c I think
> 96974a24 did a good thing to all the related codes for omap3
> boards. So I think we can call board and driver as BSP level :-)
> 
> If #ifdef in driver can save many codes, I guess it's deserved.

No, platform/board specific ifdefs in the generic driver code are never
deserved.
How about the attached patch, does it fix the problem for you?


-- 
Regards,
Igor.

[-- Attachment #2: ads7846.patch --]
[-- Type: text/x-patch, Size: 1432 bytes --]

diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 1706ebc..c187586 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -63,28 +63,30 @@ 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) {
-		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);
-
-		if (gpio_debounce)
-			gpio_set_debounce(gpio_pendown, gpio_debounce);
+	err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
+	if (err) {
+		pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
+		return;
 	}
 
+	if (gpio_debounce)
+		gpio_set_debounce(gpio_pendown, gpio_debounce);
+
 	spi_bi->bus_num	= bus_num;
 	spi_bi->irq	= gpio_to_irq(gpio_pendown);
 
 	if (board_pdata) {
 		board_pdata->gpio_pendown = gpio_pendown;
 		spi_bi->platform_data = board_pdata;
+		if (board_pdata->get_pendown_state)
+			gpio_export(gpio_pendown, 0);
 	} else {
 		ads7846_config.gpio_pendown = gpio_pendown;
 	}
 
+	if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))
+		gpio_free(gpio_pendown);
+
 	spi_register_board_info(&ads7846_spi_board_info, 1);
 }
 #else

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  6:31       ` Hiremath, Vaibhav
@ 2012-06-14  6:59         ` Zumeng Chen
  2012-06-16  0:15           ` zumeng.chen
  2012-06-20  5:28           ` Zumeng Chen
  0 siblings, 2 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-14  6:59 UTC (permalink / raw)
  To: Hiremath, Vaibhav, mike@compulab.co.il
  Cc: Zumeng Chen, tony@atomide.com, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 3134 bytes --]

于 2012年06月14日 14:31, Hiremath, Vaibhav 写道:
> On Thu, Jun 14, 2012 at 10:16:55, Zumeng Chen wrote:
>> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>>
>>>> If we don't set proper debouce time for ads7846, then there are
>>>> flooded interrupt counters of ads7846 responding to one time
>>>> touch on screen, so the driver couldn't work well.
>>>>
>>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>>> after having gpio_request done.
>>>>
>>>> This patch has been validated on 3530evm.
>>>>
>>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>> ---
>>>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>> index f02028e..459ff29 100644
>>>> --- a/drivers/input/touchscreen/ads7846.c
>>>> +++ b/drivers/input/touchscreen/ads7846.c
>>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>>   		}
>>>>
>>>>   		ts->gpio_pendown = pdata->gpio_pendown;
>>>> +#ifdef CONFIG_ARCH_OMAP3
>>>> +		/* 310 means about 10 microsecond for omap3 */
>>>> +		gpio_set_debounce(pdata->gpio_pendown, 310);
>>>> +#endif
>>>>
>>> Zumeng,
>>>
>>> With my sign-off you are changing the original code, that too
>>> without my sign-off and ack.
>>> I wouldn't mind you to submit patches from my tree, but the expectation is
>>> if you are changing the original code, it should be under your sign-off.
>> Thanks, good to learn. I'll remove in next time.
>>> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>> delay is specific to OMAP GPIO and driver should not be aware of this,
>>> that's where you will find the original patch handling it in board file.
>> According to the git blame of the board-omap3evm.c I think
>> 96974a24 did a good thing to all the related codes for omap3
>> boards. So I think we can call board and driver as BSP level :-)
>>
>> If #ifdef in driver can save many codes, I guess it's deserved.
>>
> No, not really.
>
> In the same commit, the debounce time is already handled as an argument to 
> the function omap_ads7846_init(), and that’s the way it should be.
That means you'd like to implement the same get_pendown_state for every
omap3 board? Currently, board_pdata is NULL.

And actually, the reason why I agree 96974a24 is that get_pendown_state
for all omap3 boards is the common chip level gpio operations. so I think
we should set debounce for them in one common point.

But since Igor and you don't like them, I have created and tested the
attachment
patch, and I'd like Mike to check if convenience too
But obviously there are more codes than mine before :-)

Regards,
Zumeng
> So no need for #ifdefs in driver...
>
> Thanks,
> Vaibhav


[-- Attachment #2: ads7846-common.diff --]
[-- Type: text/x-patch, Size: 2373 bytes --]

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 56cce1e..887bd35 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -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
 
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 719f62e..8cf0140 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -34,6 +34,11 @@
 static struct omap2_mcspi_device_config ads7846_mcspi_config = {
 	.turbo_mode	= 0,
 };
+	
+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,
@@ -45,6 +50,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,17 +69,14 @@ 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) {
-		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);
-
-		if (gpio_debounce)
-			gpio_set_debounce(gpio_pendown, gpio_debounce);
+	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);
+	if (gpio_debounce)
+		gpio_set_debounce(gpio_pendown, gpio_debounce);
 
 	spi_bi->bus_num	= bus_num;
 	spi_bi->irq	= gpio_to_irq(gpio_pendown);
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index a0b4a428..4c4ef6a 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -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;

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  6:44       ` Igor Grinberg
@ 2012-06-14  7:08         ` Zumeng Chen
  2012-06-14  8:06           ` Igor Grinberg
  0 siblings, 1 reply; 25+ messages in thread
From: Zumeng Chen @ 2012-06-14  7:08 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Hilman, Kevin, linux-input@vger.kernel.org, Zumeng Chen,
	tony@atomide.com, dmitry.torokhov@gmail.com, Hiremath, Vaibhav,
	Gupta, Ajay Kumar, Syed Mohammed, Khasim, Hunter, Jon, mike,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org


[-- Attachment #1.1: Type: text/plain, Size: 4432 bytes --]

于 2012年06月14日 14:44, Igor Grinberg 写道:
> On 06/14/12 07:46, Zumeng Chen wrote:
>> >  于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>> >>  On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>> >>>  From: Zumeng Chen<zumeng.chen@windriver.com>
>>>> >>>
>>>> >>>  If we don't set proper debouce time for ads7846, then there are
>>>> >>>  flooded interrupt counters of ads7846 responding to one time
>>>> >>>  touch on screen, so the driver couldn't work well.
>>>> >>>
>>>> >>>  And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>> >>>  to omap_ads7846_init, so it's more proper to set it in driver level
>>>> >>>  after having gpio_request done.
>>>> >>>
>>>> >>>  This patch has been validated on 3530evm.
>>>> >>>
>>>> >>>  Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>> >>>  Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>> >>>  ---
>>>> >>>     drivers/input/touchscreen/ads7846.c |    4 ++++
>>>> >>>     1 files changed, 4 insertions(+), 0 deletions(-)
>>>> >>>
>>>> >>>  diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>> >>>  index f02028e..459ff29 100644
>>>> >>>  --- a/drivers/input/touchscreen/ads7846.c
>>>> >>>  +++ b/drivers/input/touchscreen/ads7846.c
>>>> >>>  @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>> >>>             }
>>>> >>>
>>>> >>>             ts->gpio_pendown = pdata->gpio_pendown;
>>>> >>>  +#ifdef CONFIG_ARCH_OMAP3
>>>> >>>  +        /* 310 means about 10 microsecond for omap3 */
>>>> >>>  +        gpio_set_debounce(pdata->gpio_pendown, 310);
>>>> >>>  +#endif
>>>> >>>
>>> >>  Zumeng,
>>> >>
>>> >>  With my sign-off you are changing the original code, that too
>>> >>  without my sign-off and ack.
>>> >>  I wouldn't mind you to submit patches from my tree, but the expectation is
>>> >>  if you are changing the original code, it should be under your sign-off.
>> >  Thanks, good to learn. I'll remove in next time.
>>> >>  Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>> >>  delay is specific to OMAP GPIO and driver should not be aware of this,
>>> >>  that's where you will find the original patch handling it in board file.
>> >  According to the git blame of the board-omap3evm.c I think
>> >  96974a24 did a good thing to all the related codes for omap3
>> >  boards. So I think we can call board and driver as BSP level:-)
>> >  
>> >  If #ifdef in driver can save many codes, I guess it's deserved.
> No, platform/board specific ifdefs in the generic driver code are never
> deserved.
> How about the attached patch, does it fix the problem for you?
Sorry Igor, I just read your patch, yes, most are there, and we
just have to set get_pendown_state as you early said. Really
*thanks* for your drive :)

Regards,
Zumeng
> -- Regards, Igor.
> ads7846.patch
>
>
> diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
> index 1706ebc..c187586 100644
> --- a/arch/arm/mach-omap2/common-board-devices.c
> +++ b/arch/arm/mach-omap2/common-board-devices.c
> @@ -63,28 +63,30 @@ 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) {
> -		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);
> -
> -		if (gpio_debounce)
> -			gpio_set_debounce(gpio_pendown, gpio_debounce);
> +	err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
> +	if (err) {
> +		pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
> +		return;
>   	}
>   	
> +	if (gpio_debounce)
> +		gpio_set_debounce(gpio_pendown, gpio_debounce);
> +
>   	spi_bi->bus_num	= bus_num;
>   	spi_bi->irq	= gpio_to_irq(gpio_pendown);
>
>   	if (board_pdata) {
>   		board_pdata->gpio_pendown = gpio_pendown;
>   		spi_bi->platform_data = board_pdata;
> +		if (board_pdata->get_pendown_state)
> +			gpio_export(gpio_pendown, 0);
>   	} else {
>   		ads7846_config.gpio_pendown = gpio_pendown;
>   	}
>
> +	if (!board_pdata || (board_pdata&&  !board_pdata->get_pendown_state))
> +		gpio_free(gpio_pendown);
> +
>   	spi_register_board_info(&ads7846_spi_board_info, 1);
>   }
>   #else


[-- Attachment #1.2: Type: text/html, Size: 8423 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  7:08         ` Zumeng Chen
@ 2012-06-14  8:06           ` Igor Grinberg
  2012-06-14  8:18             ` Zumeng Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Igor Grinberg @ 2012-06-14  8:06 UTC (permalink / raw)
  To: Zumeng Chen
  Cc: Hiremath, Vaibhav, mike, Zumeng Chen, tony@atomide.com,
	Hunter, Jon, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

On 06/14/12 10:08, Zumeng Chen wrote:
> 于 2012年06月14日 14:44, Igor Grinberg 写道:
>> On 06/14/12 07:46, Zumeng Chen wrote:
>>> > 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>>> >> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>>> >>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>>> >>>
>>>>> >>> If we don't set proper debouce time for ads7846, then there are
>>>>> >>> flooded interrupt counters of ads7846 responding to one time
>>>>> >>> touch on screen, so the driver couldn't work well.
>>>>> >>>
>>>>> >>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>>> >>> to omap_ads7846_init, so it's more proper to set it in driver level
>>>>> >>> after having gpio_request done.
>>>>> >>>
>>>>> >>> This patch has been validated on 3530evm.
>>>>> >>>
>>>>> >>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>>> >>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>>> >>> ---
>>>>> >>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>>> >>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>>> >>>
>>>>> >>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>>> >>> index f02028e..459ff29 100644
>>>>> >>> --- a/drivers/input/touchscreen/ads7846.c
>>>>> >>> +++ b/drivers/input/touchscreen/ads7846.c
>>>>> >>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>>> >>>           }
>>>>> >>>
>>>>> >>>           ts->gpio_pendown = pdata->gpio_pendown;
>>>>> >>> +#ifdef CONFIG_ARCH_OMAP3
>>>>> >>> +        /* 310 means about 10 microsecond for omap3 */
>>>>> >>> +        gpio_set_debounce(pdata->gpio_pendown, 310);
>>>>> >>> +#endif
>>>>> >>>
>>>> >> Zumeng,
>>>> >>
>>>> >> With my sign-off you are changing the original code, that too
>>>> >> without my sign-off and ack.
>>>> >> I wouldn't mind you to submit patches from my tree, but the expectation is
>>>> >> if you are changing the original code, it should be under your sign-off.
>>> > Thanks, good to learn. I'll remove in next time.
>>>> >> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>>> >> delay is specific to OMAP GPIO and driver should not be aware of this,
>>>> >> that's where you will find the original patch handling it in board file.
>>> > According to the git blame of the board-omap3evm.c I think
>>> > 96974a24 did a good thing to all the related codes for omap3
>>> > boards. So I think we can call board and driver as BSP level :-)
>>> > 
>>> > If #ifdef in driver can save many codes, I guess it's deserved.
>> No, platform/board specific ifdefs in the generic driver code are never
>> deserved.
>> How about the attached patch, does it fix the problem for you?
> Sorry Igor, I just read your patch, yes, most are there, and we
> just have to set get_pendown_state as you early said. Really
> *thanks* for your drive :)

No, with my patch, you don't need the get_pendown_state() and
you don't need to change the board-omap3evm.c ADS7846 related code.
So, I'm going to submit my patch properly.

> 
> Regards,
> Zumeng
>> -- Regards, Igor.
>> ads7846.patch
>>
>>
>> diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
>> index 1706ebc..c187586 100644
>> --- a/arch/arm/mach-omap2/common-board-devices.c
>> +++ b/arch/arm/mach-omap2/common-board-devices.c
>> @@ -63,28 +63,30 @@ 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) {
>> -		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);
>> -
>> -		if (gpio_debounce)
>> -			gpio_set_debounce(gpio_pendown, gpio_debounce);
>> +	err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
>> +	if (err) {
>> +		pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
>> +		return;
>>  	}
>>  	
>> +	if (gpio_debounce)
>> +		gpio_set_debounce(gpio_pendown, gpio_debounce);
>> +
>>  	spi_bi->bus_num	= bus_num;
>>  	spi_bi->irq	= gpio_to_irq(gpio_pendown);
>>  
>>  	if (board_pdata) {
>>  		board_pdata->gpio_pendown = gpio_pendown;
>>  		spi_bi->platform_data = board_pdata;
>> +		if (board_pdata->get_pendown_state)
>> +			gpio_export(gpio_pendown, 0);
>>  	} else {
>>  		ads7846_config.gpio_pendown = gpio_pendown;
>>  	}
>>  
>> +	if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))
>> +		gpio_free(gpio_pendown);
>> +
>>  	spi_register_board_info(&ads7846_spi_board_info, 1);
>>  }
>>  #else
> 

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

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  8:06           ` Igor Grinberg
@ 2012-06-14  8:18             ` Zumeng Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-14  8:18 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Hiremath, Vaibhav, mike, Zumeng Chen, tony@atomide.com,
	Hunter, Jon, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

于 2012年06月14日 16:06, Igor Grinberg 写道:
> On 06/14/12 10:08, Zumeng Chen wrote:
>> 于 2012年06月14日 14:44, Igor Grinberg 写道:
>>> On 06/14/12 07:46, Zumeng Chen wrote:
>>>>> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>>>>>> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>>>>>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>>>>>>>
>>>>>>>>> If we don't set proper debouce time for ads7846, then there are
>>>>>>>>> flooded interrupt counters of ads7846 responding to one time
>>>>>>>>> touch on screen, so the driver couldn't work well.
>>>>>>>>>
>>>>>>>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>>>>>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>>>>>>>> after having gpio_request done.
>>>>>>>>>
>>>>>>>>> This patch has been validated on 3530evm.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>>>>>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>>>>>>> ---
>>>>>>>>>    drivers/input/touchscreen/ads7846.c |    4 ++++
>>>>>>>>>    1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>>>>>>> index f02028e..459ff29 100644
>>>>>>>>> --- a/drivers/input/touchscreen/ads7846.c
>>>>>>>>> +++ b/drivers/input/touchscreen/ads7846.c
>>>>>>>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>>>>>>>            }
>>>>>>>>>
>>>>>>>>>            ts->gpio_pendown = pdata->gpio_pendown;
>>>>>>>>> +#ifdef CONFIG_ARCH_OMAP3
>>>>>>>>> +        /* 310 means about 10 microsecond for omap3 */
>>>>>>>>> +        gpio_set_debounce(pdata->gpio_pendown, 310);
>>>>>>>>> +#endif
>>>>>>>>>
>>>>>>> Zumeng,
>>>>>>>
>>>>>>> With my sign-off you are changing the original code, that too
>>>>>>> without my sign-off and ack.
>>>>>>> I wouldn't mind you to submit patches from my tree, but the expectation is
>>>>>>> if you are changing the original code, it should be under your sign-off.
>>>>> Thanks, good to learn. I'll remove in next time.
>>>>>>> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>>>>>> delay is specific to OMAP GPIO and driver should not be aware of this,
>>>>>>> that's where you will find the original patch handling it in board file.
>>>>> According to the git blame of the board-omap3evm.c I think
>>>>> 96974a24 did a good thing to all the related codes for omap3
>>>>> boards. So I think we can call board and driver as BSP level :-)
>>>>>
>>>>> If #ifdef in driver can save many codes, I guess it's deserved.
>>> No, platform/board specific ifdefs in the generic driver code are never
>>> deserved.
>>> How about the attached patch, does it fix the problem for you?
>> Sorry Igor, I just read your patch, yes, most are there, and we
>> just have to set get_pendown_state as you early said. Really
>> *thanks* for your drive :)
> No, with my patch, you don't need the get_pendown_state() and
> you don't need to change the board-omap3evm.c ADS7846 related code.
> So, I'm going to submit my patch properly.
Feel free to do that

>> Regards,
>> Zumeng
>>> -- Regards, Igor.
>>> ads7846.patch
>>>
>>>
>>> diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
>>> index 1706ebc..c187586 100644
>>> --- a/arch/arm/mach-omap2/common-board-devices.c
>>> +++ b/arch/arm/mach-omap2/common-board-devices.c
>>> @@ -63,28 +63,30 @@ 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) {
>>> -		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);
>>> -
>>> -		if (gpio_debounce)
>>> -			gpio_set_debounce(gpio_pendown, gpio_debounce);
>>> +	err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
>>> +	if (err) {
>>> +		pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
>>> +		return;
>>>   	}
>>>   	
>>> +	if (gpio_debounce)
>>> +		gpio_set_debounce(gpio_pendown, gpio_debounce);
>>> +
>>>   	spi_bi->bus_num	= bus_num;
>>>   	spi_bi->irq	= gpio_to_irq(gpio_pendown);
>>>
>>>   	if (board_pdata) {
>>>   		board_pdata->gpio_pendown = gpio_pendown;
>>>   		spi_bi->platform_data = board_pdata;
>>> +		if (board_pdata->get_pendown_state)
>>> +			gpio_export(gpio_pendown, 0);
>>>   	} else {
>>>   		ads7846_config.gpio_pendown = gpio_pendown;
>>>   	}
>>>
>>> +	if (!board_pdata || (board_pdata&&  !board_pdata->get_pendown_state))
>>> +		gpio_free(gpio_pendown);
>>> +
>>>   	spi_register_board_info(&ads7846_spi_board_info, 1);
>>>   }
>>>   #else

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

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  6:59         ` Zumeng Chen
@ 2012-06-16  0:15           ` zumeng.chen
  2012-06-20  5:28           ` Zumeng Chen
  1 sibling, 0 replies; 25+ messages in thread
From: zumeng.chen @ 2012-06-16  0:15 UTC (permalink / raw)
  To: mike@compulab.co.il, tony@atomide.com
  Cc: Zumeng Chen, Hiremath, Vaibhav, Zumeng Chen, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

On 2012年06月14日 14:59, Zumeng Chen wrote:
> 于 2012年06月14日 14:31, Hiremath, Vaibhav 写道:
>> On Thu, Jun 14, 2012 at 10:16:55, Zumeng Chen wrote:
>>> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>>> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>>>
>>>>> If we don't set proper debouce time for ads7846, then there are
>>>>> flooded interrupt counters of ads7846 responding to one time
>>>>> touch on screen, so the driver couldn't work well.
>>>>>
>>>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>>>> after having gpio_request done.
>>>>>
>>>>> This patch has been validated on 3530evm.
>>>>>
>>>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>>> ---
>>>>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>>> index f02028e..459ff29 100644
>>>>> --- a/drivers/input/touchscreen/ads7846.c
>>>>> +++ b/drivers/input/touchscreen/ads7846.c
>>>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>>>   		}
>>>>>
>>>>>   		ts->gpio_pendown = pdata->gpio_pendown;
>>>>> +#ifdef CONFIG_ARCH_OMAP3
>>>>> +		/* 310 means about 10 microsecond for omap3 */
>>>>> +		gpio_set_debounce(pdata->gpio_pendown, 310);
>>>>> +#endif
>>>>>
>>>> Zumeng,
>>>>
>>>> With my sign-off you are changing the original code, that too
>>>> without my sign-off and ack.
>>>> I wouldn't mind you to submit patches from my tree, but the expectation is
>>>> if you are changing the original code, it should be under your sign-off.
>>> Thanks, good to learn. I'll remove in next time.
>>>> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>>> delay is specific to OMAP GPIO and driver should not be aware of this,
>>>> that's where you will find the original patch handling it in board file.
>>> According to the git blame of the board-omap3evm.c I think
>>> 96974a24 did a good thing to all the related codes for omap3
>>> boards. So I think we can call board and driver as BSP level :-)
>>>
>>> If #ifdef in driver can save many codes, I guess it's deserved.
>>>
>> No, not really.
>>
>> In the same commit, the debounce time is already handled as an argument to 
>> the function omap_ads7846_init(), and that’s the way it should be.
> That means you'd like to implement the same get_pendown_state for every
> omap3 board? Currently, board_pdata is NULL.
>
> And actually, the reason why I agree 96974a24 is that get_pendown_state
> for all omap3 boards is the common chip level gpio operations. so I think
> we should set debounce for them in one common point.
>
> But since Igor and you don't like them, I have created and tested the
> attachment
> patch, and I'd like Mike to check if convenience too
> But obviously there are more codes than mine before :-)
Tony & Mike,

How about your comments on this issue? Do you think the following is
acceptable VS my last email _attachment_.

+#ifdef CONFIG_ARCH_OMAP3
+		/* 310 means about 10 microsecond for omap3 */
+		gpio_set_debounce(pdata->gpio_pendown, 310);
+#endif


Regards,
Zumeng


> Regards,
> Zumeng
>> So no need for #ifdefs in driver...
>>
>> Thanks,
>> Vaibhav


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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-13 10:13       ` Igor Grinberg
@ 2012-06-16 13:27         ` Marek Vasut
  0 siblings, 0 replies; 25+ messages in thread
From: Marek Vasut @ 2012-06-16 13:27 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Zumeng Chen, Zumeng Chen, tony, jon-hunter, linux-omap,
	linux-arm-kernel, khilman, khasim, ajay.gupta, hvaibhav,
	dmitry.torokhov, linux-input

Dear Igor Grinberg,

> On 06/13/12 12:03, Zumeng Chen wrote:
> > 于 2012年06月13日 15:51, Igor Grinberg 写道:
> >> On 06/13/12 04:44, Zumeng Chen wrote:
> >>> From: Zumeng Chen<zumeng.chen@windriver.com>
> >>> 
> >>> If we don't set proper debouce time for ads7846, then there are
> >>> flooded interrupt counters of ads7846 responding to one time
> >>> touch on screen, so the driver couldn't work well.
> >>> 
> >>> And since most OMAP3 series boards pass NULL pointer of board_pdata
> >>> to omap_ads7846_init, so it's more proper to set it in driver level
> >>> after having gpio_request done.
> >>> 
> >>> This patch has been validated on 3530evm.
> >>> 
> >>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
> >>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
> >>> ---
> >>> 
> >>>   drivers/input/touchscreen/ads7846.c |    4 ++++
> >>>   1 files changed, 4 insertions(+), 0 deletions(-)
> >>> 
> >>> diff --git a/drivers/input/touchscreen/ads7846.c
> >>> b/drivers/input/touchscreen/ads7846.c index f02028e..459ff29 100644
> >>> --- a/drivers/input/touchscreen/ads7846.c
> >>> +++ b/drivers/input/touchscreen/ads7846.c
> >>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct
> >>> spi_device *spi, struct ads784
> >>> 
> >>>           }
> >>>           
> >>>           ts->gpio_pendown = pdata->gpio_pendown;
> >>> 
> >>> +#ifdef CONFIG_ARCH_OMAP3
> >>> +        /* 310 means about 10 microsecond for omap3 */
> >>> +        gpio_set_debounce(pdata->gpio_pendown, 310);
> >>> +#endif
> >> 
> >> Unless this concerns many boards/archs/platforms,
> > 
> > Yes, this is the case.
> > 
> >> I'd suggest you to implement
> >> the get_pendown_state() method in the board file.
> > 
> > it seems they are different way between gpio and
> > get_pendown_state, and gpio way is used for omap3
> > to drive ads7846, so I guess we may have to do like this.
> 
> No, this is not (and does not have to be) OMAP wide.
> The decision for this is made on per-board basis.

+1 agreed

> > Regards,
> > Zumeng
> > 
> >> If more users will need this, it can be facilitated in the driver.
> >> (and of course not with the ugly ifdefs...)
> >> 
> >>>       } else {
> >>>       
> >>>           dev_err(&spi->dev, "no get_pendown_state nor
> >>>           gpio_pendown?\n");

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level
  2012-06-14  6:59         ` Zumeng Chen
  2012-06-16  0:15           ` zumeng.chen
@ 2012-06-20  5:28           ` Zumeng Chen
  1 sibling, 0 replies; 25+ messages in thread
From: Zumeng Chen @ 2012-06-20  5:28 UTC (permalink / raw)
  To: mike@compulab.co.il
  Cc: Hiremath, Vaibhav, Zumeng Chen, tony@atomide.com, Hunter, Jon,
	grinberg@compulab.co.il, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Hilman, Kevin,
	Syed Mohammed, Khasim, Gupta, Ajay Kumar,
	dmitry.torokhov@gmail.com, linux-input@vger.kernel.org

于 2012年06月14日 14:59, Zumeng Chen 写道:
> 于 2012年06月14日 14:31, Hiremath, Vaibhav 写道:
>> On Thu, Jun 14, 2012 at 10:16:55, Zumeng Chen wrote:
>>> 于 2012年06月13日 20:18, Hiremath, Vaibhav 写道:
>>>> On Wed, Jun 13, 2012 at 07:14:10, Zumeng Chen wrote:
>>>>> From: Zumeng Chen<zumeng.chen@windriver.com>
>>>>>
>>>>> If we don't set proper debouce time for ads7846, then there are
>>>>> flooded interrupt counters of ads7846 responding to one time
>>>>> touch on screen, so the driver couldn't work well.
>>>>>
>>>>> And since most OMAP3 series boards pass NULL pointer of board_pdata
>>>>> to omap_ads7846_init, so it's more proper to set it in driver level
>>>>> after having gpio_request done.
>>>>>
>>>>> This patch has been validated on 3530evm.
>>>>>
>>>>> Signed-off-by: Zumeng Chen<zumeng.chen@windriver.com>
>>>>> Signed-off-by: Syed Mohammed Khasim<khasim@ti.com>
>>>>> ---
>>>>>   drivers/input/touchscreen/ads7846.c |    4 ++++
>>>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>>>> index f02028e..459ff29 100644
>>>>> --- a/drivers/input/touchscreen/ads7846.c
>>>>> +++ b/drivers/input/touchscreen/ads7846.c
>>>>> @@ -980,6 +980,10 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>>>   		}
>>>>>
>>>>>   		ts->gpio_pendown = pdata->gpio_pendown;
>>>>> +#ifdef CONFIG_ARCH_OMAP3
>>>>> +		/* 310 means about 10 microsecond for omap3 */
>>>>> +		gpio_set_debounce(pdata->gpio_pendown, 310);
>>>>> +#endif
>>>>>
>>>> Zumeng,
>>>>
>>>> With my sign-off you are changing the original code, that too
>>>> without my sign-off and ack.
>>>> I wouldn't mind you to submit patches from my tree, but the expectation is
>>>> if you are changing the original code, it should be under your sign-off.
>>> Thanks, good to learn. I'll remove in next time.
>>>> Coming to the patch, #ifdef in driver is not recommended, and this 10msec
>>>> delay is specific to OMAP GPIO and driver should not be aware of this,
>>>> that's where you will find the original patch handling it in board file.
>>> According to the git blame of the board-omap3evm.c I think
>>> 96974a24 did a good thing to all the related codes for omap3
>>> boards. So I think we can call board and driver as BSP level :-)
>>>
>>> If #ifdef in driver can save many codes, I guess it's deserved.
>>>
>> No, not really.
>>
>> In the same commit, the debounce time is already handled as an argument to 
>> the function omap_ads7846_init(), and that’s the way it should be.
> That means you'd like to implement the same get_pendown_state for every
> omap3 board? Currently, board_pdata is NULL.
>
> And actually, the reason why I agree 96974a24 is that get_pendown_state
> for all omap3 boards is the common chip level gpio operations. so I think
> we should set debounce for them in one common point.
>
> But since Igor and you don't like them, I have created and tested the
> attachment
> patch, and I'd like Mike to check if convenience too
> But obviously there are more codes than mine before :-)
Hi Mike,

I'll send V3 with the change on the attachment to you for 5/5,
if you happen to get it, it's high appreciated to review it.

Regards,
Zumeng
>
> Regards,
> Zumeng
>> So no need for #ifdefs in driver...
>>
>> Thanks,
>> Vaibhav


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

end of thread, other threads:[~2012-06-20  5:29 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13  1:44 [PATCH v2 0/5] ARM OMAP3530evm misc fixes for linux-omap Zumeng Chen
2012-06-13  1:44 ` [PATCH V2 1/5] ARM: OMAP3EVM: Add NAND flash definition Zumeng Chen
2012-06-13  7:57   ` Igor Grinberg
2012-06-13  8:16     ` Zumeng Chen
2012-06-13  1:44 ` [PATCH V2 2/5] ARM: OMAP3EVM: Adding USB internal LDOs board file Zumeng Chen
2012-06-13  8:16   ` Igor Grinberg
2012-06-13  8:23     ` Zumeng Chen
2012-06-13  1:44 ` [PATCH V2 3/5] ARM: omap3evm: enable VBUS switch for EHCI tranceiver Zumeng Chen
2012-06-13  1:44 ` [PATCH V2 4/5] ARM: OMAP3EVM: cosmetic fixes for parent clk set Zumeng Chen
2012-06-13  1:44 ` [PATCH V2 5/5] Input: ads7846: set proper debounce time in driver level Zumeng Chen
2012-06-13  7:51   ` Igor Grinberg
2012-06-13  9:03     ` Zumeng Chen
2012-06-13 10:13       ` Igor Grinberg
2012-06-16 13:27         ` Marek Vasut
2012-06-13 12:18   ` Hiremath, Vaibhav
2012-06-14  3:29     ` Zumeng Chen
2012-06-14  4:46     ` Zumeng Chen
2012-06-14  6:31       ` Hiremath, Vaibhav
2012-06-14  6:59         ` Zumeng Chen
2012-06-16  0:15           ` zumeng.chen
2012-06-20  5:28           ` Zumeng Chen
2012-06-14  6:44       ` Igor Grinberg
2012-06-14  7:08         ` Zumeng Chen
2012-06-14  8:06           ` Igor Grinberg
2012-06-14  8:18             ` Zumeng Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).