treewide: fix replace nbd@openwrt.org with nbd@nbd.name
[openwrt.git] / target / linux / generic / patches-3.18 / 259-regmap_dynamic.patch
1 --- a/drivers/base/regmap/Kconfig
2 +++ b/drivers/base/regmap/Kconfig
3 @@ -3,26 +3,31 @@
4  # subsystems should select the appropriate symbols.
5  
6  config REGMAP
7 -       default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || 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_I2C
15 -       tristate
16 +       tristate "Regmap I2C"
17 +       select REGMAP
18         depends on I2C
19  
20  config REGMAP_SPI
21 -       tristate
22 +       tristate "Regmap SPI"
23 +       select REGMAP
24 +       depends on SPI_MASTER
25         depends on SPI
26  
27  config REGMAP_SPMI
28 +       select REGMAP
29         tristate
30         depends on SPMI
31  
32  config REGMAP_MMIO
33 -       tristate
34 +       tristate "Regmap MMIO"
35 +       select REGMAP
36  
37  config REGMAP_IRQ
38 +       select REGMAP
39         bool
40 --- a/include/linux/regmap.h
41 +++ b/include/linux/regmap.h
42 @@ -49,7 +49,7 @@ struct reg_default {
43         unsigned int def;
44  };
45  
46 -#ifdef CONFIG_REGMAP
47 +#if IS_ENABLED(CONFIG_REGMAP)
48  
49  enum regmap_endian {
50         /* Unspecified -> 0 -> Backwards compatible default */
51 --- a/drivers/base/regmap/Makefile
52 +++ b/drivers/base/regmap/Makefile
53 @@ -1,6 +1,8 @@
54 -obj-$(CONFIG_REGMAP) += regmap.o regcache.o
55 -obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
56 -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
57 +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-lzo.o regcache-flat.o
58 +ifdef CONFIG_DEBUG_FS
59 +regmap-core-objs += regmap-debugfs.o
60 +endif
61 +obj-$(CONFIG_REGMAP) += regmap-core.o
62  obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
63  obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
64  obj-$(CONFIG_REGMAP_SPMI) += regmap-spmi.o
65 --- a/drivers/base/regmap/regmap.c
66 +++ b/drivers/base/regmap/regmap.c
67 @@ -13,6 +13,7 @@
68  #include <linux/device.h>
69  #include <linux/slab.h>
70  #include <linux/export.h>
71 +#include <linux/module.h>
72  #include <linux/mutex.h>
73  #include <linux/err.h>
74  #include <linux/of.h>
75 @@ -2630,3 +2631,5 @@ static int __init regmap_initcall(void)
76         return 0;
77  }
78  postcore_initcall(regmap_initcall);
79 +
80 +MODULE_LICENSE("GPL");