259-regmap_dynamic.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. config REGMAP
  6. - default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
  7. select IRQ_DOMAIN if REGMAP_IRQ
  8. - bool
  9. + tristate "Regmap"
  10. config REGCACHE_COMPRESSED
  11. select LZO_COMPRESS
  12. @@ -16,19 +15,25 @@ config REGMAP_AC97
  13. tristate
  14. config REGMAP_I2C
  15. - tristate
  16. + tristate "Regmap I2C"
  17. + select REGMAP
  18. depends on I2C
  19. config REGMAP_SPI
  20. - tristate
  21. + tristate "Regmap SPI"
  22. + select REGMAP
  23. + depends on SPI_MASTER
  24. depends on SPI
  25. config REGMAP_SPMI
  26. + select REGMAP
  27. tristate
  28. depends on SPMI
  29. config REGMAP_MMIO
  30. - tristate
  31. + tristate "Regmap MMIO"
  32. + select REGMAP
  33. config REGMAP_IRQ
  34. + select REGMAP
  35. bool
  36. --- a/include/linux/regmap.h
  37. +++ b/include/linux/regmap.h
  38. @@ -135,7 +135,7 @@ struct reg_sequence {
  39. pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
  40. })
  41. -#ifdef CONFIG_REGMAP
  42. +#if IS_ENABLED(CONFIG_REGMAP)
  43. enum regmap_endian {
  44. /* Unspecified -> 0 -> Backwards compatible default */
  45. --- a/drivers/base/regmap/Makefile
  46. +++ b/drivers/base/regmap/Makefile
  47. @@ -1,10 +1,14 @@
  48. # For include/trace/define_trace.h to include trace.h
  49. CFLAGS_regmap.o := -I$(src)
  50. -obj-$(CONFIG_REGMAP) += regmap.o regcache.o
  51. -obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
  52. -obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
  53. -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
  54. +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o
  55. +ifdef CONFIG_DEBUG_FS
  56. +regmap-core-objs += regmap-debugfs.o
  57. +endif
  58. +ifdef CONFIG_REGCACHE_COMPRESSED
  59. +regmap-core-objs += regcache-lzo.o
  60. +endif
  61. +obj-$(CONFIG_REGMAP) += regmap-core.o
  62. obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
  63. obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
  64. obj-$(CONFIG_REGMAP_SPI) += regmap-spi.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. @@ -2913,3 +2914,5 @@ static int __init regmap_initcall(void)
  76. return 0;
  77. }
  78. postcore_initcall(regmap_initcall);
  79. +
  80. +MODULE_LICENSE("GPL");