0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From 7e582eea049788f8f4077e439030b03bd30c3a2b Mon Sep 17 00:00:00 2001
  2. From: Dave Stevenson <6by9@users.noreply.github.com>
  3. Date: Fri, 1 Apr 2016 15:28:46 +0100
  4. Subject: [PATCH 231/381] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685
  5. driver over I2C
  6. Includes DT overlay to configure it.
  7. Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com>
  8. ---
  9. arch/arm/boot/dts/overlays/Makefile | 1 +
  10. arch/arm/boot/dts/overlays/README | 6 +++++
  11. .../boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts | 26 ++++++++++++++++++++++
  12. arch/arm/configs/bcm2709_defconfig | 1 +
  13. arch/arm/configs/bcmrpi_defconfig | 1 +
  14. 5 files changed, 35 insertions(+)
  15. create mode 100644 arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
  16. --- a/arch/arm/boot/dts/overlays/Makefile
  17. +++ b/arch/arm/boot/dts/overlays/Makefile
  18. @@ -30,6 +30,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
  19. dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo
  22. +dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
  23. dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
  24. dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
  25. dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo
  26. --- a/arch/arm/boot/dts/overlays/README
  27. +++ b/arch/arm/boot/dts/overlays/README
  28. @@ -366,6 +366,12 @@ Load: dtoverlay=i2c-mux-pca9548a,<para
  29. Params: addr I2C address of PCA9548A (default 0x70)
  30. +Name: i2c-pwm-pca9685a
  31. +Info: Adds support for an NXP PCA9685A I2C PWM controller on i2c_arm
  32. +Load: dtoverlay=i2c-pwm-pca9685a,<param>=<val>
  33. +Params: addr I2C address of PCA9685A (default 0x40)
  34. +
  35. +
  36. Name: i2c-rtc
  37. Info: Adds support for a number of I2C Real Time Clock devices
  38. Load: dtoverlay=i2c-rtc,<param>=<val>
  39. --- /dev/null
  40. +++ b/arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
  41. @@ -0,0 +1,26 @@
  42. +// Definitions for NXP PCA9685A I2C PWM controller on ARM I2C bus.
  43. +/dts-v1/;
  44. +/plugin/;
  45. +
  46. +/{
  47. + compatible = "brcm,bcm2708";
  48. +
  49. + fragment@0 {
  50. + target = <&i2c_arm>;
  51. + __overlay__ {
  52. + #address-cells = <1>;
  53. + #size-cells = <0>;
  54. + status = "okay";
  55. +
  56. + pca: pca@40 {
  57. + compatible = "nxp,pca9685";
  58. + #pwm-cells = <2>;
  59. + reg = <0x40>;
  60. + status = "okay";
  61. + };
  62. + };
  63. + };
  64. + __overrides__ {
  65. + addr = <&pca>,"reg:0";
  66. + };
  67. +};
  68. --- a/arch/arm/configs/bcm2709_defconfig
  69. +++ b/arch/arm/configs/bcm2709_defconfig
  70. @@ -1122,6 +1122,7 @@ CONFIG_MCP320X=m
  71. CONFIG_MCP3422=m
  72. CONFIG_DHT11=m
  73. CONFIG_PWM_BCM2835=m
  74. +CONFIG_PWM_PCA9685=m
  75. CONFIG_RASPBERRYPI_FIRMWARE=y
  76. CONFIG_EXT4_FS=y
  77. CONFIG_EXT4_FS_POSIX_ACL=y
  78. --- a/arch/arm/configs/bcmrpi_defconfig
  79. +++ b/arch/arm/configs/bcmrpi_defconfig
  80. @@ -1129,6 +1129,7 @@ CONFIG_MCP320X=m
  81. CONFIG_MCP3422=m
  82. CONFIG_DHT11=m
  83. CONFIG_PWM_BCM2835=m
  84. +CONFIG_PWM_PCA9685=m
  85. CONFIG_RASPBERRYPI_FIRMWARE=y
  86. CONFIG_EXT4_FS=y
  87. CONFIG_EXT4_FS_POSIX_ACL=y