From 5ddcf81464d44504568ec5fb5d2226ddd16adb0c Mon Sep 17 00:00:00 2001 From: Stricted Date: Mon, 15 Oct 2018 00:15:50 +0200 Subject: [PATCH] s5neolte: Add device hardware key layout Change-Id: I215ac725e5bd87a817fba6d196b775d6d05ee17b --- device.mk | 8 ++++ idc/Synaptics_HID_TouchPad.idc | 59 ++++++++++++++++++++++++++ idc/Synaptics_RMI4_TouchPad_Sensor.idc | 59 ++++++++++++++++++++++++++ keylayout/Button_Jack.kl | 3 ++ keylayout/gpio_keys.kl | 16 +++++++ keylayout/sec_touchkey.kl | 18 ++++++++ 6 files changed, 163 insertions(+) create mode 100644 idc/Synaptics_HID_TouchPad.idc create mode 100644 idc/Synaptics_RMI4_TouchPad_Sensor.idc create mode 100644 keylayout/Button_Jack.kl create mode 100644 keylayout/gpio_keys.kl create mode 100644 keylayout/sec_touchkey.kl diff --git a/device.mk b/device.mk index a39523c..7164b19 100644 --- a/device.mk +++ b/device.mk @@ -44,6 +44,14 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml +# Key-layout +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/idc/Synaptics_HID_TouchPad.idc:system/usr/idc/Synaptics_HID_TouchPad.idc \ + $(LOCAL_PATH)/idc/Synaptics_RMI4_TouchPad_Sensor.idc:system/usr/idc/Synaptics_RMI4_TouchPad_Sensor.idc \ + $(LOCAL_PATH)/keylayout/Button_Jack.kl:system/usr/keylayout/Button_Jack.kl \ + $(LOCAL_PATH)/keylayout/gpio_keys.kl:system/usr/keylayout/gpio_keys.kl \ + $(LOCAL_PATH)/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl + # NFC PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/nfc/libnfc-sec-hal.conf:system/etc/libnfc-sec-hal.conf \ diff --git a/idc/Synaptics_HID_TouchPad.idc b/idc/Synaptics_HID_TouchPad.idc new file mode 100644 index 0000000..f0fbe15 --- /dev/null +++ b/idc/Synaptics_HID_TouchPad.idc @@ -0,0 +1,59 @@ +# Copyright (C) 2010 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. + +# +# Input Device Configuration File for the Atmel Maxtouch touch screen. +# +# These calibration values are derived from empirical measurements +# and may not be appropriate for use with other touch screens. +# Refer to the input device configuration documentation for more details. +# + +device.internal = 0 + +# Basic Parameters +touch.deviceType = pointer +touch.orientationAware = 1 + +touch.gestureMode = pointer + +# Touch Size +touch.touchSize.calibration = pressure + +# Tool Size +# Driver reports tool size as an area measurement. +# +# Based on empirical measurements, we estimate the size of the tool +# using size = sqrt(22 * rawToolArea + 0) * 6 + 0. +touch.toolSize.calibration = area +touch.toolSize.areaScale = 22 +touch.toolSize.areaBias = 0 +touch.toolSize.linearScale = 6 +touch.toolSize.linearBias = 0 +touch.toolSize.isSummed = 0 + +# Pressure +# Driver reports signal strength as pressure. +# +# A normal index finger touch typically registers about 80 signal strength +# units although we don't expect these values to be accurate. +touch.pressure.calibration = amplitude +touch.pressure.source = default +touch.pressure.scale = 0.0125 + +# Size +touch.size.calibration = normalized + +# Orientation +touch.orientation.calibration = vector diff --git a/idc/Synaptics_RMI4_TouchPad_Sensor.idc b/idc/Synaptics_RMI4_TouchPad_Sensor.idc new file mode 100644 index 0000000..35b7b4f --- /dev/null +++ b/idc/Synaptics_RMI4_TouchPad_Sensor.idc @@ -0,0 +1,59 @@ +# Copyright (C) 2010 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. + +# +# Input Device Configuration File for the Atmel Maxtouch touch screen. +# +# These calibration values are derived from empirical measurements +# and may not be appropriate for use with other touch screens. +# Refer to the input device configuration documentation for more details. +# + +device.internal = 0 + +# Basic Parameters +touch.deviceType = pointer +touch.orientationAware = 0 + +touch.gestureMode = pointer + +# Touch Size +touch.touchSize.calibration = pressure + +# Tool Size +# Driver reports tool size as an area measurement. +# +# Based on empirical measurements, we estimate the size of the tool +# using size = sqrt(22 * rawToolArea + 0) * 6 + 0. +touch.toolSize.calibration = area +touch.toolSize.areaScale = 22 +touch.toolSize.areaBias = 0 +touch.toolSize.linearScale = 6 +touch.toolSize.linearBias = 0 +touch.toolSize.isSummed = 0 + +# Pressure +# Driver reports signal strength as pressure. +# +# A normal index finger touch typically registers about 80 signal strength +# units although we don't expect these values to be accurate. +touch.pressure.calibration = amplitude +touch.pressure.source = default +touch.pressure.scale = 0.0125 + +# Size +touch.size.calibration = normalized + +# Orientation +touch.orientation.calibration = vector diff --git a/keylayout/Button_Jack.kl b/keylayout/Button_Jack.kl new file mode 100644 index 0000000..ddb0dbf --- /dev/null +++ b/keylayout/Button_Jack.kl @@ -0,0 +1,3 @@ +key 256 HEADSETHOOK +key 257 VOLUME_UP +key 258 VOLUME_DOWN diff --git a/keylayout/gpio_keys.kl b/keylayout/gpio_keys.kl new file mode 100644 index 0000000..ed7b36e --- /dev/null +++ b/keylayout/gpio_keys.kl @@ -0,0 +1,16 @@ +# You can find out the values using the 'getevent' command. +# Press a button and you will see something like: +# +# /dev/input/event7: 0001 0074 00000001 +# ^^^^ +# +# This is the power button. Convert 0x74 hex to decimal and +# add it here to a file you name after the 'name' of the +# device. +# +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 116 POWER +key 152 POWER +key 172 HOME + diff --git a/keylayout/sec_touchkey.kl b/keylayout/sec_touchkey.kl new file mode 100644 index 0000000..efa2ea9 --- /dev/null +++ b/keylayout/sec_touchkey.kl @@ -0,0 +1,18 @@ +# +# Copyright (C) 2016 The CyanogenMod 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. +# + +key 158 BACK VIRTUAL +key 254 APP_SWITCH VIRTUAL -- 2.20.1