From ca451e014aa9932148de273bc42055477573d160 Mon Sep 17 00:00:00 2001 From: Luke Go Date: Wed, 7 Dec 2016 14:27:21 +0900 Subject: [PATCH] ODROID: Added options the ignoring the Vu7 id. - Ignoring Vu7 vid and pid when using other touch screen. - Added disable_vu7 options to boot.ini when using other touch screen. Change-Id: I99d3ed0767436dc3c3151e4b6fe9e045c2a73b8d --- drivers/input/touchscreen/dwav-usb-mt.c | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/input/touchscreen/dwav-usb-mt.c b/drivers/input/touchscreen/dwav-usb-mt.c index e72f9f39bca7..fc2c0ba28ecb 100644 --- a/drivers/input/touchscreen/dwav-usb-mt.c +++ b/drivers/input/touchscreen/dwav-usb-mt.c @@ -412,6 +412,33 @@ 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) +{ + if (disable_vu7 && id->driver_info == ODROID_VU7) + return true; + else + return false; +} + /*-------------------------------------------------------------------------*/ static int dwav_usb_mt_probe(struct usb_interface *intf, const struct usb_device_id *id) @@ -423,6 +450,10 @@ static int dwav_usb_mt_probe(struct usb_interface *intf, int err = 0; + /* ignore the vu7 id when using other device */ + if (dwav_usb_mt_ignore(id)) + return -ENODEV; + endpoint = dwav_usb_mt_get_input_endpoint(intf->cur_altsetting); if (!endpoint) return -ENXIO;