All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
@ 2012-10-09 15:35 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-10-09 15:35 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Barry Song, linux-arm-kernel, linux-kernel

The prima2 platform advertises needing no mach/gpio.h header file,
but its pinctrl driver now has a sirfsoc_gpio_set_pull function
that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
which fails to build.

Fortunately, the sirfsoc_gpio_set_pull is not used anywhere in the
kernel, so we can safely remove it. Any out of tree drivers using
it will have to be converted to use proper pinctrl functions to
do the same.

Without this patch, building prima2_defconfig results in:

drivers/pinctrl/pinctrl-sirf.c: In function 'sirfsoc_gpio_set_pull':
drivers/pinctrl/pinctrl-sirf.c:1331:7: error: 'SIRFSOC_GPIO_PULL_NONE' undeclared (first use in this function)
drivers/pinctrl/pinctrl-sirf.c:1331:7: note: each undeclared identifier is reported only once for each function it appears in
drivers/pinctrl/pinctrl-sirf.c:1334:7: error: 'SIRFSOC_GPIO_PULL_UP' undeclared (first use in this function)
drivers/pinctrl/pinctrl-sirf.c:1338:7: error: 'SIRFSOC_GPIO_PULL_DOWN' undeclared (first use in this function)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Barry Song <Baohua.Song@csr.com>
Cc: Linus Walleij <linus.walleij@linaro.org>

diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h
deleted file mode 100644
index 1904bb0..0000000
--- a/arch/arm/mach-prima2/include/mach/gpio.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-/* Pull up/down values */
-enum sirfsoc_gpio_pull {
-	SIRFSOC_GPIO_PULL_NONE,
-	SIRFSOC_GPIO_PULL_UP,
-	SIRFSOC_GPIO_PULL_DOWN,
-};
-
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
-
-#endif
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 675497c..9ecacf3 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
 	return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
 }
 
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
-{
-	struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
-	int idx = sirfsoc_gpio_to_offset(gpio);
-	u32 val, offset;
-	unsigned long flags;
-
-	offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
-
-	spin_lock_irqsave(&sgpio_lock, flags);
-
-	val = readl(bank->chip.regs + offset);
-
-	switch (mode) {
-	case SIRFSOC_GPIO_PULL_NONE:
-		val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
-		break;
-	case SIRFSOC_GPIO_PULL_UP:
-		val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-		val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
-		break;
-	case SIRFSOC_GPIO_PULL_DOWN:
-		val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-		val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
-		break;
-	default:
-		break;
-	}
-
-	writel(val, bank->chip.regs + offset);
-
-	spin_unlock_irqrestore(&sgpio_lock, flags);
-}
-EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
-
 static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
 {
 	return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);

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

* [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
@ 2012-10-09 15:35 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-10-09 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

The prima2 platform advertises needing no mach/gpio.h header file,
but its pinctrl driver now has a sirfsoc_gpio_set_pull function
that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
which fails to build.

Fortunately, the sirfsoc_gpio_set_pull is not used anywhere in the
kernel, so we can safely remove it. Any out of tree drivers using
it will have to be converted to use proper pinctrl functions to
do the same.

Without this patch, building prima2_defconfig results in:

drivers/pinctrl/pinctrl-sirf.c: In function 'sirfsoc_gpio_set_pull':
drivers/pinctrl/pinctrl-sirf.c:1331:7: error: 'SIRFSOC_GPIO_PULL_NONE' undeclared (first use in this function)
drivers/pinctrl/pinctrl-sirf.c:1331:7: note: each undeclared identifier is reported only once for each function it appears in
drivers/pinctrl/pinctrl-sirf.c:1334:7: error: 'SIRFSOC_GPIO_PULL_UP' undeclared (first use in this function)
drivers/pinctrl/pinctrl-sirf.c:1338:7: error: 'SIRFSOC_GPIO_PULL_DOWN' undeclared (first use in this function)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Barry Song <Baohua.Song@csr.com>
Cc: Linus Walleij <linus.walleij@linaro.org>

diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h
deleted file mode 100644
index 1904bb0..0000000
--- a/arch/arm/mach-prima2/include/mach/gpio.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-/* Pull up/down values */
-enum sirfsoc_gpio_pull {
-	SIRFSOC_GPIO_PULL_NONE,
-	SIRFSOC_GPIO_PULL_UP,
-	SIRFSOC_GPIO_PULL_DOWN,
-};
-
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
-
-#endif
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 675497c..9ecacf3 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
 	return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
 }
 
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
-{
-	struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
-	int idx = sirfsoc_gpio_to_offset(gpio);
-	u32 val, offset;
-	unsigned long flags;
-
-	offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
-
-	spin_lock_irqsave(&sgpio_lock, flags);
-
-	val = readl(bank->chip.regs + offset);
-
-	switch (mode) {
-	case SIRFSOC_GPIO_PULL_NONE:
-		val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
-		break;
-	case SIRFSOC_GPIO_PULL_UP:
-		val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-		val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
-		break;
-	case SIRFSOC_GPIO_PULL_DOWN:
-		val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-		val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
-		break;
-	default:
-		break;
-	}
-
-	writel(val, bank->chip.regs + offset);
-
-	spin_unlock_irqrestore(&sgpio_lock, flags);
-}
-EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
-
 static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
 {
 	return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);

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

* Re: [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
  2012-10-09 15:35 ` Arnd Bergmann
@ 2012-10-09 16:31   ` Barry Song
  -1 siblings, 0 replies; 6+ messages in thread
From: Barry Song @ 2012-10-09 16:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, linux-kernel, linux-arm-kernel, Barry Song,
	DL-SHA-WorkGroupLinux

Hi Arnd,

2012/10/9 Arnd Bergmann <arnd@arndb.de>:
> The prima2 platform advertises needing no mach/gpio.h header file,
> but its pinctrl driver now has a sirfsoc_gpio_set_pull function
> that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
> which fails to build.
>
> Fortunately, the sirfsoc_gpio_set_pull is not used anywhere in the
> kernel, so we can safely remove it. Any out of tree drivers using
> it will have to be converted to use proper pinctrl functions to
> do the same.
>

i understand we want to delete the mach/gpio.h. originally we had
sirfsoc_gpio_set_pull() as a prima2 customized pull config function.

i will take care moving to the dt mapping for pullup/down/none.


> Without this patch, building prima2_defconfig results in:
>
> drivers/pinctrl/pinctrl-sirf.c: In function 'sirfsoc_gpio_set_pull':
> drivers/pinctrl/pinctrl-sirf.c:1331:7: error: 'SIRFSOC_GPIO_PULL_NONE' undeclared (first use in this function)
> drivers/pinctrl/pinctrl-sirf.c:1331:7: note: each undeclared identifier is reported only once for each function it appears in
> drivers/pinctrl/pinctrl-sirf.c:1334:7: error: 'SIRFSOC_GPIO_PULL_UP' undeclared (first use in this function)
> drivers/pinctrl/pinctrl-sirf.c:1338:7: error: 'SIRFSOC_GPIO_PULL_DOWN' undeclared (first use in this function)
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Barry Song <Baohua.Song@csr.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Barry Song <Baohua.Song@csr.com>

>
> diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h
> deleted file mode 100644
> index 1904bb0..0000000
> --- a/arch/arm/mach-prima2/include/mach/gpio.h
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -#ifndef __MACH_GPIO_H
> -#define __MACH_GPIO_H
> -
> -/* Pull up/down values */
> -enum sirfsoc_gpio_pull {
> -       SIRFSOC_GPIO_PULL_NONE,
> -       SIRFSOC_GPIO_PULL_UP,
> -       SIRFSOC_GPIO_PULL_DOWN,
> -};
> -
> -void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
> -
> -#endif
> diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
> index 675497c..9ecacf3 100644
> --- a/drivers/pinctrl/pinctrl-sirf.c
> +++ b/drivers/pinctrl/pinctrl-sirf.c
> @@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
>         return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
>  }
>
> -void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
> -{
> -       struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
> -       int idx = sirfsoc_gpio_to_offset(gpio);
> -       u32 val, offset;
> -       unsigned long flags;
> -
> -       offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
> -
> -       spin_lock_irqsave(&sgpio_lock, flags);
> -
> -       val = readl(bank->chip.regs + offset);
> -
> -       switch (mode) {
> -       case SIRFSOC_GPIO_PULL_NONE:
> -               val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
> -               break;
> -       case SIRFSOC_GPIO_PULL_UP:
> -               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
> -               val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
> -               break;
> -       case SIRFSOC_GPIO_PULL_DOWN:
> -               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
> -               val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
> -               break;
> -       default:
> -               break;
> -       }
> -
> -       writel(val, bank->chip.regs + offset);
> -
> -       spin_unlock_irqrestore(&sgpio_lock, flags);
> -}
> -EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
> -
>  static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
>  {
>         return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);

-barry

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

* [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
@ 2012-10-09 16:31   ` Barry Song
  0 siblings, 0 replies; 6+ messages in thread
From: Barry Song @ 2012-10-09 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

2012/10/9 Arnd Bergmann <arnd@arndb.de>:
> The prima2 platform advertises needing no mach/gpio.h header file,
> but its pinctrl driver now has a sirfsoc_gpio_set_pull function
> that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
> which fails to build.
>
> Fortunately, the sirfsoc_gpio_set_pull is not used anywhere in the
> kernel, so we can safely remove it. Any out of tree drivers using
> it will have to be converted to use proper pinctrl functions to
> do the same.
>

i understand we want to delete the mach/gpio.h. originally we had
sirfsoc_gpio_set_pull() as a prima2 customized pull config function.

i will take care moving to the dt mapping for pullup/down/none.


> Without this patch, building prima2_defconfig results in:
>
> drivers/pinctrl/pinctrl-sirf.c: In function 'sirfsoc_gpio_set_pull':
> drivers/pinctrl/pinctrl-sirf.c:1331:7: error: 'SIRFSOC_GPIO_PULL_NONE' undeclared (first use in this function)
> drivers/pinctrl/pinctrl-sirf.c:1331:7: note: each undeclared identifier is reported only once for each function it appears in
> drivers/pinctrl/pinctrl-sirf.c:1334:7: error: 'SIRFSOC_GPIO_PULL_UP' undeclared (first use in this function)
> drivers/pinctrl/pinctrl-sirf.c:1338:7: error: 'SIRFSOC_GPIO_PULL_DOWN' undeclared (first use in this function)
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Barry Song <Baohua.Song@csr.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Barry Song <Baohua.Song@csr.com>

>
> diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h
> deleted file mode 100644
> index 1904bb0..0000000
> --- a/arch/arm/mach-prima2/include/mach/gpio.h
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -#ifndef __MACH_GPIO_H
> -#define __MACH_GPIO_H
> -
> -/* Pull up/down values */
> -enum sirfsoc_gpio_pull {
> -       SIRFSOC_GPIO_PULL_NONE,
> -       SIRFSOC_GPIO_PULL_UP,
> -       SIRFSOC_GPIO_PULL_DOWN,
> -};
> -
> -void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
> -
> -#endif
> diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
> index 675497c..9ecacf3 100644
> --- a/drivers/pinctrl/pinctrl-sirf.c
> +++ b/drivers/pinctrl/pinctrl-sirf.c
> @@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
>         return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
>  }
>
> -void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
> -{
> -       struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
> -       int idx = sirfsoc_gpio_to_offset(gpio);
> -       u32 val, offset;
> -       unsigned long flags;
> -
> -       offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
> -
> -       spin_lock_irqsave(&sgpio_lock, flags);
> -
> -       val = readl(bank->chip.regs + offset);
> -
> -       switch (mode) {
> -       case SIRFSOC_GPIO_PULL_NONE:
> -               val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
> -               break;
> -       case SIRFSOC_GPIO_PULL_UP:
> -               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
> -               val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
> -               break;
> -       case SIRFSOC_GPIO_PULL_DOWN:
> -               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
> -               val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
> -               break;
> -       default:
> -               break;
> -       }
> -
> -       writel(val, bank->chip.regs + offset);
> -
> -       spin_unlock_irqrestore(&sgpio_lock, flags);
> -}
> -EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
> -
>  static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
>  {
>         return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);

-barry

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

* Re: [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
  2012-10-09 15:35 ` Arnd Bergmann
@ 2012-10-10  7:53   ` Linus Walleij
  -1 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2012-10-10  7:53 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Barry Song, linux-arm-kernel, linux-kernel

On Tue, Oct 9, 2012 at 5:35 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> The prima2 platform advertises needing no mach/gpio.h header file,
> but its pinctrl driver now has a sirfsoc_gpio_set_pull function
> that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
> which fails to build.

Applied to my pinctrl "fixes" branch with Barry's ACK.

Thanks!
Linus Walleij

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

* [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function
@ 2012-10-10  7:53   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2012-10-10  7:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 9, 2012 at 5:35 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> The prima2 platform advertises needing no mach/gpio.h header file,
> but its pinctrl driver now has a sirfsoc_gpio_set_pull function
> that uses constants defined in arch/arm/mach-prima2/include/mach/gpio.h,
> which fails to build.

Applied to my pinctrl "fixes" branch with Barry's ACK.

Thanks!
Linus Walleij

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

end of thread, other threads:[~2012-10-10  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 15:35 [PATCH] pinctrl: sirf: remove sirfsoc_gpio_set_pull function Arnd Bergmann
2012-10-09 15:35 ` Arnd Bergmann
2012-10-09 16:31 ` Barry Song
2012-10-09 16:31   ` Barry Song
2012-10-10  7:53 ` Linus Walleij
2012-10-10  7:53   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.