diff --git a/patches/5.11/0001-surface3-oemb.patch b/patches/5.11/0001-surface3-oemb.patch index 02addb542..5185c72d7 100644 --- a/patches/5.11/0001-surface3-oemb.patch +++ b/patches/5.11/0001-surface3-oemb.patch @@ -1,4 +1,4 @@ -From be52a2ec3db3f16d7408b40fdaa17b8d066725b3 Mon Sep 17 00:00:00 2001 +From e9ccabbc550117695c61332c352e8d7b56753c0c Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 18 Oct 2020 16:42:44 +0900 Subject: [PATCH] (surface3-oemb) add DMI matches for Surface 3 with broken DMI diff --git a/patches/5.11/0002-wifi.patch b/patches/5.11/0002-wifi.patch index f25c272b7..73e8aa3d7 100644 --- a/patches/5.11/0002-wifi.patch +++ b/patches/5.11/0002-wifi.patch @@ -1,4 +1,4 @@ -From b639c7ba32929ad309783a293029f831e0e4f1e2 Mon Sep 17 00:00:00 2001 +From ce8e4eee82fee52fb1531ba7c1c6f4a204605baf Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Mon, 28 Sep 2020 17:46:49 +0900 Subject: [PATCH] mwifiex: pcie: add DMI-based quirk impl for Surface devices @@ -206,7 +206,7 @@ index 000000000000..5326ae7e5671 -- 2.30.1 -From e996d2b5ad3ee4b2e6bcbb9483be5f0a67c4765f Mon Sep 17 00:00:00 2001 +From c9806809f41fcc75c4d249558e04433ee78edc30 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Tue, 29 Sep 2020 17:25:22 +0900 Subject: [PATCH] mwifiex: pcie: add reset_d3cold quirk for Surface gen4+ @@ -407,7 +407,7 @@ index 5326ae7e5671..8b9dcb5070d8 100644 -- 2.30.1 -From 85d61cb36f4e9fb4891b5f9cfe099bb9075c742f Mon Sep 17 00:00:00 2001 +From 478260a1e225edee0564f910fd50092355d8cdd3 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Tue, 29 Sep 2020 17:32:22 +0900 Subject: [PATCH] mwifiex: pcie: add reset_wsid quirk for Surface 3 @@ -586,7 +586,7 @@ index 8b9dcb5070d8..3ef7440418e3 100644 -- 2.30.1 -From 5aacb771524eb91e98b7d36107936a82f7060103 Mon Sep 17 00:00:00 2001 +From 6f0697a2d9cf1b8513471d8f8eda3befd0235793 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Wed, 30 Sep 2020 18:08:24 +0900 Subject: [PATCH] mwifiex: pcie: (OEMB) add quirk for Surface 3 with broken DMI @@ -648,7 +648,7 @@ index f0a6fa0a7ae5..34dcd84f02a6 100644 -- 2.30.1 -From e929da72221262907056171eed43956850d4490c Mon Sep 17 00:00:00 2001 +From 93addb19794e6eb4cfcda6602038b595f0e46242 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Thu, 24 Sep 2020 01:56:34 +0900 Subject: [PATCH] mwifiex: pcie: use shutdown_sw()/reinit_sw() on @@ -767,7 +767,7 @@ index bf9ef4ede3f1..30a602a18f9d 100644 -- 2.30.1 -From 7a3800eb38818462b06617629d5d797f3be481c7 Mon Sep 17 00:00:00 2001 +From 619adb8c8d0277c326a8f70441a4818b3077ca4b Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Mon, 24 Aug 2020 17:11:35 +0900 Subject: [PATCH] mwifiex: pcie: add enable_device_dump module parameter @@ -816,7 +816,7 @@ index 30a602a18f9d..113636355dec 100644 -- 2.30.1 -From 90a16cfa6779902faa82b5b458cd03bda6112c98 Mon Sep 17 00:00:00 2001 +From 3a8c34e479f994373b4fd38c68962deb76aee6c7 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 4 Oct 2020 00:11:49 +0900 Subject: [PATCH] mwifiex: pcie: disable bridge_d3 for Surface gen4+ @@ -971,7 +971,7 @@ index 3ef7440418e3..a95ebac06e13 100644 -- 2.30.1 -From 1b8dd96c2bd602eb6874fe3cff321a382fbd5533 Mon Sep 17 00:00:00 2001 +From 091be09b019eda77ca544bb13a5481ebc6a7c9a1 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 4 Oct 2020 00:25:48 +0900 Subject: [PATCH] mwifiex: add allow_ps_mode module parameter @@ -1033,7 +1033,7 @@ index a6b9dc6700b1..943bc1e8ceae 100644 -- 2.30.1 -From ef208c596398830c5f7aaa232de061fe2b538dfd Mon Sep 17 00:00:00 2001 +From 812dbb8f06dd6c9f9923e2fef13d7ff93dbeb7c3 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 4 Oct 2020 00:38:48 +0900 Subject: [PATCH] mwifiex: print message when changing ps_mode @@ -1068,7 +1068,7 @@ index 943bc1e8ceae..a2eb8df8d385 100644 -- 2.30.1 -From 0e1fc8f028817f9682711d21be5c703a7ea6fddc Mon Sep 17 00:00:00 2001 +From e6fc5f004273fe3f5dc71e47d839e24c67ff0187 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 4 Oct 2020 00:59:37 +0900 Subject: [PATCH] mwifiex: disable ps_mode explicitly by default instead diff --git a/patches/5.11/0003-ipts.patch b/patches/5.11/0003-ipts.patch index 3531ea13a..bd7fbe771 100644 --- a/patches/5.11/0003-ipts.patch +++ b/patches/5.11/0003-ipts.patch @@ -1,4 +1,4 @@ -From 886d61e91ee345da44d3c0a4ad655fe4fb6d8519 Mon Sep 17 00:00:00 2001 +From 59cd8351a53682899325c43daaff7c6a314f4ffb Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Thu, 30 Jul 2020 13:21:53 +0200 Subject: [PATCH] misc: mei: Add missing IPTS device IDs @@ -10,7 +10,7 @@ Patchset: ipts 2 files changed, 2 insertions(+) diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h -index 9cf8d8f60cfe..ca2d4faff6a2 100644 +index 14be76d4c2e6..6cfdbedd9b13 100644 --- a/drivers/misc/mei/hw-me-regs.h +++ b/drivers/misc/mei/hw-me-regs.h @@ -92,6 +92,7 @@ @@ -22,7 +22,7 @@ index 9cf8d8f60cfe..ca2d4faff6a2 100644 #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */ diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c -index 1de9ef7a272b..e12484840f88 100644 +index a7e179626b63..fdcc0eedc49f 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c @@ -96,6 +96,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { @@ -36,7 +36,36 @@ index 1de9ef7a272b..e12484840f88 100644 -- 2.30.1 -From 92d426c6bb955e76e632652e4603e4fb392f4465 Mon Sep 17 00:00:00 2001 +From fefc86d977d0ac1bf0992eca084325c5cc55742f Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Thu, 25 Feb 2021 09:37:47 +0100 +Subject: [PATCH] misc: mei: Remove client devices before shutting down bus + +Patchset: ipts +--- + drivers/misc/mei/init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c +index bcee77768b91..21ed765003e1 100644 +--- a/drivers/misc/mei/init.c ++++ b/drivers/misc/mei/init.c +@@ -302,10 +302,10 @@ void mei_stop(struct mei_device *dev) + { + dev_dbg(dev->dev, "stopping the device.\n"); + ++ mei_cl_bus_remove_devices(dev); + mutex_lock(&dev->device_lock); + mei_set_devstate(dev, MEI_DEV_POWER_DOWN); + mutex_unlock(&dev->device_lock); +- mei_cl_bus_remove_devices(dev); + + mei_cancel_work(dev); + +-- +2.30.1 + +From 5616edbf3d4709ea3a44e4126981a763d56984c1 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Thu, 6 Aug 2020 11:20:41 +0200 Subject: [PATCH] misc: Add support for Intel Precise Touch & Stylus @@ -50,18 +79,18 @@ Patchset: ipts drivers/misc/Makefile | 1 + drivers/misc/ipts/Kconfig | 17 ++ drivers/misc/ipts/Makefile | 12 ++ - drivers/misc/ipts/context.h | 47 ++++++ - drivers/misc/ipts/control.c | 76 +++++++++ - drivers/misc/ipts/control.h | 22 +++ - drivers/misc/ipts/mei.c | 118 ++++++++++++++ - drivers/misc/ipts/protocol.h | 284 ++++++++++++++++++++++++++++++++++ - drivers/misc/ipts/receiver.c | 188 ++++++++++++++++++++++ + drivers/misc/ipts/context.h | 47 +++++ + drivers/misc/ipts/control.c | 113 +++++++++++ + drivers/misc/ipts/control.h | 24 +++ + drivers/misc/ipts/mei.c | 127 +++++++++++++ + drivers/misc/ipts/protocol.h | 347 ++++++++++++++++++++++++++++++++++ + drivers/misc/ipts/receiver.c | 224 ++++++++++++++++++++++ drivers/misc/ipts/receiver.h | 16 ++ - drivers/misc/ipts/resources.c | 128 +++++++++++++++ + drivers/misc/ipts/resources.c | 128 +++++++++++++ drivers/misc/ipts/resources.h | 17 ++ - drivers/misc/ipts/uapi.c | 211 +++++++++++++++++++++++++ - drivers/misc/ipts/uapi.h | 47 ++++++ - 15 files changed, 1185 insertions(+) + drivers/misc/ipts/uapi.c | 208 ++++++++++++++++++++ + drivers/misc/ipts/uapi.h | 47 +++++ + 15 files changed, 1329 insertions(+) create mode 100644 drivers/misc/ipts/Kconfig create mode 100644 drivers/misc/ipts/Makefile create mode 100644 drivers/misc/ipts/context.h @@ -191,10 +220,10 @@ index 000000000000..f4b06a2d3f72 +#endif /* _IPTS_CONTEXT_H_ */ diff --git a/drivers/misc/ipts/control.c b/drivers/misc/ipts/control.c new file mode 100644 -index 000000000000..24d3d19a667a +index 000000000000..a1d1f97a13d7 --- /dev/null +++ b/drivers/misc/ipts/control.c -@@ -0,0 +1,76 @@ +@@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2016 Intel Corporation @@ -223,13 +252,47 @@ index 000000000000..24d3d19a667a + memcpy(&cmd.payload, payload, size); + + ret = mei_cldev_send(ipts->cldev, (u8 *)&cmd, sizeof(cmd.code) + size); -+ if (ret >= 0 || ret == -EINTR) ++ if (ret >= 0) + return 0; + -+ dev_err(ipts->dev, "Error while sending: 0x%X:%d\n", code, ret); ++ /* ++ * During shutdown the device might get pulled away from below our feet. ++ * Dont log an error in this case, because it will confuse people. ++ */ ++ if (ret != -ENODEV || ipts->status != IPTS_HOST_STATUS_STOPPING) ++ dev_err(ipts->dev, "Error while sending: 0x%X:%d\n", code, ret); ++ + return ret; +} + ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer) ++{ ++ struct ipts_feedback_cmd cmd; ++ ++ memset(&cmd, 0, sizeof(struct ipts_feedback_cmd)); ++ cmd.buffer = buffer; ++ ++ return ipts_control_send(ipts, IPTS_CMD_FEEDBACK, &cmd, ++ sizeof(struct ipts_feedback_cmd)); ++} ++ ++int ipts_control_set_feature(struct ipts_context *ipts, u8 report, u8 value) ++{ ++ struct ipts_feedback_buffer *feedback; ++ ++ memset(ipts->host2me.address, 0, ipts->device_info.feedback_size); ++ feedback = (struct ipts_feedback_buffer *)ipts->host2me.address; ++ ++ feedback->cmd_type = IPTS_FEEDBACK_CMD_TYPE_NONE; ++ feedback->data_type = IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES; ++ feedback->buffer = IPTS_HOST2ME_BUFFER; ++ feedback->size = 2; ++ feedback->payload[0] = report; ++ feedback->payload[1] = value; ++ ++ return ipts_control_send_feedback(ipts, IPTS_HOST2ME_BUFFER); ++} ++ +int ipts_control_start(struct ipts_context *ipts) +{ + if (ipts->status != IPTS_HOST_STATUS_STOPPED) @@ -245,6 +308,8 @@ index 000000000000..24d3d19a667a + +int ipts_control_stop(struct ipts_context *ipts) +{ ++ int ret; ++ + if (ipts->status == IPTS_HOST_STATUS_STOPPING) + return -EBUSY; + @@ -257,10 +322,11 @@ index 000000000000..24d3d19a667a + ipts_uapi_unlink(); + ipts_resources_free(ipts); + -+ if (!mei_cldev_enabled(ipts->cldev)) -+ return 0; ++ ret = ipts_control_send_feedback(ipts, 0); ++ if (ret == -ENODEV) ++ ipts->status = IPTS_HOST_STATUS_STOPPED; + -+ return ipts_control_send(ipts, IPTS_CMD_CLEAR_MEM_WINDOW, NULL, 0); ++ return ret; +} + +int ipts_control_restart(struct ipts_context *ipts) @@ -273,10 +339,10 @@ index 000000000000..24d3d19a667a +} diff --git a/drivers/misc/ipts/control.h b/drivers/misc/ipts/control.h new file mode 100644 -index 000000000000..4ee0ceb84749 +index 000000000000..2c44e9e0e99f --- /dev/null +++ b/drivers/misc/ipts/control.h -@@ -0,0 +1,22 @@ +@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2016 Intel Corporation @@ -294,6 +360,8 @@ index 000000000000..4ee0ceb84749 + +int ipts_control_send(struct ipts_context *ipts, u32 cmd, void *payload, + size_t size); ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer); ++int ipts_control_set_feature(struct ipts_context *ipts, u8 report, u8 value); +int ipts_control_start(struct ipts_context *ipts); +int ipts_control_restart(struct ipts_context *ipts); +int ipts_control_stop(struct ipts_context *ipts); @@ -301,10 +369,10 @@ index 000000000000..4ee0ceb84749 +#endif /* _IPTS_CONTROL_H_ */ diff --git a/drivers/misc/ipts/mei.c b/drivers/misc/ipts/mei.c new file mode 100644 -index 000000000000..2945809d5b46 +index 000000000000..b3805a91383d --- /dev/null +++ b/drivers/misc/ipts/mei.c -@@ -0,0 +1,118 @@ +@@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2016 Intel Corporation @@ -316,8 +384,8 @@ index 000000000000..2945809d5b46 +#include +#include +#include -+#include +#include ++#include +#include + +#include "context.h" @@ -372,10 +440,19 @@ index 000000000000..2945809d5b46 + +static int ipts_mei_remove(struct mei_cl_device *cldev) +{ ++ int i; + struct ipts_context *ipts = mei_cldev_get_drvdata(cldev); + -+ mei_cldev_disable(cldev); + ipts_control_stop(ipts); ++ ++ for (i = 0; i < 20; i++) { ++ if (ipts->status == IPTS_HOST_STATUS_STOPPED) ++ break; ++ ++ msleep(25); ++ } ++ ++ mei_cldev_disable(cldev); + kfree(ipts); + + return 0; @@ -425,10 +502,10 @@ index 000000000000..2945809d5b46 +module_exit(ipts_mei_exit); diff --git a/drivers/misc/ipts/protocol.h b/drivers/misc/ipts/protocol.h new file mode 100644 -index 000000000000..381068504d46 +index 000000000000..c3458904a94d --- /dev/null +++ b/drivers/misc/ipts/protocol.h -@@ -0,0 +1,284 @@ +@@ -0,0 +1,347 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2016 Intel Corporation @@ -572,6 +649,11 @@ index 000000000000..381068504d46 + */ +#define IPTS_BUFFERS 16 + ++/* ++ * The special buffer ID that is used for direct host2me feedback. ++ */ ++#define IPTS_HOST2ME_BUFFER IPTS_BUFFERS ++ +/** + * enum ipts_mode - Operation mode for IPTS hardware + * @IPTS_MODE_SINGLETOUCH: Fallback that supports only one finger and no stylus. @@ -649,6 +731,56 @@ index 000000000000..381068504d46 +} __packed; + +/** ++ * enum ipts_feedback_cmd_type - Commands that can be executed on the sensor through feedback. ++ */ ++enum ipts_feedback_cmd_type { ++ IPTS_FEEDBACK_CMD_TYPE_NONE = 0, ++ IPTS_FEEDBACK_CMD_TYPE_SOFT_RESET = 1, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_ARMED = 2, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SENSING = 3, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SLEEP = 4, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_DOZE = 5, ++ IPTS_FEEDBACK_CMD_TYPE_HARD_RESET = 6, ++}; ++ ++/** ++ * enum ipts_feedback_data_type - Describes the data that a feedback buffer contains. ++ * @IPTS_FEEDBACK_DATA_TYPE_VENDOR: The buffer contains vendor specific feedback. ++ * @IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES: The buffer contains a HID set features command. ++ * @IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES: The buffer contains a HID get features command. ++ * @IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT: The buffer contains a HID output report. ++ * @IPTS_FEEDBACK_DATA_TYPE_STORE_DATA: The buffer contains calibration data for the sensor. ++ */ ++enum ipts_feedback_data_type { ++ IPTS_FEEDBACK_DATA_TYPE_VENDOR = 0, ++ IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES = 1, ++ IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES = 2, ++ IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT = 3, ++ IPTS_FEEDBACK_DATA_TYPE_STORE_DATA = 4, ++}; ++ ++/** ++ * struct ipts_feedback_buffer - The contents of an IPTS feedback buffer. ++ * @cmd_type: A command that should be executed on the sensor. ++ * @size: The size of the payload to be written. ++ * @buffer: The ID of the buffer that contains this feedback data. ++ * @protocol: The protocol version of the EDS. ++ * @data_type: The type of payload that the buffer contains. ++ * @spi_offset: The offset at which to write the payload data. ++ * @payload: Payload for the feedback command, or 0 if no payload is sent. ++ */ ++struct ipts_feedback_buffer { ++ enum ipts_feedback_cmd_type cmd_type; ++ u32 size; ++ u32 buffer; ++ u32 protocol; ++ enum ipts_feedback_data_type data_type; ++ u32 spi_offset; ++ u8 reserved[40]; ++ u8 payload[]; ++} __packed; ++ ++/** + * enum ipts_reset_type - Possible ways of resetting the touch sensor + * @IPTS_RESET_TYPE_HARD: Perform hardware reset using GPIO pin. + * @IPTS_RESET_TYPE_SOFT: Perform software reset using SPI interface. @@ -701,6 +833,14 @@ index 000000000000..381068504d46 +} __packed; + +/** ++ * struct ipts_feedback_rsp - Payload for the FEEDBACK response. ++ * @buffer: The buffer that has received feedback. ++ */ ++struct ipts_feedback_rsp { ++ u32 buffer; ++} __packed; ++ ++/** + * struct ipts_response - A message sent from the ME to the host. + * @code: The message code describing the response. (see IPTS_RSP_*) + * @status: The status code returned by the command. @@ -715,10 +855,10 @@ index 000000000000..381068504d46 +#endif /* _IPTS_PROTOCOL_H_ */ diff --git a/drivers/misc/ipts/receiver.c b/drivers/misc/ipts/receiver.c new file mode 100644 -index 000000000000..916ba3ec211b +index 000000000000..23dca13c2139 --- /dev/null +++ b/drivers/misc/ipts/receiver.c -@@ -0,0 +1,188 @@ +@@ -0,0 +1,224 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2016 Intel Corporation @@ -728,6 +868,7 @@ index 000000000000..916ba3ec211b + */ + +#include ++#include +#include + +#include "context.h" @@ -735,6 +876,13 @@ index 000000000000..916ba3ec211b +#include "protocol.h" +#include "resources.h" + ++/* ++ * Temporary parameter to guard gen7 multitouch mode. ++ * Remove once gen7 has stable iptsd support. ++ */ ++static bool gen7mt; ++module_param(gen7mt, bool, 0644); ++ +static int ipts_receiver_handle_get_device_info(struct ipts_context *ipts, + struct ipts_response *rsp) +{ @@ -795,11 +943,36 @@ index 000000000000..916ba3ec211b + +static int ipts_receiver_handle_set_mem_window(struct ipts_context *ipts) +{ ++ int ret; ++ + dev_info(ipts->dev, "Device %04hX:%04hX ready\n", + ipts->device_info.vendor_id, ipts->device_info.device_id); + ipts->status = IPTS_HOST_STATUS_STARTED; + -+ return ipts_control_send(ipts, IPTS_CMD_READY_FOR_DATA, NULL, 0); ++ ret = ipts_control_send(ipts, IPTS_CMD_READY_FOR_DATA, NULL, 0); ++ if (ret) ++ return ret; ++ ++ if (!gen7mt) ++ return 0; ++ ++ return ipts_control_set_feature(ipts, 0x5, 0x1); ++} ++ ++static int ipts_receiver_handle_feedback(struct ipts_context *ipts, ++ struct ipts_response *rsp) ++{ ++ struct ipts_feedback_rsp feedback; ++ ++ if (ipts->status != IPTS_HOST_STATUS_STOPPING) ++ return 0; ++ ++ memcpy(&feedback, rsp->payload, sizeof(feedback)); ++ ++ if (feedback.buffer < IPTS_BUFFERS - 1) ++ return ipts_control_send_feedback(ipts, feedback.buffer + 1); ++ ++ return ipts_control_send(ipts, IPTS_CMD_CLEAR_MEM_WINDOW, NULL, 0); +} + +static int ipts_receiver_handle_clear_mem_window(struct ipts_context *ipts) @@ -873,6 +1046,9 @@ index 000000000000..916ba3ec211b + case IPTS_RSP_SET_MEM_WINDOW: + ret = ipts_receiver_handle_set_mem_window(ipts); + break; ++ case IPTS_RSP_FEEDBACK: ++ ret = ipts_receiver_handle_feedback(ipts, rsp); ++ break; + case IPTS_RSP_CLEAR_MEM_WINDOW: + ret = ipts_receiver_handle_clear_mem_window(ipts); + break; @@ -1088,10 +1264,10 @@ index 000000000000..fdac0eee9156 +#endif /* _IPTS_RESOURCES_H_ */ diff --git a/drivers/misc/ipts/uapi.c b/drivers/misc/ipts/uapi.c new file mode 100644 -index 000000000000..8107a027223f +index 000000000000..598f0710ad64 --- /dev/null +++ b/drivers/misc/ipts/uapi.c -@@ -0,0 +1,211 @@ +@@ -0,0 +1,208 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2016 Intel Corporation @@ -1101,11 +1277,11 @@ index 000000000000..8107a027223f + */ + +#include ++#include +#include +#include -+#include -+#include +#include ++#include + +#include "context.h" +#include "control.h" @@ -1190,17 +1366,14 @@ index 000000000000..8107a027223f + struct file *file) +{ + int ret; -+ struct ipts_feedback_cmd cmd; ++ u32 buffer; + + if (!ipts || ipts->status != IPTS_HOST_STATUS_STARTED) + return -ENODEV; + -+ memset(&cmd, 0, sizeof(struct ipts_feedback_cmd)); -+ cmd.buffer = MINOR(file->f_path.dentry->d_inode->i_rdev); -+ -+ ret = ipts_control_send(ipts, IPTS_CMD_FEEDBACK, &cmd, -+ sizeof(struct ipts_feedback_cmd)); ++ buffer = MINOR(file->f_path.dentry->d_inode->i_rdev); + ++ ret = ipts_control_send_feedback(ipts, buffer); + if (ret) + return -EFAULT; + diff --git a/patches/5.11/0004-surface-sam-over-hid.patch b/patches/5.11/0004-surface-sam-over-hid.patch index b0420a3de..9a409d557 100644 --- a/patches/5.11/0004-surface-sam-over-hid.patch +++ b/patches/5.11/0004-surface-sam-over-hid.patch @@ -1,4 +1,4 @@ -From e84ca436738d7fd8781f77e7bbcb813f602dce3c Mon Sep 17 00:00:00 2001 +From 4b5e30fbedddfa4eb0aa76d03c60e884968fe964 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 25 Jul 2020 17:19:53 +0200 Subject: [PATCH] i2c: acpi: Implement RawBytes read access @@ -110,7 +110,7 @@ index 37c510d9347a..aed579942436 100644 -- 2.30.1 -From 79a4b8747237071f0b4b2bda1d57fcfc730fd824 Mon Sep 17 00:00:00 2001 +From 57c502dbc48850cdbae683f2b703e54c3ac26467 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 13 Feb 2021 16:41:18 +0100 Subject: [PATCH] platform/surface: Add driver for Surface Book 1 dGPU switch diff --git a/patches/5.11/0005-surface-sam.patch b/patches/5.11/0005-surface-sam.patch index 5b00e4b85..b4c5dc1e0 100644 --- a/patches/5.11/0005-surface-sam.patch +++ b/patches/5.11/0005-surface-sam.patch @@ -1,4 +1,4 @@ -From e843aba556dfdcc3eb52a59da2581ba07c129264 Mon Sep 17 00:00:00 2001 +From d501d2140e2dc54a5d99988ba98dbfd6444f2bbe Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:51 +0100 Subject: [PATCH] platform/surface: Add Surface Aggregator subsystem @@ -9160,7 +9160,7 @@ index 000000000000..64276fbfa1d5 -- 2.30.1 -From c27a9fdec42a6256b5a108771c1ccccb4a022129 Mon Sep 17 00:00:00 2001 +From a5b7ae79f792640dc79474da5be422c6e4dd5477 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:52 +0100 Subject: [PATCH] platform/surface: aggregator: Add control packet allocation @@ -9322,7 +9322,7 @@ index 058f111292ca..e8757d03f279 100644 -- 2.30.1 -From dfa18cda7bcd165f010296f86b979d8184c7c424 Mon Sep 17 00:00:00 2001 +From 988a56392c1e49e18ddfd3e185b97d8b280cc4ab Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:53 +0100 Subject: [PATCH] platform/surface: aggregator: Add event item allocation @@ -9550,7 +9550,7 @@ index 60d312f71436..37593234fb31 100644 -- 2.30.1 -From 30c51ea3b67b30af16a7f79075ed72af3ed64449 Mon Sep 17 00:00:00 2001 +From dbc4ef3bb20b2219f42800683c52807790589050 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:54 +0100 Subject: [PATCH] platform/surface: aggregator: Add trace points @@ -10444,7 +10444,7 @@ index 000000000000..dcca8007d876 -- 2.30.1 -From c71a61eda0fe21590831ace0887ca6714aa9d551 Mon Sep 17 00:00:00 2001 +From 9a6408b60fe57adb7962cabeadc18e914e25815b Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:55 +0100 Subject: [PATCH] platform/surface: aggregator: Add error injection @@ -10953,7 +10953,7 @@ index dcca8007d876..eb332bb53ae4 100644 -- 2.30.1 -From 38a8ac1671564ba6cd91fdf7b226289da6e4b86a Mon Sep 17 00:00:00 2001 +From 0ed8048c061dc8066a03efcb18649d313595daaa Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:56 +0100 Subject: [PATCH] platform/surface: aggregator: Add dedicated bus and device @@ -12052,7 +12052,7 @@ index fb4827027536..d21d2871387b 100644 -- 2.30.1 -From cef2a8715a849b4416e2c3e8d0ef4a799a9f0c4b Mon Sep 17 00:00:00 2001 +From 942a3345fa7c106a7c21652d613c011a2bee8158 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:57 +0100 Subject: [PATCH] docs: driver-api: Add Surface Aggregator subsystem @@ -13691,7 +13691,7 @@ index 2818a31d79db..c89d831e74e0 100644 -- 2.30.1 -From b1ef35b9076e896c80c2ddc77c694226db1aaee6 Mon Sep 17 00:00:00 2001 +From b18187e91146963b7d8b95614f2e95858dbe66b7 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:58 +0100 Subject: [PATCH] platform/surface: Add Surface Aggregator user-space interface @@ -14303,7 +14303,7 @@ index 000000000000..fbcce04abfe9 -- 2.30.1 -From b42609f185ad3142d58ef16df9a62b57fefeef96 Mon Sep 17 00:00:00 2001 +From ffdb38a97b3ed9b99a17954a733491ab144eb1b8 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 21 Dec 2020 19:39:59 +0100 Subject: [PATCH] platform/surface: Add Surface ACPI Notify driver @@ -15418,7 +15418,7 @@ index 000000000000..8e3e86c7d78c -- 2.30.1 -From c4b99c73cfee54e7cf59c1cf45b4aee78fce2c81 Mon Sep 17 00:00:00 2001 +From d0c9ae12fba197f2b36046a22f6d784a0d2475e0 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Mon, 11 Jan 2021 14:46:48 +0000 Subject: [PATCH] platform/surface: fix potential integer overflow on shift of @@ -15456,7 +15456,7 @@ index 8cd67a669c86..ef9c1f8e8336 100644 -- 2.30.1 -From dcda1b902b58d38b65fb1ed95d1657839e657d73 Mon Sep 17 00:00:00 2001 +From 11ffaa764df755d12a14176b203044b7e076fb77 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 11 Jan 2021 16:48:50 +0100 Subject: [PATCH] platform/surface: aggregator_cdev: Fix access of @@ -15496,7 +15496,7 @@ index 340d15b148b9..979340cdd9de 100644 -- 2.30.1 -From 023b9d531d3e26d351d0aaed8c785fb2a3434f49 Mon Sep 17 00:00:00 2001 +From 08fcb5aabe345920327295828a343cb21b38266f Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 11 Jan 2021 16:48:51 +0100 Subject: [PATCH] platform/surface: aggregator_cdev: Add comments regarding @@ -15565,7 +15565,7 @@ index 979340cdd9de..79e28fab7e40 100644 -- 2.30.1 -From 794b4e9ca8d93da88444b48aa486e923f7c1adb4 Mon Sep 17 00:00:00 2001 +From e40f24dbc901fdfa623d1ad48dc189fa0cd2cf05 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 14 Jan 2021 09:04:52 +0100 Subject: [PATCH] platform/surface: aggregator: fix a kernel-doc markup @@ -15600,7 +15600,7 @@ index bb1c862411a2..25db4d638cfa 100644 -- 2.30.1 -From 475b311fa4c01f4391de90730daf0d1e718f5ada Mon Sep 17 00:00:00 2001 +From 8a72a107fc7ba9bf27295ab263ae7d218821a861 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 14 Jan 2021 16:08:26 +0100 Subject: [PATCH] platform/surface: aggregator: Fix kernel-doc references @@ -15637,7 +15637,7 @@ index 25db4d638cfa..52a83a8fcf82 100644 -- 2.30.1 -From 9f0cf2d2b5da3a6c3bb040794d295ee99a4ad5b2 Mon Sep 17 00:00:00 2001 +From 2e25eccababb35a7df5e7078af331b1545eb7091 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 26 Jan 2021 18:22:02 +0100 Subject: [PATCH] platform/surface: aggregator: Fix braces in if condition with @@ -15700,7 +15700,7 @@ index 74f0faaa2b27..583315db8b02 100644 -- 2.30.1 -From c81c70309a61976d024c2cb898bc16fd19686d63 Mon Sep 17 00:00:00 2001 +From a9118a4d20085508588984edc8d93ef3d09c6fd4 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 11 Feb 2021 13:41:49 +0100 Subject: [PATCH] platform/surface: aggregator: Fix access of unaligned value @@ -15740,7 +15740,7 @@ index 583315db8b02..15d96eac6811 100644 -- 2.30.1 -From 245b63acc338f0d5998234bab3c5a0039fe8de85 Mon Sep 17 00:00:00 2001 +From c79e18e307808826e6dce7131c727deb9c25d12c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 03:42:45 +0100 Subject: [PATCH] platform/surface: Set up Surface Aggregator device registry @@ -16135,7 +16135,7 @@ index 000000000000..a051d941ad96 -- 2.30.1 -From 7ffa29669f90c35561bd0b9131b60f6ad56c7981 Mon Sep 17 00:00:00 2001 +From 55068c44b24b551e8db338ebea187adfaaf6a322 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 04:14:35 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add base device hub @@ -16461,7 +16461,7 @@ index a051d941ad96..6c23d75a044c 100644 -- 2.30.1 -From 3ef39d45e162a91ef20d41e4584f22213e838ac7 Mon Sep 17 00:00:00 2001 +From 5091d9c2501775903682f1a155b34e6df2acefaf Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 04:55:09 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add battery subsystem @@ -16547,7 +16547,7 @@ index 6c23d75a044c..cde279692842 100644 -- 2.30.1 -From 7e71870e30d8a2c0539f3c3a97b77d7dfcbcbfa4 Mon Sep 17 00:00:00 2001 +From d640cf19b11b6cd362f33e9e2b3f4ee47c3618c4 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 05:01:08 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add platform profile @@ -16646,7 +16646,7 @@ index cde279692842..33904613dd4b 100644 -- 2.30.1 -From 813f8ad53117549bfc1dce60b8700cecb76dff89 Mon Sep 17 00:00:00 2001 +From 9eb068b50213c8d57ff7bb360c3e57a54c2768f5 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 05:06:41 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add DTX device @@ -16687,7 +16687,7 @@ index 33904613dd4b..dc044d06828b 100644 -- 2.30.1 -From 603eba200fad0b5480c15ca0463166f6aee93264 Mon Sep 17 00:00:00 2001 +From b25c456e6bc32c93b667a4c41d225b2af6c09413 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 7 Feb 2021 05:16:44 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add HID subsystem @@ -16780,7 +16780,48 @@ index dc044d06828b..caee90d135c5 100644 -- 2.30.1 -From fe31d5f5e6c75f2c6619b3b0b52d5083eaca78da Mon Sep 17 00:00:00 2001 +From 8786955a1f821d5ee4d13b1c19af2541653f2dfb Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 9 Mar 2021 17:03:15 +0100 +Subject: [PATCH] platform/surface: aggregator_registry: Add support for + Surface Pro 7+ + +The Surface Pro 7+ is essentially a refresh of the Surface Pro 7 with +updated hardware and a new WSID identifier. + +Signed-off-by: Maximilian Luz +Patchset: surface-sam +--- + drivers/platform/surface/surface_aggregator_registry.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index caee90d135c5..6de74e893d06 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -191,7 +191,7 @@ static const struct software_node *ssam_node_group_sp6[] = { + NULL, + }; + +-/* Devices for Surface Pro 7. */ ++/* Devices for Surface Pro 7 and Surface Pro 7+. */ + static const struct software_node *ssam_node_group_sp7[] = { + &ssam_node_root, + &ssam_node_bat_ac, +@@ -521,6 +521,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = { + /* Surface Pro 7 */ + { "MSHW0116", (unsigned long)ssam_node_group_sp7 }, + ++ /* Surface Pro 7+ */ ++ { "MSHW0119", (unsigned long)ssam_node_group_sp7 }, ++ + /* Surface Book 2 */ + { "MSHW0107", (unsigned long)ssam_node_group_sb2 }, + +-- +2.30.1 + +From 83ab20b8c641c93335439bccd9e083bc53596fba Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 9 Feb 2021 02:46:40 +0100 Subject: [PATCH] platform/surface: Add DTX driver @@ -18271,7 +18312,7 @@ index 000000000000..0833aab0d819 -- 2.30.1 -From 5666bacf4fa214ee9b61767660ee796568ec881a Mon Sep 17 00:00:00 2001 +From cbce4b6b86fda90b9120a0943259d790623714ab Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 9 Feb 2021 02:50:11 +0100 Subject: [PATCH] platform/surface: dtx: Add support for native SSAM devices @@ -18412,7 +18453,7 @@ index a95adc1094aa..4bb5d286bf95 100644 -- 2.30.1 -From 21ef9d0ead48bb568c3898df5f5b0d99a21977b8 Mon Sep 17 00:00:00 2001 +From 7acdf3f22691ea81328bd4d3fe80c8c9e8914cc5 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 9 Feb 2021 02:55:31 +0100 Subject: [PATCH] docs: driver-api: Add Surface DTX driver documentation @@ -19180,7 +19221,7 @@ index 8ea459fc56f4..ba2dfafeb28c 100644 -- 2.30.1 -From 1699b3a1c4fadac21f7787d3237eaa636e501a83 Mon Sep 17 00:00:00 2001 +From 1ac0425ccc915648bb5e136f79eff64ae51d8e45 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 11 Feb 2021 20:02:57 +0100 Subject: [PATCH] input: Add bus ID for Surface Aggregator Module @@ -19209,7 +19250,7 @@ index 9a61c28ed3ae..3e81ea3d7df2 100644 -- 2.30.1 -From c000bc102bd387084452507a7ce24e01fad471bb Mon Sep 17 00:00:00 2001 +From 28d661771a3edbd8dba2c03b58200021b51b9619 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 11 Feb 2021 20:08:50 +0100 Subject: [PATCH] HID: Add support for Surface Aggregator Module HID transport @@ -19952,7 +19993,7 @@ index 000000000000..4b1a7b57e035 -- 2.30.1 -From b50a40d767e1cd4479c879599d4996b4191fa61f Mon Sep 17 00:00:00 2001 +From 06b730bfa7ae353acda87086de464c4430dd21f9 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 11 Feb 2021 20:10:17 +0100 Subject: [PATCH] HID: surface-hid: Add support for legacy keyboard interface @@ -19974,8 +20015,9 @@ Patchset: surface-sam --- drivers/hid/surface-hid/Kconfig | 14 ++ drivers/hid/surface-hid/Makefile | 1 + - drivers/hid/surface-hid/surface_kbd.c | 303 ++++++++++++++++++++++++++ - 3 files changed, 318 insertions(+) + drivers/hid/surface-hid/surface_hid.c | 7 +- + drivers/hid/surface-hid/surface_kbd.c | 300 ++++++++++++++++++++++++++ + 4 files changed, 317 insertions(+), 5 deletions(-) create mode 100644 drivers/hid/surface-hid/surface_kbd.c diff --git a/drivers/hid/surface-hid/Kconfig b/drivers/hid/surface-hid/Kconfig @@ -20012,12 +20054,34 @@ index 62fc04632d3d..4ae11cf09b25 100644 obj-$(CONFIG_SURFACE_HID_CORE) += surface_hid_core.o obj-$(CONFIG_SURFACE_HID) += surface_hid.o +obj-$(CONFIG_SURFACE_KBD) += surface_kbd.o +diff --git a/drivers/hid/surface-hid/surface_hid.c b/drivers/hid/surface-hid/surface_hid.c +index e4477c328536..3477b31611ae 100644 +--- a/drivers/hid/surface-hid/surface_hid.c ++++ b/drivers/hid/surface-hid/surface_hid.c +@@ -157,15 +157,12 @@ static int ssam_hid_get_raw_report(struct surface_hid_device *shid, u8 rprt_id, + static u32 ssam_hid_event_fn(struct ssam_event_notifier *nf, const struct ssam_event *event) + { + struct surface_hid_device *shid = container_of(nf, struct surface_hid_device, notif); +- int status; + + if (event->command_id != 0x00) + return 0; + +- status = hid_input_report(shid->hid, HID_INPUT_REPORT, (u8 *)&event->data[0], +- event->length, 0); +- +- return ssam_notifier_from_errno(status) | SSAM_NOTIF_HANDLED; ++ hid_input_report(shid->hid, HID_INPUT_REPORT, (u8 *)&event->data[0], event->length, 0); ++ return SSAM_NOTIF_HANDLED; + } + + diff --git a/drivers/hid/surface-hid/surface_kbd.c b/drivers/hid/surface-hid/surface_kbd.c new file mode 100644 -index 000000000000..e72baac952ec +index 000000000000..0635341bc517 --- /dev/null +++ b/drivers/hid/surface-hid/surface_kbd.c -@@ -0,0 +1,303 @@ +@@ -0,0 +1,300 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Surface System Aggregator Module (SSAM) HID transport driver for the legacy @@ -20144,7 +20208,6 @@ index 000000000000..e72baac952ec +static u32 ssam_kbd_event_fn(struct ssam_event_notifier *nf, const struct ssam_event *event) +{ + struct surface_hid_device *shid = container_of(nf, struct surface_hid_device, notif); -+ int status; + + /* + * Check against device UID manually, as registry and device target @@ -20163,10 +20226,8 @@ index 000000000000..e72baac952ec + if (!ssam_kbd_is_input_event(event)) + return 0; + -+ status = hid_input_report(shid->hid, HID_INPUT_REPORT, (u8 *)&event->data[0], -+ event->length, 0); -+ -+ return ssam_notifier_from_errno(status) | SSAM_NOTIF_HANDLED; ++ hid_input_report(shid->hid, HID_INPUT_REPORT, (u8 *)&event->data[0], event->length, 0); ++ return SSAM_NOTIF_HANDLED; +} + + @@ -20324,7 +20385,7 @@ index 000000000000..e72baac952ec -- 2.30.1 -From 883c16b19d9588593a8fc403bf5cf990a1d4e281 Mon Sep 17 00:00:00 2001 +From ae5f2370627050e0371686a7a1f2bdf17920eddf Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 21:06:12 +0100 Subject: [PATCH] power: supply: Add battery driver for Surface Aggregator @@ -20374,10 +20435,10 @@ index d4ebe9f7ae69..b107e059770f 100644 M: Maximilian Luz L: platform-driver-x86@vger.kernel.org diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig -index eec646c568b7..ed132dde0735 100644 +index 1699b9269a78..b635331daba4 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig -@@ -774,4 +774,20 @@ config RN5T618_POWER +@@ -775,4 +775,20 @@ config RN5T618_POWER This driver can also be built as a module. If so, the module will be called rn5t618_power. @@ -21317,7 +21378,7 @@ index 000000000000..327fd7af386b -- 2.30.1 -From 71bde8d631028d94e2132ba05302af1baf447414 Mon Sep 17 00:00:00 2001 +From 59806be0c63b97b7dd85f0dc99d0c8e11a34b487 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 21:07:17 +0100 Subject: [PATCH] power: supply: Add AC driver for Surface Aggregator Module @@ -21359,10 +21420,10 @@ index b107e059770f..2144ec466377 100644 MICROSOFT SURFACE DTX DRIVER M: Maximilian Luz diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig -index ed132dde0735..d4105228a2a5 100644 +index b635331daba4..d4d756d95778 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig -@@ -790,4 +790,20 @@ config BATTERY_SURFACE +@@ -791,4 +791,20 @@ config BATTERY_SURFACE Microsoft Surface devices, i.e. Surface Pro 7, Surface Laptop 3, Surface Book 3, and Surface Laptop Go. @@ -21697,7 +21758,7 @@ index 000000000000..982f9b9ef6f5 -- 2.30.1 -From f983d2631fe3b634dd06198b2da985794a4b1259 Mon Sep 17 00:00:00 2001 +From 543dd0fdf499152300c99786ba28b7de43c3a6ee Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 13 Feb 2021 19:58:50 +0100 Subject: [PATCH] platform/surface: Add performance mode driver @@ -21884,3 +21945,516 @@ index 000000000000..3b92a43f8606 -- 2.30.1 +From a361586c1ea6a5740e7cf64426d0a7946b57f700 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Thu, 4 Mar 2021 20:05:24 +0100 +Subject: [PATCH] platform/surface: aggregator: Make SSAM_DEFINE_SYNC_REQUEST_x + define static functions + +The SSAM_DEFINE_SYNC_REQUEST_x() macros are intended to reduce +boiler-plate code for SSAM request definitions by defining a wrapper +function for the specified request. The client device variants of those +macros, i.e. SSAM_DEFINE_SYNC_REQUEST_CL_x() in particular rely on the +multi-device (MD) variants, e.g.: + + #define SSAM_DEFINE_SYNC_REQUEST_CL_R(name, rtype, spec...) \ + SSAM_DEFINE_SYNC_REQUEST_MD_R(__raw_##name, rtype, spec) \ + int name(struct ssam_device *sdev, rtype *ret) \ + { \ + return __raw_##name(sdev->ctrl, sdev->uid.target, \ + sdev->uid.instance, ret); \ + } + +This now creates the problem that it is not possible to declare the +generated functions static via + + static SSAM_DEFINE_SYNC_REQUEST_CL_R(...) + +as this will only apply to the function defined by the multi-device +macro, i.e. SSAM_DEFINE_SYNC_REQUEST_MD_R(). Thus compiling with +`-Wmissing-prototypes' rightfully complains that there is a 'static' +keyword missing. + +To solve this, make all SSAM_DEFINE_SYNC_REQUEST_x() macros define +static functions. Non-client-device macros are also changed for +consistency. In general, we expect those functions to be only used +locally in the respective drivers for the corresponding interfaces, so +having to define a wrapper function to be able to export this should be +the odd case out. + +Reported-by: kernel test robot +Fixes: b78b4982d763 ("platform/surface: Add platform profile driver") +Signed-off-by: Maximilian Luz +Link: https://lore.kernel.org/r/20210304190524.1172197-1-luzmaximilian@gmail.com +Signed-off-by: Hans de Goede +Patchset: surface-sam +--- + .../driver-api/surface_aggregator/client.rst | 4 +- + .../platform/surface/aggregator/controller.c | 10 +-- + .../surface/surface_aggregator_registry.c | 2 +- + drivers/platform/surface/surface_dtx.c | 18 ++--- + drivers/platform/surface/surface_perfmode.c | 4 +- + drivers/power/supply/surface_battery.c | 8 +- + drivers/power/supply/surface_charger.c | 4 +- + include/linux/surface_aggregator/controller.h | 74 +++++++++---------- + include/linux/surface_aggregator/device.h | 31 ++++---- + 9 files changed, 78 insertions(+), 77 deletions(-) + +diff --git a/Documentation/driver-api/surface_aggregator/client.rst b/Documentation/driver-api/surface_aggregator/client.rst +index 26d13085a117..e519d374c378 100644 +--- a/Documentation/driver-api/surface_aggregator/client.rst ++++ b/Documentation/driver-api/surface_aggregator/client.rst +@@ -248,7 +248,7 @@ This example defines a function + + .. code-block:: c + +- int __ssam_tmp_perf_mode_set(struct ssam_controller *ctrl, const __le32 *arg); ++ static int __ssam_tmp_perf_mode_set(struct ssam_controller *ctrl, const __le32 *arg); + + executing the specified request, with the controller passed in when calling + said function. In this example, the argument is provided via the ``arg`` +@@ -296,7 +296,7 @@ This invocation of the macro defines a function + + .. code-block:: c + +- int ssam_bat_get_sta(struct ssam_device *sdev, __le32 *ret); ++ static int ssam_bat_get_sta(struct ssam_device *sdev, __le32 *ret); + + executing the specified request, using the device IDs and controller given + in the client device. The full list of such macros for client devices is: +diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c +index 5bcb59ed579d..aa6f37b4f46e 100644 +--- a/drivers/platform/surface/aggregator/controller.c ++++ b/drivers/platform/surface/aggregator/controller.c +@@ -1750,35 +1750,35 @@ EXPORT_SYMBOL_GPL(ssam_request_sync_with_buffer); + + /* -- Internal SAM requests. ------------------------------------------------ */ + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_get_firmware_version, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_get_firmware_version, __le32, { + .target_category = SSAM_SSH_TC_SAM, + .target_id = 0x01, + .command_id = 0x13, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_display_off, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_display_off, u8, { + .target_category = SSAM_SSH_TC_SAM, + .target_id = 0x01, + .command_id = 0x15, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_display_on, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_display_on, u8, { + .target_category = SSAM_SSH_TC_SAM, + .target_id = 0x01, + .command_id = 0x16, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_d0_exit, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_d0_exit, u8, { + .target_category = SSAM_SSH_TC_SAM, + .target_id = 0x01, + .command_id = 0x33, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_d0_entry, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_ssh_notif_d0_entry, u8, { + .target_category = SSAM_SSH_TC_SAM, + .target_id = 0x01, + .command_id = 0x34, +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index 6de74e893d06..c42b97f61a57 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -302,7 +302,7 @@ struct ssam_base_hub { + struct ssam_event_notifier notif; + }; + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_query_opmode, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_query_opmode, u8, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x0d, +diff --git a/drivers/platform/surface/surface_dtx.c b/drivers/platform/surface/surface_dtx.c +index 4bb5d286bf95..85451eb94d98 100644 +--- a/drivers/platform/surface/surface_dtx.c ++++ b/drivers/platform/surface/surface_dtx.c +@@ -69,63 +69,63 @@ struct ssam_bas_base_info { + + static_assert(sizeof(struct ssam_bas_base_info) == 2); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_lock, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_lock, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x06, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_unlock, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_unlock, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x07, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_request, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_request, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x08, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_confirm, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_confirm, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x09, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_heartbeat, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_heartbeat, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x0a, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_cancel, { ++SSAM_DEFINE_SYNC_REQUEST_N(ssam_bas_latch_cancel, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x0b, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_base, struct ssam_bas_base_info, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_base, struct ssam_bas_base_info, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x0c, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_device_mode, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_device_mode, u8, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x0d, + .instance_id = 0x00, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_latch_status, u8, { ++SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_get_latch_status, u8, { + .target_category = SSAM_SSH_TC_BAS, + .target_id = 0x01, + .command_id = 0x11, +diff --git a/drivers/platform/surface/surface_perfmode.c b/drivers/platform/surface/surface_perfmode.c +index 3b92a43f8606..a9114e001d0d 100644 +--- a/drivers/platform/surface/surface_perfmode.c ++++ b/drivers/platform/surface/surface_perfmode.c +@@ -33,12 +33,12 @@ struct ssam_perf_info { + __le16 unknown2; + } __packed; + +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_tmp_perf_mode_get, struct ssam_perf_info, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_tmp_perf_mode_get, struct ssam_perf_info, { + .target_category = SSAM_SSH_TC_TMP, + .command_id = 0x02, + }); + +-static SSAM_DEFINE_SYNC_REQUEST_CL_W(__ssam_tmp_perf_mode_set, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_CL_W(__ssam_tmp_perf_mode_set, __le32, { + .target_category = SSAM_SSH_TC_TMP, + .command_id = 0x03, + }); +diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c +index 327fd7af386b..b93a4f556b5c 100644 +--- a/drivers/power/supply/surface_battery.c ++++ b/drivers/power/supply/surface_battery.c +@@ -85,25 +85,25 @@ static_assert(sizeof(struct spwr_bst) == 16); + #define SPWR_BATTERY_VALUE_UNKNOWN 0xffffffff + + /* Get battery status (_STA) */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_sta, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_sta, __le32, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x01, + }); + + /* Get battery static information (_BIX). */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_bix, struct spwr_bix, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_bix, struct spwr_bix, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x02, + }); + + /* Get battery dynamic information (_BST). */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_bst, struct spwr_bst, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_bst, struct spwr_bst, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x03, + }); + + /* Set battery trip point (_BTP). */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_W(ssam_bat_set_btp, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_CL_W(ssam_bat_set_btp, __le32, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x04, + }); +diff --git a/drivers/power/supply/surface_charger.c b/drivers/power/supply/surface_charger.c +index 982f9b9ef6f5..fe484523a2c2 100644 +--- a/drivers/power/supply/surface_charger.c ++++ b/drivers/power/supply/surface_charger.c +@@ -28,13 +28,13 @@ enum sam_battery_sta { + }; + + /* Get battery status (_STA). */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_sta, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_sta, __le32, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x01, + }); + + /* Get platform power source for battery (_PSR / DPTF PSRC). */ +-static SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_psrc, __le32, { ++SSAM_DEFINE_SYNC_REQUEST_CL_R(ssam_bat_get_psrc, __le32, { + .target_category = SSAM_SSH_TC_BAT, + .command_id = 0x0d, + }); +diff --git a/include/linux/surface_aggregator/controller.h b/include/linux/surface_aggregator/controller.h +index f4b1ba887384..0806796eabcb 100644 +--- a/include/linux/surface_aggregator/controller.h ++++ b/include/linux/surface_aggregator/controller.h +@@ -344,16 +344,16 @@ struct ssam_request_spec_md { + * request has been fully completed. The required transport buffer will be + * allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl)``, returning the status of the request, which is zero on success and +- * negative on failure. The ``ctrl`` parameter is the controller via which the +- * request is being sent. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl)``, returning the status of the request, which is ++ * zero on success and negative on failure. The ``ctrl`` parameter is the ++ * controller via which the request is being sent. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_N(name, spec...) \ +- int name(struct ssam_controller *ctrl) \ ++ static int name(struct ssam_controller *ctrl) \ + { \ + struct ssam_request_spec s = (struct ssam_request_spec)spec; \ + struct ssam_request rqst; \ +@@ -383,17 +383,17 @@ struct ssam_request_spec_md { + * returning once the request has been fully completed. The required transport + * buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl, const atype *arg)``, returning the status of the request, which is +- * zero on success and negative on failure. The ``ctrl`` parameter is the +- * controller via which the request is sent. The request argument is specified +- * via the ``arg`` pointer. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl, const atype *arg)``, returning the status of the ++ * request, which is zero on success and negative on failure. The ``ctrl`` ++ * parameter is the controller via which the request is sent. The request ++ * argument is specified via the ``arg`` pointer. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_W(name, atype, spec...) \ +- int name(struct ssam_controller *ctrl, const atype *arg) \ ++ static int name(struct ssam_controller *ctrl, const atype *arg) \ + { \ + struct ssam_request_spec s = (struct ssam_request_spec)spec; \ + struct ssam_request rqst; \ +@@ -424,17 +424,17 @@ struct ssam_request_spec_md { + * request itself, returning once the request has been fully completed. The + * required transport buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl, rtype *ret)``, returning the status of the request, which is zero on +- * success and negative on failure. The ``ctrl`` parameter is the controller +- * via which the request is sent. The request's return value is written to the +- * memory pointed to by the ``ret`` parameter. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl, rtype *ret)``, returning the status of the request, ++ * which is zero on success and negative on failure. The ``ctrl`` parameter is ++ * the controller via which the request is sent. The request's return value is ++ * written to the memory pointed to by the ``ret`` parameter. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_R(name, rtype, spec...) \ +- int name(struct ssam_controller *ctrl, rtype *ret) \ ++ static int name(struct ssam_controller *ctrl, rtype *ret) \ + { \ + struct ssam_request_spec s = (struct ssam_request_spec)spec; \ + struct ssam_request rqst; \ +@@ -483,17 +483,17 @@ struct ssam_request_spec_md { + * returning once the request has been fully completed. The required transport + * buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl, u8 tid, u8 iid)``, returning the status of the request, which is +- * zero on success and negative on failure. The ``ctrl`` parameter is the +- * controller via which the request is sent, ``tid`` the target ID for the +- * request, and ``iid`` the instance ID. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl, u8 tid, u8 iid)``, returning the status of the ++ * request, which is zero on success and negative on failure. The ``ctrl`` ++ * parameter is the controller via which the request is sent, ``tid`` the ++ * target ID for the request, and ``iid`` the instance ID. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_MD_N(name, spec...) \ +- int name(struct ssam_controller *ctrl, u8 tid, u8 iid) \ ++ static int name(struct ssam_controller *ctrl, u8 tid, u8 iid) \ + { \ + struct ssam_request_spec_md s = (struct ssam_request_spec_md)spec; \ + struct ssam_request rqst; \ +@@ -524,18 +524,18 @@ struct ssam_request_spec_md { + * the request itself, returning once the request has been fully completed. + * The required transport buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl, u8 tid, u8 iid, const atype *arg)``, returning the status of the +- * request, which is zero on success and negative on failure. The ``ctrl`` +- * parameter is the controller via which the request is sent, ``tid`` the +- * target ID for the request, and ``iid`` the instance ID. The request argument +- * is specified via the ``arg`` pointer. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl, u8 tid, u8 iid, const atype *arg)``, returning the ++ * status of the request, which is zero on success and negative on failure. ++ * The ``ctrl`` parameter is the controller via which the request is sent, ++ * ``tid`` the target ID for the request, and ``iid`` the instance ID. The ++ * request argument is specified via the ``arg`` pointer. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_MD_W(name, atype, spec...) \ +- int name(struct ssam_controller *ctrl, u8 tid, u8 iid, const atype *arg)\ ++ static int name(struct ssam_controller *ctrl, u8 tid, u8 iid, const atype *arg) \ + { \ + struct ssam_request_spec_md s = (struct ssam_request_spec_md)spec; \ + struct ssam_request rqst; \ +@@ -567,18 +567,18 @@ struct ssam_request_spec_md { + * execution of the request itself, returning once the request has been fully + * completed. The required transport buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_controller +- * *ctrl, u8 tid, u8 iid, rtype *ret)``, returning the status of the request, +- * which is zero on success and negative on failure. The ``ctrl`` parameter is +- * the controller via which the request is sent, ``tid`` the target ID for the +- * request, and ``iid`` the instance ID. The request's return value is written +- * to the memory pointed to by the ``ret`` parameter. ++ * The generated function is defined as ``static int name(struct ++ * ssam_controller *ctrl, u8 tid, u8 iid, rtype *ret)``, returning the status ++ * of the request, which is zero on success and negative on failure. The ++ * ``ctrl`` parameter is the controller via which the request is sent, ``tid`` ++ * the target ID for the request, and ``iid`` the instance ID. The request's ++ * return value is written to the memory pointed to by the ``ret`` parameter. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_MD_R(name, rtype, spec...) \ +- int name(struct ssam_controller *ctrl, u8 tid, u8 iid, rtype *ret) \ ++ static int name(struct ssam_controller *ctrl, u8 tid, u8 iid, rtype *ret) \ + { \ + struct ssam_request_spec_md s = (struct ssam_request_spec_md)spec; \ + struct ssam_request rqst; \ +diff --git a/include/linux/surface_aggregator/device.h b/include/linux/surface_aggregator/device.h +index 02f3e06c0a60..4441ad667c3f 100644 +--- a/include/linux/surface_aggregator/device.h ++++ b/include/linux/surface_aggregator/device.h +@@ -336,17 +336,18 @@ void ssam_device_driver_unregister(struct ssam_device_driver *d); + * request has been fully completed. The required transport buffer will be + * allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_device *sdev)``, +- * returning the status of the request, which is zero on success and negative +- * on failure. The ``sdev`` parameter specifies both the target device of the +- * request and by association the controller via which the request is sent. ++ * The generated function is defined as ``static int name(struct ssam_device ++ * *sdev)``, returning the status of the request, which is zero on success and ++ * negative on failure. The ``sdev`` parameter specifies both the target ++ * device of the request and by association the controller via which the ++ * request is sent. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_CL_N(name, spec...) \ + SSAM_DEFINE_SYNC_REQUEST_MD_N(__raw_##name, spec) \ +- int name(struct ssam_device *sdev) \ ++ static int name(struct ssam_device *sdev) \ + { \ + return __raw_##name(sdev->ctrl, sdev->uid.target, \ + sdev->uid.instance); \ +@@ -368,19 +369,19 @@ void ssam_device_driver_unregister(struct ssam_device_driver *d); + * itself, returning once the request has been fully completed. The required + * transport buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_device *sdev, +- * const atype *arg)``, returning the status of the request, which is zero on +- * success and negative on failure. The ``sdev`` parameter specifies both the +- * target device of the request and by association the controller via which +- * the request is sent. The request's argument is specified via the ``arg`` +- * pointer. ++ * The generated function is defined as ``static int name(struct ssam_device ++ * *sdev, const atype *arg)``, returning the status of the request, which is ++ * zero on success and negative on failure. The ``sdev`` parameter specifies ++ * both the target device of the request and by association the controller via ++ * which the request is sent. The request's argument is specified via the ++ * ``arg`` pointer. + * + * Refer to ssam_request_sync_onstack() for more details on the behavior of + * the generated function. + */ + #define SSAM_DEFINE_SYNC_REQUEST_CL_W(name, atype, spec...) \ + SSAM_DEFINE_SYNC_REQUEST_MD_W(__raw_##name, atype, spec) \ +- int name(struct ssam_device *sdev, const atype *arg) \ ++ static int name(struct ssam_device *sdev, const atype *arg) \ + { \ + return __raw_##name(sdev->ctrl, sdev->uid.target, \ + sdev->uid.instance, arg); \ +@@ -402,8 +403,8 @@ void ssam_device_driver_unregister(struct ssam_device_driver *d); + * itself, returning once the request has been fully completed. The required + * transport buffer will be allocated on the stack. + * +- * The generated function is defined as ``int name(struct ssam_device *sdev, +- * rtype *ret)``, returning the status of the request, which is zero on ++ * The generated function is defined as ``static int name(struct ssam_device ++ * *sdev, rtype *ret)``, returning the status of the request, which is zero on + * success and negative on failure. The ``sdev`` parameter specifies both the + * target device of the request and by association the controller via which + * the request is sent. The request's return value is written to the memory +@@ -414,7 +415,7 @@ void ssam_device_driver_unregister(struct ssam_device_driver *d); + */ + #define SSAM_DEFINE_SYNC_REQUEST_CL_R(name, rtype, spec...) \ + SSAM_DEFINE_SYNC_REQUEST_MD_R(__raw_##name, rtype, spec) \ +- int name(struct ssam_device *sdev, rtype *ret) \ ++ static int name(struct ssam_device *sdev, rtype *ret) \ + { \ + return __raw_##name(sdev->ctrl, sdev->uid.target, \ + sdev->uid.instance, ret); \ +-- +2.30.1 + diff --git a/patches/5.11/0006-surface-hotplug.patch b/patches/5.11/0006-surface-hotplug.patch index d900bb71c..4e30cb0fb 100644 --- a/patches/5.11/0006-surface-hotplug.patch +++ b/patches/5.11/0006-surface-hotplug.patch @@ -1,4 +1,4 @@ -From 789f7b475f230ae8eca4a1792cd829f0aefdc190 Mon Sep 17 00:00:00 2001 +From c4a51a33b30769caab6ac407e3c5ce8c7658d42c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 4 Feb 2021 23:06:40 +0100 Subject: [PATCH] PCI: Run platform power transition on initial D0 entry @@ -43,7 +43,7 @@ Patchset: surface-hotplug 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c -index 790393d1e318..c9fcd5514409 100644 +index ba791165ed19..0fa8e52208fe 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1800,7 +1800,7 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars) @@ -58,7 +58,7 @@ index 790393d1e318..c9fcd5514409 100644 -- 2.30.1 -From 88347b2a5d4d24c78124b1c9fdda42088192199d Mon Sep 17 00:00:00 2001 +From e795af3b2f568aa849a0f3278327fe80bc7b1fb9 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 5 Feb 2021 02:26:57 +0100 Subject: [PATCH] platform/surface: Add Surface Hot-Plug driver diff --git a/patches/5.11/0007-surface-typecover.patch b/patches/5.11/0007-surface-typecover.patch index a9c6f6d54..945b379ad 100644 --- a/patches/5.11/0007-surface-typecover.patch +++ b/patches/5.11/0007-surface-typecover.patch @@ -1,4 +1,4 @@ -From be2a2310c392ac571f62c5180d1795f132a0f8fd Mon Sep 17 00:00:00 2001 +From 886c643c9affeb43bae8ad1713bd1e19f8368cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 5 Nov 2020 13:09:45 +0100 Subject: [PATCH] hid/multitouch: Turn off Type Cover keyboard backlight when diff --git a/patches/5.11/0008-surface-sensors.patch b/patches/5.11/0008-surface-sensors.patch index 462abd9f2..5a05e24b5 100644 --- a/patches/5.11/0008-surface-sensors.patch +++ b/patches/5.11/0008-surface-sensors.patch @@ -1,4 +1,4 @@ -From 85bf81d420abd726680d219c6cc338af1dd3d480 Mon Sep 17 00:00:00 2001 +From 7202f640893255d3291bf1dbeb44fc26876b7d5b Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sat, 19 Dec 2020 17:50:55 -0800 Subject: [PATCH] iio:light:apds9960 add detection for MSHW0184 ACPI device in diff --git a/patches/5.11/0009-cameras.patch b/patches/5.11/0009-cameras.patch index 9ab2cfdc0..9c40be76c 100644 --- a/patches/5.11/0009-cameras.patch +++ b/patches/5.11/0009-cameras.patch @@ -1,52 +1,4 @@ -From b6df1f1f4904e1f9a4735c430c11a472fa3c474d Mon Sep 17 00:00:00 2001 -From: Daniel Scally -Date: Sat, 10 Oct 2020 23:42:09 +0100 -Subject: [PATCH] software_node: Fix refcounts in - software_node_get_next_child() - -The software_node_get_next_child() function currently does not hold -references to the child software_node that it finds or put the ref that -is held against the old child - fix that. - -Fixes: 59abd83672f7 ("drivers: base: Introducing software nodes to the firmware node framework") -Reviewed-by: Andy Shevchenko -Reviewed-by: Laurent Pinchart -Reviewed-by: Sakari Ailus -Signed-off-by: Daniel Scally -Patchset: cameras ---- - drivers/base/swnode.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c -index 4a4b2008fbc2..4fcc1a6fb724 100644 ---- a/drivers/base/swnode.c -+++ b/drivers/base/swnode.c -@@ -443,14 +443,18 @@ software_node_get_next_child(const struct fwnode_handle *fwnode, - struct swnode *c = to_swnode(child); - - if (!p || list_empty(&p->children) || -- (c && list_is_last(&c->entry, &p->children))) -+ (c && list_is_last(&c->entry, &p->children))) { -+ fwnode_handle_put(child); - return NULL; -+ } - - if (c) - c = list_next_entry(c, entry); - else - c = list_first_entry(&p->children, struct swnode, entry); -- return &c->fwnode; -+ -+ fwnode_handle_put(child); -+ return fwnode_handle_get(&c->fwnode); - } - - static struct fwnode_handle * --- -2.30.1 - -From 9119d068d1f45d793de73f2c791f16f5c36b5458 Mon Sep 17 00:00:00 2001 +From 87808db00a9bec80f5c7e61af87d8920c1140276 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 30 Dec 2020 22:44:05 +0200 Subject: [PATCH] media: ipu3-cio2: Add headers that ipu3-cio2.h is direct user @@ -98,7 +50,7 @@ index ccf0b85ae36f..62187ab5ae43 100644 -- 2.30.1 -From 6d388078962c74c27edecdc3f9350c73a4b06be7 Mon Sep 17 00:00:00 2001 +From 7d3ab2200e50851ec1020f291231b7f9b98e857b Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 24 Oct 2020 22:42:28 +0100 Subject: [PATCH] device property: Return true in fwnode_device_is_available @@ -143,7 +95,7 @@ index 35b95c6ac0c6..0bf5260f14c6 100644 -- 2.30.1 -From d937d514c28776fc4a0a3f9bbd44aa5bd3650161 Mon Sep 17 00:00:00 2001 +From fbcf60d36e7a531adc97e0a1b46ae8ce45feee65 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 21 Nov 2020 22:06:38 +0000 Subject: [PATCH] device property: Call fwnode_graph_get_endpoint_by_id() for @@ -187,7 +139,7 @@ index 0bf5260f14c6..1421e9548857 100644 -- 2.30.1 -From e4f8f968690d7edeee00513081b012fd67e7cce0 Mon Sep 17 00:00:00 2001 +From 0610f7bece4792c305fde64c2a50c1bf366e0e49 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 25 Oct 2020 22:49:08 +0000 Subject: [PATCH] software_node: Enforce parent before child ordering of nodes @@ -290,7 +242,7 @@ index 4fcc1a6fb724..166c5cc73f39 100644 -- 2.30.1 -From 0a4f7d6ed8bdfea4dc5dcf3a60ab451c1053fe80 Mon Sep 17 00:00:00 2001 +From d295abae3b2f332c1687829eb1513e02f54c88b8 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 22:25:03 +0100 Subject: [PATCH] software_node: unregister software_nodes in reverse order @@ -345,7 +297,7 @@ index 166c5cc73f39..6f7443c6d3b5 100644 -- 2.30.1 -From f823cf632a2493e3ed7b9445af8558255b233060 Mon Sep 17 00:00:00 2001 +From 2c65b3e862143735638f649a89649e82f51cc241 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 22 Dec 2020 13:09:05 +0000 Subject: [PATCH] device property: Define format macros for ports and endpoints @@ -386,7 +338,7 @@ index fde4ad97564c..77414e431e89 100644 -- 2.30.1 -From 1e9cc0db2370b954e7cf6e365982d6028d48f47e Mon Sep 17 00:00:00 2001 +From 7d7da50bc117568c5d399cdc7017e030b8194f8e Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Tue, 15 Sep 2020 15:47:46 +0100 Subject: [PATCH] software_node: Add support for fwnode_graph*() family of @@ -554,7 +506,7 @@ index 6f7443c6d3b5..9104a0abd531 100644 -- 2.30.1 -From 076f3a5f8b5208c2601870ac7ed6789ee93bc1b9 Mon Sep 17 00:00:00 2001 +From 987fcc4a7f64afcf7ea9b05de6b4f936adf6744f Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 10 Oct 2020 23:07:22 +0100 Subject: [PATCH] lib/test_printf.c: Use helper function to unwind array of @@ -592,7 +544,7 @@ index 7ac87f18a10f..7d60f24240a4 100644 -- 2.30.1 -From f2216eb19d6643cba7876af0d3d7f2fe9193bd16 Mon Sep 17 00:00:00 2001 +From 5209d9e8919d703ceb63d6f7c88c1274a7d30a25 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 10 Oct 2020 23:11:36 +0100 Subject: [PATCH] ipu3-cio2: Add T: entry to MAINTAINERS @@ -623,7 +575,7 @@ index a4a0519ce88c..66ce274c17d7 100644 -- 2.30.1 -From d296a20a7e3452abafc94e1ab070673864f46eae Mon Sep 17 00:00:00 2001 +From b3710b74d073a6e0c1638e52488301bfadd4c1e7 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 10 Oct 2020 22:47:21 +0100 Subject: [PATCH] ipu3-cio2: Rename ipu3-cio2.c @@ -658,7 +610,7 @@ rename to drivers/media/pci/intel/ipu3/ipu3-cio2-main.c -- 2.30.1 -From c68d9e1970c22cb653c66d2b5265313bdc57fefb Mon Sep 17 00:00:00 2001 +From 0fa14fefa139cc528a9c24eab102a44b5979656d Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 21:53:05 +0100 Subject: [PATCH] media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in @@ -699,7 +651,7 @@ index e3ab003a6c85..9dd896d085ec 100644 -- 2.30.1 -From 59a8a1e0fe448a026d2b58d3f253c2d21e40bd44 Mon Sep 17 00:00:00 2001 +From 990e177da9a00f84f6d1779c9b84fd4a5b8d83a2 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 15 Nov 2020 08:15:34 +0000 Subject: [PATCH] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper @@ -808,7 +760,7 @@ index 6d1879bf9440..02a716a0af5d 100644 -- 2.30.1 -From bfdb7fa362ffe0e50e5f90bb9d39a2ab61c1fd02 Mon Sep 17 00:00:00 2001 +From b62cadbe3c03cc44806af0bd2785c7798cf5830a Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 19 Dec 2020 23:55:04 +0000 Subject: [PATCH] media: v4l2-fwnode: Include v4l2_fwnode_bus_type @@ -885,7 +837,7 @@ index 4365430eea6f..77fd6a3ec308 100644 -- 2.30.1 -From 2ecacb9cd48ca324e4d74eeb0ce4d3128cd43710 Mon Sep 17 00:00:00 2001 +From d92eb11b231d731f2f1bc96df934a08129a59297 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 21:53:44 +0100 Subject: [PATCH] ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver @@ -926,10 +878,10 @@ index 66ce274c17d7..fb99543648d3 100644 L: linux-media@vger.kernel.org S: Maintained diff --git a/drivers/media/pci/intel/ipu3/Kconfig b/drivers/media/pci/intel/ipu3/Kconfig -index 82d7f17e6a02..96a2231b16ad 100644 +index 7a805201034b..24f4e79fe0cb 100644 --- a/drivers/media/pci/intel/ipu3/Kconfig +++ b/drivers/media/pci/intel/ipu3/Kconfig -@@ -16,3 +16,21 @@ config VIDEO_IPU3_CIO2 +@@ -17,3 +17,21 @@ config VIDEO_IPU3_CIO2 Say Y or M here if you have a Skylake/Kaby Lake SoC with MIPI CSI-2 connected camera. The module will be called ipu3-cio2. @@ -1409,7 +1361,7 @@ index 000000000000..dd0ffcafa489 + +#endif diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c -index 6cada8a6e50c..c830c12babd9 100644 +index 143ba9d90342..d13d64ae342e 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c @@ -1702,11 +1702,28 @@ static void cio2_queues_exit(struct cio2_device *cio2) @@ -1483,7 +1435,7 @@ index 62187ab5ae43..dc3e343a37fb 100644 -- 2.30.1 -From b3f74699bf73617b5dca455e08005e5150b29d89 Mon Sep 17 00:00:00 2001 +From 7ef611d32079b60fdb259e02a7e38a88704eb080 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Dec 2020 12:38:10 +0000 Subject: [PATCH] acpi: utils: move acpi_lpss_dep() to utils @@ -1585,7 +1537,7 @@ index ddca1550cce6..78b38775f18b 100644 -- 2.30.1 -From c8a8199d91263824437e9d704738e4f802218d92 Mon Sep 17 00:00:00 2001 +From 926f38272c0bcefe876c97d66af84b3a9bfa0a40 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 26 Nov 2020 21:12:41 +0000 Subject: [PATCH] acpi: utils: Add function to fetch dependent acpi_devices @@ -1671,7 +1623,7 @@ index 02a716a0af5d..33deb22294f2 100644 -- 2.30.1 -From d18c420c43a3ddab897837fe408766ff3599e1b6 Mon Sep 17 00:00:00 2001 +From 44cf4f3e3eb4d9fc28fb4bb25969f63e9ffb6e5b Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 16 Nov 2020 21:38:49 +0000 Subject: [PATCH] i2c: i2c-core-base: Use format macro in i2c_dev_set_name() @@ -1739,7 +1691,7 @@ index 56622658b215..65acae61dc5c 100644 -- 2.30.1 -From c77e0ac04cb8e73291c520554153aee9bb3761ad Mon Sep 17 00:00:00 2001 +From 81c4f7153d35280aee130326b0063dfc1e7e993d Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Dec 2020 16:41:42 +0000 Subject: [PATCH] i2c: i2c-core-acpi: Add i2c_acpi_dev_name() @@ -1797,7 +1749,7 @@ index 65acae61dc5c..b82aac05b17f 100644 -- 2.30.1 -From 3697ae368de6eba0dcf4f776c752e5d4bbf5aa35 Mon Sep 17 00:00:00 2001 +From 0344c27fbf5d528d3224015a11bc714d1fafe8ef Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 16 Nov 2020 00:16:56 +0000 Subject: [PATCH] gpio: gpiolib-acpi: Export acpi_get_gpiod() @@ -1861,7 +1813,7 @@ index 053bf05fb1f7..626d43b00c4f 100644 -- 2.30.1 -From 2d9e688f36d83ffdfebe60223bf3ec24be34b019 Mon Sep 17 00:00:00 2001 +From 6a9bc940f7bdfa0dfa25e1a0540a0d4624313746 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 12 Dec 2020 23:56:59 +0000 Subject: [PATCH] mfd: Remove tps68470 MFD driver @@ -2052,7 +2004,7 @@ index 4a4df4ffd18c..000000000000 -- 2.30.1 -From 35c50c04d90453ec373602263c14209453be8f59 Mon Sep 17 00:00:00 2001 +From 22cc6004e98f1ff2dd83a77278bd8f04f6f22dc6 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 15 Jan 2021 12:37:31 +0000 Subject: [PATCH] platform: x86: Add intel_skl_int3472 driver @@ -2110,7 +2062,7 @@ index fb99543648d3..f543702b8c65 100644 M: Srinivas Pandruvada L: platform-driver-x86@vger.kernel.org diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig -index 91e6176cdfbd..916b077df2d5 100644 +index ac4125ec0660..ca95ec1cbc4e 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -844,6 +844,31 @@ config INTEL_CHT_INT33FE @@ -3021,7 +2973,7 @@ index 000000000000..3fe27ec0caff -- 2.30.1 -From 5c51db3de4fed9f76e34fb07369235cadc0667d9 Mon Sep 17 00:00:00 2001 +From e0e56e5c4ec4483bc3b85d0ebbf3c2251c5d8398 Mon Sep 17 00:00:00 2001 From: Jake Day Date: Fri, 25 Sep 2020 10:24:53 -0400 Subject: [PATCH] media: i2c: Add support for the OV5693 image sensor @@ -3043,7 +2995,7 @@ Patchset: cameras create mode 100644 drivers/media/i2c/ov5693.h diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig -index 2b9d81e4794a..3099cb91ef21 100644 +index 6eed3209ee2d..fc96e3d4764b 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -972,6 +972,17 @@ config VIDEO_OV5675 @@ -6378,7 +6330,7 @@ index 000000000000..9a508e1f3624 -- 2.30.1 -From 1a0606e05a713465f2d4396b926448029cb383ab Mon Sep 17 00:00:00 2001 +From b71f733a7cbdfaefad333d218a23f5902a405e7e Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 17 Jan 2021 19:08:18 +0000 Subject: [PATCH] media: i2c: Add reset pin toggling to ov5693 @@ -6419,7 +6371,7 @@ index 32485e4ed42b..f9ced52ad37a 100644 -- 2.30.1 -From 8483265d4a23150a773fd0fb760f2bf8c5307426 Mon Sep 17 00:00:00 2001 +From 23d3da32422d08c3deb15c324e68944b424ff08d Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 17 Jan 2021 21:39:15 +0000 Subject: [PATCH] media: i2c: Fix misnamed variable in power_down() for ov5693 @@ -6448,7 +6400,7 @@ index f9ced52ad37a..9fd44a3d1d85 100644 -- 2.30.1 -From d90e95ac0ba73580c98af561a74152d538d7fbac Mon Sep 17 00:00:00 2001 +From 36dd147f28b485c502868acae951a61e3a034d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCthrich?= Date: Fri, 22 Jan 2021 20:58:13 +0100 Subject: [PATCH] cio2-bridge: Parse sensor orientation and rotation @@ -6611,7 +6563,7 @@ index dd0ffcafa489..924d99d20328 100644 -- 2.30.1 -From 89fb5c747609d2c10c77f6595638883a5700e395 Mon Sep 17 00:00:00 2001 +From 173d655455237910750b8f08f53c1fbef0ea20a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCthrich?= Date: Fri, 22 Jan 2021 21:23:47 +0100 Subject: [PATCH] ov5693: Add orientation and rotation controls @@ -6667,7 +6619,7 @@ index 9fd44a3d1d85..1a85800df7ed 100644 -- 2.30.1 -From 2ba5f312ff72c2744848983a4098177cbf054081 Mon Sep 17 00:00:00 2001 +From a23bd2514938e1063b40ce374f9474ee0c738c67 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 23 Jan 2021 00:28:32 +0000 Subject: [PATCH] platform: x86: Stylistic updates for intel-skl-int3472 @@ -7084,7 +7036,7 @@ index 3fe27ec0caff..40629291b339 100644 -- 2.30.1 -From 75b63fc7f75d662d516d8120c3a870bd781e14c7 Mon Sep 17 00:00:00 2001 +From bfa0494efc110ec10b813fa251d110e3adb651fc Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 23 Jan 2021 00:30:15 +0000 Subject: [PATCH] platform: x86: Add recalc_rate opp to int3472-discrete clock @@ -7211,7 +7163,7 @@ index 42ae8396eb64..98eb1ec3399e 100644 -- 2.30.1 -From 0b11240196604cd0bd721b4a46180fe7823ee06b Mon Sep 17 00:00:00 2001 +From e0ad52e910564795fb13077e195efe47d9450d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCthrich?= Date: Sun, 24 Jan 2021 11:07:42 +0100 Subject: [PATCH] cio2-bridge: Use macros and add warnings @@ -7315,7 +7267,7 @@ index 924d99d20328..e1e388cc9f45 100644 -- 2.30.1 -From 08a3bb7988c47cd2857802bfe4c438cf1e395582 Mon Sep 17 00:00:00 2001 +From 7bd176a9e98e9a199232975799c180e65e2693ad Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 8 Feb 2021 21:44:38 +0000 Subject: [PATCH] media: i2c: Tidy up ov5693_init_controls() @@ -7437,7 +7389,7 @@ index 9a508e1f3624..26819cf3f4d2 100644 -- 2.30.1 -From 252fa0aaa35d6f4f8a1bc83737070c22df65279e Mon Sep 17 00:00:00 2001 +From 75e46b44c5e81c3eae596e9fd54e4c8a53f8c670 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 8 Feb 2021 21:46:49 +0000 Subject: [PATCH] media: i2c: Remove OV5693_PPL_DEFAULT @@ -7475,7 +7427,7 @@ index a9747ab783d7..7fb368eec327 100644 -- 2.30.1 -From a887349f340c1c4289e2c7510d2f13942c3b5fa3 Mon Sep 17 00:00:00 2001 +From 99b3425614d465dff825f507cc56616549a4b6d4 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 8 Feb 2021 22:53:02 +0000 Subject: [PATCH] media: i2c: Add vblank control to ov5693 driver @@ -7551,7 +7503,7 @@ index 26819cf3f4d2..9d7eed97963b 100644 -- 2.30.1 -From a30ff7e85e20058b44895896cc607afeff6b3cfc Mon Sep 17 00:00:00 2001 +From 69a956301158060de1297d2c04300af6f4e23c09 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 10 Feb 2021 00:36:32 +0000 Subject: [PATCH] media: i2c: update exposure control for ov5693 @@ -7626,7 +7578,7 @@ index 1950d7ac2d54..cea767230aa9 100644 -- 2.30.1 -From 14cb1065b1f464fe00330c4fb764157e1cda8173 Mon Sep 17 00:00:00 2001 +From c86a8c5729d9b4cf9f193801fe56ee8ef7730ee6 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 10 Feb 2021 00:39:42 +0000 Subject: [PATCH] media: i2c: Fix incorrect bit-setting @@ -7662,7 +7614,7 @@ index cea767230aa9..f681dbfcec56 100644 -- 2.30.1 -From 6edf21c2eeed5c8ac2656ff6de0b465fd852deb2 Mon Sep 17 00:00:00 2001 +From 7c18b8ef50454eafb757838859f0faed7efb62fc Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 10 Feb 2021 16:25:48 +0000 Subject: [PATCH] media: i2c: Don't set stream on during mode config @@ -7812,7 +7764,7 @@ index 9d7eed97963b..965208078c2b 100644 -- 2.30.1 -From bfab6b01e4e984f7fce2e10168b0fe4242ceee83 Mon Sep 17 00:00:00 2001 +From 7c1acdf7f6e92976050a3d9eab123cd9700426ab Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 10 Feb 2021 16:35:24 +0000 Subject: [PATCH] media: i2c: Update gain control for ov5693 @@ -7884,7 +7836,7 @@ index f681dbfcec56..51eb3b05d121 100644 -- 2.30.1 -From 052136967d4972f1c91817e35eb9d9538e80a832 Mon Sep 17 00:00:00 2001 +From 31fef3605057bace741136d282dee35da1c44bd6 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 10 Feb 2021 23:44:39 +0000 Subject: [PATCH] media: i2c: Fixup gain read @@ -7947,7 +7899,7 @@ index 51eb3b05d121..952558c4f33b 100644 -- 2.30.1 -From 3139bc00474507b373240f08f11f798643b490c8 Mon Sep 17 00:00:00 2001 +From 34030f540523c5db8c6497bf4fce8ff7bed129fe Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 11 Feb 2021 00:40:10 +0000 Subject: [PATCH] media: i2c: Update controls on stream @@ -7982,7 +7934,7 @@ index 952558c4f33b..dd31083eeb7b 100644 -- 2.30.1 -From 4be03779770b9b17c12cf2ac8775501c8623105f Mon Sep 17 00:00:00 2001 +From 3e1edf7b50b78525cb03b2ebc209929bf343fb06 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 11 Feb 2021 23:29:15 +0000 Subject: [PATCH] media: i2c: Correct link frequency value @@ -8021,7 +7973,7 @@ index 965208078c2b..7f1d31a82d3d 100644 -- 2.30.1 -From 58ae978d22ef1b1128226a3c16afc5bc2f191286 Mon Sep 17 00:00:00 2001 +From eb6ecc3d06a479b8f470da0507151e506c607d60 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 25 Jan 2021 23:12:09 +0000 Subject: [PATCH] media: i2c: Cleanup ov5693 driver @@ -8942,7 +8894,7 @@ index 7f1d31a82d3d..70ccb3aae4c7 100644 -- 2.30.1 -From 7782702ee9456f20e2a43b92e78513760cd74342 Mon Sep 17 00:00:00 2001 +From a68625a771c755ca74154aa7d0af9bf2477096e5 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 28 Jan 2021 12:04:38 +0000 Subject: [PATCH] media: i2c: Add pm_runtime support to ov5693 driver @@ -9287,7 +9239,7 @@ index 70ccb3aae4c7..b78d3b474a43 100644 -- 2.30.1 -From 103d1e9d84c51990aea3d5ddb43e64fafb03908d Mon Sep 17 00:00:00 2001 +From eb586cf951c1a5f78774686c3cc62642fad497b1 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 28 Jan 2021 12:07:36 +0000 Subject: [PATCH] media: i2c: Remove old power methods from ov5693 @@ -9458,7 +9410,7 @@ index f2eaa5f71a31..ce26ce86fbd5 100644 -- 2.30.1 -From faea14734a72b8dcc08860d85709fad37fe15567 Mon Sep 17 00:00:00 2001 +From e27947a296518692f81a77e17c3539519c269da8 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 28 Jan 2021 12:14:00 +0000 Subject: [PATCH] media: i2c: Trim unused headers from ov5693 @@ -9499,7 +9451,7 @@ index ce26ce86fbd5..b3b391a49fdb 100644 -- 2.30.1 -From bcb92e99e64d26c45b463436002e445fff6c0d47 Mon Sep 17 00:00:00 2001 +From 8d15bc69fe81ad66f40e822a1b26f534e78ae185 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 13 Feb 2021 21:39:35 +0000 Subject: [PATCH] media: i2c: Remove VCM stuff @@ -9918,7 +9870,7 @@ index b3b391a49fdb..2c82b6578de9 100644 -- 2.30.1 -From da0b81ee826e58b1e5e5530cee2f77c9ffa4bbba Mon Sep 17 00:00:00 2001 +From 8acae4db377a938ff089d3b673a359aac1bca75c Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 13 Feb 2021 22:16:08 +0000 Subject: [PATCH] media: i2c: Tidy up ov5693 sensor init @@ -10074,7 +10026,7 @@ index 2c82b6578de9..313bc9177328 100644 -- 2.30.1 -From 58c8f883b0c227f30a7317e2206e8ab6939dd7cd Mon Sep 17 00:00:00 2001 +From 0efea969af985e646868a2e03acb61d9088c29fe Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 12 Feb 2021 16:14:04 +0000 Subject: [PATCH] media: i2c: cleanup macros in ov5693.h @@ -10220,7 +10172,7 @@ index b78d3b474a43..6502777eb5f3 100644 -- 2.30.1 -From 044cf8819322eeaa99c8e52499b6764357fd21c6 Mon Sep 17 00:00:00 2001 +From 6b76a59d6a7964aefaffd4df2621d111398e5dff Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 12 Feb 2021 16:19:09 +0000 Subject: [PATCH] media: i2c: use devm_kzalloc() to initialise ov5693 @@ -10250,7 +10202,7 @@ index 313bc9177328..d092ed698eb3 100644 -- 2.30.1 -From 0477079d23bb8559d318d0803f0e7d06d9e45be6 Mon Sep 17 00:00:00 2001 +From 6cdaa6994c03c4edd4b27cda4413d62478653bf5 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 12 Feb 2021 16:26:21 +0000 Subject: [PATCH] media: i2c: Check for supported clk rate in probe @@ -10307,7 +10259,7 @@ index 6502777eb5f3..0dfbbe9a0ff2 100644 -- 2.30.1 -From f8dec837099fd628522f29a33e4a0688be938b27 Mon Sep 17 00:00:00 2001 +From 05b3e1c013910ee54877cb0883ec68bde48f910d Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 13 Feb 2021 23:17:50 +0000 Subject: [PATCH] media: i2c: Use devres to fetch gpios @@ -10381,7 +10333,7 @@ index 8082d37841da..c580159079d2 100644 -- 2.30.1 -From 0385044877ff117385d9042666cbffaf68dae788 Mon Sep 17 00:00:00 2001 +From 44f8b2d74cf8d0ecda0b34119675977be5f60cc0 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 13 Feb 2021 23:20:47 +0000 Subject: [PATCH] media: i2c: Use devres to fetch regulators @@ -10424,7 +10376,7 @@ index c580159079d2..9f61b470f8ba 100644 -- 2.30.1 -From f5a33a3fec053a1fef75409be2b5cabf6aa0896a Mon Sep 17 00:00:00 2001 +From 8851c67a028b75aa25876baeef5637872e0bddc0 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 14 Feb 2021 12:39:14 +0000 Subject: [PATCH] media: i2c: remove debug print @@ -10503,7 +10455,7 @@ index 9f61b470f8ba..622a7ddf4063 100644 -- 2.30.1 -From 7ea821a1907225382ec148ee1d0bbbf8369ee113 Mon Sep 17 00:00:00 2001 +From dccc0c21df12e39bc3eb994ca23650b9445d2261 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 14 Feb 2021 14:32:50 +0000 Subject: [PATCH] media: i2c: Remove unused resolutions from ov5693 @@ -10932,7 +10884,7 @@ index 0dfbbe9a0ff2..29e6735112da 100644 -- 2.30.1 -From 2d4ebcefd309fd583a75fe1d61242ede4d341237 Mon Sep 17 00:00:00 2001 +From dcf7ffb69fd62c1ea6e821d5203346c4637cada9 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 14 Feb 2021 14:45:58 +0000 Subject: [PATCH] media: i2c: update set_fmt() for ov5693 diff --git a/patches/5.11/0010-ath10k-firmware-override.patch b/patches/5.11/0010-ath10k-firmware-override.patch new file mode 100644 index 000000000..83b1e5ca2 --- /dev/null +++ b/patches/5.11/0010-ath10k-firmware-override.patch @@ -0,0 +1,120 @@ +From 8f475731fb84c2718743c8dbc03610a6f987cc1e Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sat, 27 Feb 2021 00:45:52 +0100 +Subject: [PATCH] ath10k: Add module parameters to override board files + +Some Surface devices, specifically the Surface Go and AMD version of the +Surface Laptop 3 (wich both come with QCA6174 WiFi chips), work better +with a different board file, as it seems that the firmeware included +upstream is buggy. + +As it is generally not a good idea to randomly overwrite files, let +alone doing so via packages, we add module parameters to override those +file names in the driver. This allows us to package/deploy the override +via a modprobe.d config. + +Signed-off-by: Maximilian Luz +--- + drivers/net/wireless/ath/ath10k/core.c | 58 ++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c +index a419ec7130f9..b2c21bf5995e 100644 +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -35,6 +35,9 @@ static bool skip_otp; + static bool rawmode; + static bool fw_diag_log; + ++static char *override_board = ""; ++static char *override_board2 = ""; ++ + unsigned long ath10k_coredump_mask = BIT(ATH10K_FW_CRASH_DUMP_REGISTERS) | + BIT(ATH10K_FW_CRASH_DUMP_CE_DATA); + +@@ -47,6 +50,9 @@ module_param(rawmode, bool, 0644); + module_param(fw_diag_log, bool, 0644); + module_param_named(coredump_mask, ath10k_coredump_mask, ulong, 0444); + ++module_param(override_board, charp, 0644); ++module_param(override_board2, charp, 0644); ++ + MODULE_PARM_DESC(debug_mask, "Debugging mask"); + MODULE_PARM_DESC(uart_print, "Uart target debugging"); + MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode"); +@@ -55,6 +61,9 @@ MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath"); + MODULE_PARM_DESC(coredump_mask, "Bitfield of what to include in firmware crash file"); + MODULE_PARM_DESC(fw_diag_log, "Diag based fw log debugging"); + ++MODULE_PARM_DESC(override_board, "Override for board.bin file"); ++MODULE_PARM_DESC(override_board2, "Override for board-2.bin file"); ++ + static const struct ath10k_hw_params ath10k_hw_params_list[] = { + { + .id = QCA988X_HW_2_0_VERSION, +@@ -810,6 +819,42 @@ static int ath10k_init_configure_target(struct ath10k *ar) + return 0; + } + ++static const char *ath10k_override_board_fw_file(struct ath10k *ar, ++ const char *file) ++{ ++ if (strcmp(file, "board.bin") == 0) { ++ if (strcmp(override_board, "") == 0) ++ return file; ++ ++ if (strcmp(override_board, "none") == 0) { ++ dev_info(ar->dev, "firmware override: pretending 'board.bin' does not exist\n"); ++ return NULL; ++ } ++ ++ dev_info(ar->dev, "firmware override: replacing 'board.bin' with '%s'\n", ++ override_board); ++ ++ return override_board; ++ } ++ ++ if (strcmp(file, "board-2.bin") == 0) { ++ if (strcmp(override_board2, "") == 0) ++ return file; ++ ++ if (strcmp(override_board2, "none") == 0) { ++ dev_info(ar->dev, "firmware override: pretending 'board-2.bin' does not exist\n"); ++ return NULL; ++ } ++ ++ dev_info(ar->dev, "firmware override: replacing 'board-2.bin' with '%s'\n", ++ override_board2); ++ ++ return override_board2; ++ } ++ ++ return file; ++} ++ + static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar, + const char *dir, + const char *file) +@@ -824,6 +869,19 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar, + if (dir == NULL) + dir = "."; + ++ /* HACK: Override board.bin and board-2.bin files if specified. ++ * ++ * Some Surface devices perform better with a different board ++ * configuration. To this end, one would need to replace the board.bin ++ * file with the modified config and remove the board-2.bin file. ++ * Unfortunately, that's not a solution that we can easily package. So ++ * we add module options to perform these overrides here. ++ */ ++ ++ file = ath10k_override_board_fw_file(ar, file); ++ if (!file) ++ return ERR_PTR(-ENOENT); ++ + snprintf(filename, sizeof(filename), "%s/%s", dir, file); + ret = firmware_request_nowarn(&fw, filename, ar->dev); + ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n", +-- +2.30.1 + diff --git a/pkg/arch/kernel/0010-ath10k-firmware-override.patch b/pkg/arch/kernel/0010-ath10k-firmware-override.patch new file mode 120000 index 000000000..a8e1bd93f --- /dev/null +++ b/pkg/arch/kernel/0010-ath10k-firmware-override.patch @@ -0,0 +1 @@ +../../../patches/5.11/0010-ath10k-firmware-override.patch \ No newline at end of file diff --git a/pkg/arch/kernel/PKGBUILD b/pkg/arch/kernel/PKGBUILD index 7f1286f46..38e250229 100644 --- a/pkg/arch/kernel/PKGBUILD +++ b/pkg/arch/kernel/PKGBUILD @@ -36,6 +36,7 @@ source=( 0007-surface-typecover.patch 0008-surface-sensors.patch 0009-cameras.patch + 0010-ath10k-firmware-override.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds @@ -46,15 +47,16 @@ sha256sums=('90820a7e47c958d01a9d001f87d9b13edd32b63b9a880fca8caae3ae6367ca29' 'd8d5d11c80424985642b0eea6ace3256b5a1e5e69d637104523460a5ebdda202' '3fbd134c61de6f4fa86567bb0faf02c4eb2c54111b6dc45367b8f6e9ef06556e' '8cd2b019aac6d3807a5cdcbbbe0aad81e63193ff3e8dffd7a79d4a1421b858f6' - 'b7c6f90940e045d9b98704f6c1ee783de3a6036f6509d51ed40e5cb4fd6573b7' - '0fabd3dad13b191ff0f0154faee6d689749e7557f606ee21e89197a6219fd8f6' - '5cebfbd408af53cf47057a515b0e31d5d7cef077d6504e6a92e40c4f851a37e1' - '4756e2c7d0fdd53e0079175915bb0c7e2e5b0d027c42b2a36a8ed64728f1a53e' - 'e4984dedbac210b1f145dbd73164e9a2192a462e7092eb05060ddda6c8e7bb4d' - 'ea243724dae4cd66638767d7551892b11d2b69460dfc4f519ecf13342f1a76f4' - '2b5bcd34340c60320566e0b13d0d2337e14606d96514541ee6d62182bef22e52' - '9aeb52e72929f1806dbedb08ba16ce49da65b7078c93dd783cd8f6a7abe006bf' - 'a422d3a6eb82b44940ffabe7b0bb89e0ebaad0016aa5b964355eeeeafab7eb24') + '9e7fea8b5c65b48257f54e42cacbedfb29f9c9878866d8435c8e03bc75ee6ee4' + '497358ccba2f03346bab2b0d152ee7aa5aa605c03081e66c8e4d8c1185f0be90' + 'b5389b02d7a5b7ac2d2e1f1036b1feed9877db5c602f1581698cd12b429aea76' + 'cd05489b441f7357c1fd0d74ca60b0ceafe5c798eee27fcad79a4653162a23c7' + 'f194e1a66eec726b9dd3c828f556d2a0a31164450293cc07cee467f756efbfad' + 'a0728b87f7abeccd9508f0bc8f5617336d6253a072a54e4d2323981dfacb5de4' + 'bc7c63cd6f9781f04f19028cc7ca557283d4a65be56de58342cd99d4127ad04f' + '7d0251fd15c9c38bbd2a68120b0160f6f7db0245b2d48b6e296547f176df81cd' + 'b5587e78db8c8a8b2b3e53dc987c9d884bc36507442e1c7440fb30deb7a9f58b' + '719033b5da72d233dbeb8aef4019461554a76954ea6566c012efc866a465086c') export KBUILD_BUILD_HOST=archlinux