259-regmap_dynamic.patch 1.9 KB

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