From e8d045dd0a51785c92db3ea25090a879ce9ae179 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 25 Mar 2019 00:07:47 +0100 Subject: [PATCH] common: Import Xiaomi HAL definitions Change-Id: I8ba524bc678101af129a3d2845737f7b18f27514 --- interfaces/Android.bp | 4 +++ .../hardware/displayfeature/1.0/Android.bp | 13 ++++++++ .../displayfeature/1.0/IDisplayFeature.hal | 21 +++++++++++++ .../fingerprintextension/1.0/Android.bp | 13 ++++++++ .../1.0/IXiaomiFingerprint.hal | 21 +++++++++++++ interfaces/hardware/motor/1.0/Android.bp | 18 +++++++++++ interfaces/hardware/motor/1.0/IMotor.hal | 30 +++++++++++++++++++ .../hardware/motor/1.0/IMotorCallback.hal | 21 +++++++++++++ interfaces/hardware/motor/1.0/types.hal | 22 ++++++++++++++ interfaces/updates-makefiles.sh | 6 ++++ 10 files changed, 169 insertions(+) create mode 100644 interfaces/Android.bp create mode 100644 interfaces/hardware/displayfeature/1.0/Android.bp create mode 100644 interfaces/hardware/displayfeature/1.0/IDisplayFeature.hal create mode 100644 interfaces/hardware/fingerprintextension/1.0/Android.bp create mode 100644 interfaces/hardware/fingerprintextension/1.0/IXiaomiFingerprint.hal create mode 100644 interfaces/hardware/motor/1.0/Android.bp create mode 100644 interfaces/hardware/motor/1.0/IMotor.hal create mode 100644 interfaces/hardware/motor/1.0/IMotorCallback.hal create mode 100644 interfaces/hardware/motor/1.0/types.hal create mode 100755 interfaces/updates-makefiles.sh diff --git a/interfaces/Android.bp b/interfaces/Android.bp new file mode 100644 index 0000000..8240021 --- /dev/null +++ b/interfaces/Android.bp @@ -0,0 +1,4 @@ +hidl_package_root { + name: "vendor.xiaomi", + path: "device/xiaomi/common/interfaces", +} diff --git a/interfaces/hardware/displayfeature/1.0/Android.bp b/interfaces/hardware/displayfeature/1.0/Android.bp new file mode 100644 index 0000000..5e6aacd --- /dev/null +++ b/interfaces/hardware/displayfeature/1.0/Android.bp @@ -0,0 +1,13 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "vendor.xiaomi.hardware.displayfeature@1.0", + root: "vendor.xiaomi", + srcs: [ + "IDisplayFeature.hal", + ], + interfaces: [ + "android.hidl.base@1.0", + ], + gen_java: true, +} diff --git a/interfaces/hardware/displayfeature/1.0/IDisplayFeature.hal b/interfaces/hardware/displayfeature/1.0/IDisplayFeature.hal new file mode 100644 index 0000000..2e37d8d --- /dev/null +++ b/interfaces/hardware/displayfeature/1.0/IDisplayFeature.hal @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2019-2020 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.displayfeature@1.0; + +interface IDisplayFeature { + setFeature(uint32_t displayId, uint32_t mode, uint32_t value, uint32_t cookie); +}; diff --git a/interfaces/hardware/fingerprintextension/1.0/Android.bp b/interfaces/hardware/fingerprintextension/1.0/Android.bp new file mode 100644 index 0000000..e73453a --- /dev/null +++ b/interfaces/hardware/fingerprintextension/1.0/Android.bp @@ -0,0 +1,13 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "vendor.xiaomi.hardware.fingerprintextension@1.0", + root: "vendor.xiaomi", + srcs: [ + "IXiaomiFingerprint.hal", + ], + interfaces: [ + "android.hidl.base@1.0", + ], + gen_java: true, +} diff --git a/interfaces/hardware/fingerprintextension/1.0/IXiaomiFingerprint.hal b/interfaces/hardware/fingerprintextension/1.0/IXiaomiFingerprint.hal new file mode 100644 index 0000000..6b2826c --- /dev/null +++ b/interfaces/hardware/fingerprintextension/1.0/IXiaomiFingerprint.hal @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2019-2020 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.fingerprintextension@1.0; + +interface IXiaomiFingerprint { + extCmd(int32_t cmd, int32_t param) generates (int32_t result); +}; diff --git a/interfaces/hardware/motor/1.0/Android.bp b/interfaces/hardware/motor/1.0/Android.bp new file mode 100644 index 0000000..c75eeb6 --- /dev/null +++ b/interfaces/hardware/motor/1.0/Android.bp @@ -0,0 +1,18 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "vendor.xiaomi.hardware.motor@1.0", + root: "vendor.xiaomi", + srcs: [ + "types.hal", + "IMotor.hal", + "IMotorCallback.hal", + ], + interfaces: [ + "android.hidl.base@1.0", + ], + types: [ + "MotorEvent", + ], + gen_java: true, +} diff --git a/interfaces/hardware/motor/1.0/IMotor.hal b/interfaces/hardware/motor/1.0/IMotor.hal new file mode 100644 index 0000000..fc45a20 --- /dev/null +++ b/interfaces/hardware/motor/1.0/IMotor.hal @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2019-2020 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.motor@1.0; + +import vendor.xiaomi.hardware.motor@1.0::IMotorCallback; + +interface IMotor { + popupMotor(int32_t cookie); + takebackMotor(int32_t cookie); + setMotorCallback(IMotorCallback motorcallback); + init(); + release(); + getMotorStatus() generates (int32_t result); + calibration(); + takebackMotorShortly(); +}; diff --git a/interfaces/hardware/motor/1.0/IMotorCallback.hal b/interfaces/hardware/motor/1.0/IMotorCallback.hal new file mode 100644 index 0000000..e93d7d0 --- /dev/null +++ b/interfaces/hardware/motor/1.0/IMotorCallback.hal @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2019-2020 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.motor@1.0; + +interface IMotorCallback { + oneway onNotify(MotorEvent event); +}; diff --git a/interfaces/hardware/motor/1.0/types.hal b/interfaces/hardware/motor/1.0/types.hal new file mode 100644 index 0000000..d1b670c --- /dev/null +++ b/interfaces/hardware/motor/1.0/types.hal @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2019-2020 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.motor@1.0; + +struct MotorEvent { + int32_t vaalue; + int32_t cookie; +}; diff --git a/interfaces/updates-makefiles.sh b/interfaces/updates-makefiles.sh new file mode 100755 index 0000000..781d4ba --- /dev/null +++ b/interfaces/updates-makefiles.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +source $ANDROID_BUILD_TOP/system/tools/hidl/update-makefiles-helper.sh + +do_makefiles_update \ + "vendor.xiaomi:device/xiaomi/common/interfaces"