Files
linux/drivers/input/touchscreen/rk_tp.c
Tao Huang f9eefeeaa7 rk: add SPDX license identifier to files with no license
Change-Id: I754250669891307b0deab2bdab1bd01512713f79
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-31 20:56:06 +08:00

39 lines
859 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
static int check_tp_param(void)
{
if(en == 0 || i2c == -1 || addr == -1 || x_max == -1 || y_max == -1){
printk("touchpad: en: %d, i2c: %d, addr: 0x%x, x_max: %d, y_max: %d\n",
en, i2c, addr, x_max, y_max);
return -EINVAL;
}else{
return 0;
}
}
static struct i2c_board_info __initdata tp_info = {
.type = TP_MODULE_NAME,
.flags = 0,
};
static int tp_board_init(void)
{
int ret = 0;
ret = check_tp_param();
if(ret < 0)
return ret;
tp_info.addr = addr;
ret = i2c_add_device(i2c, &tp_info);
return ret;
}