S3C: fix order of MACH_S3C* checks on GPIO count define
PATCH 1/1 S3C: fix order of MACH_S3C* checks on GPIO count define
From: Gusakov Andrey <[email protected]>
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.
--- arch/arm/mach-s3c2410/include/mach/gpio.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-s3c2410/include/mach/gpio.h +6 -6
@@ -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
Signature · 1 line
1.7.0.4
PATCH 1/1 S3C: enable debuging over UART3
From: Gusakov Andrey <[email protected]>
Some S3C24XX SoCs have 4 uarts. This patch allow set uart3 for debug output.
--- arch/arm/Kconfig.debug | 11 +++++++++++ arch/arm/plat-samsung/Kconfig | 1 + 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/Kconfig.debug +11 -0
@@ -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
arch/arm/plat-samsung/Kconfig +1 -0
@@ -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
Signature · 1 line
1.7.0.4
PATCH 1/1 S3C: increase hwmon channels to 10
In reply to Gusakov AndreyS3C2416/2443 have 10-ch ADC. So increase number of hwmon's channels to 10.
--- arch/arm/plat-samsung/include/plat/hwmon.h | 2 +- drivers/hwmon/s3c-hwmon.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/plat-samsung/include/plat/hwmon.h +1 -1
@@ -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 ]; };/**
drivers/hwmon/s3c-hwmon.c +6 -2
@@ -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, };
Signature · 1 line
1.7.0.4
PATCH 1/1 S3C: fix order of MACH_S3C* checks on GPIO count define
In reply to Gusakov AndreyQuoted 3 lines · Gusakov Andrey
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.
arch/arm/mach-s3c2410/include/mach/gpio.h line 24
Quoted 10 lines
arch/arm/mach-s3c2410/include/mach/gpio.h +3
-3-#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 0to set ARCH_NR_GPIO in generic code.