linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define
@ 2011-12-29 13:07 Gusakov Andrey
  2011-12-29 13:07 ` [PATCH] S3C: enable debuging over UART3 Gusakov Andrey
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gusakov Andrey @ 2011-12-29 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Gusakov Andrey <dron_gus@mail.ru>

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.

Signed-off-by: Gusakov Andrey <dron0gus@gmail.com>
---
 arch/arm/mach-s3c2410/include/mach/gpio.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 6fac70f..07257da 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -15,10 +15,10 @@
  * devices that need GPIO.
  */
 
-#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
@@ -26,10 +26,10 @@
 #include <mach/gpio-nrs.h>
 #include <mach/gpio-fns.h>
 
-#ifdef CONFIG_CPU_S3C244X
-#define S3C_GPIO_END	(S3C2410_GPJ(0) + 32)
-#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+#if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
 #define S3C_GPIO_END	(S3C2410_GPM(0) + 32)
+#elif defined(CONFIG_CPU_S3C244X)
+#define S3C_GPIO_END	(S3C2410_GPJ(0) + 32)
 #else
 #define S3C_GPIO_END	(S3C2410_GPH(0) + 32)
 #endif
-- 
1.7.0.4

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

* [PATCH] S3C: enable debuging over UART3
  2011-12-29 13:07 [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define Gusakov Andrey
@ 2011-12-29 13:07 ` Gusakov Andrey
  2011-12-29 13:07 ` [PATCH] S3C: increase hwmon channels to 10 Gusakov Andrey
  2012-01-03  9:43 ` [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define Russell King - ARM Linux
  2 siblings, 0 replies; 4+ messages in thread
From: Gusakov Andrey @ 2011-12-29 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Gusakov Andrey <dron_gus@mail.ru>

Some S3C24XX SoCs have 4 uarts. This patch allow set uart3 for
debug output.

Signed-off-by: Gusakov Andrey <dron0gus@gmail.com>
---
 arch/arm/Kconfig.debug        |   11 +++++++++++
 arch/arm/plat-samsung/Kconfig |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index c5213e7..0b3debd 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -231,6 +231,17 @@ choice
 		  The uncompressor code port configuration is now handled
 		  by CONFIG_S3C_LOWLEVEL_UART_PORT.
 
+	config DEBUG_S3C_UART3
+		depends on PLAT_SAMSUNG
+		bool "Use S3C UART 3 for low-level debug"
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART 3. The port must have been initialised
+		  by the boot-loader before use.
+
+		  The uncompressor code port configuration is now handled
+		  by CONFIG_S3C_LOWLEVEL_UART_PORT.
+
 	config DEBUG_REALVIEW_STD_PORT
 		bool "RealView Default UART"
 		depends on ARCH_REALVIEW
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 313eb26..7ead783 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -344,5 +344,6 @@ config DEBUG_S3C_UART
 	default "0" if DEBUG_S3C_UART0
 	default "1" if DEBUG_S3C_UART1
 	default "2" if DEBUG_S3C_UART2
+	default "3" if DEBUG_S3C_UART3
 
 endif
-- 
1.7.0.4

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

* [PATCH] S3C: increase hwmon channels to 10
  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 ` Gusakov Andrey
  2012-01-03  9:43 ` [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define Russell King - ARM Linux
  2 siblings, 0 replies; 4+ messages in thread
From: Gusakov Andrey @ 2011-12-29 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

S3C2416/2443 have 10-ch ADC. So increase number of hwmon's channels
to 10.

Signed-off-by: Gusakov Andrey <dron0gus@gmail.com>
---
 arch/arm/plat-samsung/include/plat/hwmon.h |    2 +-
 drivers/hwmon/s3c-hwmon.c                  |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/hwmon.h b/arch/arm/plat-samsung/include/plat/hwmon.h
index c167e44..91d8a13 100644
--- a/arch/arm/plat-samsung/include/plat/hwmon.h
+++ b/arch/arm/plat-samsung/include/plat/hwmon.h
@@ -34,7 +34,7 @@ struct s3c_hwmon_chcfg {
  * @in: One configuration for each possible channel used.
  */
 struct s3c_hwmon_pdata {
-	struct s3c_hwmon_chcfg	*in[8];
+	struct s3c_hwmon_chcfg	*in[10];
 };
 
 /**
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index f6c26d1..894110d 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -55,7 +55,7 @@ struct s3c_hwmon {
 	struct s3c_adc_client	*client;
 	struct device		*hwmon_dev;
 
-	struct s3c_hwmon_attr	attrs[8];
+	struct s3c_hwmon_attr	attrs[10];
 };
 
 /**
@@ -119,8 +119,10 @@ DEF_ADC_ATTR(4);
 DEF_ADC_ATTR(5);
 DEF_ADC_ATTR(6);
 DEF_ADC_ATTR(7);
+DEF_ADC_ATTR(8);
+DEF_ADC_ATTR(9);
 
-static struct attribute *s3c_hwmon_attrs[9] = {
+static struct attribute *s3c_hwmon_attrs[11] = {
 	&sensor_dev_attr_adc0_raw.dev_attr.attr,
 	&sensor_dev_attr_adc1_raw.dev_attr.attr,
 	&sensor_dev_attr_adc2_raw.dev_attr.attr,
@@ -129,6 +131,8 @@ static struct attribute *s3c_hwmon_attrs[9] = {
 	&sensor_dev_attr_adc5_raw.dev_attr.attr,
 	&sensor_dev_attr_adc6_raw.dev_attr.attr,
 	&sensor_dev_attr_adc7_raw.dev_attr.attr,
+	&sensor_dev_attr_adc8_raw.dev_attr.attr,
+	&sensor_dev_attr_adc9_raw.dev_attr.attr,
 	NULL,
 };
 
-- 
1.7.0.4

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

* [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-01-03  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

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.

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

end of thread, other threads:[~2012-01-03  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] S3C: fix order of MACH_S3C* checks on GPIO count define Russell King - ARM Linux

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).