diff mbox

[v2] ARM: EXYNOS: Add touchscreen support to SMDK4X12

Message ID 1342420976-25068-1-git-send-email-sachin.kamat@linaro.org
State Superseded
Headers show

Commit Message

Sachin Kamat July 16, 2012, 6:42 a.m. UTC
Pixcir touchscreen device support is added to SMDK4X12 boards.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
This patch is based on Kukjin Kim's latest for-next branch.

Changes since v1:
Incorporated Kukjin's review comments
-reduced mdelay
-removed a unnecessary gpio
---
 arch/arm/mach-exynos/mach-smdk4x12.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

Comments

Sylwester Nawrocki July 16, 2012, 8:20 a.m. UTC | #1
Hi Sachin,

On 07/16/2012 08:42 AM, Sachin Kamat wrote:
> Pixcir touchscreen device support is added to SMDK4X12 boards.
>
> Signed-off-by: Sachin Kamat<sachin.kamat@linaro.org>
> ---
> This patch is based on Kukjin Kim's latest for-next branch.
>
> Changes since v1:
> Incorporated Kukjin's review comments
> -reduced mdelay
> -removed a unnecessary gpio
> ---
>   arch/arm/mach-exynos/mach-smdk4x12.c |   31 ++++++++++++++++++++++++++++++-
>   1 files changed, 30 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
> index 2623f3b..b3207ea 100644
> --- a/arch/arm/mach-exynos/mach-smdk4x12.c
> +++ b/arch/arm/mach-exynos/mach-smdk4x12.c
> @@ -9,9 +9,11 @@
>    * published by the Free Software Foundation.
>   */
>
> +#include<linux/delay.h>
>   #include<linux/gpio.h>
>   #include<linux/i2c.h>
>   #include<linux/input.h>
> +#include<linux/input/pixcir_ts.h>
>   #include<linux/io.h>
>   #include<linux/lcd.h>
>   #include<linux/mfd/max8997.h>
> @@ -207,8 +209,33 @@ static struct i2c_board_info smdk4x12_i2c_devs3[] __initdata = {
>   	/* nothing here yet */
>   };
>
> +static void smdk4x12_ts_gpio_setup(void)
> +{
> +	int gpio_reset = EXYNOS4_GPM3(4);

I don't seem to find this GPIO defined in Kgene's for-next tree.
Is there already GPIO support for Exynos4x12 SoC's merged in someone's
tree ? I thought it's not completed yet.

> +
> +	gpio_request_one(gpio_reset, GPIOF_OUT_INIT_LOW, "TOUCH RESET");
> +	mdelay(2);

Any reason to use mdelay, rather than msleep/usleep_range ?

> +	gpio_direction_output(gpio_reset, 1);

Probably better to make it:

	gpio_set_value(gpio_reset, 1);

since the GPIO's direction is already set in gpio_request_one().

> +	mdelay(30);

msleep(30);

--

Regards,
Sylwester
Sachin Kamat July 16, 2012, 8:31 a.m. UTC | #2
Hi Sylwester,

Thank you for the review.

On 16/07/2012, Sylwester Nawrocki <sylvester.nawrocki@gmail.com> wrote:
> Hi Sachin,
>
> On 07/16/2012 08:42 AM, Sachin Kamat wrote:
>> Pixcir touchscreen device support is added to SMDK4X12 boards.
>>
>> Signed-off-by: Sachin Kamat<sachin.kamat@linaro.org>
>> ---
>> This patch is based on Kukjin Kim's latest for-next branch.
>>
>> Changes since v1:
>> Incorporated Kukjin's review comments
>> -reduced mdelay
>> -removed a unnecessary gpio
>> ---
>>   arch/arm/mach-exynos/mach-smdk4x12.c |   31
>> ++++++++++++++++++++++++++++++-
>>   1 files changed, 30 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c
>> b/arch/arm/mach-exynos/mach-smdk4x12.c
>> index 2623f3b..b3207ea 100644
>> --- a/arch/arm/mach-exynos/mach-smdk4x12.c
>> +++ b/arch/arm/mach-exynos/mach-smdk4x12.c
>> @@ -9,9 +9,11 @@
>>    * published by the Free Software Foundation.
>>   */
>>
>> +#include<linux/delay.h>
>>   #include<linux/gpio.h>
>>   #include<linux/i2c.h>
>>   #include<linux/input.h>
>> +#include<linux/input/pixcir_ts.h>
>>   #include<linux/io.h>
>>   #include<linux/lcd.h>
>>   #include<linux/mfd/max8997.h>
>> @@ -207,8 +209,33 @@ static struct i2c_board_info smdk4x12_i2c_devs3[]
>> __initdata = {
>>   	/* nothing here yet */
>>   };
>>
>> +static void smdk4x12_ts_gpio_setup(void)
>> +{
>> +	int gpio_reset = EXYNOS4_GPM3(4);
>
> I don't seem to find this GPIO defined in Kgene's for-next tree.
> Is there already GPIO support for Exynos4x12 SoC's merged in someone's
> tree ? I thought it's not completed yet.

Yes, you are right. GPIO support for 4X12 is not yet merged. I had
that patch locally on my branch, so did not realise it. This patch
should then go after the GPIO support gets merged.


>
>> +
>> +	gpio_request_one(gpio_reset, GPIOF_OUT_INIT_LOW, "TOUCH RESET");
>> +	mdelay(2);
>
> Any reason to use mdelay, rather than msleep/usleep_range ?
No.

>
>> +	gpio_direction_output(gpio_reset, 1);
>
> Probably better to make it:
>
> 	gpio_set_value(gpio_reset, 1);

Ok.


>
> since the GPIO's direction is already set in gpio_request_one().
>
>> +	mdelay(30);
>
> msleep(30);
Ok.

I will update and re-send the patch once GPIO support gets merged.


>
> --
>
> Regards,
> Sylwester
>
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index 2623f3b..b3207ea 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -9,9 +9,11 @@ 
  * published by the Free Software Foundation.
 */
 
+#include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
+#include <linux/input/pixcir_ts.h>
 #include <linux/io.h>
 #include <linux/lcd.h>
 #include <linux/mfd/max8997.h>
@@ -207,8 +209,33 @@  static struct i2c_board_info smdk4x12_i2c_devs3[] __initdata = {
 	/* nothing here yet */
 };
 
+static void smdk4x12_ts_gpio_setup(void)
+{
+	int gpio_reset = EXYNOS4_GPM3(4);
+
+	gpio_request_one(gpio_reset, GPIOF_OUT_INIT_LOW, "TOUCH RESET");
+	mdelay(2);
+	gpio_direction_output(gpio_reset, 1);
+	mdelay(30);
+}
+
+static int smdk4x12_ts_get_value(void)
+{
+	return 1;
+}
+
+static struct pixcir_ts_platform_data smdk4x12_ts_data = {
+	.attb_read_val = smdk4x12_ts_get_value,
+	.x_max = 480,
+	.y_max = 800,
+};
+
 static struct i2c_board_info smdk4x12_i2c_devs7[] __initdata = {
-	/* nothing here yet */
+	{
+		I2C_BOARD_INFO("pixcir_ts", 0x5C),
+		.irq		= IRQ_EINT(22),
+		.platform_data	= &smdk4x12_ts_data,
+	}
 };
 
 static struct samsung_bl_gpio_info smdk4x12_bl_gpio_info = {
@@ -336,6 +363,8 @@  static void __init smdk4x12_machine_init(void)
 
 	s5p_fimd0_set_platdata(&smdk4x12_lcd_pdata);
 
+	smdk4x12_ts_gpio_setup();
+
 	platform_add_devices(smdk4x12_devices, ARRAY_SIZE(smdk4x12_devices));
 }