mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
bangkok add tp charger mode
bangkok:add focal tp charger mode Change-Id: Idc0a8235fef180fdc681c5b025cc005829567a47 Reviewed-on: https://gerrit.mot.com/2596224 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng <dengwei1@motorola.com> Reviewed-by: <zhuwg1@motorola.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
77db14c6c2
commit
b1ba34da62
1 changed files with 21 additions and 9 deletions
|
|
@ -229,16 +229,28 @@ static int fts_mmi_charger_mode(struct device *dev, int mode)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
read_data |= (!!mode);
|
||||
ret = fts_write_reg(FTS_REG_CHARGER_MODE_EN, read_data);
|
||||
if(ret < 0){
|
||||
FTS_ERROR("Failed to set charger mode\n");
|
||||
mutex_unlock(&ts_data->mode_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (ts_data->pdata->pocket_mode_ctrl) {
|
||||
read_data |= (!!mode);
|
||||
ret = fts_write_reg(FTS_REG_CHARGER_MODE_EN, read_data);
|
||||
if(ret < 0){
|
||||
FTS_ERROR("Failed to set charger mode\n");
|
||||
mutex_unlock(&ts_data->mode_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
FTS_INFO("Success to %s charger mode, 0x8B = 0x%02x\n", mode ? "Enable" : "Disable",
|
||||
read_data);
|
||||
FTS_INFO("Success to %s charger mode, 0x8B = 0x%02x\n", mode ? "Enable" : "Disable",
|
||||
read_data);
|
||||
} else {
|
||||
ret = fts_write_reg(FTS_REG_CHARGER_MODE_EN, mode);
|
||||
if(ret < 0){
|
||||
FTS_ERROR("Failed to set charger mode\n");
|
||||
mutex_unlock(&ts_data->mode_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
FTS_INFO("Success to %s charger mode, 0x8B = 0x%02x\n", mode ? "Enable" : "Disable",
|
||||
mode);
|
||||
}
|
||||
|
||||
mutex_unlock(&ts_data->mode_lock);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue