diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2011-10-04 19:55:49 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-12 08:20:13 -0400 |
commit | c034b184597d93ad7749aca3e8bd1c2105104f07 (patch) | |
tree | 2e8678e74eada9690eb882b7a6cad7f85f4f483d | |
parent | b82cee243633fbb734de704e38f57c771d7afd73 (diff) |
gpio/samsung: Move SoC specific codes within macro
In drivers/gpio/gpio-samsung.c, there are certain structures
and functions which are not getting used if the particular
CPU is not selected. These code segments are moved under CPU
specific macros to remove compilation warnings.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | drivers/gpio/gpio-samsung.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index de8788de759d..479edc3b8ea3 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -318,6 +318,7 @@ static unsigned samsung_gpio_getcfg_4bit(struct samsung_gpio_chip *chip, | |||
318 | return S3C_GPIO_SPECIAL(con); | 318 | return S3C_GPIO_SPECIAL(con); |
319 | } | 319 | } |
320 | 320 | ||
321 | #ifdef CONFIG_PLAT_S3C24XX | ||
321 | /* | 322 | /* |
322 | * s3c24xx_gpio_setcfg_abank - S3C24XX style GPIO configuration (Bank A) | 323 | * s3c24xx_gpio_setcfg_abank - S3C24XX style GPIO configuration (Bank A) |
323 | * @chip: The gpio chip that is being configured. | 324 | * @chip: The gpio chip that is being configured. |
@@ -379,7 +380,9 @@ static unsigned s3c24xx_gpio_getcfg_abank(struct samsung_gpio_chip *chip, | |||
379 | 380 | ||
380 | return S3C_GPIO_SFN(con); | 381 | return S3C_GPIO_SFN(con); |
381 | } | 382 | } |
383 | #endif | ||
382 | 384 | ||
385 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) | ||
383 | static int s5p64x0_gpio_setcfg_rbank(struct samsung_gpio_chip *chip, | 386 | static int s5p64x0_gpio_setcfg_rbank(struct samsung_gpio_chip *chip, |
384 | unsigned int off, unsigned int cfg) | 387 | unsigned int off, unsigned int cfg) |
385 | { | 388 | { |
@@ -417,6 +420,7 @@ static int s5p64x0_gpio_setcfg_rbank(struct samsung_gpio_chip *chip, | |||
417 | 420 | ||
418 | return 0; | 421 | return 0; |
419 | } | 422 | } |
423 | #endif | ||
420 | 424 | ||
421 | static void __init samsung_gpiolib_set_cfg(struct samsung_gpio_cfg *chipcfg, | 425 | static void __init samsung_gpiolib_set_cfg(struct samsung_gpio_cfg *chipcfg, |
422 | int nr_chips) | 426 | int nr_chips) |
@@ -438,10 +442,12 @@ struct samsung_gpio_cfg s3c24xx_gpiocfg_default = { | |||
438 | .get_config = samsung_gpio_getcfg_2bit, | 442 | .get_config = samsung_gpio_getcfg_2bit, |
439 | }; | 443 | }; |
440 | 444 | ||
445 | #ifdef CONFIG_PLAT_S3C24XX | ||
441 | static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = { | 446 | static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = { |
442 | .set_config = s3c24xx_gpio_setcfg_abank, | 447 | .set_config = s3c24xx_gpio_setcfg_abank, |
443 | .get_config = s3c24xx_gpio_getcfg_abank, | 448 | .get_config = s3c24xx_gpio_getcfg_abank, |
444 | }; | 449 | }; |
450 | #endif | ||
445 | 451 | ||
446 | static struct samsung_gpio_cfg exynos4_gpio_cfg = { | 452 | static struct samsung_gpio_cfg exynos4_gpio_cfg = { |
447 | .set_pull = exynos4_gpio_setpull, | 453 | .set_pull = exynos4_gpio_setpull, |
@@ -450,6 +456,7 @@ static struct samsung_gpio_cfg exynos4_gpio_cfg = { | |||
450 | .get_config = samsung_gpio_getcfg_4bit, | 456 | .get_config = samsung_gpio_getcfg_4bit, |
451 | }; | 457 | }; |
452 | 458 | ||
459 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) | ||
453 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { | 460 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { |
454 | .cfg_eint = 0x3, | 461 | .cfg_eint = 0x3, |
455 | .set_config = s5p64x0_gpio_setcfg_rbank, | 462 | .set_config = s5p64x0_gpio_setcfg_rbank, |
@@ -457,6 +464,7 @@ static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { | |||
457 | .set_pull = samsung_gpio_setpull_updown, | 464 | .set_pull = samsung_gpio_setpull_updown, |
458 | .get_pull = samsung_gpio_getpull_updown, | 465 | .get_pull = samsung_gpio_getpull_updown, |
459 | }; | 466 | }; |
467 | #endif | ||
460 | 468 | ||
461 | static struct samsung_gpio_cfg samsung_gpio_cfgs[] = { | 469 | static struct samsung_gpio_cfg samsung_gpio_cfgs[] = { |
462 | { | 470 | { |
@@ -689,6 +697,7 @@ static int samsung_gpiolib_4bit2_output(struct gpio_chip *chip, | |||
689 | return 0; | 697 | return 0; |
690 | } | 698 | } |
691 | 699 | ||
700 | #ifdef CONFIG_PLAT_S3C24XX | ||
692 | /* The next set of routines are for the case of s3c24xx bank a */ | 701 | /* The next set of routines are for the case of s3c24xx bank a */ |
693 | 702 | ||
694 | static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset) | 703 | static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset) |
@@ -724,6 +733,7 @@ static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip, | |||
724 | local_irq_restore(flags); | 733 | local_irq_restore(flags); |
725 | return 0; | 734 | return 0; |
726 | } | 735 | } |
736 | #endif | ||
727 | 737 | ||
728 | /* The next set of routines are for the case of s5p64x0 bank r */ | 738 | /* The next set of routines are for the case of s5p64x0 bank r */ |
729 | 739 | ||