|
89 | 89 | #define AXP717_BAT_CC_MIN_UA 0
|
90 | 90 | #define AXP717_BAT_CC_MAX_UA 3008000
|
91 | 91 |
|
| 92 | +#define AXP717_TS_PIN_DISABLE BIT(4) |
| 93 | + |
92 | 94 | struct axp20x_batt_ps;
|
93 | 95 |
|
94 | 96 | struct axp_data {
|
@@ -117,6 +119,7 @@ struct axp20x_batt_ps {
|
117 | 119 | /* Maximum constant charge current */
|
118 | 120 | unsigned int max_ccc;
|
119 | 121 | const struct axp_data *data;
|
| 122 | + bool ts_disable; |
120 | 123 | };
|
121 | 124 |
|
122 | 125 | static int axp20x_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt,
|
@@ -985,6 +988,24 @@ static void axp717_set_battery_info(struct platform_device *pdev,
|
985 | 988 | int ccc = info->constant_charge_current_max_ua;
|
986 | 989 | int val;
|
987 | 990 |
|
| 991 | + axp_batt->ts_disable = (device_property_read_bool(axp_batt->dev, |
| 992 | + "x-powers,no-thermistor")); |
| 993 | + |
| 994 | + /* |
| 995 | + * Under rare conditions an incorrectly programmed efuse for |
| 996 | + * the temp sensor on the PMIC may trigger a fault condition. |
| 997 | + * Allow users to hard-code if the ts pin is not used to work |
| 998 | + * around this problem. Note that this requires the battery |
| 999 | + * be correctly defined in the device tree with a monitored |
| 1000 | + * battery node. |
| 1001 | + */ |
| 1002 | + if (axp_batt->ts_disable) { |
| 1003 | + regmap_update_bits(axp_batt->regmap, |
| 1004 | + AXP717_TS_PIN_CFG, |
| 1005 | + AXP717_TS_PIN_DISABLE, |
| 1006 | + AXP717_TS_PIN_DISABLE); |
| 1007 | + } |
| 1008 | + |
988 | 1009 | if (vmin > 0 && axp717_set_voltage_min_design(axp_batt, vmin))
|
989 | 1010 | dev_err(&pdev->dev,
|
990 | 1011 | "couldn't set voltage_min_design\n");
|
|
0 commit comments