tp:fogona icnl9916c tp bring [1/3]

WHY:icnl9916c tp bringup
HOW:add tp driver
Change-Id: I86baf02cfe46de578cbe6d801c04edd6d04d692e
Signed-off-by: lzl <longc157@motorola.com>
Reviewed-on: https://gerrit.mot.com/2673320
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
This commit is contained in:
longc authored and longc157 committed 2023-07-12 03:58:19 -05:00
1 parent c92029353b
commit db2b27811a
8 files changed
+66 -6

No files matched your search

@@ -6,20 +6,25 @@ CHIPONE_MMI_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/
else
CHIPONE_MMI_MODULE_PATH := $(KERNEL_MODULES_OUT)
endif
ifeq ($(CHIPONE_ESD),true)
KERNEL_CFLAGS += CONFIG_CHIPONE_ESD=y
KBUILD_OPTIONS += CONFIG_CHIPONE_ESD=y
endif
ifneq ($(BOARD_USES_DOUBLE_TAP),)
KERNEL_CFLAGS += CONFIG_INPUT_CHIPONE_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
KBUILD_OPTIONS += CONFIG_INPUT_CHIPONE_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
endif
ifneq ($(BOARD_USES_PANEL_NOTIFICATIONS),)
KERNEL_CFLAGS += CONFIG_INPUT_CHIPONE_PANEL_NOTIFICATIONS=y
KBUILD_OPTIONS += CONFIG_INPUT_CHIPONE_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
endif
ifneq ($(MOTO_PANEL_CHECK_TOUCH_STATE),)
KERNEL_CFLAGS += CONFIG_INPUT_CHIPONE_0FLASH_MMI_NOTIFY_TOUCH_STATE=y
KBUILD_OPTIONS += CONFIG_INPUT_CHIPONE_0FLASH_MMI_NOTIFY_TOUCH_STATE=y
endif
ifneq ($(findstring mmi_info.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
@@ -35,6 +40,8 @@ LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(CHIPONE_MMI_MODULE_PATH)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/mmi_info.ko
ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
KBUILD_OPTIONS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko
endif
KBUILD_OPTIONS += MODULE_KERNEL_VERSION=$(TARGET_KERNEL_VERSION)
include $(DLKM_DIR)/AndroidKernelModule.mk
@@ -1,3 +1,24 @@
ifeq ($(strip $(MODULE_KERNEL_VERSION)), 5.15)
all: modules
modules:
$(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS)
modules_install:
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(M) modules_install
%:
$(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS)
clean:
rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
rm -rf .tmp_versions
KBUILD_EXTRA_SYMBOLS += $(M)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers
else
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
all:
@@ -11,3 +32,5 @@ clean:
KBUILD_EXTRA_SYMBOLS += $(M)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers
endif
@@ -1,6 +1,6 @@
#ifndef CTS_CONFIG_H
#define CTS_CONFIG_H
#include <linux/version.h>
/** Driver version */
#define CFG_CTS_DRIVER_MAJOR_VERSION 3
#define CFG_CTS_DRIVER_MINOR_VERSION 4
@@ -160,8 +160,9 @@
/****************************************************************************
* Platform configurations
****************************************************************************/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
#define CONFIG_CTS_PM_FB_NOTIFIER
#endif
#ifdef CONFIG_CTS_PM_FB_NOTIFIER
#ifdef CONFIG_DRM
#define CFG_CTS_DRM_NOTIFIER
@@ -432,6 +432,7 @@ struct chipone_ts_data {
struct kobject *suspend_kobj;
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
static inline u32 get_unaligned_le24(const void *p)
{
const u8 *puc = (const u8 *)p;
@@ -452,6 +453,7 @@ static inline void put_unaligned_be24(u32 v, void *p)
puc[1] = (v >> 8) & 0xFF;
puc[2] = (v >> 0) & 0xFF;
}
#endif
#define wrap(max, x) ((max) - 1 - (x))
@@ -639,6 +639,9 @@ static void dump_tsdata_to_seq_file(struct seq_file *m,
len = dump_tsdata_row_to_buffer(linebuf, sizeof(linebuf),
data, cols, NULL, "\n", ',');
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void) len;
#endif
seq_puts(m, linebuf);
data += hw_cols;
@@ -729,7 +732,9 @@ static void dump_comp_cap_to_seq_file(struct seq_file *m,
len = dump_comp_cap_row_to_buffer(linebuf, sizeof(linebuf),
data, cols, NULL, "\n", ',');
seq_puts(m, linebuf);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void) len;
#endif
data += hw_cols;
}
}
@@ -1411,9 +1416,15 @@ static int cts_factory_test_show(struct seq_file *m, void *v)
cts_info("gstrlp_noise_max : %d", limit.gstrlp_noise_max);
normal_rawdata_frames = limit.normal_rawdata_frames;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void) normal_rawdata_frames;
#endif
normal_rawdata_min = limit.normal_rawdata_min;
normal_rawdata_max = limit.normal_rawdata_max;
normal_noise_frames = limit.normal_noise_frames;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void)normal_noise_frames;
#endif
normal_noise_max = limit.normal_noise_max;
normal_open_min = limit.normal_open_min;
normal_short_min = limit.normal_short_min;
@@ -133,7 +133,9 @@ int cts_spi_send_recv(struct cts_platform_data *pdata, size_t len,
struct chipone_ts_data *cts_data;
struct spi_message msg;
struct spi_transfer cmd = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
.delay_usecs = 0,
#endif
.speed_hz = pdata->spi_speed * 1000u,
.tx_buf = tx_buffer,
.rx_buf = rx_buffer,
@@ -458,6 +460,9 @@ int cts_plat_is_normal_mode(struct cts_platform_data *pdata)
cts_set_normal_addr(pdata->cts_dev);
cts_data = container_of(pdata->cts_dev, struct chipone_ts_data, cts_dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void)cts_data;
#endif
ret = cts_tcs_get_fw_id(pdata->cts_dev, &fwid);
/*
addr = CTS_DEVICE_FW_REG_CHIP_TYPE;
@@ -999,9 +1004,10 @@ int cts_plat_process_touch_msg(struct cts_platform_data *pdata,
#endif
cts_dbg("Process touch %d msgs", num);
cts_data = container_of(pdata->cts_dev, struct chipone_ts_data, cts_dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
(void) cts_data;
#endif
if (num == 0 || num > CFG_CTS_MAX_TOUCH_NUM)
return 0;
@@ -5,7 +5,6 @@
#include <asm/byteorder.h>
#include <linux/bitops.h>
#include <linux/ctype.h>
#include <linux/unaligned/access_ok.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
@@ -44,6 +43,11 @@
#include <linux/spi/spidev.h>
#include "cts_config.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
#include <asm-generic/unaligned.h>
#else
#include <linux/unaligned/access_ok.h>
#endif
#include "cts_core.h"
extern bool cts_show_debug_log;
@@ -266,7 +266,9 @@ static int cts_tcs_spi_xtrans(const struct cts_device *cts_dev, u8 *tx,
int ret;
memset(&xfer[0], 0, sizeof(struct spi_transfer));
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
xfer[0].delay_usecs = 0;
#endif
xfer[0].speed_hz = cts_dev->pdata->spi_speed * 1000u;
xfer[0].tx_buf = tx;
xfer[0].rx_buf = NULL;
@@ -288,7 +290,9 @@ static int cts_tcs_spi_xtrans(const struct cts_device *cts_dev, u8 *tx,
udelay(100);
memset(&xfer[1], 0, sizeof(struct spi_transfer));
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
xfer[1].delay_usecs = 0;
#endif
xfer[1].speed_hz = cts_dev->pdata->spi_speed * 1000u;
xfer[1].tx_buf = NULL;
xfer[1].rx_buf = rx;
@@ -338,7 +342,9 @@ static int cts_tcs_spi_xtrans_1_cs(const struct cts_device *cts_dev, u8 *tx,
int ret;
memset(&xfer[0], 0, sizeof(struct spi_transfer));
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
xfer[0].delay_usecs = 0;
#endif
xfer[0].speed_hz = cts_dev->pdata->spi_speed * 1000u;
xfer[0].tx_buf = tx;
xfer[0].rx_buf = rx;