Add luci mirror repository
[librecmc/librecmc.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 --- a/include/linux/rfkill.h
17 +++ b/include/linux/rfkill.h
18 @@ -64,7 +64,7 @@ struct rfkill_ops {
19         int     (*set_block)(void *data, bool blocked);
20  };
21  
22 -#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
23 +#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE)
24  /**
25   * rfkill_alloc - allocate rfkill structure
26   * @name: name of the struct -- the string is not copied internally
27 --- a/net/Makefile
28 +++ b/net/Makefile
29 @@ -51,7 +51,7 @@ obj-$(CONFIG_MAC80211)                += mac80211/
30  obj-$(CONFIG_TIPC)             += tipc/
31  obj-$(CONFIG_NETLABEL)         += netlabel/
32  obj-$(CONFIG_IUCV)             += iucv/
33 -obj-$(CONFIG_RFKILL)           += rfkill/
34 +obj-$(CONFIG_RFKILL_FULL)      += rfkill/
35  obj-$(CONFIG_NET_9P)           += 9p/
36  obj-$(CONFIG_CAIF)             += caif/
37  ifneq ($(CONFIG_DCB),)
38 --- a/net/rfkill/Kconfig
39 +++ b/net/rfkill/Kconfig
40 @@ -1,7 +1,11 @@
41  #
42  # RF switch subsystem configuration
43  #
44 -menuconfig RFKILL
45 +config RFKILL
46 +       bool
47 +       default y
48 +
49 +menuconfig RFKILL_FULL
50         tristate "RF switch subsystem support"
51         help
52           Say Y here if you want to have control over RF switches
53 @@ -13,19 +17,19 @@ menuconfig RFKILL
54  # LED trigger support
55  config RFKILL_LEDS
56         bool
57 -       depends on RFKILL
58 +       depends on RFKILL_FULL
59         depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS
60         default y
61  
62  config RFKILL_INPUT
63         bool "RF switch input support" if EXPERT
64 -       depends on RFKILL
65 +       depends on RFKILL_FULL
66         depends on INPUT = y || RFKILL = INPUT
67         default y if !EXPERT
68  
69  config RFKILL_REGULATOR
70         tristate "Generic rfkill regulator driver"
71 -       depends on RFKILL || !RFKILL
72 +       depends on RFKILL_FULL || !RFKILL_FULL
73         depends on REGULATOR
74         help
75            This options enable controlling radio transmitters connected to
76 @@ -36,7 +40,7 @@ config RFKILL_REGULATOR
77  
78  config RFKILL_GPIO
79         tristate "GPIO RFKILL driver"
80 -       depends on RFKILL
81 +       depends on RFKILL_FULL
82         depends on GPIOLIB || COMPILE_TEST
83         default n
84         help
85 --- a/net/rfkill/Makefile
86 +++ b/net/rfkill/Makefile
87 @@ -4,6 +4,6 @@
88  
89  rfkill-y                       += core.o
90  rfkill-$(CONFIG_RFKILL_INPUT)  += input.o
91 -obj-$(CONFIG_RFKILL)           += rfkill.o
92 +obj-$(CONFIG_RFKILL_FULL)      += rfkill.o
93  obj-$(CONFIG_RFKILL_REGULATOR) += rfkill-regulator.o
94  obj-$(CONFIG_RFKILL_GPIO)      += rfkill-gpio.o