summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-02-13 17:31:41 -0800
committerMichael Wright <michaelwr@google.com>2015-02-23 10:45:55 -0800
commit5113aff7e2a8540cc3f6364b8c730f853784e2ff (patch)
tree423bf08dec26c32c09cd1a9af2e41a2a16cb903c /modules
parent5d4ee176fb9b9c48505476a2200e20ecaca90353 (diff)
downloadhardware_libhardware-5113aff7e2a8540cc3f6364b8c730f853784e2ff.zip
hardware_libhardware-5113aff7e2a8540cc3f6364b8c730f853784e2ff.tar.gz
hardware_libhardware-5113aff7e2a8540cc3f6364b8c730f853784e2ff.tar.bz2
Add input HAL header.
Change-Id: Ia959dd1d1adf024459d2423fc9d59a811466e53c
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