892e8be295eff5de9e939ee0b75c6c992590ea5c
[openwrt/staging/dedeckeh.git] / target / linux / at91 / patches-5.10 / 149-ARM-at91-pm-Move-prototypes-to-mutually-included-hea.patch
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
5 header
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Both the caller and the supplier's source file should have access to
11 the include file containing the prototypes.
12
13 Fixes the following W=1 kernel build warning(s):
14
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 | ^~~~~~~~~~~~~~~~~~~~~~~~
21
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
30 ---
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
36
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
41 @@ -17,6 +17,8 @@
42 #include <linux/clk/at91_pmc.h>
43 #include <linux/platform_data/atmel.h>
44
45 +#include <soc/at91/pm.h>
46 +
47 #include <asm/cacheflush.h>
48 #include <asm/fncpy.h>
49 #include <asm/system_misc.h>
50 @@ -25,17 +27,6 @@
51 #include "generic.h"
52 #include "pm.h"
53
54 -/*
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.
59 - */
60 -#ifdef CONFIG_PINCTRL_AT91
61 -extern void at91_pinctrl_gpio_suspend(void);
62 -extern void at91_pinctrl_gpio_resume(void);
63 -#endif
64 -
65 struct at91_soc_pm {
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)
70 {
71 #ifdef CONFIG_PINCTRL_AT91
72 + /*
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.
77 + */
78 at91_pinctrl_gpio_suspend();
79 #endif
80
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
85 @@ -23,6 +23,8 @@
86 /* Since we request GPIOs from ourself */
87 #include <linux/pinctrl/consumer.h>
88
89 +#include <soc/at91/pm.h>
90 +
91 #include "pinctrl-at91.h"
92 #include "core.h"
93
94 diff --git a/include/soc/at91/pm.h b/include/soc/at91/pm.h
95 new file mode 100644
96 index 000000000000..7a41e53a3ffa
97 --- /dev/null
98 +++ b/include/soc/at91/pm.h
99 @@ -0,0 +1,16 @@
100 +/* SPDX-License-Identifier: GPL-2.0-only */
101 +/*
102 + * Atmel Power Management
103 + *
104 + * Copyright (C) 2020 Atmel
105 + *
106 + * Author: Lee Jones <lee.jones@linaro.org>
107 + */
108 +
109 +#ifndef __SOC_ATMEL_PM_H
110 +#define __SOC_ATMEL_PM_H
111 +
112 +void at91_pinctrl_gpio_suspend(void);
113 +void at91_pinctrl_gpio_resume(void);
114 +
115 +#endif /* __SOC_ATMEL_PM_H */
116 --
117 2.32.0
118