snps,creg-gpio.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. GPIO via CREG (control registers) driver
  2. 31 9 7 5 0 < bit number
  3. | | | | |
  4. [ not used | gpio-1 | gpio-0 | <-shift-> ] < 32 bit register
  5. ^ ^
  6. | |
  7. write 0x2 == set output to "1" (activate)
  8. write 0x3 == set output to "0" (deactivate)
  9. Required properties:
  10. - compatible : "snps,creg-gpio"
  11. - reg : Exactly one register range with length 0x4.
  12. - #gpio-cells : Should be one - the pin number.
  13. - gpio-controller : Marks the device node as a GPIO controller.
  14. - gpio-count: Number of GPIO pins.
  15. - gpio-bit-per-line: Number of bits per gpio line (see picture).
  16. - gpio-first-shift: Shift (in bits) of the first GPIO field in register
  17. (see picture).
  18. - gpio-activate-val: Value should be set in corresponding field to set
  19. output to "1" (see picture). Applied to all GPIO ports.
  20. - gpio-deactivate-val: Value should be set in corresponding field to set
  21. output to "0" (see picture). Applied to all GPIO ports.
  22. Optional properties:
  23. - gpio-bank-name: name of bank (as default driver name is used is used)
  24. - gpio-default-val: array of default output values (must me 0 or 1)
  25. Example (see picture):
  26. gpio: gpio@f00014b0 {
  27. compatible = "snps,creg-gpio";
  28. reg = <0xf00014b0 0x4>;
  29. gpio-controller;
  30. #gpio-cells = <1>;
  31. gpio-bank-name = "hsdk-spi-cs";
  32. gpio-count = <2>;
  33. gpio-first-shift = <5>;
  34. gpio-bit-per-line = <2>;
  35. gpio-activate-val = <2>;
  36. gpio-deactivate-val = <3>;
  37. gpio-default-val = <1 1>;
  38. };