kernel: split patches folder up into backport, pending and hack folders
[openwrt/staging/chunkeey.git] / target / linux / generic / hack-4.9 / 280-rfkill-stubs.patch
1 From 236c1acdfef5958010ac9814a9872e0a46fd78ee Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Fri, 7 Jul 2017 17:13:44 +0200
4 Subject: rfkill: add fake rfkill support
5
6 allow building of modules depending on RFKILL even if RFKILL is not enabled.
7
8 Signed-off-by: John Crispin <john@phrozen.org>
9 ---
10 include/linux/rfkill.h | 2 +-
11 net/Makefile | 2 +-
12 net/rfkill/Kconfig | 14 +++++++++-----
13 net/rfkill/Makefile | 2 +-
14 4 files changed, 12 insertions(+), 8 deletions(-)
15
16 diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
17 index e6a0031d1b1f..21cf4dab0b9a 100644
18 --- a/include/linux/rfkill.h
19 +++ b/include/linux/rfkill.h
20 @@ -64,7 +64,7 @@ struct rfkill_ops {
21 int (*set_block)(void *data, bool blocked);
22 };
23
24 -#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
25 +#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE)
26 /**
27 * rfkill_alloc - allocate rfkill structure
28 * @name: name of the struct -- the string is not copied internally
29 diff --git a/net/Makefile b/net/Makefile
30 index 4cafaa2b4667..6566175e6c0a 100644
31 --- a/net/Makefile
32 +++ b/net/Makefile
33 @@ -51,7 +51,7 @@ obj-$(CONFIG_MAC80211) += mac80211/
34 obj-$(CONFIG_TIPC) += tipc/
35 obj-$(CONFIG_NETLABEL) += netlabel/
36 obj-$(CONFIG_IUCV) += iucv/
37 -obj-$(CONFIG_RFKILL) += rfkill/
38 +obj-$(CONFIG_RFKILL_FULL) += rfkill/
39 obj-$(CONFIG_NET_9P) += 9p/
40 obj-$(CONFIG_CAIF) += caif/
41 ifneq ($(CONFIG_DCB),)
42 diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig
43 index 868f1ad0415a..159b6ebeacd8 100644
44 --- a/net/rfkill/Kconfig
45 +++ b/net/rfkill/Kconfig
46 @@ -1,7 +1,11 @@
47 #
48 # RF switch subsystem configuration
49 #
50 -menuconfig RFKILL
51 +config RFKILL
52 + bool
53 + default y
54 +
55 +menuconfig RFKILL_FULL
56 tristate "RF switch subsystem support"
57 help
58 Say Y here if you want to have control over RF switches
59 @@ -13,19 +17,19 @@ menuconfig RFKILL
60 # LED trigger support
61 config RFKILL_LEDS
62 bool
63 - depends on RFKILL
64 + depends on RFKILL_FULL
65 depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS
66 default y
67
68 config RFKILL_INPUT
69 bool "RF switch input support" if EXPERT
70 - depends on RFKILL
71 + depends on RFKILL_FULL
72 depends on INPUT = y || RFKILL = INPUT
73 default y if !EXPERT
74
75 config RFKILL_REGULATOR
76 tristate "Generic rfkill regulator driver"
77 - depends on RFKILL || !RFKILL
78 + depends on RFKILL_FULL || !RFKILL_FULL
79 depends on REGULATOR
80 help
81 This options enable controlling radio transmitters connected to
82 @@ -36,7 +40,7 @@ config RFKILL_REGULATOR
83
84 config RFKILL_GPIO
85 tristate "GPIO RFKILL driver"
86 - depends on RFKILL
87 + depends on RFKILL_FULL
88 depends on GPIOLIB || COMPILE_TEST
89 default n
90 help
91 diff --git a/net/rfkill/Makefile b/net/rfkill/Makefile
92 index 311768783f4a..dbb01a8645af 100644
93 --- a/net/rfkill/Makefile
94 +++ b/net/rfkill/Makefile
95 @@ -4,6 +4,6 @@
96
97 rfkill-y += core.o
98 rfkill-$(CONFIG_RFKILL_INPUT) += input.o
99 -obj-$(CONFIG_RFKILL) += rfkill.o
100 +obj-$(CONFIG_RFKILL_FULL) += rfkill.o
101 obj-$(CONFIG_RFKILL_REGULATOR) += rfkill-regulator.o
102 obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o
103 --
104 2.11.0
105