sm8250-common: vibrator: Sync with upstream

Change-Id: Ia72f93829bbeaf9c80aafa5b7d4310948029a078
This commit is contained in:
LuK1337 2021-04-28 18:29:10 +02:00
parent 2bf9eeee2f
commit 86b4e9c707

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -55,6 +55,13 @@ namespace vibrator {
#define INVALID_VALUE -1 #define INVALID_VALUE -1
#define CUSTOM_DATA_LEN 3 #define CUSTOM_DATA_LEN 3
#define MSM_CPU_LAHAINA 415
#define APQ_CPU_LAHAINA 439
#define MSM_CPU_SHIMA 450
#define MSM_CPU_SM8325 501
#define APQ_CPU_SM8325P 502
#define MSM_CPU_YUPIK 475
#define test_bit(bit, array) ((array)[(bit)/8] & (1<<((bit)%8))) #define test_bit(bit, array) ((array)[(bit)/8] & (1<<((bit)%8)))
static const char LED_DEVICE[] = "/sys/class/leds/vibrator"; static const char LED_DEVICE[] = "/sys/class/leds/vibrator";
@ -164,10 +171,18 @@ InputFFDevice::InputFFDevice()
fscanf(fp, "%u", &soc); fscanf(fp, "%u", &soc);
fclose(fp); fclose(fp);
} }
if (soc == 400 || soc == 415) { switch (soc) {
case MSM_CPU_LAHAINA:
case APQ_CPU_LAHAINA:
case MSM_CPU_SHIMA:
case MSM_CPU_SM8325:
case APQ_CPU_SM8325P:
case MSM_CPU_YUPIK:
mSupportExternalControl = true; mSupportExternalControl = true;
} else { break;
default:
mSupportExternalControl = false; mSupportExternalControl = false;
break;
} }
break; break;
} }