259-regmap_dynamic.patch 1.9 KB

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