generic: early (incomplete!) 4.0 support
[openwrt.git] / target / linux / generic / patches-4.0 / 259-regmap_dynamic.patch
1 --- a/drivers/base/regmap/Kconfig
2 +++ b/drivers/base/regmap/Kconfig
3 @@ -3,29 +3,35 @@
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 LZO_COMPRESS
9         select LZO_DECOMPRESS
10         select IRQ_DOMAIN if REGMAP_IRQ
11 -       bool
12 +       tristate "Regmap"
13  
14  config REGMAP_AC97
15 +       select REGMAP
16         tristate
17  
18  config REGMAP_I2C
19 -       tristate
20 +       tristate "Regmap I2C"
21 +       select REGMAP
22         depends on I2C
23  
24  config REGMAP_SPI
25 -       tristate
26 +       tristate "Regmap SPI"
27 +       select REGMAP
28 +       depends on SPI_MASTER
29         depends on SPI
30  
31  config REGMAP_SPMI
32 +       select REGMAP
33         tristate
34         depends on SPMI
35  
36  config REGMAP_MMIO
37 +       select REGMAP
38         tristate
39  
40  config REGMAP_IRQ
41 +       select REGMAP
42         bool
43 --- a/include/linux/regmap.h
44 +++ b/include/linux/regmap.h
45 @@ -50,7 +50,7 @@ struct reg_default {
46         unsigned int def;
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,6 +1,8 @@
57 -obj-$(CONFIG_REGMAP) += regmap.o regcache.o
58 -obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
59 -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
60 +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-lzo.o regcache-flat.o
61 +ifdef CONFIG_DEBUG_FS
62 +regmap-core-objs += regmap-debugfs.o
63 +endif
64 +obj-$(CONFIG_REGMAP) += regmap-core.o
65  obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
66  obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
67  obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
68 --- a/drivers/base/regmap/regmap.c
69 +++ b/drivers/base/regmap/regmap.c
70 @@ -13,6 +13,7 @@
71  #include <linux/device.h>
72  #include <linux/slab.h>
73  #include <linux/export.h>
74 +#include <linux/module.h>
75  #include <linux/mutex.h>
76  #include <linux/err.h>
77  #include <linux/of.h>
78 @@ -2636,3 +2637,5 @@ static int __init regmap_initcall(void)
79         return 0;
80  }
81  postcore_initcall(regmap_initcall);
82 +
83 +MODULE_LICENSE("GPL");