diff --git a/arch/arm64/configs/odroidc4_android_defconfig b/arch/arm64/configs/odroidc4_android_defconfig index e23f4bb32f7f..a5a0ec0bd5f7 100644 --- a/arch/arm64/configs/odroidc4_android_defconfig +++ b/arch/arm64/configs/odroidc4_android_defconfig @@ -2672,7 +2672,7 @@ CONFIG_TOUCHSCREEN_PROPERTIES=y # CONFIG_TOUCHSCREEN_TPS6507X is not set # CONFIG_TOUCHSCREEN_ZFORCE is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set -CONFIG_TOUCHSCREEN_DWAV_USB_MT=y +CONFIG_TOUCHSCREEN_DWAV_USB_MT=m CONFIG_TOUCHSCREEN_SX8650=m CONFIG_INPUT_MISC=y # CONFIG_INPUT_AD714X is not set @@ -4043,7 +4043,7 @@ CONFIG_LOGIWHEELS_FF=y # CONFIG_HID_MAGICMOUSE is not set # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MONTEREY is not set -CONFIG_HID_MULTITOUCH=y +CONFIG_HID_MULTITOUCH=m # CONFIG_HID_NTRIG is not set # CONFIG_HID_ORTEK is not set # CONFIG_HID_PANTHERLORD is not set diff --git a/arch/arm64/configs/odroidn2_android_defconfig b/arch/arm64/configs/odroidn2_android_defconfig index 35c596e5d1bc..d5e4469ed08f 100644 --- a/arch/arm64/configs/odroidn2_android_defconfig +++ b/arch/arm64/configs/odroidn2_android_defconfig @@ -2325,7 +2325,7 @@ CONFIG_TOUCHSCREEN_PROPERTIES=y # CONFIG_TOUCHSCREEN_TPS6507X is not set # CONFIG_TOUCHSCREEN_ZFORCE is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set -CONFIG_TOUCHSCREEN_DWAV_USB_MT=y +CONFIG_TOUCHSCREEN_DWAV_USB_MT=m CONFIG_TOUCHSCREEN_SX8650=m CONFIG_INPUT_MISC=y # CONFIG_INPUT_AD714X is not set @@ -3541,7 +3541,7 @@ CONFIG_LOGIWHEELS_FF=y # CONFIG_HID_MAGICMOUSE is not set # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MONTEREY is not set -CONFIG_HID_MULTITOUCH=y +CONFIG_HID_MULTITOUCH=m # CONFIG_HID_NTRIG is not set # CONFIG_HID_ORTEK is not set # CONFIG_HID_PANTHERLORD is not set diff --git a/drivers/hardkernel/odroid-sysfs.c b/drivers/hardkernel/odroid-sysfs.c index ad76e3e01d54..08d142501301 100644 --- a/drivers/hardkernel/odroid-sysfs.c +++ b/drivers/hardkernel/odroid-sysfs.c @@ -33,6 +33,78 @@ #include #include +bool touch_invert_x; +/*-------------------------------------------------------------------------*/ +static int __init touch_invert_x_para_setup(char *s) +{ + touch_invert_x = false; + if (!strncmp(s, "true", 4)) + touch_invert_x = true; + else if (!strncmp(s, "false", 5)) + touch_invert_x = false; + else { + pr_err("%s - wrong touch_invert_x parameter", __func__); + touch_invert_x = true; + } + + return 0; +} +__setup("touch_invert_x=", touch_invert_x_para_setup); + +bool get_touch_invert_x(void) +{ + return touch_invert_x; +} +EXPORT_SYMBOL(get_touch_invert_x); + +bool touch_invert_y; +/*-------------------------------------------------------------------------*/ +static int __init touch_invert_y_para_setup(char *s) +{ + touch_invert_y = false; + if (!strncmp(s, "true", 4)) + touch_invert_y = true; + else if (!strncmp(s, "false", 5)) + touch_invert_y = false; + else { + pr_err("%s - wrong touch_invert_y parameter", __func__); + touch_invert_y = true; + } + + return 0; +} +__setup("touch_invert_y=", touch_invert_y_para_setup); + +bool get_touch_invert_y(void) +{ + return touch_invert_y; +} +EXPORT_SYMBOL(get_touch_invert_y); + +static bool disable_vu7; +/*-------------------------------------------------------------------------*/ +static int __init dwav_usb_mt_boot_para_setup(char *s) +{ + disable_vu7 = false; + if (!strncmp(s, "true", 4)) + disable_vu7 = true; + else if (!strncmp(s, "false", 5)) + disable_vu7 = false; + else { + pr_err("%s - wrong disable_vu7 parameter", __func__); + disable_vu7 = true; + } + + return 0; +} +__setup("disable_vu7=", dwav_usb_mt_boot_para_setup); + +bool get_disable_vu7(void) +{ + return touch_invert_y; +} +EXPORT_SYMBOL(get_disable_vu7); + static int prevent_sleep = 0; static int __init prevent_sleep_setup(char *s) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 6970b2e00844..83f9b1d7676c 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -609,8 +609,12 @@ static int mt_compute_slot(struct mt_device *td, struct input_dev *input) return input_mt_get_slot_by_key(input, td->curdata.contactid); } -extern bool touch_invert_x; -extern bool touch_invert_y; +bool touch_invert_x; +bool touch_invert_y; + +extern bool get_touch_invert_x(void); +extern bool get_touch_invert_y(void); + /* * this function is called when a whole contact has been processed, * so that it can assign it to a slot and store the data there @@ -651,6 +655,9 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) int major = max(s->w, s->h) >> 1; int minor = min(s->w, s->h) >> 1; + touch_invert_x = get_touch_invert_x(); + touch_invert_y = get_touch_invert_y(); + if (touch_invert_x) input_event(input, EV_ABS, ABS_MT_POSITION_X, input->absinfo[0].maximum - s->x); diff --git a/drivers/input/touchscreen/dwav-usb-mt.c b/drivers/input/touchscreen/dwav-usb-mt.c index 89d903020dff..758c0c1ec7cd 100644 --- a/drivers/input/touchscreen/dwav-usb-mt.c +++ b/drivers/input/touchscreen/dwav-usb-mt.c @@ -123,41 +123,13 @@ struct dwav_usb_mt { struct finger_t *finger; }; +bool disable_vu7; bool touch_invert_x; -/*-------------------------------------------------------------------------*/ -static int __init touch_invert_x_para_setup(char *s) -{ - touch_invert_x = false; - if (!strncmp(s, "true", 4)) - touch_invert_x = true; - else if (!strncmp(s, "false", 5)) - touch_invert_x = false; - else { - pr_err("%s - wrong touch_invert_x parameter", __func__); - touch_invert_x = true; - } - - return 0; -} -__setup("touch_invert_x=", touch_invert_x_para_setup); - bool touch_invert_y; -/*-------------------------------------------------------------------------*/ -static int __init touch_invert_y_para_setup(char *s) -{ - touch_invert_y = false; - if (!strncmp(s, "true", 4)) - touch_invert_y = true; - else if (!strncmp(s, "false", 5)) - touch_invert_y = false; - else { - pr_err("%s - wrong touch_invert_y parameter", __func__); - touch_invert_y = true; - } - return 0; -} -__setup("touch_invert_y=", touch_invert_y_para_setup); +extern bool get_touch_invert_x(void); +extern bool get_touch_invert_y(void); +extern bool get_disable_vu7(void); /*-------------------------------------------------------------------------*/ static void dwav_usb_mt_report(struct dwav_usb_mt *dwav_usb_mt) @@ -183,6 +155,10 @@ static void dwav_usb_mt_report(struct dwav_usb_mt *dwav_usb_mt) if (dwav_usb_mt->finger[id].status != TS_EVENT_RELEASE) { input_mt_report_slot_state(dwav_usb_mt->input, MT_TOOL_FINGER, true); + + touch_invert_x = get_touch_invert_x(); + touch_invert_y = get_touch_invert_y(); + if (touch_invert_x) input_report_abs(dwav_usb_mt->input, ABS_MT_POSITION_X, @@ -458,27 +434,10 @@ static int dwav_usb_mt_init(struct dwav_usb_mt *dwav_usb_mt, void *dev) return 0; } -static bool disable_vu7; -/*-------------------------------------------------------------------------*/ -static int __init dwav_usb_mt_boot_para_setup(char *s) -{ - disable_vu7 = false; - if (!strncmp(s, "true", 4)) - disable_vu7 = true; - else if (!strncmp(s, "false", 5)) - disable_vu7 = false; - else { - pr_err("%s - wrong disable_vu7 parameter", __func__); - disable_vu7 = true; - } - - return 0; -} -__setup("disable_vu7=", dwav_usb_mt_boot_para_setup); - /*-------------------------------------------------------------------------*/ static bool dwav_usb_mt_ignore(const struct usb_device_id *id) { + disable_vu7 = get_disable_vu7(); if (disable_vu7 && id->driver_info == ODROID_VU7) return true; else