public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: samsung: remove exynos_gpio_cfg
@ 2012-12-14 10:44 Joonyoung Shim
  2012-12-14 10:44 ` [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5 Joonyoung Shim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Joonyoung Shim @ 2012-12-14 10:44 UTC (permalink / raw)
  To: grant.likely, linus.walleij
  Cc: linux-samsung-soc, linux-kernel, kgene.kim, kyungmin.park

The exynos_gpio_cfg can be substituted to samsung_gpio_cfgs[8].

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 drivers/gpio/gpio-samsung.c |   25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index 6f93d36..a462f2c 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -452,15 +452,6 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
-static struct samsung_gpio_cfg exynos_gpio_cfg = {
-	.set_pull	= exynos_gpio_setpull,
-	.get_pull	= exynos_gpio_getpull,
-	.set_config	= samsung_gpio_setcfg_4bit,
-	.get_config	= samsung_gpio_getcfg_4bit,
-};
-#endif
-
 #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450)
 static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = {
 	.cfg_eint	= 0x3,
@@ -2181,7 +2172,7 @@ static struct samsung_gpio_chip s5pv210_gpios_4bit[] = {
  * Followings are the gpio banks in EXYNOS SoCs
  *
  * The 'config' member when left to NULL, is initialized to the default
- * structure exynos_gpio_cfg in the init function below.
+ * structure samsung_gpio_cfgs[8] in the init function below.
  *
  * The 'base' member is also initialized in the init function below.
  * Note: The initialization of 'base' member of samsung_gpio_chip structure
@@ -2837,7 +2828,7 @@ static __init void exynos4_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -2864,7 +2855,7 @@ static __init void exynos4_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -2885,7 +2876,7 @@ static __init void exynos4_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -2940,7 +2931,7 @@ static __init void exynos5_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -2961,7 +2952,7 @@ static __init void exynos5_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -2989,7 +2980,7 @@ static __init void exynos5_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
@@ -3010,7 +3001,7 @@ static __init void exynos5_gpiolib_init(void)
 
 	for (i = 0; i < nr_chips; i++, chip++) {
 		if (!chip->config) {
-			chip->config = &exynos_gpio_cfg;
+			chip->config = &samsung_gpio_cfgs[8];
 			chip->group = group++;
 		}
 		exynos_gpiolib_attach_ofnode(chip,
-- 
1.7.9.5


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

* [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5
  2012-12-14 10:44 [PATCH] gpio: samsung: remove exynos_gpio_cfg Joonyoung Shim
@ 2012-12-14 10:44 ` Joonyoung Shim
  2013-01-17  8:14   ` Linus Walleij
  2012-12-14 12:09 ` [PATCH] gpio: samsung: remove exynos_gpio_cfg Tomasz Figa
  2012-12-19 22:22 ` Grant Likely
  2 siblings, 1 reply; 6+ messages in thread
From: Joonyoung Shim @ 2012-12-14 10:44 UTC (permalink / raw)
  To: grant.likely, linus.walleij
  Cc: linux-samsung-soc, linux-kernel, kgene.kim, kyungmin.park

This adds GPIO interrupt registration and modification needs to register
GPIO interrupt rightly for exynos5 SoCs. EXYNOS5_GPYx gpios shouldn't be
counted to GPIO interrupt group register number because they doesn't
support GPIO interrupt, so their struct samsung_gpio_cfg should be
initialized to &samsung_gpio_cfgs[8] in declaration ahead.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 drivers/gpio/gpio-samsung.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index e30cd60..a462f2c 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -2519,42 +2519,49 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
 			.label	= "GPD1",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY0(0),
 			.ngpio	= EXYNOS5_GPIO_Y0_NR,
 			.label	= "GPY0",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY1(0),
 			.ngpio	= EXYNOS5_GPIO_Y1_NR,
 			.label	= "GPY1",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY2(0),
 			.ngpio	= EXYNOS5_GPIO_Y2_NR,
 			.label	= "GPY2",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY3(0),
 			.ngpio	= EXYNOS5_GPIO_Y3_NR,
 			.label	= "GPY3",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY4(0),
 			.ngpio	= EXYNOS5_GPIO_Y4_NR,
 			.label	= "GPY4",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY5(0),
 			.ngpio	= EXYNOS5_GPIO_Y5_NR,
 			.label	= "GPY5",
 		},
 	}, {
+		.config	= &samsung_gpio_cfgs[8],
 		.chip	= {
 			.base	= EXYNOS5_GPY6(0),
 			.ngpio	= EXYNOS5_GPIO_Y6_NR,
@@ -3002,6 +3009,24 @@ static __init void exynos5_gpiolib_init(void)
 	}
 	samsung_gpiolib_add_4bit_chips(exynos5_gpios_4,
 				       nr_chips, gpio_base4);
+
+#ifdef CONFIG_S5P_GPIO_INT
+	s5p_register_gpioint_bank(EXYNOS5_IRQ_GPIO_XA, 0,
+			EXYNOS5_IRQ_GPIO1_NR_GROUPS);
+	s5p_register_gpioint_bank(EXYNOS5_IRQ_GPIO_XB,
+			EXYNOS5_IRQ_GPIO1_NR_GROUPS,
+			EXYNOS5_IRQ_GPIO2_NR_GROUPS);
+	s5p_register_gpioint_bank(EXYNOS5_IRQ_GPIO_C2C,
+			EXYNOS5_IRQ_GPIO1_NR_GROUPS +
+			EXYNOS5_IRQ_GPIO2_NR_GROUPS,
+			EXYNOS5_IRQ_GPIO3_NR_GROUPS);
+	s5p_register_gpioint_bank(EXYNOS5_IRQ_GPIO,
+			EXYNOS5_IRQ_GPIO1_NR_GROUPS +
+			EXYNOS5_IRQ_GPIO2_NR_GROUPS +
+			EXYNOS5_IRQ_GPIO3_NR_GROUPS,
+			EXYNOS5_IRQ_GPIO4_NR_GROUPS);
+#endif
+
 	return;
 
 err_ioremap4:
-- 
1.7.9.5


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

* Re: [PATCH] gpio: samsung: remove exynos_gpio_cfg
  2012-12-14 10:44 [PATCH] gpio: samsung: remove exynos_gpio_cfg Joonyoung Shim
  2012-12-14 10:44 ` [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5 Joonyoung Shim
@ 2012-12-14 12:09 ` Tomasz Figa
  2012-12-19 22:22 ` Grant Likely
  2 siblings, 0 replies; 6+ messages in thread
From: Tomasz Figa @ 2012-12-14 12:09 UTC (permalink / raw)
  To: Joonyoung Shim
  Cc: grant.likely, linus.walleij, linux-samsung-soc, linux-kernel,
	kgene.kim, kyungmin.park

Hi Joonyoung,

On Friday 14 of December 2012 19:44:01 Joonyoung Shim wrote:
> The exynos_gpio_cfg can be substituted to samsung_gpio_cfgs[8].
> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

Since recently Thomas Abraham posted patches for pin control support of 
Exynos5250, basically making the legacy GPIO support useless, I think 
there is no need to extend it.

Instead existing boards should be made to use the pinctrl driver.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Linux Platform


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

* Re: [PATCH] gpio: samsung: remove exynos_gpio_cfg
  2012-12-14 10:44 [PATCH] gpio: samsung: remove exynos_gpio_cfg Joonyoung Shim
  2012-12-14 10:44 ` [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5 Joonyoung Shim
  2012-12-14 12:09 ` [PATCH] gpio: samsung: remove exynos_gpio_cfg Tomasz Figa
@ 2012-12-19 22:22 ` Grant Likely
  2012-12-20  1:13   ` Joonyoung Shim
  2 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2012-12-19 22:22 UTC (permalink / raw)
  To: Joonyoung Shim, linus.walleij
  Cc: linux-samsung-soc, linux-kernel, kgene.kim, kyungmin.park

On Fri, 14 Dec 2012 19:44:01 +0900, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> The exynos_gpio_cfg can be substituted to samsung_gpio_cfgs[8].
> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

Hi Joonyoung,

I need some help here. I don't understand what this patch is for or how
it works. The commit text above doesn't give me enough information to
evaluate the patch. What is the intent here? Why is samsung_gpio_cfgs[8]
more correct than exynos_gpio_cfg?

g.


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

* Re: [PATCH] gpio: samsung: remove exynos_gpio_cfg
  2012-12-19 22:22 ` Grant Likely
@ 2012-12-20  1:13   ` Joonyoung Shim
  0 siblings, 0 replies; 6+ messages in thread
From: Joonyoung Shim @ 2012-12-20  1:13 UTC (permalink / raw)
  To: Grant Likely
  Cc: linus.walleij, linux-samsung-soc, linux-kernel, kgene.kim,
	kyungmin.park

Hi Grant,

On 12/20/2012 07:22 AM, Grant Likely wrote:
> On Fri, 14 Dec 2012 19:44:01 +0900, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>> The exynos_gpio_cfg can be substituted to samsung_gpio_cfgs[8].
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> Hi Joonyoung,
>
> I need some help here. I don't understand what this patch is for or how
> it works. The commit text above doesn't give me enough information to
> evaluate the patch. What is the intent here? Why is samsung_gpio_cfgs[8]
> more correct than exynos_gpio_cfg?

First, i just wondered why samsung_gpio_cfgs[8] is used in the
exynos4_gpios_2[] even if exynos_gpio_cfg is exist and found
samsung_gpio_cfgs[8] does same thing with exynos_gpio_cfg. The
exynos_gpio_cfg is used only for Exynos SoCs so it is compiled by #if
defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5).
I think one can be removed because they are duplicated codes and it is
better to decrease use of #if defined.

Thanks.

> g.
>
>


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

* Re: [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5
  2012-12-14 10:44 ` [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5 Joonyoung Shim
@ 2013-01-17  8:14   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2013-01-17  8:14 UTC (permalink / raw)
  To: Joonyoung Shim, kyungmin.park, Thomas Abraham, kgene.kim
  Cc: grant.likely, linux-samsung-soc, linux-kernel

On Fri, Dec 14, 2012 at 11:44 AM, Joonyoung Shim
<jy0922.shim@samsung.com> wrote:

> This adds GPIO interrupt registration and modification needs to register
> GPIO interrupt rightly for exynos5 SoCs. EXYNOS5_GPYx gpios shouldn't be
> counted to GPIO interrupt group register number because they doesn't
> support GPIO interrupt, so their struct samsung_gpio_cfg should be
> initialized to &samsung_gpio_cfgs[8] in declaration ahead.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

This patch has been floating for a while, Kyungmin, Kukjin, Thomas:
shall it be applied?

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-01-17  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 10:44 [PATCH] gpio: samsung: remove exynos_gpio_cfg Joonyoung Shim
2012-12-14 10:44 ` [PATCH] gpio: samsung: add GPIO interrupt registration for exynos5 Joonyoung Shim
2013-01-17  8:14   ` Linus Walleij
2012-12-14 12:09 ` [PATCH] gpio: samsung: remove exynos_gpio_cfg Tomasz Figa
2012-12-19 22:22 ` Grant Likely
2012-12-20  1:13   ` Joonyoung Shim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox