From: David Brown <davidb@codeaurora.org>
To: David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
H Hartley Sweeten <hartleys@visionengravers.com>
Subject: [PATCH v2 5/7] msm: gpiomux: Move public API to public header
Date: Fri, 3 Jun 2011 15:44:17 -0700 [thread overview]
Message-ID: <1307141059-22431-6-git-send-email-davidb@codeaurora.org> (raw)
In-Reply-To: <1307141059-22431-1-git-send-email-davidb@codeaurora.org>
The gpiomux.h header contains some SOC ifdefs. However, the API that
is actually used by the GPIO driver only uses two functions that are
general. Move these general definitions into a public header file.
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
---
arch/arm/mach-msm/gpio.c | 2 +-
arch/arm/mach-msm/gpiomux.h | 17 +-----------
arch/arm/mach-msm/include/mach/msm_gpiomux.h | 38 ++++++++++++++++++++++++++
3 files changed, 40 insertions(+), 17 deletions(-)
create mode 100644 arch/arm/mach-msm/include/mach/msm_gpiomux.h
diff --git a/arch/arm/mach-msm/gpio.c b/arch/arm/mach-msm/gpio.c
index e96199d..6767deb 100644
--- a/arch/arm/mach-msm/gpio.c
+++ b/arch/arm/mach-msm/gpio.c
@@ -21,8 +21,8 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <mach/cpu.h>
+#include <mach/msm_gpiomux.h>
#include "gpio_hw.h"
-#include "gpiomux.h"
#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0)
diff --git a/arch/arm/mach-msm/gpiomux.h b/arch/arm/mach-msm/gpiomux.h
index b178d9c..00459f6 100644
--- a/arch/arm/mach-msm/gpiomux.h
+++ b/arch/arm/mach-msm/gpiomux.h
@@ -19,6 +19,7 @@
#include <linux/bitops.h>
#include <linux/errno.h>
+#include <mach/msm_gpiomux.h>
#if defined(CONFIG_MSM_V2_TLMM)
#include "gpiomux-v2.h"
@@ -71,12 +72,6 @@ enum {
*/
extern struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS];
-/* Increment a gpio's reference count, possibly activating the line. */
-int __must_check msm_gpiomux_get(unsigned gpio);
-
-/* Decrement a gpio's reference count, possibly suspending the line. */
-int msm_gpiomux_put(unsigned gpio);
-
/* Install a new configuration to the gpio line. To avoid overwriting
* a configuration, leave the VALID bit out.
*/
@@ -94,16 +89,6 @@ int msm_gpiomux_write(unsigned gpio,
*/
void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val);
#else
-static inline int __must_check msm_gpiomux_get(unsigned gpio)
-{
- return -ENOSYS;
-}
-
-static inline int msm_gpiomux_put(unsigned gpio)
-{
- return -ENOSYS;
-}
-
static inline int msm_gpiomux_write(unsigned gpio,
gpiomux_config_t active,
gpiomux_config_t suspended)
diff --git a/arch/arm/mach-msm/include/mach/msm_gpiomux.h b/arch/arm/mach-msm/include/mach/msm_gpiomux.h
new file mode 100644
index 0000000..0c7d393
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/msm_gpiomux.h
@@ -0,0 +1,38 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _LINUX_MSM_GPIOMUX_H
+#define _LINUX_MSM_GPIOMUX_H
+
+#ifdef CONFIG_MSM_GPIOMUX
+
+/* Increment a gpio's reference count, possibly activating the line. */
+int __must_check msm_gpiomux_get(unsigned gpio);
+
+/* Decrement a gpio's reference count, possibly suspending the line. */
+int msm_gpiomux_put(unsigned gpio);
+
+#else
+
+static inline int __must_check msm_gpiomux_get(unsigned gpio)
+{
+ return -ENOSYS;
+}
+
+static inline int msm_gpiomux_put(unsigned gpio)
+{
+ return -ENOSYS;
+}
+
+#endif
+
+#endif /* _LINUX_MSM_GPIOMUX_H */
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2011-06-03 22:45 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 21:50 [PATCH 0/7] Move Qualcomm gpio drivers into drivers dir David Brown
2011-05-18 21:50 ` [PATCH 1/7] msm: gpio: Remove unsupported devices David Brown
2011-05-18 21:50 ` [PATCH 2/7] msm: Remove chip-ifdefs for GPIO io mappings David Brown
2011-05-18 21:50 ` [PATCH 3/7] msm: gpio: Remove chip-specific register definitions David Brown
2011-05-18 21:50 ` [PATCH 4/7] msm: gpio: Remove ifdefs on gpio chip registers David Brown
2011-05-18 21:50 ` [PATCH 5/7] msm: gpiomux: Move public API to public header David Brown
2011-05-18 22:44 ` H Hartley Sweeten
2011-05-18 23:06 ` David Brown
2011-05-18 21:50 ` [PATCH 6/7] gpio_msm: Move Qualcomm v6 MSM driver into drivers David Brown
2011-05-18 21:50 ` [PATCH 7/7] gpio_msm: Move Qualcomm MSM v2 gpio " David Brown
2011-05-18 22:35 ` Stephen Boyd
2011-05-18 22:43 ` David Brown
2011-05-18 22:25 ` [PATCH 0/7] Move Qualcomm gpio drivers into drivers dir Linus Walleij
2011-05-19 19:34 ` Nicolas Pitre
2011-05-27 3:13 ` Grant Likely
2011-05-27 16:29 ` David Brown
2011-05-27 16:35 ` David Brown
2011-05-27 19:31 ` Nicolas Pitre
2011-05-27 21:19 ` David Brown
2011-06-03 22:44 ` [PATCH v2 " David Brown
2011-06-03 22:44 ` [PATCH v2 1/7] msm: gpio: Remove unsupported devices David Brown
2011-06-03 22:44 ` [PATCH v2 2/7] msm: Remove chip-ifdefs for GPIO io mappings David Brown
2011-06-03 22:44 ` [PATCH v2 3/7] msm: gpio: Remove chip-specific register definitions David Brown
2011-06-03 22:44 ` [PATCH v2 4/7] msm: gpio: Remove ifdefs on gpio chip registers David Brown
2011-06-03 22:44 ` David Brown [this message]
2011-06-03 22:44 ` [PATCH v2 6/7] gpio_msm: Move Qualcomm v6 MSM driver into drivers David Brown
2011-06-04 6:44 ` Grant Likely
2011-06-03 22:44 ` [PATCH v2 7/7] gpio_msm: Move Qualcomm MSM v2 gpio " David Brown
2011-06-04 6:45 ` Grant Likely
2011-06-04 0:15 ` [PATCH v2 0/7] Move Qualcomm gpio drivers into drivers dir David Brown
2011-06-06 21:51 ` [PATCH v3 0/8] " David Brown
2011-06-06 21:51 ` [PATCH v3 1/8] msm: gpio: Remove unsupported devices David Brown
2011-06-06 21:51 ` [PATCH v3 2/8] msm: Remove chip-ifdefs for GPIO io mappings David Brown
2011-06-06 21:51 ` [PATCH v3 3/8] msm: gpio: Remove chip-specific register definitions David Brown
2011-06-06 21:51 ` [PATCH v3 4/8] msm: gpio: Remove ifdefs on gpio chip registers David Brown
2011-06-06 21:51 ` [PATCH v3 5/8] msm: gpiomux: Move public API to public header David Brown
2011-06-06 21:51 ` [PATCH v3 6/8] msm: gpio: Fold register defs into C file David Brown
2011-06-06 21:51 ` [PATCH v3 7/8] gpio_msm: Move Qualcomm v6 MSM driver into drivers David Brown
2011-06-06 21:51 ` [PATCH v3 8/8] gpio_msm: Move Qualcomm MSM v2 gpio " David Brown
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=1307141059-22431-6-git-send-email-davidb@codeaurora.org \
--to=davidb@codeaurora.org \
--cc=bryanh@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=hartleys@visionengravers.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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).