From 4b669d52d8f274fe12b8e313975758a4f41f8cdd Mon Sep 17 00:00:00 2001 From: stenvezhong Date: Thu, 8 Jul 2021 20:50:36 +0800 Subject: [PATCH] telephony modify driver usb serial Change-Id: I1f9448a92e5b7156d5ab544a459c672ad2de52d5 --- .../hi3516dv300_small.patch | 151 ++++++++++-------- 1 file changed, 86 insertions(+), 65 deletions(-) diff --git a/linux-4.19/hi3516dv300_small_patch/hi3516dv300_small.patch b/linux-4.19/hi3516dv300_small_patch/hi3516dv300_small.patch index 299188b..5682d23 100644 --- a/linux-4.19/hi3516dv300_small_patch/hi3516dv300_small.patch +++ b/linux-4.19/hi3516dv300_small_patch/hi3516dv300_small.patch @@ -303444,6 +303444,69 @@ index 05122167d9d8..98db2015b83f 100644 } EXPORT_SYMBOL_GPL(hid_disconnect); +diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c +index 11bd2ca22a2e..7c040f28a4af 100644 +--- a/drivers/hid/hid-input.c ++++ b/drivers/hid/hid-input.c +@@ -31,7 +31,7 @@ + + #include + #include +- ++#include "hdf_hid_adapter.h" + #include "hid-ids.h" + + #define unk KEY_UNKNOWN +@@ -1364,8 +1364,11 @@ void hidinput_report_event(struct hid_device *hid, struct hid_report *report) + if (hid->quirks & HID_QUIRK_NO_INPUT_SYNC) + return; + +- list_for_each_entry(hidinput, &hid->inputs, list) ++ list_for_each_entry(hidinput, &hid->inputs, list) { + input_sync(hidinput->input); ++ if(hid->input_dev) ++ HidReportEvent(hid->input_dev, EV_SYN, SYN_REPORT, 0); ++ } + } + EXPORT_SYMBOL_GPL(hidinput_report_event); + +@@ -1729,6 +1732,27 @@ static inline void hidinput_configure_usages(struct hid_input *hidinput, + report->field[i]->usage + j); + } + ++static void transferinfo(struct input_dev *dev) ++{ ++ HidInfo info; ++ info.devName = dev->name; ++ memcpy(info.devProp, dev->propbit, sizeof(unsigned long) * BITS_TO_LONGS(INPUT_PROP_CNT)); ++ memcpy(info.eventType, dev->evbit, sizeof(unsigned long) * BITS_TO_LONGS(EV_CNT)); ++ memcpy(info.keyCode, dev->keybit, sizeof(unsigned long) * BITS_TO_LONGS(KEY_CNT)); ++ memcpy(info.relCode, dev->relbit, sizeof(unsigned long) * BITS_TO_LONGS(REL_CNT)); ++ memcpy(info.absCode, dev->absbit, sizeof(unsigned long) * BITS_TO_LONGS(ABS_CNT)); ++ memcpy(info.miscCode, dev->mscbit, sizeof(unsigned long) * BITS_TO_LONGS(MSC_CNT)); ++ memcpy(info.ledCode, dev->ledbit, sizeof(unsigned long) * BITS_TO_LONGS(LED_CNT)); ++ memcpy(info.soundCode, dev->sndbit, sizeof(unsigned long) * BITS_TO_LONGS(SND_CNT)); ++ memcpy(info.forceCode, dev->ffbit, sizeof(unsigned long) * BITS_TO_LONGS(FF_CNT)); ++ memcpy(info.switchCode, dev->swbit, sizeof(unsigned long) * BITS_TO_LONGS(SW_CNT)); ++ info.bustype = dev->id.bustype; ++ info.vendor = dev->id.vendor; ++ info.product = dev->id.product; ++ info.version = dev->id.version; ++ GetInfoFromHid(info); ++} ++ + /* + * Register the input device; print a message. + * Configure the input layer interface +@@ -1811,7 +1835,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) + hidinput_cleanup_hidinput(hid, hidinput); + continue; + } +- ++ transferinfo(hidinput->input); + if (input_register_device(hidinput->input)) + goto out_unwind; + hidinput->registered = true; diff --git a/drivers/hidmac/Kconfig b/drivers/hidmac/Kconfig new file mode 100644 index 000000000000..dcb3e08bf5d2 @@ -359338,6 +359401,29 @@ index 2c9821ec836e..68b67755f676 100644 /* Initialize the video buffers queue. */ uvcg_queue_init(&video->queue, V4L2_BUF_TYPE_VIDEO_OUTPUT, +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index c773db129bf9..723e40e3e215 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -97,6 +97,10 @@ static void option_instat_callback(struct urb *urb); + #define YISO_VENDOR_ID 0x0EAB + #define YISO_PRODUCT_U893 0xC893 + ++/* MEIG PRODUCTS */ ++#define MEIG_VENDOR_ID 0x2DEE ++#define MEIG_PRODUCT_SLM790 0x4D20 ++ + /* + * NOVATEL WIRELESS PRODUCTS + * +@@ -575,6 +579,7 @@ static void option_instat_callback(struct urb *urb); + + + static const struct usb_device_id option_ids[] = { ++ { USB_DEVICE(MEIG_VENDOR_ID, MEIG_PRODUCT_SLM790) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index c989f777bf77..0bcb9027b59e 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c @@ -364657,68 +364743,3 @@ index 67048f922ff2..e950f32243b6 100755 ipv6_route_test|ipv6_rt) ipv6_route_test;; ipv4_route_test|ipv4_rt) ipv4_route_test;; ipv6_addr_metric) ipv6_addr_metric_test;; --- -2.25.1 -diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c -index 11bd2ca22..7c040f28a 100644 ---- a/drivers/hid/hid-input.c -+++ b/drivers/hid/hid-input.c -@@ -31,7 +31,7 @@ - - #include - #include -- -+#include "hdf_hid_adapter.h" - #include "hid-ids.h" - - #define unk KEY_UNKNOWN -@@ -1364,8 +1364,11 @@ void hidinput_report_event(struct hid_device *hid, struct hid_report *report) - if (hid->quirks & HID_QUIRK_NO_INPUT_SYNC) - return; - -- list_for_each_entry(hidinput, &hid->inputs, list) -+ list_for_each_entry(hidinput, &hid->inputs, list) { - input_sync(hidinput->input); -+ if(hid->input_dev) -+ HidReportEvent(hid->input_dev, EV_SYN, SYN_REPORT, 0); -+ } - } - EXPORT_SYMBOL_GPL(hidinput_report_event); - -@@ -1729,6 +1732,27 @@ static inline void hidinput_configure_usages(struct hid_input *hidinput, - report->field[i]->usage + j); - } - -+static void transferinfo(struct input_dev *dev) -+{ -+ HidInfo info; -+ info.devName = dev->name; -+ memcpy(info.devProp, dev->propbit, sizeof(unsigned long) * BITS_TO_LONGS(INPUT_PROP_CNT)); -+ memcpy(info.eventType, dev->evbit, sizeof(unsigned long) * BITS_TO_LONGS(EV_CNT)); -+ memcpy(info.keyCode, dev->keybit, sizeof(unsigned long) * BITS_TO_LONGS(KEY_CNT)); -+ memcpy(info.relCode, dev->relbit, sizeof(unsigned long) * BITS_TO_LONGS(REL_CNT)); -+ memcpy(info.absCode, dev->absbit, sizeof(unsigned long) * BITS_TO_LONGS(ABS_CNT)); -+ memcpy(info.miscCode, dev->mscbit, sizeof(unsigned long) * BITS_TO_LONGS(MSC_CNT)); -+ memcpy(info.ledCode, dev->ledbit, sizeof(unsigned long) * BITS_TO_LONGS(LED_CNT)); -+ memcpy(info.soundCode, dev->sndbit, sizeof(unsigned long) * BITS_TO_LONGS(SND_CNT)); -+ memcpy(info.forceCode, dev->ffbit, sizeof(unsigned long) * BITS_TO_LONGS(FF_CNT)); -+ memcpy(info.switchCode, dev->swbit, sizeof(unsigned long) * BITS_TO_LONGS(SW_CNT)); -+ info.bustype = dev->id.bustype; -+ info.vendor = dev->id.vendor; -+ info.product = dev->id.product; -+ info.version = dev->id.version; -+ GetInfoFromHid(info); -+} -+ - /* - * Register the input device; print a message. - * Configure the input layer interface -@@ -1811,7 +1835,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) - hidinput_cleanup_hidinput(hid, hidinput); - continue; - } -- -+ transferinfo(hidinput->input); - if (input_register_device(hidinput->input)) - goto out_unwind; - hidinput->registered = true; -- Gitee