259-regmap_dynamic.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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_MMIO || REGMAP_IRQ)
  7. select IRQ_DOMAIN if REGMAP_IRQ
  8. - bool
  9. + tristate
  10. config REGCACHE_COMPRESSED
  11. select LZO_COMPRESS
  12. @@ -14,18 +13,24 @@ config REGCACHE_COMPRESSED
  13. config REGMAP_I2C
  14. tristate
  15. + select REGMAP
  16. depends on I2C
  17. config REGMAP_SPI
  18. tristate
  19. + select REGMAP
  20. + depends on SPI_MASTER
  21. depends on SPI
  22. config REGMAP_SPMI
  23. + select REGMAP
  24. tristate
  25. depends on SPMI
  26. config REGMAP_MMIO
  27. tristate
  28. + select REGMAP
  29. config REGMAP_IRQ
  30. + select REGMAP
  31. bool
  32. --- a/include/linux/regmap.h
  33. +++ b/include/linux/regmap.h
  34. @@ -49,7 +49,7 @@ struct reg_default {
  35. unsigned int def;
  36. };
  37. -#ifdef CONFIG_REGMAP
  38. +#if IS_ENABLED(CONFIG_REGMAP)
  39. enum regmap_endian {
  40. /* Unspecified -> 0 -> Backwards compatible default */
  41. --- a/drivers/base/regmap/Makefile
  42. +++ b/drivers/base/regmap/Makefile
  43. @@ -1,7 +1,11 @@
  44. -obj-$(CONFIG_REGMAP) += regmap.o regcache.o
  45. -obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
  46. -obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
  47. -obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
  48. +regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o
  49. +ifdef CONFIG_DEBUG_FS
  50. +regmap-core-objs += regmap-debugfs.o
  51. +endif
  52. +ifdef CONFIG_REGCACHE_COMPRESSED
  53. +regmap-core-objs += regcache-lzo.o
  54. +endif
  55. +obj-$(CONFIG_REGMAP) += regmap-core.o
  56. obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
  57. obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
  58. obj-$(CONFIG_REGMAP_SPMI) += regmap-spmi.o
  59. --- a/drivers/base/regmap/regmap.c
  60. +++ b/drivers/base/regmap/regmap.c
  61. @@ -13,6 +13,7 @@
  62. #include <linux/device.h>
  63. #include <linux/slab.h>
  64. #include <linux/export.h>
  65. +#include <linux/module.h>
  66. #include <linux/mutex.h>
  67. #include <linux/err.h>
  68. #include <linux/of.h>
  69. @@ -2630,3 +2631,5 @@ static int __init regmap_initcall(void)
  70. return 0;
  71. }
  72. postcore_initcall(regmap_initcall);
  73. +
  74. +MODULE_LICENSE("GPL");