1 From 746aba88c64e409cbc3757a5f81fad5b5c74bbcc Mon Sep 17 00:00:00 2001
2 From: Lee Jones <lee.jones@linaro.org>
3 Date: Wed, 3 Mar 2021 12:41:49 +0000
4 Subject: [PATCH 149/247] ARM: at91: pm: Move prototypes to mutually included
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Both the caller and the supplier's source file should have access to
11 the include file containing the prototypes.
13 Fixes the following W=1 kernel build warning(s):
15 drivers/pinctrl/pinctrl-at91.c:1637:6: warning: no previous prototype for ‘at91_pinctrl_gpio_suspend’ [-Wmissing-prototypes]
16 1637 | void at91_pinctrl_gpio_suspend(void)
17 | ^~~~~~~~~~~~~~~~~~~~~~~~~
18 drivers/pinctrl/pinctrl-at91.c:1661:6: warning: no previous prototype for ‘at91_pinctrl_gpio_resume’ [-Wmissing-prototypes]
19 1661 | void at91_pinctrl_gpio_resume(void)
20 | ^~~~~~~~~~~~~~~~~~~~~~~~
22 Cc: Russell King <linux@armlinux.org.uk>
23 Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
24 Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
25 Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
26 Signed-off-by: Lee Jones <lee.jones@linaro.org>
27 Acked-by: Linus Walleij <linus.walleij@linaro.org>
28 Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
29 Link: https://lore.kernel.org/r/20210303124149.3149511-1-lee.jones@linaro.org
31 arch/arm/mach-at91/pm.c | 19 ++++++++-----------
32 drivers/pinctrl/pinctrl-at91.c | 2 ++
33 include/soc/at91/pm.h | 16 ++++++++++++++++
34 3 files changed, 26 insertions(+), 11 deletions(-)
35 create mode 100644 include/soc/at91/pm.h
37 diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
38 index 3f015cb6ec2b..2dee383f9050 100644
39 --- a/arch/arm/mach-at91/pm.c
40 +++ b/arch/arm/mach-at91/pm.c
42 #include <linux/clk/at91_pmc.h>
43 #include <linux/platform_data/atmel.h>
45 +#include <soc/at91/pm.h>
47 #include <asm/cacheflush.h>
48 #include <asm/fncpy.h>
49 #include <asm/system_misc.h>
55 - * FIXME: this is needed to communicate between the pinctrl driver and
56 - * the PM implementation in the machine. Possibly part of the PM
57 - * implementation should be moved down into the pinctrl driver and get
58 - * called as part of the generic suspend/resume path.
60 -#ifdef CONFIG_PINCTRL_AT91
61 -extern void at91_pinctrl_gpio_suspend(void);
62 -extern void at91_pinctrl_gpio_resume(void);
66 int (*config_shdwc_ws)(void __iomem *shdwc, u32 *mode, u32 *polarity);
67 int (*config_pmc_ws)(void __iomem *pmc, u32 mode, u32 polarity);
68 @@ -326,6 +317,12 @@ static void at91_pm_suspend(suspend_state_t state)
69 static int at91_pm_enter(suspend_state_t state)
71 #ifdef CONFIG_PINCTRL_AT91
73 + * FIXME: this is needed to communicate between the pinctrl driver and
74 + * the PM implementation in the machine. Possibly part of the PM
75 + * implementation should be moved down into the pinctrl driver and get
76 + * called as part of the generic suspend/resume path.
78 at91_pinctrl_gpio_suspend();
81 diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
82 index 9015486e38c1..dcbb71fa1b2b 100644
83 --- a/drivers/pinctrl/pinctrl-at91.c
84 +++ b/drivers/pinctrl/pinctrl-at91.c
86 /* Since we request GPIOs from ourself */
87 #include <linux/pinctrl/consumer.h>
89 +#include <soc/at91/pm.h>
91 #include "pinctrl-at91.h"
94 diff --git a/include/soc/at91/pm.h b/include/soc/at91/pm.h
96 index 000000000000..7a41e53a3ffa
98 +++ b/include/soc/at91/pm.h
100 +/* SPDX-License-Identifier: GPL-2.0-only */
102 + * Atmel Power Management
104 + * Copyright (C) 2020 Atmel
106 + * Author: Lee Jones <lee.jones@linaro.org>
109 +#ifndef __SOC_ATMEL_PM_H
110 +#define __SOC_ATMEL_PM_H
112 +void at91_pinctrl_gpio_suspend(void);
113 +void at91_pinctrl_gpio_resume(void);
115 +#endif /* __SOC_ATMEL_PM_H */