public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: ben-linux@fluff•org (Ben Dooks)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 07/16] ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100
Date: Thu, 13 May 2010 02:05:01 +0100	[thread overview]
Message-ID: <20100513010501.GP6684@trinity.fluff.org> (raw)
In-Reply-To: <1270190944-21644-8-git-send-email-m.szyprowski@samsung.com>

On Fri, Apr 02, 2010 at 08:48:55AM +0200, Marek Szyprowski wrote:
> Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio
> functionality is now supported. Gpio interrupts are disabled temporarly
> and will be added later.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung•com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung•com>
> ---
>  arch/arm/mach-s5pc100/Makefile                     |    2 +-
>  .../gpiolib.c => mach-s5pc100/gpio.c}              |   48 +++++++++++---------
>  .../plat => mach-s5pc100/include/mach}/regs-gpio.h |    2 +-
>  3 files changed, 28 insertions(+), 24 deletions(-)
>  rename arch/arm/{plat-s5pc1xx/gpiolib.c => mach-s5pc100/gpio.c} (90%)
>  rename arch/arm/{plat-s5pc1xx/include/plat => mach-s5pc100/include/mach}/regs-gpio.h (98%)
> 
> diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
> index 8371cfb..187b06d 100644
> --- a/arch/arm/mach-s5pc100/Makefile
> +++ b/arch/arm/mach-s5pc100/Makefile
> @@ -11,7 +11,7 @@ obj-				:=
>  
>  # Core support for S5PC100 system
>  
> -obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
> +obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
>  obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
>  
>  # machine support
> diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/mach-s5pc100/gpio.c
> similarity index 90%
> rename from arch/arm/plat-s5pc1xx/gpiolib.c
> rename to arch/arm/mach-s5pc100/gpio.c
> index 1ffc57a..9f6fbe1 100644
> --- a/arch/arm/plat-s5pc1xx/gpiolib.c
> +++ b/arch/arm/mach-s5pc100/gpio.c
> @@ -4,7 +4,7 @@
>   *  Copyright 2009 Samsung Electronics Co
>   *  Kyungmin Park <kyungmin.park@samsung•com>
>   *
> - * S5PC1XX - GPIOlib support
> + * S5PC100 - GPIOlib support
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> @@ -17,11 +17,11 @@
>  #include <linux/gpio.h>
>  
>  #include <mach/map.h>
> +#include <mach/regs-gpio.h>
>  
>  #include <plat/gpio-core.h>
>  #include <plat/gpio-cfg.h>
>  #include <plat/gpio-cfg-helpers.h>
> -#include <plat/regs-gpio.h>
>  
>  /* S5PC100 GPIO bank summary:
>   *
> @@ -72,7 +72,7 @@
>  #define gpio_dbg(x...) printk(KERN_DEBUG x)
>  #endif
>  
> -/* The s5pc1xx_gpiolib routines are to control the gpio banks where
> +/* The s5pc100_gpiolib routines are to control the gpio banks where
>   * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
>   * following example:
>   *
> @@ -87,7 +87,7 @@
>   * the output.
>   */
>  
> -static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
> +static int s5pc100_gpiolib_input(struct gpio_chip *chip, unsigned offset)
>  {
>  	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
>  	void __iomem *base = ourchip->base;
> @@ -102,7 +102,7 @@ static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
>  	return 0;
>  }

to be honest i'd rather see the back of these and use the common support
for s5pc/s3c64xx which seems to be pretty much the same.
  
> -static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
> +static int s5pc100_gpiolib_output(struct gpio_chip *chip,
>  				       unsigned offset, int value)
>  {
>  	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
> @@ -129,12 +129,14 @@ static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
>  	return 0;
>  }
>  
> -static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
> +#if 0
> +static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
>  {
>  	return S3C_IRQ_GPIO(chip->base + offset);
>  }
> +#endif
>  
> -static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
> +static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
>  {
>  	int base;
>  
> @@ -449,33 +451,34 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
>  };
>  
>  /* FIXME move from irq-gpio.c */
> -extern struct irq_chip s5pc1xx_gpioint;
> -extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
> +extern struct irq_chip s5pc100_gpioint;
> +extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
>  
> -static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
> +static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
>  {
> -	chip->chip.direction_input = s5pc1xx_gpiolib_input;
> -	chip->chip.direction_output = s5pc1xx_gpiolib_output;
> +	chip->chip.direction_input = s5pc100_gpiolib_input;
> +	chip->chip.direction_output = s5pc100_gpiolib_output;
>  	chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
> -
> +#if 0
>  	/* Interrupt */
>  	if (chip->config == &gpio_cfg) {
>  		int i, irq;
>  
> -		chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
> +		chip->chip.to_irq = s5pc100_gpiolib_to_irq;
>  
>  		for (i = 0;  i < chip->chip.ngpio; i++) {
>  			irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
> -			set_irq_chip(irq, &s5pc1xx_gpioint);
> +			set_irq_chip(irq, &s5pc100_gpioint);
>  			set_irq_data(irq, &chip->chip);
>  			set_irq_handler(irq, handle_level_irq);
>  			set_irq_flags(irq, IRQF_VALID);
>  		}
>  	} else if (chip->config == &gpio_cfg_eint)
> -		chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
> +		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
> +#endif
>  }
>  
> -static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
> +static __init void s5pc100_gpiolib_add(struct s3c_gpio_chip *chips,
>  				       int nr_chips,
>  				       void (*fn)(struct s3c_gpio_chip *))
>  {
> @@ -486,7 +489,7 @@ static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
>  	}
>  }
>  
> -static __init int s5pc1xx_gpiolib_init(void)
> +static __init int s5pc100_gpiolib_init(void)
>  {
>  	struct s3c_gpio_chip *chips;
>  	int nr_chips;
> @@ -494,10 +497,11 @@ static __init int s5pc1xx_gpiolib_init(void)
>  		chips = s5pc100_gpio_chips;
>  		nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
>  
> -	s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
> +	s5pc100_gpiolib_add(chips, nr_chips, s5pc100_gpiolib_link);
>  	/* Interrupt */
> -	set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
> -
> +#if 0
> +	set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
> +#endif
>  	return 0;
>  }
> -core_initcall(s5pc1xx_gpiolib_init);
> +core_initcall(s5pc100_gpiolib_init);
> diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h b/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
> similarity index 98%
> rename from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
> rename to arch/arm/mach-s5pc100/include/mach/regs-gpio.h
> index 43c7bc8..b523d84 100644
> --- a/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
> +++ b/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
> @@ -12,7 +12,7 @@
>  #include <mach/map.h>
>  
>  /* S5PC100 */
> -#define S5PC100_GPIO_BASE	S5PC1XX_VA_GPIO
> +#define S5PC100_GPIO_BASE	S5P_VA_GPIO
>  #define S5PC100_GPA0_BASE	(S5PC100_GPIO_BASE + 0x0000)
>  #define S5PC100_GPA1_BASE	(S5PC100_GPIO_BASE + 0x0020)
>  #define S5PC100_GPB_BASE	(S5PC100_GPIO_BASE + 0x0040)
> -- 
> 1.6.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

  parent reply	other threads:[~2010-05-13  1:05 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  6:48 [PATCH] ARM: Samsung: S5PC100 platform cleanup Marek Szyprowski
2010-04-02  6:48 ` [PATCH 01/16] ARM: S5PC1xx rename registers to match plat-s5p style Marek Szyprowski
2010-05-12  4:55   ` Kukjin Kim
2010-05-12  5:33     ` Marek Szyprowski
2010-05-13  0:54   ` Ben Dooks
2010-04-02  6:48 ` [PATCH 02/16] drivers: serial: S5PC100 serial driver cleanup Marek Szyprowski
2010-04-06 15:59   ` Ben Dooks
2010-04-08  8:08     ` Marek Szyprowski
2010-04-02  6:48 ` [PATCH 03/16] ARM: Samsung: plat-s5p - enable access to clk_27m clock Marek Szyprowski
2010-05-12  4:55   ` Kukjin Kim
2010-05-12 16:14     ` Marek Szyprowski
2010-04-02  6:48 ` [PATCH 04/16] ARM: S5PC100: copy clocks from plat-s5pc1xx Marek Szyprowski
2010-05-12  4:55   ` Kukjin Kim
2010-05-12  5:22     ` Marek Szyprowski
2010-04-02  6:48 ` [PATCH 05/16] ARM: S5PC100: new clocks definition Marek Szyprowski
2010-05-12  4:56   ` Kukjin Kim
2010-05-12  6:43     ` Marek Szyprowski
2010-05-12  7:34       ` Kukjin Kim
2010-05-12  8:37         ` Marek Szyprowski
2010-05-12  8:48           ` Jassi Brar
2010-05-13  0:59           ` Ben Dooks
2010-05-12 17:48     ` Marek Szyprowski
2010-05-13  0:22       ` Kukjin Kim
2010-04-02  6:48 ` [PATCH 06/16] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework Marek Szyprowski
2010-05-12  5:41   ` Kukjin Kim
2010-05-12  5:54     ` Marek Szyprowski
2010-05-12  6:31       ` jassi brar
2010-05-12  6:40         ` Marek Szyprowski
2010-05-12  6:57           ` jassi brar
2010-04-02  6:48 ` [PATCH 07/16] ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100 Marek Szyprowski
2010-05-12  5:50   ` Kukjin Kim
2010-05-12  6:02     ` Marek Szyprowski
2010-05-13  1:05   ` Ben Dooks [this message]
2010-04-02  6:48 ` [PATCH 08/16] ARM: S5PC100: Move frame buffer helpers " Marek Szyprowski
2010-05-12  5:52   ` Kukjin Kim
2010-05-12  6:08     ` Marek Szyprowski
2010-04-02  6:48 ` [PATCH 09/16] ARM: SMDKC100: enable frame buffer again Marek Szyprowski
2010-05-12  5:55   ` Kukjin Kim
2010-04-02  6:48 ` [PATCH 10/16] ARM: S5PC100: Move i2c helpers from plat-s5pc1xx to mach-s5pc100 Marek Szyprowski
2010-05-12  6:05   ` Kukjin Kim
2010-04-02  6:48 ` [PATCH 11/16] ARM: SMDKC100: enable i2c support again Marek Szyprowski
2010-05-12  6:06   ` Kukjin Kim
2010-04-02  6:49 ` [PATCH 12/16] ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100 Marek Szyprowski
2010-05-12  7:04   ` Kukjin Kim
2010-05-12  7:24     ` Marek Szyprowski
2010-04-02  6:49 ` [PATCH 13/16] ARM: SMDKC100: enable sdhci support again Marek Szyprowski
2010-05-12  7:05   ` Kukjin Kim
2010-04-02  6:49 ` [PATCH 14/16] ARM: Samsung: Move external interrupts support from plat-s5pc1xx to plat-s5p Marek Szyprowski
2010-04-02  6:49 ` [PATCH 15/16] ARM: S5PC100: Add support for gpio interrupt Marek Szyprowski
2010-04-02  6:49 ` [PATCH 16/16] ARM: remove obsolete plat-s5pc1xx directory Marek Szyprowski

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=20100513010501.GP6684@trinity.fluff.org \
    --to=ben-linux@fluff$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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