0360-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. From 55e8faa999c9bf3ae4a3fb75faf5e991167c42ba Mon Sep 17 00:00:00 2001
  2. From: Michael Kaplan <m.kaplan@evva.com>
  3. Date: Tue, 24 May 2016 10:19:08 +0200
  4. Subject: [PATCH 360/381] Added Overlay for Microchip MCP23017 I2C gpio
  5. expander
  6. ---
  7. arch/arm/boot/dts/overlays/README | 9 +++++
  8. arch/arm/boot/dts/overlays/mcp23017-overlay.dts | 54 +++++++++++++++++++++++++
  9. 2 files changed, 63 insertions(+)
  10. create mode 100644 arch/arm/boot/dts/overlays/mcp23017-overlay.dts
  11. --- a/arch/arm/boot/dts/overlays/README
  12. +++ b/arch/arm/boot/dts/overlays/README
  13. @@ -567,6 +567,15 @@ Params: gpio_out_pin GPIO for
  14. (default "off")
  15. +Name: mcp23017
  16. +Info: Configures the MCP23017 I2C port expander
  17. +Load: dtoverlay=mcp23017,<param>=<val>
  18. +Params: gpiopin Gpio pin connected to the INTA output of the
  19. + MCP23017 (default: 4)
  20. +
  21. + addr I2C address of the MCP23017 (default: 0x20)
  22. +
  23. +
  24. Name: mcp2515-can0
  25. Info: Configures the MCP2515 CAN controller on spi0.0
  26. Load: dtoverlay=mcp2515-can0,<param>=<val>
  27. --- /dev/null
  28. +++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
  29. @@ -0,0 +1,54 @@
  30. +// Definitions for MCP23017 Gpio Extender from Microchip Semiconductor
  31. +
  32. +/dts-v1/;
  33. +/plugin/;
  34. +
  35. +/ {
  36. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  37. +
  38. + fragment@0 {
  39. + target = <&i2c1>;
  40. + __overlay__ {
  41. + status = "okay";
  42. + };
  43. + };
  44. +
  45. + fragment@1 {
  46. + target = <&gpio>;
  47. + __overlay__ {
  48. + mcp23017_pins: mcp23017_pins {
  49. + brcm,pins = <4>;
  50. + brcm,function = <0>;
  51. + };
  52. + };
  53. + };
  54. +
  55. + fragment@2 {
  56. + target = <&i2c1>;
  57. + __overlay__ {
  58. + #address-cells = <1>;
  59. + #size-cells = <0>;
  60. +
  61. + mcp23017: mcp@20 {
  62. + compatible = "microchip,mcp23017";
  63. + reg = <0x20>;
  64. + gpio-controller;
  65. + #gpio-cells = <2>;
  66. + #interrupt-cells=<2>;
  67. + interrupt-parent = <&gpio>;
  68. + interrupts = <4 2>;
  69. + interrupt-controller;
  70. + microchip,irq-mirror;
  71. +
  72. + status = "okay";
  73. + };
  74. + };
  75. + };
  76. +
  77. + __overrides__ {
  78. + gpiopin = <&mcp23017_pins>,"brcm,pins:0",
  79. + <&mcp23017>,"interrupts:0";
  80. + addr = <&mcp23017>,"reg:0";
  81. + };
  82. +};
  83. +