All of lore.kernel.org
 help / color / mirror / Atom feed
From: Przemyslaw Marczak <p.marczak@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin numbering feature
Date: Mon, 14 Apr 2014 17:15:19 +0200	[thread overview]
Message-ID: <534BFB87.5020503@samsung.com> (raw)
In-Reply-To: <1397295812-4010-2-git-send-email-Akshay.s@samsung.com>

Hello,
I like this idea. This is a good feature for easy and fast gpio 
maintaining. I have few comments to this.

On 04/12/2014 11:43 AM, Akshay Saraswat wrote:
> From: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>
> This patch adds gpio pin numbering support for EXYNOS 5250 & 5420.
> To have consistent 0..n-1 GPIO numbering the banks are divided
> into different parts where ever they have holes in them.
>
> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
> ---

You use quite magic numbers in gpio names like "EXYNOS5_GPIO_A05",
maybe better is to add "PIN" word here like this: EXYNOS5_GPIO_A0_PIN5.
So then we really know what we are using and I think this just looks better.

> diff --git a/arch/arm/include/asm/arch-exynos/gpio.h b/arch/arm/include/asm/arch-exynos/gpio.h
> index d6868fa..211383d 100644
> --- a/arch/arm/include/asm/arch-exynos/gpio.h
> +++ b/arch/arm/include/asm/arch-exynos/gpio.h
> @@ -141,14 +141,16 @@ struct exynos5420_gpio_part1 {
>
It seems that those all exynos5*_gpio_partX structures and also 
exynos5*_gpio_get() macros can be removed now.

>   struct exynos5420_gpio_part2 {
>   	struct s5p_gpio_bank y7; /* 0x1340_0000 */
> -	struct s5p_gpio_bank res[0x5f]; /*  */
> +};
> +
> +struct exynos5420_gpio_part3 {
>   	struct s5p_gpio_bank x0; /* 0x1340_0C00 */
>   	struct s5p_gpio_bank x1; /* 0x1340_0C20 */
>   	struct s5p_gpio_bank x2; /* 0x1340_0C40 */
>   	struct s5p_gpio_bank x3; /* 0x1340_0C60 */
>   };
>
> -struct exynos5420_gpio_part3 {
> +struct exynos5420_gpio_part4 {
>   	struct s5p_gpio_bank c0;
>   	struct s5p_gpio_bank c1;
>   	struct s5p_gpio_bank c2;
> @@ -164,7 +166,7 @@ struct exynos5420_gpio_part3 {
>   	struct s5p_gpio_bank y6;
>   };
>
> -struct exynos5420_gpio_part4 {
> +struct exynos5420_gpio_part5 {
>   	struct s5p_gpio_bank e0; /* 0x1400_0000 */
>   	struct s5p_gpio_bank e1; /* 0x1400_0020 */
>   	struct s5p_gpio_bank f0; /* 0x1400_0040 */
> @@ -175,7 +177,7 @@ struct exynos5420_gpio_part4 {
>   	struct s5p_gpio_bank j4; /* 0x1400_00E0 */
>   };
>
> -struct exynos5420_gpio_part5 {
> +struct exynos5420_gpio_part6 {
>   	struct s5p_gpio_bank z0; /* 0x0386_0000 */
>   };
>
> @@ -200,16 +202,20 @@ struct exynos5_gpio_part1 {
>   	struct s5p_gpio_bank y4;
>   	struct s5p_gpio_bank y5;
>   	struct s5p_gpio_bank y6;
> -	struct s5p_gpio_bank res1[0x3];
> +};
> +
> +struct exynos5_gpio_part2 {
>   	struct s5p_gpio_bank c4;
> -	struct s5p_gpio_bank res2[0x48];
> +};
> +
> +struct exynos5_gpio_part3 {
>   	struct s5p_gpio_bank x0;
>   	struct s5p_gpio_bank x1;
>   	struct s5p_gpio_bank x2;
>   	struct s5p_gpio_bank x3;
>   };
>
> -struct exynos5_gpio_part2 {
> +struct exynos5_gpio_part4 {
>   	struct s5p_gpio_bank e0;
>   	struct s5p_gpio_bank e1;
>   	struct s5p_gpio_bank f0;
> @@ -221,20 +227,25 @@ struct exynos5_gpio_part2 {
>   	struct s5p_gpio_bank h1;
>   };
>
> -struct exynos5_gpio_part3 {
> +struct exynos5_gpio_part5 {
>   	struct s5p_gpio_bank v0;
>   	struct s5p_gpio_bank v1;
> -	struct s5p_gpio_bank res1[0x1];
> +};
> +
> +struct exynos5_gpio_part6 {
>   	struct s5p_gpio_bank v2;
>   	struct s5p_gpio_bank v3;
> -	struct s5p_gpio_bank res2[0x1];
> +};
> +
> +struct exynos5_gpio_part7 {
>   	struct s5p_gpio_bank v4;
>   };
>
> -struct exynos5_gpio_part4 {
> +struct exynos5_gpio_part8 {
>   	struct s5p_gpio_bank z;
>   };
>

There are also unchanged gpios initializations in files:
- arndale/arndale.c line 19
- smdk5420/smdk5420.c line 45

Thanks

-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

  parent reply	other threads:[~2014-04-14 15:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12  9:43 [U-Boot] [PATCH v6 0/4] Exynos5: Add GPIO numbering feature Akshay Saraswat
2014-04-12  9:43 ` [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin " Akshay Saraswat
2014-04-12 20:30   ` Simon Glass
2014-04-14  7:17   ` Lukasz Majewski
2014-04-14 14:40     ` Simon Glass
2014-04-15  6:25       ` Lukasz Majewski
2014-04-17  4:21         ` Simon Glass
2014-04-14 15:15   ` Przemyslaw Marczak [this message]
2014-04-14 15:59     ` Simon Glass
2014-04-12  9:43 ` [U-Boot] [PATCH v6 2/4] S5P: Rename GPIO definitions Akshay Saraswat
2014-04-12 20:30   ` Simon Glass
2014-04-14 15:15   ` Przemyslaw Marczak
2014-04-12  9:43 ` [U-Boot] [PATCH v6 3/4] EXYNOS5: GPIO: Support GPIO Command for EXYNOS5 Akshay Saraswat
2014-04-12 20:32   ` Simon Glass
2014-04-14 15:19   ` Przemyslaw Marczak
2014-04-12  9:43 ` [U-Boot] [PATCH v6 4/4] Config: Exynos5: Enable Generic GPIO and CMD configs Akshay Saraswat
2014-04-12 20:33   ` Simon Glass
2014-04-12 20:39     ` Simon Glass
2014-04-14  9:31 ` [U-Boot] [PATCH v6 0/4] Exynos5: Add GPIO numbering feature Przemyslaw Marczak
  -- strict thread matches above, loose matches on Subject: below --
2014-04-14  9:07 [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin " Akshay Saraswat
2014-04-14 10:53 ` Lukasz Majewski
2014-04-14 12:42   ` Minkyu Kang
2014-04-14 14:55 Akshay Saraswat
2014-04-14 15:23 ` Przemyslaw Marczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534BFB87.5020503@samsung.com \
    --to=p.marczak@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.