ar71xx: keep the RouterBOARD Power LED in On state
[oweals/openwrt.git] / target / linux / generic / patches-4.9 / 259-regmap_dynamic.patch
1 --- a/drivers/base/regmap/Kconfig
2 +++ b/drivers/base/regmap/Kconfig
3 @@ -3,9 +3,8 @@
4  # subsystems should select the appropriate symbols.
5  
6  config REGMAP
7 -       default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
8         select IRQ_DOMAIN if REGMAP_IRQ
9 -       bool
10 +       tristate "Regmap"
11  
12  config REGCACHE_COMPRESSED
13         select LZO_COMPRESS
14 @@ -16,19 +15,25 @@ config REGMAP_AC97
15         tristate
16  
17  config REGMAP_I2C
18 -       tristate
19 +       tristate "Regmap I2C"
20 +       select REGMAP
21         depends on I2C
22  
23  config REGMAP_SPI
24 -       tristate
25 +       tristate "Regmap SPI"
26 +       select REGMAP
27 +       depends on SPI_MASTER
28         depends on SPI
29  
30  config REGMAP_SPMI
31 +       select REGMAP
32         tristate
33         depends on SPMI
34  
35  config REGMAP_MMIO
36 -       tristate
37 +       tristate "Regmap MMIO"
38 +       select REGMAP
39  
40  config REGMAP_IRQ
41 +       select REGMAP
42         bool
43 --- a/include/linux/regmap.h
44 +++ b/include/linux/regmap.h
45 @@ -135,7 +135,7 @@ struct reg_sequence {
46         pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
47  })
48  
49 -#ifdef CONFIG_REGMAP
50 +#if IS_ENABLED(CONFIG_REGMAP)
51  
52  enum regmap_endian {
53         /* Unspecified -> 0 -> Backwards compatible default */
54 --- a/drivers/base/regmap/Makefile
55 +++ b/drivers/base/regmap/Makefile
56 @@ -1,10 +1,14 @@
57  # For include/trace/define_trace.h to include trace.h
58  CFLAGS_regmap.o := -I$(src)
59  
60 -obj-$(CONFIG_REGMAP) += regmap.o regcache.o
61 -obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
62 -obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
63 -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
64 +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o
65 +ifdef CONFIG_DEBUG_FS
66 +regmap-core-objs += regmap-debugfs.o
67 +endif
68 +ifdef CONFIG_REGCACHE_COMPRESSED
69 +regmap-core-objs += regcache-lzo.o
70 +endif
71 +obj-$(CONFIG_REGMAP) += regmap-core.o
72  obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
73  obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
74  obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
75 --- a/drivers/base/regmap/regmap.c
76 +++ b/drivers/base/regmap/regmap.c
77 @@ -13,6 +13,7 @@
78  #include <linux/device.h>
79  #include <linux/slab.h>
80  #include <linux/export.h>
81 +#include <linux/module.h>
82  #include <linux/mutex.h>
83  #include <linux/err.h>
84  #include <linux/of.h>
85 @@ -2913,3 +2914,5 @@ static int __init regmap_initcall(void)
86         return 0;
87  }
88  postcore_initcall(regmap_initcall);
89 +
90 +MODULE_LICENSE("GPL");