From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: linux-kernel@vger.kernel.org
Cc: Paul Mundt <lethal@linux-sh.org>,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Linus Walleij <linus.walleij@linaro.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Phil Edworthy <phil.edworthy@renesas.com>,
Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Subject: [PATCH 02/42] sh-pfc: Move private definitions and declarations to private header
Date: Wed, 21 Nov 2012 03:27:03 +0100 [thread overview]
Message-ID: <1353464863-10281-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <1353464863-10281-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
Move all private structure definitions and function declarations from
include/linux/sh_pfc.h to drivers/sh/pfc/core.h.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/sh/pfc/core.c | 2 ++
drivers/sh/pfc/core.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
drivers/sh/pfc/gpio.c | 2 ++
drivers/sh/pfc/pinctrl.c | 2 ++
include/linux/sh_pfc.h | 29 -----------------------------
5 files changed, 50 insertions(+), 29 deletions(-)
create mode 100644 drivers/sh/pfc/core.h
diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c
index ecbe51d..72421a4 100644
--- a/drivers/sh/pfc/core.c
+++ b/drivers/sh/pfc/core.c
@@ -21,6 +21,8 @@
#include <linux/ioport.h>
#include <linux/pinctrl/machine.h>
+#include "core.h"
+
static struct sh_pfc sh_pfc __read_mostly;
static void pfc_iounmap(struct sh_pfc *pfc)
diff --git a/drivers/sh/pfc/core.h b/drivers/sh/pfc/core.h
new file mode 100644
index 0000000..b07ae25
--- /dev/null
+++ b/drivers/sh/pfc/core.h
@@ -0,0 +1,44 @@
+/*
+ * SuperH Pin Function Controller support.
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#ifndef __SH_PFC_CORE_H__
+#define __SH_PFC_CORE_H__
+
+#include <linux/compiler.h>
+#include <linux/sh_pfc.h>
+#include <linux/types.h>
+
+struct pfc_window {
+ phys_addr_t phys;
+ void __iomem *virt;
+ unsigned long size;
+};
+
+struct sh_pfc {
+ struct sh_pfc_platform_data *pdata;
+ spinlock_t lock;
+
+ struct pfc_window *window;
+};
+
+int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
+
+int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
+
+int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
+void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
+ unsigned long value);
+int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
+ struct pinmux_data_reg **drp, int *bitp);
+int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
+ pinmux_enum_t *enum_idp);
+int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
+ int cfg_mode);
+
+#endif /* __SH_PFC_CORE_H__ */
diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c
index 9b7e45c..94c5489 100644
--- a/drivers/sh/pfc/gpio.c
+++ b/drivers/sh/pfc/gpio.c
@@ -19,6 +19,8 @@
#include <linux/pinctrl/consumer.h>
#include <linux/sh_pfc.h>
+#include "core.h"
+
struct sh_pfc_chip {
struct sh_pfc *pfc;
struct gpio_chip gpio_chip;
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c
index 447fb60..5efa36a 100644
--- a/drivers/sh/pfc/pinctrl.c
+++ b/drivers/sh/pfc/pinctrl.c
@@ -24,6 +24,8 @@
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf-generic.h>
+#include "core.h"
+
struct sh_pfc_pinctrl {
struct pinctrl_dev *pctl;
struct sh_pfc *pfc;
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 58587f9..f7f01b2 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -88,12 +88,6 @@ struct pinmux_range {
pinmux_enum_t force;
};
-struct pfc_window {
- phys_addr_t phys;
- void __iomem *virt;
- unsigned long size;
-};
-
struct sh_pfc_platform_data {
char *name;
pinmux_enum_t reserved_id;
@@ -123,35 +117,12 @@ struct sh_pfc_platform_data {
unsigned long unlock_reg;
};
-struct sh_pfc {
- struct sh_pfc_platform_data *pdata;
- spinlock_t lock;
-
- struct pfc_window *window;
-};
-
/* XXX compat for now */
#define pinmux_info sh_pfc_platform_data
-/* drivers/sh/pfc/gpio.c */
-int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
-
-/* drivers/sh/pfc/pinctrl.c */
-int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
-
/* drivers/sh/pfc/core.c */
int register_sh_pfc(struct sh_pfc_platform_data *pfc);
-int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
-void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
- unsigned long value);
-int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
- struct pinmux_data_reg **drp, int *bitp);
-int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
- pinmux_enum_t *enum_idp);
-int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
- int cfg_mode);
-
/* xxx */
static inline int register_pinmux(struct pinmux_info *pip)
{
--
1.7.8.6
next prev parent reply other threads:[~2012-11-21 2:38 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 2:27 [PATCH 00/42] SH pin control and GPIO rework Laurent Pinchart
2012-11-21 2:27 ` [PATCH 01/42] sh-pfc: Split platform data from the sh_pfc structure Laurent Pinchart
2012-11-21 2:27 ` Laurent Pinchart [this message]
2012-11-21 2:27 ` [PATCH 03/42] sh-pfc: Merge PFC core and pinctrl Laurent Pinchart
2012-11-21 2:27 ` [PATCH 04/42] sh-pfc: Merge PFC core and gpio Laurent Pinchart
2012-11-21 2:27 ` [PATCH 05/42] sh-pfc: Move platform device and driver to the core Laurent Pinchart
2012-11-21 2:27 ` [PATCH 06/42] sh-pfc: Let the compiler decide whether to inline functions Laurent Pinchart
2012-11-21 2:27 ` [PATCH 07/42] sh-pfc: Remove check for impossible error condition Laurent Pinchart
2012-11-21 2:27 ` [PATCH 08/42] sh-pfc: Sort headers alphabetically Laurent Pinchart
2012-11-21 2:27 ` [PATCH 09/42] sh-pfc: Split platform device and platform driver registration Laurent Pinchart
2012-11-21 2:27 ` [PATCH 10/42] sh-pfc: Support passing resources through platform device Laurent Pinchart
2012-11-21 2:27 ` [PATCH 11/42] ARM: shmobile: Register PFC " Laurent Pinchart
2012-11-21 5:16 ` Simon Horman
2012-11-21 12:43 ` Laurent Pinchart
2012-11-26 1:02 ` Simon Horman
2012-11-26 10:34 ` Laurent Pinchart
2012-11-27 2:26 ` Simon Horman
2012-11-27 11:19 ` Laurent Pinchart
2012-11-28 0:58 ` Simon Horman
2012-11-21 2:27 ` [PATCH 12/42] SH: " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 13/42] sh-pfc: Remove platform device registration Laurent Pinchart
2012-11-21 2:27 ` [PATCH 14/42] sh-pfc: Remove unused resource and num_resources platform data fields Laurent Pinchart
2012-11-21 2:27 ` [PATCH 15/42] ARM: shmobile: Select PINCTRL Laurent Pinchart
2012-11-21 2:27 ` [PATCH 16/42] sh: Select PINCTRL for CPU subtypes that require it Laurent Pinchart
2012-11-21 2:27 ` [PATCH 17/42] sh-pfc: Move driver from drivers/sh/ to drivers/pinctrl/ Laurent Pinchart
2012-11-21 3:28 ` viresh kumar
2012-11-21 13:17 ` Laurent Pinchart
2012-11-21 2:27 ` [PATCH 18/42] sh-pfc: Support pinmux info in driver data instead of platform data Laurent Pinchart
2012-11-21 2:27 ` [PATCH 19/42] sh-pfc: Add r8a7740 pinmux support Laurent Pinchart
2012-11-21 2:27 ` [PATCH 20/42] sh-pfc: Add r8a7779 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 21/42] sh-pfc: Add sh7367 " Laurent Pinchart
2012-11-22 4:56 ` Nobuhiro Iwamatsu
2012-11-21 2:27 ` [PATCH 22/42] sh-pfc: Add sh7372 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 23/42] sh-pfc: Add sh7377 " Laurent Pinchart
2012-11-22 4:55 ` Nobuhiro Iwamatsu
2012-11-22 11:12 ` Laurent Pinchart
2012-11-21 2:27 ` [PATCH 24/42] sh-pfc: Add sh73a0 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 25/42] ARM: shmobile: pfc: Use driver-provided pinmux info Laurent Pinchart
2012-11-21 2:27 ` [PATCH 26/42] sh-pfc: Add sh7203 pinmux support Laurent Pinchart
2012-11-21 2:27 ` [PATCH 27/42] sh-pfc: Add sh7264 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 28/42] sh-pfc: Add sh7269 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 29/42] sh-pfc: Add sh7720 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 30/42] sh-pfc: Add sh7722 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 31/42] sh-pfc: Add sh7723 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 32/42] sh-pfc: Add sh7724 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 33/42] sh-pfc: Add sh7734 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 34/42] sh-pfc: Add sh7757 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 35/42] sh-pfc: Add sh7785 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 36/42] sh-pfc: Add sh7786 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 37/42] sh-pfc: Add shx3 " Laurent Pinchart
2012-11-21 2:27 ` [PATCH 39/42] sh-pfc: Remove pinmux_info definition Laurent Pinchart
2012-11-21 2:27 ` [PATCH 40/42] sh-pfc: Move sh_pfc.h from include/linux/ to driver directory Laurent Pinchart
2012-11-21 2:27 ` [PATCH 41/42] ARM: shmobile: r8a7740: Add pin control resources Laurent Pinchart
2012-11-21 2:27 ` [PATCH 42/42] ARM: shmobile: sh7372: " Laurent Pinchart
2012-11-21 4:23 ` [PATCH 00/42] SH pin control and GPIO rework Paul Mundt
2012-11-21 14:51 ` Linus Walleij
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=1353464863-10281-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com \
--to=laurent.pinchart+renesas@ideasonboard.com \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lethal@linux-sh.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=nobuhiro.iwamatsu.yj@renesas.com \
--cc=phil.edworthy@renesas.com \
/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).