summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-11-17 16:58:25 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-11-17 16:58:25 +0000
commit9a9c8fcedbc1cec506420881df7742d6d96862bd (patch)
treee0137b2580783c9d50d35e9c660abe8f73bef537
parentd4e56448bcc38be62d1b2e2a117fed576c0495fc (diff)
parent8e0bae9e66e487c06e27e70a5f9ba7027bd7ac49 (diff)
downloadpixel-9a9c8fcedbc1cec506420881df7742d6d96862bd.tar.gz
Merge "Revert "vibrator: cs40l25: add pwle_ramp_down feature"" into sc-qpr1-dev am: 8e0bae9e66
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/pixel/+/16239433 Change-Id: If27dd1805013fe0e724c8700500fcb4144986bf8
-rw-r--r--vibrator/cs40l25/Hardware.h3
-rw-r--r--vibrator/cs40l25/Vibrator.cpp19
-rw-r--r--vibrator/cs40l25/Vibrator.h4
-rw-r--r--vibrator/cs40l25/android.hardware.vibrator-service.cs40l25.rc2
-rw-r--r--vibrator/cs40l25/tests/mocks.h1
-rw-r--r--vibrator/cs40l25/tests/test-hwapi.cpp3
6 files changed, 0 insertions, 32 deletions
diff --git a/vibrator/cs40l25/Hardware.h b/vibrator/cs40l25/Hardware.h
index f74fe931..d1883e53 100644
--- a/vibrator/cs40l25/Hardware.h
+++ b/vibrator/cs40l25/Hardware.h
@@ -48,7 +48,6 @@ class HwApi : public Vibrator::HwApi, private HwApiBase {
open("device/clab_enable", &mClabEnable);
open("device/available_pwle_segments", &mAvailablePwleSegments);
open("device/pwle", &mPwle);
- open("device/pwle_ramp_down", &mPwleRampDown);
}
bool setF0(uint32_t value) override { return set(value, &mF0); }
@@ -77,7 +76,6 @@ class HwApi : public Vibrator::HwApi, private HwApiBase {
bool getAvailablePwleSegments(uint32_t *value) override { return get(value, &mAvailablePwleSegments); }
bool hasPwle() override { return has(mPwle); }
bool setPwle(std::string value) override { return set(value, &mPwle); }
- bool setPwleRampDown(uint32_t value) override { return set(value, &mPwleRampDown); }
void debug(int fd) override { HwApiBase::debug(fd); }
private:
@@ -103,7 +101,6 @@ class HwApi : public Vibrator::HwApi, private HwApiBase {
std::ofstream mClabEnable;
std::ifstream mAvailablePwleSegments;
std::ofstream mPwle;
- std::ofstream mPwleRampDown;
};
class HwCal : public Vibrator::HwCal, private HwCalBase {
diff --git a/vibrator/cs40l25/Vibrator.cpp b/vibrator/cs40l25/Vibrator.cpp
index c06bf0c8..002fccf9 100644
--- a/vibrator/cs40l25/Vibrator.cpp
+++ b/vibrator/cs40l25/Vibrator.cpp
@@ -101,8 +101,6 @@ static constexpr float PWLE_FREQUENCY_MIN_HZ = 0.25;
static constexpr float PWLE_FREQUENCY_MAX_HZ = 1023.75;
static constexpr float PWLE_BW_MAP_SIZE =
1 + ((PWLE_FREQUENCY_MAX_HZ - PWLE_FREQUENCY_MIN_HZ) / PWLE_FREQUENCY_RESOLUTION_HZ);
-static constexpr float RAMP_DOWN_CONSTANT = 1048.576;
-static constexpr float RAMP_DOWN_TIME_MS = 50.0;
static struct pcm_config haptic_nohost_config = {
.channels = 1,
@@ -264,7 +262,6 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal)
createPwleMaxLevelLimitMap();
mIsUnderExternalControl = false;
- setPwleRampDown();
}
ndk::ScopedAStatus Vibrator::getCapabilities(int32_t *_aidl_return) {
@@ -1179,22 +1176,6 @@ fail:
return false;
}
-void Vibrator::setPwleRampDown() {
- // The formula for calculating the ramp down coefficient to be written into
- // pwle_ramp_down is as follows:
- // Crd = 1048.576 / Trd
- // where Trd is the desired ramp down time in seconds
- // pwle_ramp_down accepts only 24 bit integers values
-
- const float seconds = RAMP_DOWN_TIME_MS / 1000;
- const auto ramp_down_coefficient = static_cast<uint32_t>(RAMP_DOWN_CONSTANT / seconds);
-
- if (!mHwApi->setPwleRampDown(ramp_down_coefficient)) {
- ALOGE("Failed to write \"%d\" to pwle_ramp_down (%d): %s", ramp_down_coefficient, errno,
- strerror(errno));
- }
-}
-
} // namespace vibrator
} // namespace hardware
} // namespace android
diff --git a/vibrator/cs40l25/Vibrator.h b/vibrator/cs40l25/Vibrator.h
index 88f7abd8..08a115e4 100644
--- a/vibrator/cs40l25/Vibrator.h
+++ b/vibrator/cs40l25/Vibrator.h
@@ -101,9 +101,6 @@ class Vibrator : public BnVibrator {
// Specifies piecewise-linear specifications to generate complex
// waveforms.
virtual bool setPwle(std::string value) = 0;
- // Specifies the coefficient required for a ramp down when a waveform
- // ends
- virtual bool setPwleRampDown(uint32_t value) = 0;
// Emit diagnostic information to the given file.
virtual void debug(int fd) = 0;
};
@@ -203,7 +200,6 @@ class Vibrator : public BnVibrator {
bool hasHapticAlsaDevice();
bool enableHapticPcmAmp(struct pcm **haptic_pcm, bool enable, int card, int device);
void createPwleMaxLevelLimitMap();
- void setPwleRampDown();
std::unique_ptr<HwApi> mHwApi;
std::unique_ptr<HwCal> mHwCal;
diff --git a/vibrator/cs40l25/android.hardware.vibrator-service.cs40l25.rc b/vibrator/cs40l25/android.hardware.vibrator-service.cs40l25.rc
index f373d31f..3f28d81f 100644
--- a/vibrator/cs40l25/android.hardware.vibrator-service.cs40l25.rc
+++ b/vibrator/cs40l25/android.hardware.vibrator-service.cs40l25.rc
@@ -34,7 +34,6 @@ on boot
chown system system /sys/class/leds/vibrator/device/hw_reset
chown system system /sys/class/leds/vibrator/device/num_waves
chown system system /sys/class/leds/vibrator/device/pwle
- chown system system /sys/class/leds/vibrator/device/pwle_ramp_down
chown system system /sys/class/leds/vibrator/device/q_stored
chown system system /sys/class/leds/vibrator/device/redc_comp_enable
chown system system /sys/class/leds/vibrator/device/redc_stored
@@ -68,7 +67,6 @@ service vendor.vibrator.cs40l25 /vendor/bin/hw/android.hardware.vibrator-service
device/heartbeat
device/num_waves
device/pwle
- device/pwle_ramp_down
device/q_stored
device/redc_stored
state
diff --git a/vibrator/cs40l25/tests/mocks.h b/vibrator/cs40l25/tests/mocks.h
index 8f2c672e..2c69e27b 100644
--- a/vibrator/cs40l25/tests/mocks.h
+++ b/vibrator/cs40l25/tests/mocks.h
@@ -49,7 +49,6 @@ class MockApi : public ::aidl::android::hardware::vibrator::Vibrator::HwApi {
MOCK_METHOD1(getAvailablePwleSegments, bool(uint32_t *value));
MOCK_METHOD0(hasPwle, bool());
MOCK_METHOD1(setPwle, bool(std::string value));
- MOCK_METHOD1(setPwleRampDown, bool(uint32_t value));
MOCK_METHOD1(debug, void(int fd));
~MockApi() override { destructor(); };
diff --git a/vibrator/cs40l25/tests/test-hwapi.cpp b/vibrator/cs40l25/tests/test-hwapi.cpp
index a339207b..7f2ae01b 100644
--- a/vibrator/cs40l25/tests/test-hwapi.cpp
+++ b/vibrator/cs40l25/tests/test-hwapi.cpp
@@ -55,7 +55,6 @@ class HwApiTest : public Test {
"device/num_waves",
"device/available_pwle_segments",
"device/pwle",
- "device/pwle_ramp_down",
};
public:
@@ -320,8 +319,6 @@ INSTANTIATE_TEST_CASE_P(
&Vibrator::HwApi::setGpioRiseIndex),
SetUint32Test::MakeParam("device/gpio1_rise_dig_scale",
&Vibrator::HwApi::setGpioRiseScale),
- SetUint32Test::MakeParam("device/pwle_ramp_down",
- &Vibrator::HwApi::setPwleRampDown),
}),
SetUint32Test::PrintParam);