cw2015_battery.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/power/supply/cw2015_battery.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Battery driver for CW2015 shuntless fuel gauge by CellWise.
  7. maintainers:
  8. - Tobias Schramm <t.schramm@manjaro.org>
  9. description: |
  10. The driver can utilize information from a simple-battery linked via a
  11. phandle in monitored-battery. If specified the driver uses the
  12. charge-full-design-microamp-hours property of the battery.
  13. allOf:
  14. - $ref: power-supply.yaml#
  15. properties:
  16. compatible:
  17. const: cellwise,cw2015
  18. reg:
  19. maxItems: 1
  20. cellwise,battery-profile:
  21. description: |
  22. This property specifies characteristics of the battery used. The format
  23. of this binary blob is kept secret by CellWise. The only way to obtain
  24. it is to mail two batteries to a test facility of CellWise and receive
  25. back a test report with the binary blob.
  26. $ref: /schemas/types.yaml#/definitions/uint8-array
  27. minItems: 64
  28. maxItems: 64
  29. cellwise,monitor-interval-ms:
  30. description:
  31. Specifies the interval in milliseconds gauge values are polled at
  32. minimum: 250
  33. power-supplies:
  34. minItems: 1
  35. maxItems: 8 # Should be enough
  36. monitored-battery: true
  37. required:
  38. - compatible
  39. - reg
  40. additionalProperties: false
  41. examples:
  42. - |
  43. i2c {
  44. #address-cells = <1>;
  45. #size-cells = <0>;
  46. cw2015@62 {
  47. compatible = "cellwise,cw2015";
  48. reg = <0x62>;
  49. cellwise,battery-profile = /bits/ 8 <
  50. 0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
  51. 0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
  52. 0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
  53. 0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
  54. 0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
  55. 0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
  56. 0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
  57. 0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
  58. >;
  59. cellwise,monitor-interval-ms = <5000>;
  60. monitored-battery = <&bat>;
  61. power-supplies = <&mains_charger>, <&usb_charger>;
  62. };
  63. };