This function takes a 'path', property name ('prop'), index ('index') and a cell ('cell') and looks for an EDT node at that path. If it finds an EDT node, it will look to see if that node has a property called 'prop' and if that 'prop' is an phandle-array type. Then it will chec
(kconf, name, path, prop, index, cell, unit=None)
| 630 | |
| 631 | |
| 632 | def dt_node_ph_array_prop(kconf, name, path, prop, index, cell, unit=None): |
| 633 | """ |
| 634 | This function takes a 'path', property name ('prop'), index ('index') and |
| 635 | a cell ('cell') and looks for an EDT node at that path. |
| 636 | If it finds an EDT node, it will look to see if that node has a property |
| 637 | called 'prop' and if that 'prop' is an phandle-array type. |
| 638 | Then it will check if that phandle array has a cell matching the given index |
| 639 | and ten return the value of the cell named 'cell' in this array index as |
| 640 | either a string int or string hex value. If not found we return 0. |
| 641 | |
| 642 | The function will divide the value based on 'unit': |
| 643 | None No division |
| 644 | 'k' or 'K' divide by 1024 (1 << 10) |
| 645 | 'm' or 'M' divide by 1,048,576 (1 << 20) |
| 646 | 'g' or 'G' divide by 1,073,741,824 (1 << 30) |
| 647 | """ |
| 648 | if doc_mode or edt is None: |
| 649 | return "0" |
| 650 | |
| 651 | try: |
| 652 | node = edt.get_node(path) |
| 653 | except edtlib.EDTError: |
| 654 | return "0" |
| 655 | if name == "dt_node_ph_array_prop_int": |
| 656 | return str(_node_ph_array_prop(node, prop, index, cell, unit)) |
| 657 | if name == "dt_node_ph_array_prop_hex": |
| 658 | return hex(_node_ph_array_prop(node, prop, index, cell, unit)) |
| 659 | |
| 660 | def dt_node_str_prop_equals(kconf, _, path, prop, val): |
| 661 | """ |
nothing calls this directly
no test coverage detected