From 86b4e9c7076a0c305084b788d42da7534fe5b75c Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 28 Apr 2021 18:29:10 +0200 Subject: [PATCH] sm8250-common: vibrator: Sync with upstream Change-Id: Ia72f93829bbeaf9c80aafa5b7d4310948029a078 --- vibrator/Vibrator.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/vibrator/Vibrator.cpp b/vibrator/Vibrator.cpp index 063523a..f3c7c10 100644 --- a/vibrator/Vibrator.cpp +++ b/vibrator/Vibrator.cpp @@ -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 * modification, are permitted provided that the following conditions are @@ -55,6 +55,13 @@ namespace vibrator { #define INVALID_VALUE -1 #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))) static const char LED_DEVICE[] = "/sys/class/leds/vibrator"; @@ -164,10 +171,18 @@ InputFFDevice::InputFFDevice() fscanf(fp, "%u", &soc); 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; - } else { + break; + default: mSupportExternalControl = false; + break; } break; }