public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH 3/3] sunxi: gpio: Remove bank-specific size macros
Date: Tue, 14 Sep 2021 00:53:33 +0100	[thread overview]
Message-ID: <20210914005333.54ae5b76@slackpad.fritz.box> (raw)
In-Reply-To: <20210911215049.5840-4-samuel@sholland.org>

On Sat, 11 Sep 2021 16:50:49 -0500
Samuel Holland <samuel@sholland.org> wrote:

> Since the beginning, all banks have had space for 32 pins, even when
> not all pins were implemented. Let's use a single constant for the GPIO
> bank size here, like the GPIO driver is already doing.

Yeah, I always found some code in there a bit over the top, thanks for
cleaning this up.

> Signed-off-by: Samuel Holland <samuel@sholland.org>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
>  arch/arm/include/asm/arch-sunxi/gpio.h | 14 ++------------
>  drivers/gpio/sunxi_gpio.c              |  2 --
>  2 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
> index c93c051a19f..cd5e85988b1 100644
> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
> @@ -93,20 +93,10 @@ struct sunxi_gpio_reg {
>  #define GPIO_PULL_OFFSET(pin)	((((pin) & 0x1f) & 0xf) << 1)
>  
>  /* GPIO bank sizes */
> -#define SUNXI_GPIO_A_NR		32
> -#define SUNXI_GPIO_B_NR		32
> -#define SUNXI_GPIO_C_NR		32
> -#define SUNXI_GPIO_D_NR		32
> -#define SUNXI_GPIO_E_NR		32
> -#define SUNXI_GPIO_F_NR		32
> -#define SUNXI_GPIO_G_NR		32
> -#define SUNXI_GPIO_H_NR		32
> -#define SUNXI_GPIO_I_NR		32
> -#define SUNXI_GPIO_L_NR		32
> -#define SUNXI_GPIO_M_NR		32
> +#define SUNXI_GPIOS_PER_BANK	32
>  
>  #define SUNXI_GPIO_NEXT(__gpio) \
> -	((__gpio##_START) + (__gpio##_NR) + 0)
> +	((__gpio##_START) + SUNXI_GPIOS_PER_BANK)
>  
>  enum sunxi_gpio_number {
>  	SUNXI_GPIO_A_START = 0,
> diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
> index 7ce3ef73b46..ed26eb011f4 100644
> --- a/drivers/gpio/sunxi_gpio.c
> +++ b/drivers/gpio/sunxi_gpio.c
> @@ -19,8 +19,6 @@
>  #include <dm/device-internal.h>
>  #include <dt-bindings/gpio/gpio.h>
>  
> -#define SUNXI_GPIOS_PER_BANK	SUNXI_GPIO_A_NR
> -
>  struct sunxi_gpio_plat {
>  	struct sunxi_gpio *regs;
>  	const char *bank_name;	/* Name of bank, e.g. "B" */


      reply	other threads:[~2021-09-13 23:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 21:50 [PATCH 0/3] sunxi: Cleanup to prepare for DM_GPIO/DM_PINCTRL Samuel Holland
2021-09-11 21:50 ` [PATCH 1/3] sunxi: Clean up inclusions of asm/arch/gpio.h Samuel Holland
2021-09-13 23:53   ` Andre Przywara
2021-09-11 21:50 ` [PATCH 2/3] sunxi: gpio: Remove name_to_gpio macro Samuel Holland
2021-09-13 23:53   ` Andre Przywara
2021-09-11 21:50 ` [PATCH 3/3] sunxi: gpio: Remove bank-specific size macros Samuel Holland
2021-09-13 23:53   ` Andre Przywara [this message]

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=20210914005333.54ae5b76@slackpad.fritz.box \
    --to=andre.przywara@arm.com \
    --cc=jagan@amarulasolutions.com \
    --cc=samuel@sholland.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox