summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-02-23 19:35:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-23 19:35:11 +0000
commit289c26e9b1b1f1069c4a47958adb884f9891789e (patch)
treeb91abd92b3c61c7afd9b227af537ad9a0151e89f /modules
parentf55fdb2d555ae4047225238755209db02db40ebc (diff)
parent5113aff7e2a8540cc3f6364b8c730f853784e2ff (diff)
downloadhardware_libhardware-289c26e9b1b1f1069c4a47958adb884f9891789e.zip
hardware_libhardware-289c26e9b1b1f1069c4a47958adb884f9891789e.tar.gz
hardware_libhardware-289c26e9b1b1f1069c4a47958adb884f9891789e.tar.bz2
Merge "Add input HAL header."
Diffstat (limited to 'modules')
-rw-r--r--modules/Android.mk2
-rw-r--r--modules/input/Android.mk19
-rw-r--r--modules/input/evdev/Android.mk29
-rw-r--r--modules/input/evdev/EvdevModule.cpp66
4 files changed, 115 insertions, 1 deletions
diff --git a/modules/Android.mk b/modules/Android.mk
index 13a0b5b..9f7e5f0 100644
--- a/modules/Android.mk
+++ b/modules/Android.mk
@@ -1,4 +1,4 @@
hardware_modules := gralloc hwcomposer audio nfc nfc-nci local_time \
power usbaudio audio_remote_submix camera usbcamera consumerir sensors vibrator \
- tv_input fingerprint
+ tv_input fingerprint input
include $(call all-named-subdir-makefiles,$(hardware_modules))
diff --git a/modules/input/Android.mk b/modules/input/Android.mk
new file mode 100644
index 0000000..3011b2e
--- /dev/null
+++ b/modules/input/Android.mk
@@ -0,0 +1,19 @@
+# Copyright (C) 2015 The Android Open Source 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.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/modules/input/evdev/Android.mk b/modules/input/evdev/Android.mk
new file mode 100644
index 0000000..ad05af3
--- /dev/null
+++ b/modules/input/evdev/Android.mk
@@ -0,0 +1,29 @@
+# Copyright (C) 2015 The Android Open Source 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.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := input.evdev.default
+LOCAL_MODULE_RELATIVE_PATH := hw
+
+LOCAL_SRC_FILES := \
+ EvdevModule.cpp
+
+LOCAL_SHARED_LIBRARIES := liblog
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/input/evdev/EvdevModule.cpp b/modules/input/evdev/EvdevModule.cpp
new file mode 100644
index 0000000..f56842a
--- /dev/null
+++ b/modules/input/evdev/EvdevModule.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2015 The Android Open Source 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.
+ */
+
+#define LOG_NDEBUG 0
+#define LOG_TAG "EvdevModule"
+
+#include <assert.h>
+#include <hardware/hardware.h>
+#include <hardware/input.h>
+
+namespace input {
+
+extern "C" {
+
+static int dummy_open(const hw_module_t __unused *module, const char __unused *id,
+ hw_device_t __unused **device) {
+ assert(false);
+ return 0;
+}
+
+static void input_init(const input_module_t* module,
+ input_host_t* host, input_host_callbacks_t cb) {
+ return;
+}
+
+static void input_notify_report(input_report_t* r) {
+ return;
+}
+
+static struct hw_module_methods_t input_module_methods = {
+ .open = dummy_open,
+};
+
+input_module_t HAL_MODULE_INFO_SYM = {
+ .common = {
+ .tag = HARDWARE_MODULE_TAG,
+ .module_api_version = INPUT_MODULE_API_VERSION_1_0,
+ .hal_api_version = HARDWARE_HAL_API_VERSION,
+ .id = INPUT_HARDWARE_MODULE_ID,
+ .name = "Input evdev HAL",
+ .author = "The Android Open Source Project",
+ .methods = &input_module_methods,
+ .dso = NULL,
+ .reserved = {0},
+ },
+
+ .init = input_init,
+ .notify_report = input_notify_report,
+};
+
+} // extern "C"
+
+} // namespace input