Skip to content

Commit

Permalink
drivers/cps-hid.c: cps_fix_report_desc(): complete the original fix-u…
Browse files Browse the repository at this point in the history
…p for input_logmin/input_logmax vs. high voltage transfer [#1245, #2718]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
  • Loading branch information
jimklimov committed Dec 18, 2024
1 parent 6ae5fea commit 006e879
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/cps-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,16 @@ static int cps_fix_report_desc(HIDDevice_t *pDev, HIDDesc_t *pDesc_arg) {
"LogMin: %ld LogMax: %ld",
input_logmin, input_logmax);

pData->LogMin = CPS_VOLTAGE_LOGMIN;
pData->LogMax = CPS_VOLTAGE_LOGMAX;
upsdebugx(3, "Fixing Report Descriptor: "
"set Input Voltage LogMin = %d, LogMax = %d",
CPS_VOLTAGE_LOGMIN, CPS_VOLTAGE_LOGMAX);
/* TOTHINK: Should this be still about
* the *HIGH* Voltage Transfer? Or LOW?
*/
if (hvt_logmin == input_logmin && hvt_logmax == input_logmax) {
pData->LogMin = CPS_VOLTAGE_LOGMIN;
pData->LogMax = CPS_VOLTAGE_LOGMAX;
upsdebugx(3, "Fixing Report Descriptor: "
"set Input Voltage LogMin = %d, LogMax = %d",
CPS_VOLTAGE_LOGMIN, CPS_VOLTAGE_LOGMAX);
}
}

retval = 1;
Expand Down

0 comments on commit 006e879

Please sign in to comment.