Add patches for v5.3

This commit is contained in:
qzed 2019-09-22 02:22:44 +02:00 committed by Maximilian Luz
parent f0ffd413fa
commit a9681ee2ac
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02
13 changed files with 247271 additions and 23237 deletions

View file

@ -1,281 +0,0 @@
From 3902051025f388147dea5c8ccec0d6b0a8b87bd2 Mon Sep 17 00:00:00 2001
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
Date: Wed, 31 Jul 2019 08:41:30 +0900
Subject: [PATCH 02/12] suspend
Note:
NVMe part will be merged into Linux 5.3. Remove the part in this
patch when it arrives.
---
drivers/nvme/host/core.c | 24 ++++++++--
drivers/nvme/host/nvme.h | 6 +++
drivers/nvme/host/pci.c | 95 ++++++++++++++++++++++++++++++++++++++--
kernel/power/suspend.c | 11 +++++
kernel/sysctl.c | 9 ++++
5 files changed, 139 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 963b4c6309b9..4b8cf243c150 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1114,15 +1114,15 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl,
return id;
}
-static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword11,
- void *buffer, size_t buflen, u32 *result)
+static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen, u32 *result)
{
struct nvme_command c;
union nvme_result res;
int ret;
memset(&c, 0, sizeof(c));
- c.features.opcode = nvme_admin_set_features;
+ c.features.opcode = op;
c.features.fid = cpu_to_le32(fid);
c.features.dword11 = cpu_to_le32(dword11);
@@ -1133,6 +1133,24 @@ static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword
return ret;
}
+int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen,
+ u32 *result)
+{
+ return nvme_features(dev, nvme_admin_set_features, fid, dword11, buffer,
+ buflen, result);
+}
+EXPORT_SYMBOL_GPL(nvme_set_features);
+
+int nvme_get_features(struct nvme_ctrl *dev, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen,
+ u32 *result)
+{
+ return nvme_features(dev, nvme_admin_get_features, fid, dword11, buffer,
+ buflen, result);
+}
+EXPORT_SYMBOL_GPL(nvme_get_features);
+
int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
{
u32 q_count = (*count - 1) | ((*count - 1) << 16);
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 81215ca32671..9285d5f6437b 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -459,6 +459,12 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
union nvme_result *result, void *buffer, unsigned bufflen,
unsigned timeout, int qid, int at_head,
blk_mq_req_flags_t flags, bool poll);
+int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen,
+ u32 *result);
+int nvme_get_features(struct nvme_ctrl *dev, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen,
+ u32 *result);
int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count);
void nvme_stop_keep_alive(struct nvme_ctrl *ctrl);
int nvme_reset_ctrl(struct nvme_ctrl *ctrl);
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 09ffd21d1809..3e22d5f14e93 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -18,6 +18,7 @@
#include <linux/mutex.h>
#include <linux/once.h>
#include <linux/pci.h>
+#include <linux/suspend.h>
#include <linux/t10-pi.h>
#include <linux/types.h>
#include <linux/io-64-nonatomic-lo-hi.h>
@@ -116,6 +117,7 @@ struct nvme_dev {
u32 cmbsz;
u32 cmbloc;
struct nvme_ctrl ctrl;
+ u32 last_ps;
mempool_t *iod_mempool;
@@ -2849,16 +2851,94 @@ static void nvme_remove(struct pci_dev *pdev)
}
#ifdef CONFIG_PM_SLEEP
+static int nvme_get_power_state(struct nvme_ctrl *ctrl, u32 *ps)
+{
+ return nvme_get_features(ctrl, NVME_FEAT_POWER_MGMT, 0, NULL, 0, ps);
+}
+
+static int nvme_set_power_state(struct nvme_ctrl *ctrl, u32 ps)
+{
+ return nvme_set_features(ctrl, NVME_FEAT_POWER_MGMT, ps, NULL, 0, NULL);
+}
+
+static int nvme_resume(struct device *dev)
+{
+ struct nvme_dev *ndev = pci_get_drvdata(to_pci_dev(dev));
+ struct nvme_ctrl *ctrl = &ndev->ctrl;
+
+ if (pm_resume_via_firmware() || !ctrl->npss ||
+ nvme_set_power_state(ctrl, ndev->last_ps) != 0)
+ nvme_reset_ctrl(ctrl);
+ return 0;
+}
+
static int nvme_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct nvme_dev *ndev = pci_get_drvdata(pdev);
+ struct nvme_ctrl *ctrl = &ndev->ctrl;
+ int ret = -EBUSY;
+
+ /*
+ * The platform does not remove power for a kernel managed suspend so
+ * use host managed nvme power settings for lowest idle power if
+ * possible. This should have quicker resume latency than a full device
+ * shutdown. But if the firmware is involved after the suspend or the
+ * device does not support any non-default power states, shut down the
+ * device fully.
+ */
+ if (pm_suspend_via_firmware() || !ctrl->npss) {
+ nvme_dev_disable(ndev, true);
+ return 0;
+ }
+
+ nvme_start_freeze(ctrl);
+ nvme_wait_freeze(ctrl);
+ nvme_sync_queues(ctrl);
+
+ if (ctrl->state != NVME_CTRL_LIVE &&
+ ctrl->state != NVME_CTRL_ADMIN_ONLY)
+ goto unfreeze;
+
+ ndev->last_ps = 0;
+ ret = nvme_get_power_state(ctrl, &ndev->last_ps);
+ if (ret < 0)
+ goto unfreeze;
+
+ ret = nvme_set_power_state(ctrl, ctrl->npss);
+ if (ret < 0)
+ goto unfreeze;
+
+ if (ret) {
+ /*
+ * Clearing npss forces a controller reset on resume. The
+ * correct value will be resdicovered then.
+ */
+ nvme_dev_disable(ndev, true);
+ ctrl->npss = 0;
+ ret = 0;
+ goto unfreeze;
+ }
+ /*
+ * A saved state prevents pci pm from generically controlling the
+ * device's power. If we're using protocol specific settings, we don't
+ * want pci interfering.
+ */
+ pci_save_state(pdev);
+unfreeze:
+ nvme_unfreeze(ctrl);
+ return ret;
+}
+
+static int nvme_simple_suspend(struct device *dev)
+{
+ struct nvme_dev *ndev = pci_get_drvdata(to_pci_dev(dev));
nvme_dev_disable(ndev, true);
return 0;
}
-static int nvme_resume(struct device *dev)
+static int nvme_simple_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct nvme_dev *ndev = pci_get_drvdata(pdev);
@@ -2866,9 +2946,16 @@ static int nvme_resume(struct device *dev)
nvme_reset_ctrl(&ndev->ctrl);
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(nvme_dev_pm_ops, nvme_suspend, nvme_resume);
+const struct dev_pm_ops nvme_dev_pm_ops = {
+ .suspend = nvme_suspend,
+ .resume = nvme_resume,
+ .freeze = nvme_simple_suspend,
+ .thaw = nvme_simple_resume,
+ .poweroff = nvme_simple_suspend,
+ .restore = nvme_simple_resume,
+};
+#endif /* CONFIG_PM_SLEEP */
static pci_ers_result_t nvme_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
@@ -2975,9 +3062,11 @@ static struct pci_driver nvme_driver = {
.probe = nvme_probe,
.remove = nvme_remove,
.shutdown = nvme_shutdown,
+#ifdef CONFIG_PM_SLEEP
.driver = {
.pm = &nvme_dev_pm_ops,
},
+#endif
.sriov_configure = pci_sriov_configure_simple,
.err_handler = &nvme_err_handler,
};
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 096211299c07..0cb0fe170977 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -533,6 +533,8 @@ int suspend_devices_and_enter(suspend_state_t state)
goto Resume_devices;
}
+unsigned int resume_delay = 3000;
+
/**
* suspend_finish - Clean up before finishing the suspend sequence.
*
@@ -541,6 +543,15 @@ int suspend_devices_and_enter(suspend_state_t state)
*/
static void suspend_finish(void)
{
+ if (resume_delay) {
+ /* Give kernel threads a head start, such that usb-storage
+ * can detect devices before syslog attempts to write log
+ * messages from the suspend code.
+ */
+ thaw_kernel_threads();
+ pr_debug("PM: Sleeping for %d milliseconds.\n", resume_delay);
+ msleep(resume_delay);
+ }
suspend_thaw_processes();
pm_notifier_call_chain(PM_POST_SUSPEND);
pm_restore_console();
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 1beca96fb625..4b98db9bbc88 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -318,7 +318,16 @@ static int min_extfrag_threshold;
static int max_extfrag_threshold = 1000;
#endif
+extern unsigned int resume_delay;
+
static struct ctl_table kern_table[] = {
+ {
+ .procname = "resume_delay",
+ .data = &resume_delay,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
{
.procname = "sched_child_runs_first",
.data = &sysctl_sched_child_runs_first,
--
2.23.0

File diff suppressed because it is too large Load diff

View file

@ -1,26 +0,0 @@
From 2317a00a6f49dd9d0904515fe8867212c9cd187e Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:45:55 +0200
Subject: [PATCH 07/12] sdcard-reader
---
drivers/usb/core/hub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 2844366dc173..989fabd6ab39 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4205,7 +4205,8 @@ void usb_enable_lpm(struct usb_device *udev)
if (!udev || !udev->parent ||
udev->speed < USB_SPEED_SUPER ||
!udev->lpm_capable ||
- udev->state < USB_STATE_DEFAULT)
+ udev->state < USB_STATE_DEFAULT ||
+ !udev->bos || !udev->bos->ss_cap)
return;
udev->lpm_disable_count--;
--
2.23.0

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
From d4d386abdc4817e58e10db9971ee6af3e6da2e07 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:44:14 +0200
Subject: [PATCH 01/12] surface-acpi
From 227d9d1cbb636b51b99b049a600668cc7653cbf0 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Mon, 26 Aug 2019 01:11:08 +0200
Subject: [PATCH 1/9] surface-acpi
---
drivers/acpi/acpica/dsopcode.c | 2 +-
@ -59,10 +59,10 @@ index d3d2dbfba680..0b7f617a6e9b 100644
buffer_desc = acpi_ut_create_buffer_object(buffer_length);
if (!buffer_desc) {
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 7c2fd1d72e18..c00cb830914a 100644
index 1b67bb578f9f..0c1fc3655b5c 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -623,6 +623,103 @@ config THINKPAD_ACPI_HOTKEY_POLL
@@ -620,6 +620,103 @@ config THINKPAD_ACPI_HOTKEY_POLL
If you are not sure, say Y here. The driver enables polling only if
it is strictly necessary to do so.
@ -167,7 +167,7 @@ index 7c2fd1d72e18..c00cb830914a 100644
tristate "Thinkpad Hard Drive Active Protection System (hdaps)"
depends on INPUT
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 87b0069bd781..8b12c19dc165 100644
index 415104033060..662e595ae13f 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o
@ -180,7 +180,7 @@ index 87b0069bd781..8b12c19dc165 100644
obj-$(CONFIG_FUJITSU_TABLET) += fujitsu-tablet.o
diff --git a/drivers/platform/x86/surface_acpi.c b/drivers/platform/x86/surface_acpi.c
new file mode 100644
index 000000000000..f62aecb0df69
index 000000000000..ea417dbf4793
--- /dev/null
+++ b/drivers/platform/x86/surface_acpi.c
@@ -0,0 +1,3913 @@
@ -1801,7 +1801,7 @@ index 000000000000..f62aecb0df69
+{
+ struct surfacegen5_ec *ec;
+ unsigned long flags;
+ int status;
+ //int status;
+
+ ec = surfacegen5_ec_acquire_init();
+ if (!ec) {
@ -1811,10 +1811,10 @@ index 000000000000..f62aecb0df69
+ surfacegen5_ssh_sysfs_unregister(&serdev->dev);
+
+ // suspend EC and disable events
+ status = surfacegen5_ssh_ec_suspend(ec);
+ if (status) {
+ dev_err(&serdev->dev, "failed to suspend EC: %d\n", status);
+ }
+ //status = surfacegen5_ssh_ec_suspend(ec);
+ //if (status) {
+ // dev_err(&serdev->dev, "failed to suspend EC: %d\n", status);
+ //}
+
+ // make sure all events (received up to now) have been properly handled
+ flush_workqueue(ec->events.queue_ack);

View file

@ -1,7 +1,7 @@
From 28bc715183ef72470ec7a0d5df3b572814a18500 Mon Sep 17 00:00:00 2001
From 89c677637073842ed8a61000ac4cccaf9cee4f00 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:45:10 +0200
Subject: [PATCH 03/12] buttons
Date: Sat, 27 Jul 2019 17:51:37 +0200
Subject: [PATCH 2/9] buttons
---
drivers/input/misc/Kconfig | 6 +-

View file

@ -1,7 +1,7 @@
From 687a19de3665bf1408b8917796987399cd4bd4f1 Mon Sep 17 00:00:00 2001
From 3dd82efff79f1291a81dba88cb66421a2c5630d0 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:47:27 +0200
Subject: [PATCH 12/12] surfacebook2-dgpu
Date: Tue, 2 Jul 2019 22:17:46 +0200
Subject: [PATCH 3/9] surfacebook2 dgpu
---
drivers/platform/x86/Kconfig | 9 +
@ -11,10 +11,10 @@ Subject: [PATCH 12/12] surfacebook2-dgpu
create mode 100644 drivers/platform/x86/surfacebook2_dgpu_hps.c
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 04421fe566ba..cb0a53da4de1 100644
index 0c1fc3655b5c..c8abd3d70461 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -484,6 +484,15 @@ config SURFACE3_WMI
@@ -481,6 +481,15 @@ config SURFACE3_WMI
To compile this driver as a module, choose M here: the module will
be called surface3-wmi.
@ -31,7 +31,7 @@ index 04421fe566ba..cb0a53da4de1 100644
tristate "ThinkPad ACPI Laptop Extras"
depends on ACPI
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 58b07217c3cf..d18d3dcc5749 100644
index 662e595ae13f..c33d76577b5a 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_ACPI_WMI) += wmi.o

View file

@ -1,7 +1,7 @@
From 6f167c509db37afa78770af611d6e2fb2e764607 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:45:42 +0200
Subject: [PATCH 06/12] hid
From c54d91c901e7d6f42ea883f3f2d36d7b8c7b3698 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Tue, 17 Sep 2019 17:16:23 +0200
Subject: [PATCH 4/9] hid
---
drivers/hid/hid-ids.h | 21 +++++++++----
@ -11,10 +11,10 @@ Subject: [PATCH 06/12] hid
4 files changed, 86 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 76aa474e92c1..2ce782095c63 100644
index 0a00be19f7a0..7a898dca9c36 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -822,11 +822,22 @@
@@ -823,11 +823,22 @@
#define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1 0x0732
#define USB_DEVICE_ID_MS_DIGITAL_MEDIA_600 0x0750
#define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c
@ -57,10 +57,10 @@ index 8b3a922bdad3..0290a16881e5 100644
.driver_data = MS_PRESENTER },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B),
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 03448d3a29f2..09ca4b1f2797 100644
index b603c14d043b..008e6707f467 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1983,6 +1983,63 @@ static const struct hid_device_id mt_devices[] = {
@@ -1967,6 +1967,63 @@ static const struct hid_device_id mt_devices[] = {
HID_USB_DEVICE(USB_VENDOR_ID_LG,
USB_DEVICE_ID_LG_MELFAS_MT) },
@ -125,10 +125,10 @@ index 03448d3a29f2..09ca4b1f2797 100644
{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_ASUS,
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 4fe2c3ab76f9..c9feb3f76e78 100644
index 166f41f3173b..d8a595a97dc1 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -112,6 +112,17 @@ static const struct hid_device_id hid_quirks[] = {
@@ -113,6 +113,17 @@ static const struct hid_device_id hid_quirks[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), HID_QUIRK_NO_INIT_REPORTS },

View file

@ -1,7 +1,7 @@
From 8dcbe757ce810b137ddaa746598b261de98bd6f3 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:46:48 +0200
Subject: [PATCH 09/12] surface3-power
From af0373ecee9130cd0ac50a4f9c04f5e7fb357b93 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Tue, 17 Sep 2019 17:17:56 +0200
Subject: [PATCH 5/9] surface3 power
---
drivers/platform/x86/Kconfig | 7 +
@ -11,10 +11,10 @@ Subject: [PATCH 09/12] surface3-power
create mode 100644 drivers/platform/x86/surface3_power.c
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index c00cb830914a..04421fe566ba 100644
index c8abd3d70461..c381d14dea20 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1301,6 +1301,13 @@ config SURFACE_3_BUTTON
@@ -1315,6 +1315,13 @@ config SURFACE_3_BUTTON
---help---
This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet.
@ -29,10 +29,10 @@ index c00cb830914a..04421fe566ba 100644
tristate "Intel P-Unit IPC Driver"
---help---
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 8b12c19dc165..58b07217c3cf 100644
index c33d76577b5a..5c88172c0649 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -85,6 +85,7 @@ obj-$(CONFIG_INTEL_PMC_IPC) += intel_pmc_ipc.o
@@ -87,6 +87,7 @@ obj-$(CONFIG_INTEL_PMC_IPC) += intel_pmc_ipc.o
obj-$(CONFIG_TOUCHSCREEN_DMI) += touchscreen_dmi.o
obj-$(CONFIG_SURFACE_PRO3_BUTTON) += surfacepro3_button.o
obj-$(CONFIG_SURFACE_3_BUTTON) += surface3_button.o

View file

@ -1,7 +1,7 @@
From 332cb8daac70868fcec9e6c8c698e6a9318cfba6 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:47:13 +0200
Subject: [PATCH 11/12] surface-lte
From 28dd93a9ee6ed705ccd1c316a45ceef7c2f31580 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Tue, 17 Sep 2019 17:21:43 +0200
Subject: [PATCH 6/9] surface lte
---
drivers/usb/serial/qcserial.c | 1 +

View file

@ -1,7 +1,7 @@
From a8ef09ff10b30d17cff5057692bfdd60021a1a49 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Fri, 26 Jul 2019 04:46:16 +0200
Subject: [PATCH 08/12] wifi
From 876823d3e53e97c8a5bc69ca30675fbc776d2a10 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Wed, 18 Sep 2019 03:18:25 +0200
Subject: [PATCH 7/9] wifi
---
drivers/net/wireless/marvell/mwifiex/11n_aggr.c | 3 +--
@ -12,17 +12,17 @@ Subject: [PATCH 08/12] wifi
drivers/net/wireless/marvell/mwifiex/main.h | 2 ++
drivers/net/wireless/marvell/mwifiex/pcie.c | 9 +++++++++
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 ++--
.../net/wireless/marvell/mwifiex/sta_cmdresp.c | 11 ++++++++---
.../net/wireless/marvell/mwifiex/sta_cmdresp.c | 10 +++++++---
drivers/net/wireless/marvell/mwifiex/usb.c | 2 ++
scripts/leaking_addresses.pl | 0
11 files changed, 48 insertions(+), 16 deletions(-)
11 files changed, 47 insertions(+), 16 deletions(-)
mode change 100755 => 100644 scripts/leaking_addresses.pl
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
index 042a1d07f686..fc9041f58e9f 100644
index 088612438530..4386e657dfdb 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
@@ -200,8 +200,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
@@ -198,8 +198,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
do {
/* Check if AMSDU can accommodate this MSDU */
@ -33,7 +33,7 @@ index 042a1d07f686..fc9041f58e9f 100644
skb_src = skb_dequeue(&pra_list->skb_head);
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index e11a4bb67172..c3461a203deb 100644
index d89684168500..1545bae9d6cf 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -437,7 +437,10 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
@ -49,10 +49,10 @@ index e11a4bb67172..c3461a203deb 100644
return mwifiex_drv_set_power(priv, &ps_mode);
}
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 8c35441fd9b7..71872139931e 100644
index e8788c35a453..82d25b3ca914 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -1006,6 +1006,7 @@ mwifiex_cmd_timeout_func(struct timer_list *t)
@@ -1004,6 +1004,7 @@ mwifiex_cmd_timeout_func(struct timer_list *t)
if (cmd_node->wait_q_enabled) {
adapter->cmd_wait_q.status = -ETIMEDOUT;
mwifiex_cancel_pending_ioctl(adapter);
@ -60,7 +60,7 @@ index 8c35441fd9b7..71872139931e 100644
}
}
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) {
@@ -1013,11 +1014,11 @@ mwifiex_cmd_timeout_func(struct timer_list *t)
@@ -1011,11 +1012,11 @@ mwifiex_cmd_timeout_func(struct timer_list *t)
return;
}
@ -76,7 +76,7 @@ index 8c35441fd9b7..71872139931e 100644
}
void
@@ -1583,6 +1584,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
@@ -1578,6 +1579,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
adapter->key_api_minor_ver);
break;
case FW_API_VER_ID:
@ -97,7 +97,7 @@ index 1fb76d2f5d3f..fb32379da99d 100644
struct hw_spec_api_rev {
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index f6da8edab7f1..51a65f26206b 100644
index a9657ae6d782..ba99d84a31ef 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -163,6 +163,7 @@ void mwifiex_queue_main_work(struct mwifiex_adapter *adapter)
@ -108,21 +108,19 @@ index f6da8edab7f1..51a65f26206b 100644
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
} else {
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
@@ -171,18 +172,20 @@ void mwifiex_queue_main_work(struct mwifiex_adapter *adapter)
@@ -171,16 +172,18 @@ void mwifiex_queue_main_work(struct mwifiex_adapter *adapter)
}
EXPORT_SYMBOL_GPL(mwifiex_queue_main_work);
-static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter)
+void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter)
{
unsigned long flags;
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
spin_lock_bh(&adapter->rx_proc_lock);
if (adapter->rx_processing) {
+ adapter->more_rx_task_flag = true;
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
spin_unlock_bh(&adapter->rx_proc_lock);
} else {
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
spin_unlock_bh(&adapter->rx_proc_lock);
queue_work(adapter->rx_workqueue, &adapter->rx_work);
}
}
@ -130,35 +128,35 @@ index f6da8edab7f1..51a65f26206b 100644
static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
{
@@ -192,6 +195,7 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
@@ -189,6 +192,7 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
spin_lock_bh(&adapter->rx_proc_lock);
if (adapter->rx_processing || adapter->rx_locked) {
+ adapter->more_rx_task_flag = true;
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
spin_unlock_bh(&adapter->rx_proc_lock);
goto exit_rx_proc;
} else {
@@ -199,6 +203,7 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
@@ -196,6 +200,7 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
spin_unlock_bh(&adapter->rx_proc_lock);
}
+rx_process_start:
/* Check for Rx data */
while ((skb = skb_dequeue(&adapter->rx_data_q))) {
atomic_dec(&adapter->rx_pending);
@@ -220,6 +225,11 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
@@ -217,6 +222,11 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
}
}
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
spin_lock_bh(&adapter->rx_proc_lock);
+ if (adapter->more_rx_task_flag) {
+ adapter->more_rx_task_flag = false;
+ spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
+ spin_unlock_bh(&adapter->rx_proc_lock);
+ goto rx_process_start;
+ }
adapter->rx_processing = false;
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
spin_unlock_bh(&adapter->rx_proc_lock);
@@ -283,11 +293,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
@@ -280,11 +290,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
mwifiex_process_hs_config(adapter);
if (adapter->if_ops.process_int_status)
adapter->if_ops.process_int_status(adapter);
@ -173,7 +171,7 @@ index f6da8edab7f1..51a65f26206b 100644
if ((adapter->ps_state == PS_STATE_SLEEP) &&
(adapter->pm_wakeup_card_req &&
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index e39bb5c42c9a..8ec3275dad6d 100644
index 095837fba300..5dca5c25c601 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -909,6 +909,7 @@ struct mwifiex_adapter {
@ -193,7 +191,7 @@ index e39bb5c42c9a..8ec3275dad6d 100644
int cmd_type,
struct mwifiex_ds_wakeup_reason *wakeup_reason);
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 3fe81b2a929a..6e734a83e6bf 100644
index b54f73e3d508..32502f443b9a 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -1743,6 +1743,15 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
@ -228,29 +226,28 @@ index 4ed10cf82f9a..485360e8534b 100644
"deepsleep enabled=0(default), deepsleep disabled=1");
/*
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
index 24b33e20e7a9..51d0f34625e1 100644
index 20c206da0631..0e58da83417c 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
@@ -48,9 +48,14 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
@@ -47,9 +47,13 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_ps_mode_enh *pm;
unsigned long flags;
- mwifiex_dbg(adapter, ERROR,
- "CMD_RESP: cmd %#x error, result=%#x\n",
- resp->command, resp->result);
+ if (resp->command == 271 && resp->result == 2){
+ if (resp->command == 271 && resp->result == 2) {
+ // ignore this command as the firmware does not support it
+ }
+ else {
+ } else {
+ mwifiex_dbg(adapter, ERROR,
+ "CMD_RESP: cmd %#x error, result=%#x\n",
+ resp->command, resp->result);
+ "CMD_RESP: cmd %#x error, result=%#x\n",
+ resp->command, resp->result);
+ }
if (adapter->curr_cmd->wait_q_enabled)
adapter->cmd_wait_q.status = -1;
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index d445acc4786b..ae8e60cc17cb 100644
index c2365eeb7016..0a219ba378dd 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -144,6 +144,8 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,

File diff suppressed because it is too large Load diff

View file

@ -1,62 +1,60 @@
From 1770ac6019b3d02677c682996a9788ae9238a984 Mon Sep 17 00:00:00 2001
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
Date: Tue, 10 Sep 2019 21:54:42 +0900
Subject: [PATCH 05/12] ipts
From 96c22ca047851080c9954811a26567cf0cece805 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Wed, 18 Sep 2019 13:04:18 +0200
Subject: [PATCH 9/9] ipts
---
drivers/gpu/drm/i915/Makefile | 3 +
drivers/gpu/drm/i915/i915_debugfs.c | 63 +-
drivers/gpu/drm/i915/i915_drv.c | 7 +
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_gem_context.c | 12 +
drivers/gpu/drm/i915/i915_irq.c | 7 +-
drivers/gpu/drm/i915/i915_params.c | 5 +-
drivers/gpu/drm/i915/i915_params.h | 5 +-
drivers/gpu/drm/i915/intel_dp.c | 4 +-
drivers/gpu/drm/i915/intel_guc.h | 1 +
drivers/gpu/drm/i915/intel_guc_submission.c | 89 +-
drivers/gpu/drm/i915/intel_guc_submission.h | 4 +
drivers/gpu/drm/i915/intel_ipts.c | 651 ++++++++++++
drivers/gpu/drm/i915/intel_ipts.h | 34 +
drivers/gpu/drm/i915/intel_lrc.c | 15 +-
drivers/gpu/drm/i915/intel_lrc.h | 6 +
drivers/gpu/drm/i915/intel_panel.c | 7 +
drivers/hid/hid-multitouch.c | 22 +-
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/ipts/Kconfig | 11 +
drivers/misc/ipts/Makefile | 17 +
drivers/misc/ipts/companion/Kconfig | 9 +
drivers/misc/ipts/companion/Makefile | 1 +
drivers/misc/ipts/companion/ipts-surface.c | 82 ++
drivers/misc/ipts/ipts-binary-spec.h | 118 +++
drivers/misc/ipts/ipts-dbgfs.c | 364 +++++++
drivers/misc/ipts/ipts-fw.c | 113 ++
drivers/misc/ipts/ipts-fw.h | 12 +
drivers/misc/ipts/ipts-gfx.c | 185 ++++
drivers/misc/ipts/ipts-gfx.h | 24 +
drivers/misc/ipts/ipts-hid.c | 497 +++++++++
drivers/misc/ipts/ipts-hid.h | 34 +
drivers/misc/ipts/ipts-kernel.c | 1042 +++++++++++++++++++
drivers/misc/ipts/ipts-kernel.h | 23 +
drivers/misc/ipts/ipts-mei-msgs.h | 585 +++++++++++
drivers/misc/ipts/ipts-mei.c | 290 ++++++
drivers/misc/ipts/ipts-msg-handler.c | 437 ++++++++
drivers/misc/ipts/ipts-msg-handler.h | 33 +
drivers/misc/ipts/ipts-params.c | 21 +
drivers/misc/ipts/ipts-params.h | 14 +
drivers/misc/ipts/ipts-resource.c | 277 +++++
drivers/misc/ipts/ipts-resource.h | 30 +
drivers/misc/ipts/ipts-sensor-regs.h | 700 +++++++++++++
drivers/misc/ipts/ipts-state.h | 29 +
drivers/misc/ipts/ipts.h | 200 ++++
drivers/misc/mei/hw-me-regs.h | 1 +
drivers/misc/mei/pci-me.c | 1 +
include/linux/intel_ipts_fw.h | 14 +
include/linux/intel_ipts_if.h | 76 ++
50 files changed, 6154 insertions(+), 26 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_ipts.c
create mode 100644 drivers/gpu/drm/i915/intel_ipts.h
drivers/gpu/drm/i915_legacy/Makefile | 3 +
drivers/gpu/drm/i915_legacy/i915_debugfs.c | 63 +-
drivers/gpu/drm/i915_legacy/i915_drv.c | 7 +
drivers/gpu/drm/i915_legacy/i915_drv.h | 3 +
.../gpu/drm/i915_legacy/i915_gem_context.c | 12 +
drivers/gpu/drm/i915_legacy/i915_irq.c | 7 +-
drivers/gpu/drm/i915_legacy/i915_params.c | 5 +-
drivers/gpu/drm/i915_legacy/i915_params.h | 5 +-
drivers/gpu/drm/i915_legacy/intel_guc.h | 1 +
.../drm/i915_legacy/intel_guc_submission.c | 89 +-
.../drm/i915_legacy/intel_guc_submission.h | 4 +
drivers/gpu/drm/i915_legacy/intel_ipts.c | 651 ++++++++++
drivers/gpu/drm/i915_legacy/intel_ipts.h | 34 +
drivers/gpu/drm/i915_legacy/intel_lrc.c | 15 +-
drivers/gpu/drm/i915_legacy/intel_lrc.h | 6 +
drivers/gpu/drm/i915_legacy/intel_panel.c | 7 +
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/ipts/Kconfig | 11 +
drivers/misc/ipts/Makefile | 17 +
drivers/misc/ipts/companion/Kconfig | 9 +
drivers/misc/ipts/companion/Makefile | 1 +
drivers/misc/ipts/companion/ipts-surface.c | 82 ++
drivers/misc/ipts/ipts-binary-spec.h | 118 ++
drivers/misc/ipts/ipts-dbgfs.c | 291 +++++
drivers/misc/ipts/ipts-fw.c | 113 ++
drivers/misc/ipts/ipts-fw.h | 12 +
drivers/misc/ipts/ipts-gfx.c | 185 +++
drivers/misc/ipts/ipts-gfx.h | 24 +
drivers/misc/ipts/ipts-hid.c | 497 ++++++++
drivers/misc/ipts/ipts-hid.h | 34 +
drivers/misc/ipts/ipts-kernel.c | 1042 +++++++++++++++++
drivers/misc/ipts/ipts-kernel.h | 23 +
drivers/misc/ipts/ipts-mei-msgs.h | 585 +++++++++
drivers/misc/ipts/ipts-mei.c | 250 ++++
drivers/misc/ipts/ipts-msg-handler.c | 426 +++++++
drivers/misc/ipts/ipts-msg-handler.h | 32 +
drivers/misc/ipts/ipts-params.c | 21 +
drivers/misc/ipts/ipts-params.h | 14 +
drivers/misc/ipts/ipts-resource.c | 277 +++++
drivers/misc/ipts/ipts-resource.h | 30 +
drivers/misc/ipts/ipts-sensor-regs.h | 700 +++++++++++
drivers/misc/ipts/ipts-state.h | 29 +
drivers/misc/ipts/ipts.h | 200 ++++
drivers/misc/mei/hw-me-regs.h | 1 +
drivers/misc/mei/pci-me.c | 1 +
include/linux/intel_ipts_fw.h | 14 +
include/linux/intel_ipts_if.h | 76 ++
48 files changed, 6008 insertions(+), 21 deletions(-)
create mode 100644 drivers/gpu/drm/i915_legacy/intel_ipts.c
create mode 100644 drivers/gpu/drm/i915_legacy/intel_ipts.h
create mode 100644 drivers/misc/ipts/Kconfig
create mode 100644 drivers/misc/ipts/Makefile
create mode 100644 drivers/misc/ipts/companion/Kconfig
@ -86,10 +84,10 @@ Subject: [PATCH 05/12] ipts
create mode 100644 include/linux/intel_ipts_fw.h
create mode 100644 include/linux/intel_ipts_if.h
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
diff --git a/drivers/gpu/drm/i915_legacy/Makefile b/drivers/gpu/drm/i915_legacy/Makefile
index fbcb0904f4a8..1a273956b41c 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
--- a/drivers/gpu/drm/i915_legacy/Makefile
+++ b/drivers/gpu/drm/i915_legacy/Makefile
@@ -170,6 +170,9 @@ i915-y += dvo_ch7017.o \
vlv_dsi_pll.o \
intel_vdsc.o
@ -100,10 +98,10 @@ index fbcb0904f4a8..1a273956b41c 100644
# Post-mortem debug and GPU hang state capture
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
i915-$(CONFIG_DRM_I915_SELFTEST) += \
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
diff --git a/drivers/gpu/drm/i915_legacy/i915_debugfs.c b/drivers/gpu/drm/i915_legacy/i915_debugfs.c
index 5823ffb17821..2ffad9712041 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
--- a/drivers/gpu/drm/i915_legacy/i915_debugfs.c
+++ b/drivers/gpu/drm/i915_legacy/i915_debugfs.c
@@ -41,6 +41,7 @@
#include "intel_hdmi.h"
#include "intel_pm.h"
@ -188,10 +186,10 @@ index 5823ffb17821..2ffad9712041 100644
};
int i915_debugfs_register(struct drm_i915_private *dev_priv)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
diff --git a/drivers/gpu/drm/i915_legacy/i915_drv.c b/drivers/gpu/drm/i915_legacy/i915_drv.c
index d485d49c473b..adb7af18dc2b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
--- a/drivers/gpu/drm/i915_legacy/i915_drv.c
+++ b/drivers/gpu/drm/i915_legacy/i915_drv.c
@@ -63,6 +63,7 @@
#include "intel_sprite.h"
#include "intel_uc.h"
@ -220,10 +218,10 @@ index d485d49c473b..adb7af18dc2b 100644
i915_driver_unregister(dev_priv);
/*
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
diff --git a/drivers/gpu/drm/i915_legacy/i915_drv.h b/drivers/gpu/drm/i915_legacy/i915_drv.h
index 066fd2a12851..2a872d8725b5 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
--- a/drivers/gpu/drm/i915_legacy/i915_drv.h
+++ b/drivers/gpu/drm/i915_legacy/i915_drv.h
@@ -3184,6 +3184,9 @@ void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
struct sg_table *pages);
@ -234,11 +232,11 @@ index 066fd2a12851..2a872d8725b5 100644
static inline struct i915_gem_context *
__i915_gem_context_lookup_rcu(struct drm_i915_file_private *file_priv, u32 id)
{
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index dd728b26b5aa..ae3209b79b25 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -565,6 +565,18 @@ static bool needs_preempt_context(struct drm_i915_private *i915)
diff --git a/drivers/gpu/drm/i915_legacy/i915_gem_context.c b/drivers/gpu/drm/i915_legacy/i915_gem_context.c
index fb5e2784d3c7..41f569c649bd 100644
--- a/drivers/gpu/drm/i915_legacy/i915_gem_context.c
+++ b/drivers/gpu/drm/i915_legacy/i915_gem_context.c
@@ -562,6 +562,18 @@ static bool needs_preempt_context(struct drm_i915_private *i915)
return HAS_EXECLISTS(i915);
}
@ -257,10 +255,10 @@ index dd728b26b5aa..ae3209b79b25 100644
int i915_gem_contexts_init(struct drm_i915_private *dev_priv)
{
struct i915_gem_context *ctx;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
diff --git a/drivers/gpu/drm/i915_legacy/i915_irq.c b/drivers/gpu/drm/i915_legacy/i915_irq.c
index b92cfd69134b..78fcd4b78480 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
--- a/drivers/gpu/drm/i915_legacy/i915_irq.c
+++ b/drivers/gpu/drm/i915_legacy/i915_irq.c
@@ -41,6 +41,7 @@
#include "i915_trace.h"
#include "intel_drv.h"
@ -289,10 +287,10 @@ index b92cfd69134b..78fcd4b78480 100644
GT_CONTEXT_SWITCH_INTERRUPT << GEN8_RCS_IRQ_SHIFT |
GT_RENDER_USER_INTERRUPT << GEN8_BCS_IRQ_SHIFT |
GT_CONTEXT_SWITCH_INTERRUPT << GEN8_BCS_IRQ_SHIFT),
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
diff --git a/drivers/gpu/drm/i915_legacy/i915_params.c b/drivers/gpu/drm/i915_legacy/i915_params.c
index b5be0abbba35..831f2bcae687 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
--- a/drivers/gpu/drm/i915_legacy/i915_params.c
+++ b/drivers/gpu/drm/i915_legacy/i915_params.c
@@ -143,7 +143,10 @@ i915_param_named_unsafe(edp_vswing, int, 0400,
i915_param_named_unsafe(enable_guc, int, 0400,
"Enable GuC load for GuC submission and/or HuC load. "
@ -305,10 +303,10 @@ index b5be0abbba35..831f2bcae687 100644
i915_param_named(guc_log_level, int, 0400,
"GuC firmware logging level. Requires GuC to be loaded. "
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
diff --git a/drivers/gpu/drm/i915_legacy/i915_params.h b/drivers/gpu/drm/i915_legacy/i915_params.h
index 3f14e9881a0d..e314a2414041 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
--- a/drivers/gpu/drm/i915_legacy/i915_params.h
+++ b/drivers/gpu/drm/i915_legacy/i915_params.h
@@ -54,7 +54,7 @@ struct drm_printer;
param(int, disable_power_well, -1) \
param(int, enable_ips, 1) \
@ -328,25 +326,10 @@ index 3f14e9881a0d..e314a2414041 100644
#define MEMBER(T, member, ...) T member;
struct i915_params {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 560274d1c50b..e305a35de9c2 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2899,8 +2899,8 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
return;
if (mode != DRM_MODE_DPMS_ON) {
- if (downstream_hpd_needs_d0(intel_dp))
- return;
+ //if (downstream_hpd_needs_d0(intel_dp))
+ // return;
ret = drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER,
DP_SET_POWER_D3);
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
diff --git a/drivers/gpu/drm/i915_legacy/intel_guc.h b/drivers/gpu/drm/i915_legacy/intel_guc.h
index 2c59ff8d9f39..d7f91693972f 100644
--- a/drivers/gpu/drm/i915/intel_guc.h
+++ b/drivers/gpu/drm/i915/intel_guc.h
--- a/drivers/gpu/drm/i915_legacy/intel_guc.h
+++ b/drivers/gpu/drm/i915_legacy/intel_guc.h
@@ -67,6 +67,7 @@ struct intel_guc {
struct intel_guc_client *execbuf_client;
@ -355,10 +338,10 @@ index 2c59ff8d9f39..d7f91693972f 100644
struct guc_preempt_work preempt_work[I915_NUM_ENGINES];
struct workqueue_struct *preempt_wq;
diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
diff --git a/drivers/gpu/drm/i915_legacy/intel_guc_submission.c b/drivers/gpu/drm/i915_legacy/intel_guc_submission.c
index 46cd0e70aecb..e84c805f7340 100644
--- a/drivers/gpu/drm/i915/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/intel_guc_submission.c
--- a/drivers/gpu/drm/i915_legacy/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915_legacy/intel_guc_submission.c
@@ -93,12 +93,17 @@ static inline struct i915_priolist *to_priolist(struct rb_node *rb)
static inline bool is_high_priority(struct intel_guc_client *client)
@ -487,10 +470,10 @@ index 46cd0e70aecb..e84c805f7340 100644
#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "selftests/intel_guc.c"
#endif
diff --git a/drivers/gpu/drm/i915/intel_guc_submission.h b/drivers/gpu/drm/i915/intel_guc_submission.h
diff --git a/drivers/gpu/drm/i915_legacy/intel_guc_submission.h b/drivers/gpu/drm/i915_legacy/intel_guc_submission.h
index aa5e6749c925..c9e5c14e7f67 100644
--- a/drivers/gpu/drm/i915/intel_guc_submission.h
+++ b/drivers/gpu/drm/i915/intel_guc_submission.h
--- a/drivers/gpu/drm/i915_legacy/intel_guc_submission.h
+++ b/drivers/gpu/drm/i915_legacy/intel_guc_submission.h
@@ -84,5 +84,9 @@ void intel_guc_submission_disable(struct intel_guc *guc);
void intel_guc_submission_fini(struct intel_guc *guc);
int intel_guc_preempt_work_create(struct intel_guc *guc);
@ -501,11 +484,11 @@ index aa5e6749c925..c9e5c14e7f67 100644
+void i915_guc_ipts_reacquire_doorbell(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_ipts.c b/drivers/gpu/drm/i915/intel_ipts.c
diff --git a/drivers/gpu/drm/i915_legacy/intel_ipts.c b/drivers/gpu/drm/i915_legacy/intel_ipts.c
new file mode 100644
index 000000000000..3d3c353986f7
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_ipts.c
+++ b/drivers/gpu/drm/i915_legacy/intel_ipts.c
@@ -0,0 +1,651 @@
+/*
+ * Copyright 2016 Intel Corporation
@ -1158,11 +1141,11 @@ index 000000000000..3d3c353986f7
+ cancel_delayed_work(&intel_ipts.reacquire_db_work);
+ }
+}
diff --git a/drivers/gpu/drm/i915/intel_ipts.h b/drivers/gpu/drm/i915/intel_ipts.h
diff --git a/drivers/gpu/drm/i915_legacy/intel_ipts.h b/drivers/gpu/drm/i915_legacy/intel_ipts.h
new file mode 100644
index 000000000000..a6965d102417
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_ipts.h
+++ b/drivers/gpu/drm/i915_legacy/intel_ipts.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2016 Intel Corporation
@ -1198,10 +1181,10 @@ index 000000000000..a6965d102417
+int intel_ipts_notify_complete(void);
+
+#endif //_INTEL_IPTS_H_
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
diff --git a/drivers/gpu/drm/i915_legacy/intel_lrc.c b/drivers/gpu/drm/i915_legacy/intel_lrc.c
index 11e5a86610bf..4adf38cad6da 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
--- a/drivers/gpu/drm/i915_legacy/intel_lrc.c
+++ b/drivers/gpu/drm/i915_legacy/intel_lrc.c
@@ -166,8 +166,8 @@
#define ACTIVE_PRIORITY (I915_PRIORITY_NOSEMAPHORE)
@ -1252,10 +1235,10 @@ index 11e5a86610bf..4adf38cad6da 100644
{
struct drm_i915_gem_object *ctx_obj;
struct i915_vma *vma;
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
diff --git a/drivers/gpu/drm/i915_legacy/intel_lrc.h b/drivers/gpu/drm/i915_legacy/intel_lrc.h
index 84aa230ea27b..0e8008eb0f3a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.h
+++ b/drivers/gpu/drm/i915/intel_lrc.h
--- a/drivers/gpu/drm/i915_legacy/intel_lrc.h
+++ b/drivers/gpu/drm/i915_legacy/intel_lrc.h
@@ -115,6 +115,12 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine,
const char *prefix),
unsigned int max);
@ -1269,10 +1252,10 @@ index 84aa230ea27b..0e8008eb0f3a 100644
u32 gen8_make_rpcs(struct drm_i915_private *i915, struct intel_sseu *ctx_sseu);
#endif /* _INTEL_LRC_H_ */
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
diff --git a/drivers/gpu/drm/i915_legacy/intel_panel.c b/drivers/gpu/drm/i915_legacy/intel_panel.c
index 4ab4ce6569e7..2d3c523ba5c7 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
--- a/drivers/gpu/drm/i915_legacy/intel_panel.c
+++ b/drivers/gpu/drm/i915_legacy/intel_panel.c
@@ -37,6 +37,7 @@
#include "intel_connector.h"
#include "intel_drv.h"
@ -1301,87 +1284,11 @@ index 4ab4ce6569e7..2d3c523ba5c7 100644
}
static void pch_enable_backlight(const struct intel_crtc_state *crtc_state,
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index b603c14d043b..03448d3a29f2 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -169,6 +169,7 @@ struct mt_device {
static void mt_post_parse_default_settings(struct mt_device *td,
struct mt_application *app);
static void mt_post_parse(struct mt_device *td, struct mt_application *app);
+static int cc_seen = 0;
/* classes of device behavior */
#define MT_CLS_DEFAULT 0x0001
@@ -795,8 +796,11 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
app->scantime_logical_max = field->logical_maximum;
return 1;
case HID_DG_CONTACTCOUNT:
- app->have_contact_count = true;
- app->raw_cc = &field->value[usage->usage_index];
+ if(cc_seen != 1) {
+ app->have_contact_count = true;
+ app->raw_cc = &field->value[usage->usage_index];
+ cc_seen++;
+ }
return 1;
case HID_DG_AZIMUTH:
/*
@@ -1286,9 +1290,11 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
field->application != HID_DG_TOUCHSCREEN &&
field->application != HID_DG_PEN &&
field->application != HID_DG_TOUCHPAD &&
+ field->application != HID_GD_MOUSE &&
field->application != HID_GD_KEYBOARD &&
field->application != HID_GD_SYSTEM_CONTROL &&
field->application != HID_CP_CONSUMER_CONTROL &&
+ field->logical != HID_DG_TOUCHSCREEN &&
field->application != HID_GD_WIRELESS_RADIO_CTLS &&
field->application != HID_GD_SYSTEM_MULTIAXIS &&
!(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1340,6 +1346,14 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct mt_device *td = hid_get_drvdata(hdev);
struct mt_report_data *rdata;
+ if (field->application == HID_DG_TOUCHSCREEN ||
+ field->application == HID_DG_TOUCHPAD) {
+ if (usage->type == EV_KEY || usage->type == EV_ABS)
+ set_bit(usage->type, hi->input->evbit);
+
+ return -1;
+ }
+
rdata = mt_find_report_data(td, field->report);
if (rdata && rdata->is_mt_collection) {
/* We own these mappings, tell hid-input to ignore them */
@@ -1551,12 +1565,13 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
/* already handled by hid core */
break;
case HID_DG_TOUCHSCREEN:
- /* we do not set suffix = "Touchscreen" */
+ suffix = "Touchscreen";
hi->input->name = hdev->name;
break;
case HID_DG_STYLUS:
/* force BTN_STYLUS to allow tablet matching in udev */
__set_bit(BTN_STYLUS, hi->input->keybit);
+ __set_bit(INPUT_PROP_DIRECT, hi->input->propbit);
break;
case HID_VD_ASUS_CUSTOM_MEDIA_KEYS:
suffix = "Custom Media Keys";
@@ -1672,6 +1687,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
td->hdev = hdev;
td->mtclass = *mtclass;
td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN;
+ cc_seen = 0;
hid_set_drvdata(hdev, td);
INIT_LIST_HEAD(&td->applications);
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 85fc77148d19..b697f05eaf31 100644
index 16900357afc2..b44910a839e8 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -500,6 +500,7 @@ source "drivers/misc/ti-st/Kconfig"
@@ -495,6 +495,7 @@ source "drivers/misc/ti-st/Kconfig"
source "drivers/misc/lis3lv02d/Kconfig"
source "drivers/misc/altera-stapl/Kconfig"
source "drivers/misc/mei/Kconfig"
@ -1390,11 +1297,11 @@ index 85fc77148d19..b697f05eaf31 100644
source "drivers/misc/mic/Kconfig"
source "drivers/misc/genwqe/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index b9affcdaa3d6..e681e345a9ed 100644
index abd8ae249746..40c8683b4ce6 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -45,6 +45,7 @@ obj-y += lis3lv02d/
obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o
@@ -44,6 +44,7 @@ obj-y += ti-st/
obj-y += lis3lv02d/
obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/
obj-$(CONFIG_INTEL_MEI) += mei/
+obj-$(CONFIG_INTEL_IPTS) += ipts/
@ -1677,10 +1584,10 @@ index 000000000000..87d4bc4133c4
+#endif /* _IPTS_BINARY_SPEC_H */
diff --git a/drivers/misc/ipts/ipts-dbgfs.c b/drivers/misc/ipts/ipts-dbgfs.c
new file mode 100644
index 000000000000..7581b21f81e0
index 000000000000..ffa42a33399d
--- /dev/null
+++ b/drivers/misc/ipts/ipts-dbgfs.c
@@ -0,0 +1,364 @@
@@ -0,0 +1,291 @@
+/*
+ * Intel Precise Touch & Stylus device driver
+ * Copyright (c) 2016, Intel Corporation.
@ -1705,76 +1612,11 @@ index 000000000000..7581b21f81e0
+#include "ipts-state.h"
+#include "../mei/mei_dev.h"
+
+const char sensor_mode_fmt[] = "sensor mode : %01d\n";
+const char ipts_status_fmt[] = "sensor mode : %01d\nipts state : %01d\n";
+const char ipts_status_fmt[] = "ipts state : %01d\n";
+const char ipts_debug_fmt[] = ">> tdt : fw status : %s\n"
+ ">> == DB s:%x, c:%x ==\n"
+ ">> == WQ h:%u, t:%u ==\n";
+
+static ssize_t ipts_dbgfs_mode_read(struct file *fp, char __user *ubuf,
+ size_t cnt, loff_t *ppos)
+{
+ ipts_info_t *ipts = fp->private_data;
+ char mode[80];
+ int len = 0;
+
+ if (cnt < sizeof(sensor_mode_fmt) - 3)
+ return -EINVAL;
+
+ len = scnprintf(mode, 80, sensor_mode_fmt, ipts->sensor_mode);
+ if (len < 0)
+ return -EIO;
+
+ return simple_read_from_buffer(ubuf, cnt, ppos, mode, len);
+}
+
+static ssize_t ipts_dbgfs_mode_write(struct file *fp, const char __user *ubuf,
+ size_t cnt, loff_t *ppos)
+{
+ ipts_info_t *ipts = fp->private_data;
+ ipts_state_t state;
+ int sensor_mode, len;
+ char mode[3];
+
+ if (cnt == 0 || cnt > 3)
+ return -EINVAL;
+
+ state = ipts_get_state(ipts);
+ if (state != IPTS_STA_RAW_DATA_STARTED && state != IPTS_STA_HID_STARTED) {
+ return -EIO;
+ }
+
+ len = cnt;
+ if (copy_from_user(mode, ubuf, len))
+ return -EFAULT;
+
+ while(len > 0 && (isspace(mode[len-1]) || mode[len-1] == '\n'))
+ len--;
+ mode[len] = '\0';
+
+ if (sscanf(mode, "%d", &sensor_mode) != 1)
+ return -EINVAL;
+
+ if (sensor_mode != TOUCH_SENSOR_MODE_RAW_DATA &&
+ sensor_mode != TOUCH_SENSOR_MODE_HID) {
+ return -EINVAL;
+ }
+
+ if (sensor_mode == ipts->sensor_mode)
+ return 0;
+
+ ipts_switch_sensor_mode(ipts, sensor_mode);
+
+ return cnt;
+}
+
+static const struct file_operations ipts_mode_dbgfs_fops = {
+ .open = simple_open,
+ .read = ipts_dbgfs_mode_read,
+ .write = ipts_dbgfs_mode_write,
+ .llseek = generic_file_llseek,
+};
+
+static ssize_t ipts_dbgfs_status_read(struct file *fp, char __user *ubuf,
+ size_t cnt, loff_t *ppos)
+{
@ -1785,8 +1627,7 @@ index 000000000000..7581b21f81e0
+ if (cnt < sizeof(ipts_status_fmt) - 3)
+ return -EINVAL;
+
+ len = scnprintf(status, 256, ipts_status_fmt, ipts->sensor_mode,
+ ipts->state);
+ len = scnprintf(status, 256, ipts_status_fmt, ipts->state);
+ if (len < 0)
+ return -EIO;
+
@ -1982,13 +1823,6 @@ index 000000000000..7581b21f81e0
+ if (!dir)
+ return -ENOMEM;
+
+ f = debugfs_create_file("mode", S_IRUSR | S_IWUSR, dir,
+ ipts, &ipts_mode_dbgfs_fops);
+ if (!f) {
+ ipts_err(ipts, "debugfs mode creation failed\n");
+ goto err;
+ }
+
+ f = debugfs_create_file("status", S_IRUSR, dir,
+ ipts, &ipts_status_dbgfs_fops);
+ if (!f) {
@ -4616,10 +4450,10 @@ index 000000000000..8ca146800a47
+#endif // _IPTS_MEI_MSGS_H_
diff --git a/drivers/misc/ipts/ipts-mei.c b/drivers/misc/ipts/ipts-mei.c
new file mode 100644
index 000000000000..6fbe257bc7cc
index 000000000000..7773b878318e
--- /dev/null
+++ b/drivers/misc/ipts/ipts-mei.c
@@ -0,0 +1,290 @@
@@ -0,0 +1,250 @@
+/*
+ * MEI client driver for Intel Precise Touch and Stylus
+ *
@ -4661,43 +4495,6 @@ index 000000000000..6fbe257bc7cc
+ {}
+};
+
+static ssize_t sensor_mode_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ipts_info_t *ipts;
+ ipts = dev_get_drvdata(dev);
+
+ return sprintf(buf, "%d\n", ipts->sensor_mode);
+}
+
+//TODO: Verify the function implementation
+static ssize_t sensor_mode_store(struct device *dev,
+ struct device_attribute *attr, const char *buf,
+ size_t count)
+{
+ int ret;
+ long val;
+ ipts_info_t *ipts;
+
+ ipts = dev_get_drvdata(dev);
+ ret = kstrtol(buf, 10, &val);
+ if (ret)
+ return ret;
+
+ ipts_dbg(ipts, "try sensor mode = %ld\n", val);
+
+ switch (val) {
+ case TOUCH_SENSOR_MODE_HID:
+ break;
+ case TOUCH_SENSOR_MODE_RAW_DATA:
+ break;
+ default:
+ ipts_err(ipts, "sensor mode %ld is not supported\n", val);
+ }
+
+ return count;
+}
+
+static ssize_t device_info_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
@ -4711,12 +4508,9 @@ index 000000000000..6fbe257bc7cc
+ ipts->device_info.vendor_id, ipts->device_info.device_id,
+ ipts->device_info.hw_rev, ipts->device_info.fw_rev);
+}
+
+static DEVICE_ATTR_RW(sensor_mode);
+static DEVICE_ATTR_RO(device_info);
+
+static struct attribute *ipts_attrs[] = {
+ &dev_attr_sensor_mode.attr,
+ &dev_attr_device_info.attr,
+ NULL
+};
@ -4912,10 +4706,10 @@ index 000000000000..6fbe257bc7cc
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/ipts/ipts-msg-handler.c b/drivers/misc/ipts/ipts-msg-handler.c
new file mode 100644
index 000000000000..db5356a1c84e
index 000000000000..6ca74dd7037b
--- /dev/null
+++ b/drivers/misc/ipts/ipts-msg-handler.c
@@ -0,0 +1,437 @@
@@ -0,0 +1,426 @@
+#include <linux/mei_cl_bus.h>
+
+#include "ipts.h"
@ -5107,17 +4901,6 @@ index 000000000000..db5356a1c84e
+ return ret;
+}
+
+int ipts_switch_sensor_mode(ipts_info_t *ipts, int new_sensor_mode)
+{
+ int ret = 0;
+
+ ipts->new_sensor_mode = new_sensor_mode;
+ ipts->switch_sensor_mode = true;
+ ret = ipts_send_sensor_quiesce_io_cmd(ipts);
+
+ return ret;
+}
+
+#define rsp_failed(ipts, cmd, status) ipts_err(ipts, \
+ "0x%08x failed status = %d\n", cmd, status);
+
@ -5355,10 +5138,10 @@ index 000000000000..db5356a1c84e
+}
diff --git a/drivers/misc/ipts/ipts-msg-handler.h b/drivers/misc/ipts/ipts-msg-handler.h
new file mode 100644
index 000000000000..f37d9ad9af8c
index 000000000000..4ee8301dbb81
--- /dev/null
+++ b/drivers/misc/ipts/ipts-msg-handler.h
@@ -0,0 +1,33 @@
@@ -0,0 +1,32 @@
+/*
+ *
+ * Intel Precise Touch & Stylus ME message handler
@ -5381,7 +5164,6 @@ index 000000000000..f37d9ad9af8c
+int ipts_handle_cmd(ipts_info_t *ipts, u32 cmd, void *data, int data_size);
+int ipts_start(ipts_info_t *ipts);
+void ipts_stop(ipts_info_t *ipts);
+int ipts_switch_sensor_mode(ipts_info_t *ipts, int new_sensor_mode);
+int ipts_handle_resp(ipts_info_t *ipts, touch_sensor_msg_m2h_t *m2h_msg,
+ u32 msg_len);
+int ipts_handle_processed_data(ipts_info_t *ipts);
@ -6832,5 +6614,5 @@ index 000000000000..bad44fb4f233
+
+#endif // INTEL_IPTS_IF_H
--
2.21.0
2.23.0