linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: avinashphilip@ti.com (Philip Avinash)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/11] ARM: davinci: start using gpiolib support
Date: Wed, 22 May 2013 12:40:31 +0530	[thread overview]
Message-ID: <1369206634-6778-9-git-send-email-avinashphilip@ti.com> (raw)
In-Reply-To: <1369206634-6778-1-git-send-email-avinashphilip@ti.com>

- Remove NEED_MACH_GPIO_H config option for Davinci platforms to start
  using common gpio library interface.
- Added struct davinci_gpio_controller definitions in platform_data
  directory for Davinci gpio devices.
- Removed GPIO_TYPE_DAVINCI enum definition as GPIO Davinci is converted
  to Linux device driver model.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
---
 arch/arm/Kconfig                                  |    1 -
 arch/arm/mach-davinci/include/mach/gpio-davinci.h |    6 +++--
 include/linux/platform_data/gpio-davinci.h        |   27 +++++++++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 13b7394..74d3e85 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -955,7 +955,6 @@ config ARCH_DAVINCI
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select HAVE_IDE
-	select NEED_MACH_GPIO_H
 	select USE_OF
 	select ZONE_DMA
 	help
diff --git a/arch/arm/mach-davinci/include/mach/gpio-davinci.h b/arch/arm/mach-davinci/include/mach/gpio-davinci.h
index b325a1d..18140e0 100644
--- a/arch/arm/mach-davinci/include/mach/gpio-davinci.h
+++ b/arch/arm/mach-davinci/include/mach/gpio-davinci.h
@@ -23,9 +23,10 @@
 
 #define DAVINCI_GPIO_BASE 0x01C67000
 
+#ifdef CONFIG_ARCH_DAVINCI_TNETV107X
+
 enum davinci_gpio_type {
-	GPIO_TYPE_DAVINCI = 0,
-	GPIO_TYPE_TNETV107X,
+	GPIO_TYPE_TNETV107X = 0,
 };
 
 /*
@@ -90,4 +91,5 @@ static inline u32 __gpio_mask(unsigned gpio)
 	return 1 << (gpio % 32);
 }
 
+#endif	/* CONFIG_ARCH_DAVINCI_TNETV107X */
 #endif	/* __DAVINCI_DAVINCI_GPIO_H */
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
index f1c8277..75805d4 100644
--- a/include/linux/platform_data/gpio-davinci.h
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -18,10 +18,37 @@
 #ifndef __ASM_ARCH_DAVINCI_GPIO_H
 #define __ASM_ARCH_DAVINCI_GPIO_H
 
+#include <asm-generic/gpio.h>
+
 struct davinci_gpio_platform_data {
 	u32	ngpio;
 	u32	gpio_unbanked;
 	u32	intc_irq_num;
 };
 
+
+struct davinci_gpio_controller {
+	struct gpio_chip	chip;
+	int			irq_base;
+	spinlock_t		lock;
+	void __iomem		*regs;
+	void __iomem		*set_data;
+	void __iomem		*clr_data;
+	void __iomem		*in_data;
+	int			gpio_unbanked;
+	unsigned		gpio_irq;
+};
+
+/*
+ * basic gpio routines
+ */
+#define	GPIO(X)		(X)	/* 0 <= X <= (DAVINCI_N_GPIO - 1) */
+
+/* Convert GPIO signal to GPIO pin number */
+#define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
+
+static inline u32 __gpio_mask(unsigned gpio)
+{
+	return 1 << (gpio % 32);
+}
 #endif
-- 
1.7.9.5

  parent reply	other threads:[~2013-05-22  7:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  7:10 [PATCH 00/11] Convert GPIO Davinci to platform driver Philip Avinash
2013-05-22  7:10 ` [PATCH 01/11] ARM: davinci: GPIO: Add platform data structure Philip Avinash
2013-05-30 18:06   ` Linus Walleij
2013-06-11 10:36   ` Sekhar Nori
2013-06-11 11:10     ` Sergei Shtylyov
2013-06-11 12:53     ` Philip, Avinash
2013-05-22  7:10 ` [PATCH 02/11] gpio: davinci: coding style correction Philip Avinash
2013-05-22 12:59   ` Sergei Shtylyov
2013-05-23  6:27     ` Philip, Avinash
2013-05-22 14:40   ` Russell King - ARM Linux
2013-05-23  6:27     ` Philip, Avinash
2013-06-11 11:42   ` Sekhar Nori
2013-05-22  7:10 ` [PATCH 03/11] gpio: davinci: Modify to platform driver Philip Avinash
2013-05-30 18:12   ` Linus Walleij
2013-06-11 11:56   ` Sekhar Nori
2013-06-11 12:55     ` Philip, Avinash
2013-06-12  7:43       ` Sekhar Nori
2013-06-12 12:10         ` Philip, Avinash
2013-06-13  6:17           ` Sekhar Nori
2013-06-13  7:32             ` Philip, Avinash
2013-06-13  8:29               ` Sekhar Nori
2013-06-13  9:18                 ` Philip, Avinash
2013-05-22  7:10 ` [PATCH 04/11] ARM: davinci: da8xx: creation of gpio platform device Philip Avinash
2013-05-30 18:14   ` Linus Walleij
2013-05-22  7:10 ` [PATCH 05/11] ARM: davinci: creation of gpio platform device for dm platforms Philip Avinash
2013-05-30 18:15   ` Linus Walleij
2013-05-22  7:10 ` [PATCH 06/11] ARM: davinci: da8xx: gpio device creation Philip Avinash
2013-05-30 18:16   ` Linus Walleij
2013-05-22  7:10 ` [PATCH 07/11] ARM: davinci: create davinci gpio device for dm platforms Philip Avinash
2013-05-30 18:16   ` Linus Walleij
2013-05-22  7:10 ` Philip Avinash [this message]
2013-05-30 18:19   ` [PATCH 08/11] ARM: davinci: start using gpiolib support Linus Walleij
2013-05-22  7:10 ` [PATCH 09/11] gpio: davinci: DT changes for driver Philip Avinash
2013-05-30 18:25   ` Linus Walleij
2013-06-10 11:45     ` Philip, Avinash
2013-05-22  7:10 ` [PATCH 10/11] ARM: davinci: da850: add GPIO DT entries Philip Avinash
2013-05-22  7:10 ` [PATCH 11/11] ARM: davinci: da850 evm: add GPIO DT data Philip Avinash
2013-05-30 18:26   ` Linus Walleij
2013-05-30 18:04 ` [PATCH 00/11] Convert GPIO Davinci to platform driver Linus Walleij
2013-06-07  8:10 ` Sekhar Nori
2013-06-10  9:02   ` Philip, Avinash
2013-06-11  4:39     ` Sekhar Nori
2013-06-11  6:49       ` Philip, Avinash
2013-06-11 11:40         ` Sekhar Nori

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=1369206634-6778-9-git-send-email-avinashphilip@ti.com \
    --to=avinashphilip@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).