| Modify Thermal Zone based on efuse data |
| |
| This driver is to enable/disable pre-configured thermal |
| zones selectively at runtime based on efuse data. It uses QFPROM |
| nvmem cell interface to read efuse data. It supports multiple |
| efuse condition. If any of the efuse condition fails, driver just |
| exits with default enabled thermal zones. |
| |
| Properties: |
| |
| - compatible: |
| Usage: Required |
| Value type: <string> |
| Definition: shall be "qcom,thermal-qfprom-device". |
| |
| - nvmem-cells: |
| Usage: Required |
| Value type: <array of phandle> |
| Definition: Array of phandles pointing to a nvmem-cells node |
| representing the efuse registers that has information that |
| is used to select the right thermal zone to enable. |
| Please refer nvmem-cells bindings |
| Documentation/devicetree/bindings/nvmem/nvmem.txt and also |
| example below. |
| |
| nvmem-cell-names: |
| Usage: Required |
| Value type: <array of string> |
| Definition: Should be array of name for each nvmem-cells phandle data. |
| Please refer nvmem-cells bindings |
| Documentation/devicetree/bindings/nvmem/nvmem.txt and also |
| example below. |
| |
| - qcom,thermal-qfprom-bit-values: It should be array of bit mask values to |
| match with each nvmem-cells bit value respectively. If all |
| nvmem-cells values are matching with respective bit mask value |
| from this property, then driver will update thermal zones as |
| per thermal zones mentioned in 'qcom,thermal-zone-enable-list' |
| and 'qcom,thermal-zone-disable-list'. |
| |
| - qcom,thermal-zone-enable-list: |
| Usage: Required |
| Value type: <array of strings> |
| Definition: Should define this property with list of thermal zone |
| names those need to be enabled if nvmem-cells condition is met. |
| |
| - qcom,thermal-zone-disable-list: |
| Usage: Required |
| Value type: <array of strings> |
| Definition: Should define this property with list of thermal zone |
| names those need to be disabled if nvmem-cells condition is met. |
| |
| Example: |
| qcom-thermal-qfprom { |
| compatible = "qcom,thermal-qfprom-device"; |
| nvmem-cells = <&thermal_cpe>, <&thermal_revision>; |
| nvmem-cell-names = "cpe", "revision"; |
| qcom,thermal-qfprom-bit-values = <0x1 0x3> |
| qcom,thermal-zone-enable-list = "mdm-core-0-cpe-step", |
| "mdm-core-1-cpe-step"; |
| qcom,thermal-zone-disable-list = "mdm-core-0-step", |
| "mdm-core-1-step"; |
| }; |
| |
| In this example, driver gets efuse bit values of nvmem-cell register |
| for both 'cpe' and 'revision' nvmem cells. It then compares these efuse |
| values with property 'qcom,thermal-qfprom-bit-values' values (0x1 and |
| 0x3 here) respectively. If both efuse values are matching with this |
| property values, driver enables thermal zones listed in property |
| 'qcom,thermal-zone-enable-list' and disables thermal zones listed in |
| property 'qcom,thermal-zone-disable-list'. If any of the efuse |
| value is not matching with respective 'qcom,thermal-qfprom-bit-values' |
| values, driver just exits without modifying any thermal zone. |