Advertisement
zmatt

BB-I2C2-PCF8523-00A0.dts (syntax clean-up)

May 5th, 2023
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2017 Robert Nelson <robertcnelson@gmail.com>
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License version 2 as
  6.  * published by the Free Software Foundation.
  7.  */
  8.  
  9. /dts-v1/;
  10. /plugin/;
  11.  
  12. #include <dt-bindings/board/am335x-bbw-bbb-base.h>
  13. #include <dt-bindings/pinctrl/am33xx.h>
  14. #include <dt-bindings/gpio/gpio.h>
  15.  
  16. // Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
  17. &{/chosen} {
  18.     overlays {
  19.         BB-I2C2-PCF8523-00A0 = __TIMESTAMP__;
  20.     };
  21. };
  22.  
  23. // Free up the pins used by the cape from the pinmux helpers.
  24. &ocp {
  25.     P9_19_pinmux { status = "disabled"; };  // i2c2_scl
  26.     P9_20_pinmux { status = "disabled"; };  // i2c2_sda
  27. };
  28.  
  29. &{/aliases} {
  30.     rtc0 = &extrtc;   // <--- FIXME this cannot work in overlays!
  31.     rtc1 = "/ocp/rtc@44e3e000";
  32. };
  33.  
  34. &am33xx_pinmux {
  35.     bb_i2c2_pins: pinmux_bb_i2c2_pins {
  36.         pinctrl-single,pins = <
  37.             BONE_P9_20 0x73 // i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3
  38.             BONE_P9_19 0x73 // i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3
  39.         >;
  40.     };
  41. };
  42.  
  43. &i2c2 {
  44.     status = "okay";
  45.     pinctrl-names = "default";
  46.     pinctrl-0 = <&bb_i2c2_pins>;
  47.  
  48.     // this is the configuration part
  49.     clock-frequency = <100000>;
  50.  
  51.     #address-cells = <1>;
  52.     #size-cells = <0>;
  53.  
  54.     extrtc: pcf8523@68 {
  55.         compatible = "nxp,pcf8523";
  56.         reg = <0x68>;
  57.     };
  58. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement