linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define
Date: Tue, 3 Jan 2012 09:43:56 +0000	[thread overview]
Message-ID: <20120103094356.GG2914@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1325164036-15638-1-git-send-email-dron0gus@gmail.com>

On Thu, Dec 29, 2011 at 05:07:14PM +0400, Gusakov Andrey wrote:
> Differnt S3C24XX SoC have different number of GPIO. When building
> kernel for many S3C24XX SoCs GPIO number defined to minimun possible.
> This patch reordef ifdef's to define GPIO number to muximum possible.

This is error prome.  Please come up with a better solution to this.

> -#ifdef CONFIG_CPU_S3C244X
> -#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
> -#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
> +#if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
>  #define ARCH_NR_GPIOS	(32 * 12 + CONFIG_S3C24XX_GPIO_EXTRA)
> +#elif defined(CONFIG_CPU_S3C244X)
> +#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
>  #else
>  #define ARCH_NR_GPIOS	(256 + CONFIG_S3C24XX_GPIO_EXTRA)
>  #endif

Maybe something like:

#define S3C2443_NR_GPIOS	(32 * 12)
#define S3C2416_NR_GPIOS	(32 * 12)
#define S3C244X_NR_GPIOS	(32 * 9)

#define SAMSUNG_NR_GPIOS	(256)
#if defined (CONFIG_CPU_S3C244X) && S3C244X_NR_GPIOS > SAMSUNG_NR_GPIOS
#undef SAMSUNG_NR_GPIOS
#define SAMSUNG_NR_GPIOS	S3C244X_NR_GPIOS
#endif
#if defined (CONFIG_CPU_S3C2416) && S3C2416_NR_GPIOS > SAMSUNG_NR_GPIOS
#undef SAMSUNG_NR_GPIOS
#define SAMSUNG_NR_GPIOS	S3C2416_NR_GPIOS
#endif
#if defined (CONFIG_CPU_S3C2443) && S3C2443_NR_GPIOS > SAMSUNG_NR_GPIOS
#undef SAMSUNG_NR_GPIOS
#define SAMSUNG_NR_GPIOS	S3C2443_NR_GPIOS
#endif

#define ARCH_NR_GPIOS		(SAMSUNG_NR_GPIOS + CONFIG_S3C24XX_GPIO_EXTRA)

or maybe just solve this in Kconfig - we already have this:

config ARCH_NR_GPIO
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
        default 350 if ARCH_U8500
        default 0

to set ARCH_NR_GPIO in generic code.

      parent reply	other threads:[~2012-01-03  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 13:07 [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define Gusakov Andrey
2011-12-29 13:07 ` [PATCH] S3C: enable debuging over UART3 Gusakov Andrey
2011-12-29 13:07 ` [PATCH] S3C: increase hwmon channels to 10 Gusakov Andrey
2012-01-03  9:43 ` Russell King - ARM Linux [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=20120103094356.GG2914@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).