From patchwork Fri Jan 25 02:23:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2039341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id B5AC5DF264 for ; Fri, 25 Jan 2013 02:43:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyZDW-0007kf-Ur; Fri, 25 Jan 2013 02:40:35 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyYyc-0006Cc-Bw for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2013 02:25:19 +0000 Received: from ayumi.akashicho.tokyo.vergenet.net (p8120-ipbfp1001kobeminato.hyogo.ocn.ne.jp [118.10.137.120]) by kirsty.vergenet.net (Postfix) with ESMTP id 71F9D26715D; Fri, 25 Jan 2013 13:25:01 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 3665AEDE9F9; Fri, 25 Jan 2013 11:24:59 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Subject: [PATCH 09/80] sh-pfc: Move private definitions and declarations to private header Date: Fri, 25 Jan 2013 11:23:45 +0900 Message-Id: <1359080696-31489-10-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359080696-31489-1-git-send-email-horms+renesas@verge.net.au> References: <1359080696-31489-1-git-send-email-horms+renesas@verge.net.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130124_212511_580710_59CD4763 X-CRM114-Status: GOOD ( 16.38 ) X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [202.4.237.240 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Laurent Pinchart , linux-sh@vger.kernel.org, Magnus Damm , arm@kernel.org, Simon Horman , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Laurent Pinchart 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 Acked-by: Paul Mundt Acked-by: Linus Walleij Signed-off-by: Simon Horman --- 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 #include +#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 +#include +#include + +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 7597a02..565b366 100644 --- a/drivers/sh/pfc/gpio.c +++ b/drivers/sh/pfc/gpio.c @@ -19,6 +19,8 @@ #include #include +#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 3a2c77d..5801a56 100644 --- a/drivers/sh/pfc/pinctrl.c +++ b/drivers/sh/pfc/pinctrl.c @@ -24,6 +24,8 @@ #include #include +#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) {