Skip to content

Commit 006e879

Browse files
committed
drivers/cps-hid.c: cps_fix_report_desc(): complete the original fix-up for input_logmin/input_logmax vs. high voltage transfer [#1245, #2718]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 6ae5fea commit 006e879

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/cps-hid.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,16 @@ static int cps_fix_report_desc(HIDDevice_t *pDev, HIDDesc_t *pDesc_arg) {
388388
"LogMin: %ld LogMax: %ld",
389389
input_logmin, input_logmax);
390390

391-
pData->LogMin = CPS_VOLTAGE_LOGMIN;
392-
pData->LogMax = CPS_VOLTAGE_LOGMAX;
393-
upsdebugx(3, "Fixing Report Descriptor: "
394-
"set Input Voltage LogMin = %d, LogMax = %d",
395-
CPS_VOLTAGE_LOGMIN, CPS_VOLTAGE_LOGMAX);
391+
/* TOTHINK: Should this be still about
392+
* the *HIGH* Voltage Transfer? Or LOW?
393+
*/
394+
if (hvt_logmin == input_logmin && hvt_logmax == input_logmax) {
395+
pData->LogMin = CPS_VOLTAGE_LOGMIN;
396+
pData->LogMax = CPS_VOLTAGE_LOGMAX;
397+
upsdebugx(3, "Fixing Report Descriptor: "
398+
"set Input Voltage LogMin = %d, LogMax = %d",
399+
CPS_VOLTAGE_LOGMIN, CPS_VOLTAGE_LOGMAX);
400+
}
396401
}
397402

398403
retval = 1;

0 commit comments

Comments
 (0)