0408-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 6790d3a4683d7e2e6e0fe1bbc7ab856f23e37885 Mon Sep 17 00:00:00 2001
  2. From: Thomas Kriechbaumer <thomas@kriechbaumer.name>
  3. Date: Fri, 3 Jun 2016 09:40:44 +0200
  4. Subject: [PATCH] BCM270X_DT: Add spi-rtc overlay on SPI0.0
  5. Initial version only supports PCF2123 RTC.
  6. See: https://github.com/raspberrypi/linux/pull/1510
  7. ---
  8. arch/arm/boot/dts/overlays/Makefile | 1 +
  9. arch/arm/boot/dts/overlays/README | 6 +++++
  10. arch/arm/boot/dts/overlays/spi-rtc-overlay.dts | 33 ++++++++++++++++++++++++++
  11. 3 files changed, 40 insertions(+)
  12. create mode 100644 arch/arm/boot/dts/overlays/spi-rtc-overlay.dts
  13. --- a/arch/arm/boot/dts/overlays/Makefile
  14. +++ b/arch/arm/boot/dts/overlays/Makefile
  15. @@ -78,6 +78,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo
  16. dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo
  17. dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo
  18. dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo
  19. +dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo
  23. --- a/arch/arm/boot/dts/overlays/README
  24. +++ b/arch/arm/boot/dts/overlays/README
  25. @@ -975,6 +975,12 @@ Load: dtoverlay=spi-gpio35-39
  26. Params: <None>
  27. +Name: spi-rtc
  28. +Info: Adds support for a number of SPI Real Time Clock devices
  29. +Load: dtoverlay=spi-rtc,<param>=<val>
  30. +Params: pcf2123 Select the PCF2123 device
  31. +
  32. +
  33. Name: spi1-1cs
  34. Info: Enables spi1 with a single chip select (CS) line and associated spidev
  35. dev node. The gpio pin number for the CS line and spidev device node
  36. --- /dev/null
  37. +++ b/arch/arm/boot/dts/overlays/spi-rtc-overlay.dts
  38. @@ -0,0 +1,33 @@
  39. +/dts-v1/;
  40. +/plugin/;
  41. +
  42. +/ {
  43. + compatible = "brcm,bcm2708";
  44. +
  45. + fragment@0 {
  46. + target = <&spidev0>;
  47. + __dormant__ {
  48. + status = "disabled";
  49. + };
  50. + };
  51. +
  52. + fragment@1 {
  53. + target = <&spi0>;
  54. + __dormant__ {
  55. + #address-cells = <1>;
  56. + #size-cells = <0>;
  57. + status = "okay";
  58. +
  59. + rtc-pcf2123@0 {
  60. + compatible = "nxp,rtc-pcf2123";
  61. + spi-max-frequency = <5000000>;
  62. + spi-cs-high = <1>;
  63. + reg = <0>;
  64. + };
  65. + };
  66. + };
  67. +
  68. + __overrides__ {
  69. + pcf2123 = <0>, "=0=1";
  70. + };
  71. +};