generic: add linux 4.1 support
[openwrt.git] / target / linux / generic / patches-4.1 / 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,9 +1,11 @@
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-lzo.o regcache-flat.o
62 -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
63 +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-lzo.o regcache-flat.o
64 +ifdef CONFIG_DEBUG_FS
65 +regmap-core-objs += regmap-debugfs.o
66 +endif
67 +obj-$(CONFIG_REGMAP) += regmap-core.o
68  obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
69  obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
70  obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
71 --- a/drivers/base/regmap/regmap.c
72 +++ b/drivers/base/regmap/regmap.c
73 @@ -13,6 +13,7 @@
74  #include <linux/device.h>
75  #include <linux/slab.h>
76  #include <linux/export.h>
77 +#include <linux/module.h>
78  #include <linux/mutex.h>
79  #include <linux/err.h>
80  #include <linux/of.h>
81 @@ -2632,3 +2633,5 @@ static int __init regmap_initcall(void)
82         return 0;
83  }
84  postcore_initcall(regmap_initcall);
85 +
86 +MODULE_LICENSE("GPL");