From de9f91813811dbc8349ee1af72b662142b2a82ec Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 8 Jan 2021 00:15:52 +0100 Subject: [PATCH] Update v5.10 patches Changes: - General: - Update patches to latest minor version, drop redundant/integrated patches - Cameras: - Add user controls to flip image - Cleanup Links: - kernel: https://github.com/linux-surface/kernel/commit/ba33f9c5291be448b00100d137889ee4b20c20e6 --- patches/5.10/0001-surface3-oemb.patch | 4 +- patches/5.10/0002-wifi.patch | 121 +-- patches/5.10/0003-ipts.patch | 12 +- patches/5.10/0004-surface-gpe.patch | 4 +- patches/5.10/0005-surface-sam-over-hid.patch | 8 +- patches/5.10/0006-surface-sam.patch | 8 +- patches/5.10/0007-surface-hotplug.patch | 99 +-- patches/5.10/0008-surface-typecover.patch | 4 +- patches/5.10/0009-cameras.patch | 744 +++++++------------ 9 files changed, 324 insertions(+), 680 deletions(-) diff --git a/patches/5.10/0001-surface3-oemb.patch b/patches/5.10/0001-surface3-oemb.patch index 8b805216b..17d8fe0fd 100644 --- a/patches/5.10/0001-surface3-oemb.patch +++ b/patches/5.10/0001-surface3-oemb.patch @@ -1,4 +1,4 @@ -From 30db822f5c6bf7c8affc922a78c434e42f966ae7 Mon Sep 17 00:00:00 2001 +From 0785a8725a66c868c5f08ce100ee08e2af26e015 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 @@ -97,5 +97,5 @@ index 2752dc955733..ef36a316e2ed 100644 }; -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0002-wifi.patch b/patches/5.10/0002-wifi.patch index 95a4abc86..26a64e5ad 100644 --- a/patches/5.10/0002-wifi.patch +++ b/patches/5.10/0002-wifi.patch @@ -1,4 +1,4 @@ -From f33474ca8096f89895a1fcef8a7699a132cd58cb Mon Sep 17 00:00:00 2001 +From 3fa477daf29bddc5b4b38cca44619ae9e4b4e7f8 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Thu, 24 Sep 2020 18:02:06 +0900 Subject: [PATCH] mwifiex: pcie: skip cancel_work_sync() on reset failure path @@ -154,9 +154,9 @@ index 843d57eda820..5ed613d65709 100644 static inline int -- -2.29.2 +2.30.0 -From 6e2dd25cff000c2d9068ddaa804e23410da323a2 Mon Sep 17 00:00:00 2001 +From c21eee9f32323450b793375bbc0d5454013940d2 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 @@ -362,9 +362,9 @@ index 000000000000..5326ae7e5671 + +void mwifiex_initialize_quirks(struct pcie_service_card *card); -- -2.29.2 +2.30.0 -From 4e4837cc5265fac81384f88f2008aa9078795221 Mon Sep 17 00:00:00 2001 +From e90039b0852fd01960492eed7d97cbb9f53107fe 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+ @@ -563,9 +563,9 @@ index 5326ae7e5671..8b9dcb5070d8 100644 void mwifiex_initialize_quirks(struct pcie_service_card *card); +int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); -- -2.29.2 +2.30.0 -From 3b55ac7957893878dfa730d3e7068b15a583e69e Mon Sep 17 00:00:00 2001 +From 9a6f3f243387eadbfce6945c98d3ace2b3dd23c0 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 @@ -742,9 +742,9 @@ index 8b9dcb5070d8..3ef7440418e3 100644 int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); +int mwifiex_pcie_reset_wsid_quirk(struct pci_dev *pdev); -- -2.29.2 +2.30.0 -From ac37ee44eb36b38f61ad5dbd359e5e79477bbca5 Mon Sep 17 00:00:00 2001 +From 10c87526cbae4ad49f858974ff8259e4799dcceb 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 @@ -804,86 +804,9 @@ index f0a6fa0a7ae5..34dcd84f02a6 100644 .ident = "Surface Pro 3", .matches = { -- -2.29.2 +2.30.0 -From 5818b71cf20ec3fd1a56c1fe08596d9330f5b02f Mon Sep 17 00:00:00 2001 -From: Tsuchiya Yuto -Date: Thu, 24 Sep 2020 01:56:29 +0900 -Subject: [PATCH] mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure - -When FLR is performed but without fw reset for some reasons (e.g. on -Surface devices, fw reset requires another quirk), it fails to reset -properly. You can trigger the issue on such devices via debugfs entry -for reset: - - $ echo 1 | sudo tee /sys/kernel/debug/mwifiex/mlan0/reset - -and the resulting dmesg log: - - mwifiex_pcie 0000:03:00.0: Resetting per request - mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 3 - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: info: shutdown mwifiex... - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed - mwifiex_pcie 0000:03:00.0: WLAN FW already running! Skip FW dnld - mwifiex_pcie 0000:03:00.0: WLAN FW is active - mwifiex_pcie 0000:03:00.0: Unknown api_id: 4 - mwifiex_pcie 0000:03:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (15.68.19.p21) - mwifiex_pcie 0000:03:00.0: driver_version = mwifiex 1.0 (15.68.19.p21) - mwifiex_pcie 0000:03:00.0: info: trying to associate to '[SSID]' bssid [BSSID] - mwifiex_pcie 0000:03:00.0: info: associated to bssid [BSSID] successfully - mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 - mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 15 - mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 - mwifiex_pcie 0000:03:00.0: deleting the crypto keys - [...] - -When comparing mwifiex_shutdown_sw() with mwifiex_pcie_remove(), it -lacks mwifiex_init_shutdown_fw(). - -This commit fixes mwifiex_shutdown_sw() by adding the missing -mwifiex_init_shutdown_fw(). - -Fixes: 4c5dae59d2e9 ("mwifiex: add PCIe function level reset support") -Signed-off-by: Tsuchiya Yuto -Patchset: wifi ---- - drivers/net/wireless/marvell/mwifiex/main.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c -index 9ba8a8f64976..6283df5aaaf8 100644 ---- a/drivers/net/wireless/marvell/mwifiex/main.c -+++ b/drivers/net/wireless/marvell/mwifiex/main.c -@@ -1471,6 +1471,8 @@ int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) - priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); - mwifiex_deauthenticate(priv, NULL); - -+ mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN); -+ - mwifiex_uninit_sw(adapter); - adapter->is_up = false; - --- -2.29.2 - -From 2ee99cf85e62bd8226e8d0b405779781cb07abd3 Mon Sep 17 00:00:00 2001 +From 07cb2de05444afaa155babe3b441db3c6ad1521e 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 @@ -1023,9 +946,9 @@ index 94561ddaf126..7b25335f1df3 100644 return 0; } -- -2.29.2 +2.30.0 -From d01e1a6c07a5c8402a2193890280e3a1c5309898 Mon Sep 17 00:00:00 2001 +From 81a335766a264983d5d4952d17ee4c6874a390ab 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 @@ -1072,9 +995,9 @@ index 7b25335f1df3..f7e0b86eb553 100644 if (!adapter->devdump_data) { mwifiex_dbg(adapter, ERROR, -- -2.29.2 +2.30.0 -From 552e0749f9eed307e8776d5859e5a2bd4b09976b Mon Sep 17 00:00:00 2001 +From b3932f90d70e5008a0e5e8d9c46eee56dda3ea2d 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+ @@ -1227,9 +1150,9 @@ index 3ef7440418e3..a95ebac06e13 100644 void mwifiex_initialize_quirks(struct pcie_service_card *card); int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); -- -2.29.2 +2.30.0 -From 47fd5e97de1b6d2e5cf5db786ac8e91a48c56925 Mon Sep 17 00:00:00 2001 +From 383566809fd6ed44fb08f6a99ce4ed9da4ad1978 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 @@ -1289,9 +1212,9 @@ index a6b9dc6700b1..943bc1e8ceae 100644 } -- -2.29.2 +2.30.0 -From 5b66d3d049c4dc5a16712f409c88ba58ae59ff7e Mon Sep 17 00:00:00 2001 +From 5e4d61a2f464f86943f160bf135e33cf9b579e4f 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 @@ -1324,9 +1247,9 @@ index 943bc1e8ceae..a2eb8df8d385 100644 } -- -2.29.2 +2.30.0 -From bfff63e6ae5011022893dddab976610407f23b5f Mon Sep 17 00:00:00 2001 +From 65ef427dd95762e9c129fb657306df97b518e64e 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 @@ -1372,5 +1295,5 @@ index d3a968ef21ef..9b7b52fbc9c4 100644 if (drcs) { -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0003-ipts.patch b/patches/5.10/0003-ipts.patch index b87def3e5..d8f2f3b99 100644 --- a/patches/5.10/0003-ipts.patch +++ b/patches/5.10/0003-ipts.patch @@ -1,4 +1,4 @@ -From 4e9bc5faefbcd5720184644492d2edf6a51a3173 Mon Sep 17 00:00:00 2001 +From cc266a643cfcd4ba732024ddebeb5fd4d795b9f4 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Fri, 25 Sep 2020 18:06:05 +0200 Subject: [PATCH] mei: Remove client devices before shutting down @@ -25,9 +25,9 @@ index bcee77768b91..21ed765003e1 100644 mei_cancel_work(dev); -- -2.29.2 +2.30.0 -From 27e4a2fd137f757ea71e93756832c979a51767fd Mon Sep 17 00:00:00 2001 +From 4b200361320c36d70644eb7f0eef9b389159cada 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 @@ -63,9 +63,9 @@ index 1de9ef7a272b..e12484840f88 100644 {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_H, MEI_ME_PCH15_SPS_CFG)}, -- -2.29.2 +2.30.0 -From 58f18dea491b8f210c6b66621fd94d7a27270e8d Mon Sep 17 00:00:00 2001 +From b96d9f6408baa9c9a0f4d3547cbe6f0e53b3b898 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 @@ -1412,5 +1412,5 @@ index 000000000000..4c667bb6a7f2 +#endif /* _IPTS_UAPI_H_ */ + -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0004-surface-gpe.patch b/patches/5.10/0004-surface-gpe.patch index a4bfd12ba..abfe4c21a 100644 --- a/patches/5.10/0004-surface-gpe.patch +++ b/patches/5.10/0004-surface-gpe.patch @@ -1,4 +1,4 @@ -From f85420b78206233f47b19200ec09acf06a8836bb Mon Sep 17 00:00:00 2001 +From d1090d0401f8a893366ba6f98056c1ed52a64595 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 16 Aug 2020 23:39:56 +0200 Subject: [PATCH] platform/x86: Add Driver to set up lid GPEs on MS Surface @@ -397,5 +397,5 @@ index 000000000000..573dc52f568f +MODULE_LICENSE("GPL"); +MODULE_ALIAS("dmi:*:svnMicrosoftCorporation:pnSurface*:*"); -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0005-surface-sam-over-hid.patch b/patches/5.10/0005-surface-sam-over-hid.patch index bc2869024..25a62f050 100644 --- a/patches/5.10/0005-surface-sam-over-hid.patch +++ b/patches/5.10/0005-surface-sam-over-hid.patch @@ -1,4 +1,4 @@ -From 1d5b4473063525822fbbd111efcd4ea3f387058f Mon Sep 17 00:00:00 2001 +From b8aed8d33836af83212c203d6dd7b88eaa8246b3 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 @@ -108,9 +108,9 @@ index 37c510d9347a..aed579942436 100644 dev_warn(&adapter->dev, "protocol 0x%02x not supported for client 0x%02x\n", accessor_type, client->addr); -- -2.29.2 +2.30.0 -From 94f72ec4114bc660578c66bf88db5a7022235015 Mon Sep 17 00:00:00 2001 +From ffcb62de7f27deae5c0313c6f165c70a2e9d36e8 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 6 Sep 2020 04:01:19 +0200 Subject: [PATCH] platform/x86: Add driver for Surface Book 1 dGPU switch @@ -331,5 +331,5 @@ index 000000000000..8c66ed5110fd +MODULE_DESCRIPTION("Discrete GPU Power-Switch for Surface Book 1"); +MODULE_LICENSE("GPL"); -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0006-surface-sam.patch b/patches/5.10/0006-surface-sam.patch index 34d549c26..e95ecc6ea 100644 --- a/patches/5.10/0006-surface-sam.patch +++ b/patches/5.10/0006-surface-sam.patch @@ -1,4 +1,4 @@ -From 147884c84c057b3dd1cdb8a028919f201e6f2862 Mon Sep 17 00:00:00 2001 +From 1dbfc49cd901dfa219c3e0278d515cba81d00b98 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 17 Aug 2020 01:23:20 +0200 Subject: [PATCH] misc: surface_sam: Add file2alias support for Surface SAM @@ -98,9 +98,9 @@ index 2417dd1dee33..a6c583362b92 100644 /* Create MODULE_ALIAS() statements. -- -2.29.2 +2.30.0 -From cf285846d8242d9956a7d5ca78cf58066d6d5196 Mon Sep 17 00:00:00 2001 +From c272728a1daf62feceacaaa1d67eeff91e626e2a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 17 Aug 2020 01:44:30 +0200 Subject: [PATCH] misc: Add support for Surface System Aggregator Module @@ -19714,5 +19714,5 @@ index a6c583362b92..5b79fdc42641 100644 ADD(alias, "f", match_flags & SSAM_MATCH_FUNCTION, function); -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0007-surface-hotplug.patch b/patches/5.10/0007-surface-hotplug.patch index 46a5094c2..ce9d4ac21 100644 --- a/patches/5.10/0007-surface-hotplug.patch +++ b/patches/5.10/0007-surface-hotplug.patch @@ -1,89 +1,4 @@ -From 7013eb7abf78f68124b4f1822610e1c8a954dc66 Mon Sep 17 00:00:00 2001 -From: Maximilian Luz -Date: Thu, 29 Oct 2020 22:04:38 +0100 -Subject: [PATCH] PCI: Allow D3cold for hot-plug ports on Surface Books - -The Microsoft Surface Book series of devices have a tablet part (so -called clipboard) that can be detached from the base of the device. -While the clipboard contains the CPU, the base can contain a discrete -GPU (dGPU). This dGPU is connected via a PCIe hot-plug port. - -Currently D3cold is disallowed for all hot-plug ports. On the Surface -Book 2 and 3, this leads to increased power consumption during suspend -and when the dGPU is not used (i.e. runtime suspended). This can be -observed not only in battery drain, but also by the dGPU getting notably -warm while suspended and not in D3cold. - -Testing shows that the Surface Books behave well with D3cold enabled for -hot-plug ports, alleviating the aforementioned issues. Thus white-list -D3cold for hot-plug ports on those devices. - -Note: PCIe hot-plug signalling while the device is in D3cold is handled -via ACPI, out-of-band interrupts, and the surface_hotplug driver -(combined). The device will work without the surface_hotplug driver, -however, device removal/addition will only be detected on device resume. - -Signed-off-by: Maximilian Luz -Patchset: surface-hotplug ---- - drivers/pci/pci.c | 31 +++++++++++++++++++++++++++++-- - 1 file changed, 29 insertions(+), 2 deletions(-) - -diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c -index e578d34095e9..01734e413102 100644 ---- a/drivers/pci/pci.c -+++ b/drivers/pci/pci.c -@@ -2827,6 +2827,32 @@ static const struct dmi_system_id bridge_d3_blacklist[] = { - { } - }; - -+static const struct dmi_system_id bridge_d3_hotplug_whitelist[] = { -+#ifdef CONFIG_X86 -+ { -+ /* -+ * Microsoft Surface Books have a hot-plug root port for the -+ * discrete GPU (the device containing it can be detached form -+ * the top-part, containing the cpu). -+ * -+ * If this discrete GPU is not transitioned into D3cold for -+ * suspend, the device will become notably warm and also -+ * consume a lot more power than desirable. -+ * -+ * We assume that since those devices have been confirmed -+ * working with D3, future Surface devices will too. So let's -+ * keep this match generic. -+ */ -+ .ident = "Microsoft Surface", -+ .matches = { -+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), -+ DMI_MATCH(DMI_PRODUCT_NAME, "Surface"), -+ }, -+ }, -+#endif -+ { } -+}; -+ - /** - * pci_bridge_d3_possible - Is it possible to put the bridge into D3 - * @bridge: Bridge to check -@@ -2867,10 +2893,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) - /* - * Hotplug ports handled natively by the OS were not validated - * by vendors for runtime D3 at least until 2018 because there -- * was no OS support. -+ * was no OS support. Explicitly whitelist systems that have -+ * been confirmed working. - */ - if (bridge->is_hotplug_bridge) -- return false; -+ return dmi_check_system(bridge_d3_hotplug_whitelist); - - if (dmi_check_system(bridge_d3_blacklist)) - return false; --- -2.29.2 - -From 160f2f5c028248e39fb74e76f2e37a08980fb34e Mon Sep 17 00:00:00 2001 +From 3a8f566913304b60290abdcfa616f7180dbae74a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 9 Nov 2020 14:23:00 +0100 Subject: [PATCH] PCI: Run platform power transition on initial D0 entry @@ -128,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 01734e413102..05cb31b64c14 100644 +index 6427cbd0a5be..3200afed2604 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1804,7 +1804,7 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars) @@ -141,9 +56,9 @@ index 01734e413102..05cb31b64c14 100644 return err; -- -2.29.2 +2.30.0 -From 61d2b10012ac5dea690affbd7d608c03e96eba38 Mon Sep 17 00:00:00 2001 +From 29ec20b0936cd1fe938d4ef02c3dd779f739f2bf Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 31 Oct 2020 20:46:33 +0100 Subject: [PATCH] PCI: Add sysfs attribute for PCI device power state @@ -214,9 +129,9 @@ index d15c881e2e7e..b15f754e6346 100644 &dev_attr_vendor.attr, &dev_attr_device.attr, -- -2.29.2 +2.30.0 -From 03040ac65d5c89628338fff1a73a4c42e42e0862 Mon Sep 17 00:00:00 2001 +From d47cb9b5fa8704709618b4d0a183cf5b5dbfa75a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 14 Dec 2020 20:50:59 +0100 Subject: [PATCH] platform/x86: Add Surface Hotplug driver @@ -544,5 +459,5 @@ index 000000000000..572fba30cd77 +MODULE_DESCRIPTION("Surface Hot-Plug Signaling Driver for Surface Book Devices"); +MODULE_LICENSE("GPL"); -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0008-surface-typecover.patch b/patches/5.10/0008-surface-typecover.patch index 862e2076b..b60ac67a8 100644 --- a/patches/5.10/0008-surface-typecover.patch +++ b/patches/5.10/0008-surface-typecover.patch @@ -1,4 +1,4 @@ -From 40b847e2217c860e1a33b8825bf4abf175ba6df9 Mon Sep 17 00:00:00 2001 +From 8f7822534af5e10e5f7e394ee988bc90234dfb00 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 @@ -229,5 +229,5 @@ index d670bcd57bde..ca7544bf876e 100644 { .driver_data = MT_CLS_GOOGLE, HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE, -- -2.29.2 +2.30.0 diff --git a/patches/5.10/0009-cameras.patch b/patches/5.10/0009-cameras.patch index 424be1045..bc5235c06 100644 --- a/patches/5.10/0009-cameras.patch +++ b/patches/5.10/0009-cameras.patch @@ -1,268 +1,4 @@ -From 4ad46195b010200b0980832f3d9e99018dda1f95 Mon Sep 17 00:00:00 2001 -From: Sakari Ailus -Date: Mon, 12 Oct 2020 21:04:07 +0300 -Subject: [PATCH] ipu3-cio2: Return actual subdev format - -Return actual subdev format on ipu3-cio2 subdev pads. The earlier -implementation was based on an infinite recursion that exhausted the -stack. - -Reported-by: Tsuchiya Yuto -Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") -Signed-off-by: Sakari Ailus -Reviewed-by: Laurent Pinchart -Reviewed-by: Bingbu Cao -Reviewed-by: Andy Shevchenko -Cc: stable@vger.kernel.org # v4.16 and up -Patchset: cameras ---- - drivers/media/pci/intel/ipu3/ipu3-cio2.c | 24 +++--------------------- - 1 file changed, 3 insertions(+), 21 deletions(-) - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index 4e598e937dfe..afa472026ba4 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1232,29 +1232,11 @@ static int cio2_subdev_get_fmt(struct v4l2_subdev *sd, - struct v4l2_subdev_format *fmt) - { - struct cio2_queue *q = container_of(sd, struct cio2_queue, subdev); -- struct v4l2_subdev_format format; -- int ret; - -- if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { -+ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) - fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); -- return 0; -- } -- -- if (fmt->pad == CIO2_PAD_SINK) { -- format.which = V4L2_SUBDEV_FORMAT_ACTIVE; -- ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, -- &format); -- -- if (ret) -- return ret; -- /* update colorspace etc */ -- q->subdev_fmt.colorspace = format.format.colorspace; -- q->subdev_fmt.ycbcr_enc = format.format.ycbcr_enc; -- q->subdev_fmt.quantization = format.format.quantization; -- q->subdev_fmt.xfer_func = format.format.xfer_func; -- } -- -- fmt->format = q->subdev_fmt; -+ else -+ fmt->format = q->subdev_fmt; - - return 0; - } --- -2.29.2 - -From 388609d7961f7d8a2b249f38529672230687016e Mon Sep 17 00:00:00 2001 -From: Sakari Ailus -Date: Mon, 12 Oct 2020 21:04:08 +0300 -Subject: [PATCH] ipu3-cio2: Serialise access to pad format - -Pad format can be accessed from user space. Serialise access to it. - -Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") -Signed-off-by: Sakari Ailus -Reviewed-by: Laurent Pinchart -Reviewed-by: Bingbu Cao -Reviewed-by: Andy Shevchenko -Cc: stable@vger.kernel.org # v4.16 and up -Patchset: cameras ---- - drivers/media/pci/intel/ipu3/ipu3-cio2.c | 11 +++++++++++ - drivers/media/pci/intel/ipu3/ipu3-cio2.h | 1 + - 2 files changed, 12 insertions(+) - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index afa472026ba4..b3a08196e08c 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1233,11 +1233,15 @@ static int cio2_subdev_get_fmt(struct v4l2_subdev *sd, - { - struct cio2_queue *q = container_of(sd, struct cio2_queue, subdev); - -+ mutex_lock(&q->subdev_lock); -+ - if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) - fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); - else - fmt->format = q->subdev_fmt; - -+ mutex_unlock(&q->subdev_lock); -+ - return 0; - } - -@@ -1261,6 +1265,8 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, - if (fmt->pad == CIO2_PAD_SOURCE) - return cio2_subdev_get_fmt(sd, cfg, fmt); - -+ mutex_lock(&q->subdev_lock); -+ - if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { - *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; - } else { -@@ -1271,6 +1277,8 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, - fmt->format = q->subdev_fmt; - } - -+ mutex_unlock(&q->subdev_lock); -+ - return 0; - } - -@@ -1529,6 +1537,7 @@ static int cio2_queue_init(struct cio2_device *cio2, struct cio2_queue *q) - - /* Initialize miscellaneous variables */ - mutex_init(&q->lock); -+ mutex_init(&q->subdev_lock); - - /* Initialize formats to default values */ - fmt = &q->subdev_fmt; -@@ -1645,6 +1654,7 @@ static int cio2_queue_init(struct cio2_device *cio2, struct cio2_queue *q) - fail_subdev_media_entity: - cio2_fbpt_exit(q, &cio2->pci_dev->dev); - fail_fbpt: -+ mutex_destroy(&q->subdev_lock); - mutex_destroy(&q->lock); - - return r; -@@ -1657,6 +1667,7 @@ static void cio2_queue_exit(struct cio2_device *cio2, struct cio2_queue *q) - v4l2_device_unregister_subdev(&q->subdev); - media_entity_cleanup(&q->subdev.entity); - cio2_fbpt_exit(q, &cio2->pci_dev->dev); -+ mutex_destroy(&q->subdev_lock); - mutex_destroy(&q->lock); - } - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.h b/drivers/media/pci/intel/ipu3/ipu3-cio2.h -index 549b08f88f0c..146492383aa5 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.h -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.h -@@ -335,6 +335,7 @@ struct cio2_queue { - - /* Subdev, /dev/v4l-subdevX */ - struct v4l2_subdev subdev; -+ struct mutex subdev_lock; /* Serialise acces to subdev_fmt field */ - struct media_pad subdev_pads[CIO2_PADS]; - struct v4l2_mbus_framefmt subdev_fmt; - atomic_t frame_sequence; --- -2.29.2 - -From 16eecd290d5bbfa9d1faae4f22b17b1349bb115a Mon Sep 17 00:00:00 2001 -From: Sakari Ailus -Date: Mon, 12 Oct 2020 21:04:09 +0300 -Subject: [PATCH] ipu3-cio2: Validate mbus format in setting subdev format - -Validate media bus code, width and height when setting the subdev format. - -This effectively reworks how setting subdev format is implemented in the -driver. - -Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") -Signed-off-by: Sakari Ailus -Reviewed-by: Andy Shevchenko -Reviewed-by: Laurent Pinchart -Cc: stable@vger.kernel.org # v4.16 and up -Patchset: cameras ---- - drivers/media/pci/intel/ipu3/ipu3-cio2.c | 29 ++++++++++++++++-------- - 1 file changed, 20 insertions(+), 9 deletions(-) - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index b3a08196e08c..72095f8a4d46 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1257,6 +1257,9 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, - struct v4l2_subdev_format *fmt) - { - struct cio2_queue *q = container_of(sd, struct cio2_queue, subdev); -+ struct v4l2_mbus_framefmt *mbus; -+ u32 mbus_code = fmt->format.code; -+ unsigned int i; - - /* - * Only allow setting sink pad format; -@@ -1265,18 +1268,26 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, - if (fmt->pad == CIO2_PAD_SOURCE) - return cio2_subdev_get_fmt(sd, cfg, fmt); - -- mutex_lock(&q->subdev_lock); -+ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) -+ mbus = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); -+ else -+ mbus = &q->subdev_fmt; - -- if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { -- *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; -- } else { -- /* It's the sink, allow changing frame size */ -- q->subdev_fmt.width = fmt->format.width; -- q->subdev_fmt.height = fmt->format.height; -- q->subdev_fmt.code = fmt->format.code; -- fmt->format = q->subdev_fmt; -+ fmt->format.code = formats[0].mbus_code; -+ -+ for (i = 0; i < ARRAY_SIZE(formats); i++) { -+ if (formats[i].mbus_code == fmt->format.code) { -+ fmt->format.code = mbus_code; -+ break; -+ } - } - -+ fmt->format.width = min_t(u32, fmt->format.width, CIO2_IMAGE_MAX_WIDTH); -+ fmt->format.height = min_t(u32, fmt->format.height, -+ CIO2_IMAGE_MAX_LENGTH); -+ -+ mutex_lock(&q->subdev_lock); -+ *mbus = fmt->format; - mutex_unlock(&q->subdev_lock); - - return 0; --- -2.29.2 - -From 921cc3e979059eafe87bb25c5225a96e2c7a3ae8 Mon Sep 17 00:00:00 2001 -From: Sakari Ailus -Date: Mon, 12 Oct 2020 21:04:10 +0300 -Subject: [PATCH] ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE - -The ipu3-cio2 doesn't make use of the field and this is reflected in V4L2 -buffers as well as the try format. Do this in active format, too. - -Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") -Signed-off-by: Sakari Ailus -Reviewed-by: Bingbu Cao -Reviewed-by: Andy Shevchenko -Reviewed-by: Laurent Pinchart -Cc: stable@vger.kernel.org # v4.16 and up -Patchset: cameras ---- - drivers/media/pci/intel/ipu3/ipu3-cio2.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index 72095f8a4d46..87d040e176f7 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1285,6 +1285,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, - fmt->format.width = min_t(u32, fmt->format.width, CIO2_IMAGE_MAX_WIDTH); - fmt->format.height = min_t(u32, fmt->format.height, - CIO2_IMAGE_MAX_LENGTH); -+ fmt->format.field = V4L2_FIELD_NONE; - - mutex_lock(&q->subdev_lock); - *mbus = fmt->format; --- -2.29.2 - -From 735869ecebc25ec10451678f04a25bbcca288c8a Mon Sep 17 00:00:00 2001 +From 6724a7fe43dda838f3701711be5b32c4788e5a42 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Mon, 12 Oct 2020 21:04:11 +0300 Subject: [PATCH] ipu3-cio2: Use unsigned values where appropriate @@ -578,9 +314,9 @@ index 146492383aa5..7650d7998a3f 100644 struct cio2_csi2_timing { -- -2.29.2 +2.30.0 -From a1d892ca664adc48bfa85108587f6f3d14855c1c Mon Sep 17 00:00:00 2001 +From a4a1839d13e72b1ca7c7f052b06e435d7ac0835c Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Mon, 12 Oct 2020 21:04:12 +0300 Subject: [PATCH] ipu3-cio2: Remove explicit type from frame size checks @@ -596,10 +332,10 @@ Patchset: cameras 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index 87d040e176f7..e42177f8c426 100644 +index 1fcd131482e0..b2679ff185fc 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1282,9 +1282,8 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, +@@ -1283,9 +1283,8 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, } } @@ -612,9 +348,9 @@ index 87d040e176f7..e42177f8c426 100644 mutex_lock(&q->subdev_lock); -- -2.29.2 +2.30.0 -From 91a854a6a82da8fee6cf532fb18cfe4544976f23 Mon Sep 17 00:00:00 2001 +From ee88966296444b44a6e02c6048f0225513175682 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Mon, 12 Oct 2020 21:04:13 +0300 Subject: [PATCH] ipu3-cio2: Rename CIO2_IMAGE_MAX_LENGTH as @@ -634,10 +370,10 @@ Patchset: cameras 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index e42177f8c426..d9baa8bfe54f 100644 +index b2679ff185fc..51c4dd6a8f9a 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -1094,8 +1094,8 @@ static int cio2_v4l2_try_fmt(struct file *file, void *fh, struct v4l2_format *f) +@@ -1095,8 +1095,8 @@ static int cio2_v4l2_try_fmt(struct file *file, void *fh, struct v4l2_format *f) /* Only supports up to 4224x3136 */ if (mpix->width > CIO2_IMAGE_MAX_WIDTH) mpix->width = CIO2_IMAGE_MAX_WIDTH; @@ -648,7 +384,7 @@ index e42177f8c426..d9baa8bfe54f 100644 mpix->num_planes = 1; mpix->pixelformat = fmt->fourcc; -@@ -1283,7 +1283,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, +@@ -1284,7 +1284,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, } fmt->format.width = min(fmt->format.width, CIO2_IMAGE_MAX_WIDTH); @@ -671,42 +407,9 @@ index 7650d7998a3f..ccf0b85ae36f 100644 /* 32MB = 8xFBPT_entry */ #define CIO2_MAX_LOPS 8 -- -2.29.2 +2.30.0 -From f4a7f440b3d3ae42c3d3269a9528c056a4f0d8d2 Mon Sep 17 00:00:00 2001 -From: Sakari Ailus -Date: Mon, 12 Oct 2020 21:04:14 +0300 -Subject: [PATCH] ipu3-cio2: Remove traces of returned buffers - -If starting a video buffer queue fails, the buffers are returned to -videobuf2. Remove the reference to the buffer from driver's queue as well. - -Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") -Signed-off-by: Sakari Ailus -Cc: stable@vger.kernel.org # v4.16 and up -Reviewed-by: Andy Shevchenko -Reviewed-by: Laurent Pinchart -Patchset: cameras ---- - drivers/media/pci/intel/ipu3/ipu3-cio2.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -index d9baa8bfe54f..51c4dd6a8f9a 100644 ---- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c -+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c -@@ -791,6 +791,7 @@ static void cio2_vb2_return_all_buffers(struct cio2_queue *q, - atomic_dec(&q->bufs_queued); - vb2_buffer_done(&q->bufs[i]->vbb.vb2_buf, - state); -+ q->bufs[i] = NULL; - } - } - } --- -2.29.2 - -From cd5845a3875b4c31fa9de291060d9b4155f6c23d Mon Sep 17 00:00:00 2001 +From 3eff25474b3f65e7acfa1c2fc5b4fffae3114f96 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Tue, 13 Oct 2020 17:25:35 +0300 Subject: [PATCH] ipu3-cio2: Check receved the size against payload size, not @@ -758,47 +461,9 @@ index 51c4dd6a8f9a..c557d189200b 100644 } atomic_inc(&q->frame_sequence); -- -2.29.2 +2.30.0 -From 2051dc8901ff9b98fc5348288e3817de8e13295d Mon Sep 17 00:00:00 2001 -From: Daniel Scally -Date: Sat, 5 Dec 2020 17:04:03 +0000 -Subject: [PATCH] Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate - resources walks" - -This reverts commit 8a66790b7850a6669129af078768a1d42076a0ef. - -Switching this function to AE_CTRL_TERMINATE broke the documented -behaviour of acpi_dev_get_resources() - AE_CTRL_TERMINATE does not, in -fact, terminate the resource walk because acpi_walk_resource_buffer() -ignores it (specifically converting it to AE_OK), referring to that -value as "an OK termination by the user function". This means that -acpi_dev_get_resources() does not abort processing when the preproc -function returns a negative value. - -Signed-off-by: Daniel Scally -Patchset: cameras ---- - drivers/acpi/resource.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c -index ad04824ca3ba..f2f5f1dc7c61 100644 ---- a/drivers/acpi/resource.c -+++ b/drivers/acpi/resource.c -@@ -541,7 +541,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, - ret = c->preproc(ares, c->preproc_data); - if (ret < 0) { - c->error = ret; -- return AE_CTRL_TERMINATE; -+ return AE_ABORT_METHOD; - } else if (ret > 0) { - return AE_OK; - } --- -2.29.2 - -From 04e639830e80e711e141cf1ab0bb7f489e4f9692 Mon Sep 17 00:00:00 2001 +From 2d2ff25aedd907713bbfa66ce02de3edb0d99093 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 24 Oct 2020 22:42:28 +0100 Subject: [PATCH] property: Return true in fwnode_device_is_available for node @@ -837,9 +502,9 @@ index 4c43d30145c6..a5ca2306796f 100644 } EXPORT_SYMBOL_GPL(fwnode_device_is_available); -- -2.29.2 +2.30.0 -From 9ae3b927a4c5bbd1eebdff0f5e981c67e3e4d776 Mon Sep 17 00:00:00 2001 +From fbe20186e97d7f425d2280d5d98e0804c91c3710 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 21 Nov 2020 22:06:38 +0000 Subject: [PATCH] property: Add support for calling @@ -873,9 +538,9 @@ index a5ca2306796f..4ece6b086e36 100644 } EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id); -- -2.29.2 +2.30.0 -From 634fc1f6594456f48c9354c77b0061be33334b19 Mon Sep 17 00:00:00 2001 +From 8c4ccad522391bef6e526313ebe6a48c734e2b7b Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sat, 10 Oct 2020 23:42:09 +0100 Subject: [PATCH] software_node: Fix failure to put() and get() references to @@ -917,9 +582,9 @@ index 010828fc785b..615a0c93e116 100644 static struct fwnode_handle * -- -2.29.2 +2.30.0 -From beccdf398ff0bdb15ad49920e3f4c42cebffc85c Mon Sep 17 00:00:00 2001 +From 83d8bf9a179ffdfbea4d49190723c2121e2f6cf7 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 @@ -967,9 +632,9 @@ index 615a0c93e116..af7930b3679e 100644 EXPORT_SYMBOL_GPL(software_node_register_nodes); -- -2.29.2 +2.30.0 -From c479a0738d1babc2d9b49ec348228a82bbdf0a3b Mon Sep 17 00:00:00 2001 +From a79416727dfa1e3be06459a9f9a53f09cbde73ee Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 22:16:38 +0100 Subject: [PATCH] software_node: Alter software_node_unregister_nodes() to @@ -1025,9 +690,9 @@ index af7930b3679e..d39e1c76d98d 100644 } EXPORT_SYMBOL_GPL(software_node_unregister_nodes); -- -2.29.2 +2.30.0 -From 5ffdeebf4be8058b8e02741ef3946693f494348c Mon Sep 17 00:00:00 2001 +From e2173d849ceec4f6f54386d8c95d5b5bc89c1293 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 22:25:03 +0100 Subject: [PATCH] software_node: amend software_node_unregister_node_group() to @@ -1062,9 +727,9 @@ index d39e1c76d98d..9bd0bb77ad5b 100644 } EXPORT_SYMBOL_GPL(software_node_unregister_node_group); -- -2.29.2 +2.30.0 -From e7198435a6b151ee356d9cbb50a56e0b43418ca2 Mon Sep 17 00:00:00 2001 +From 32609e5229c8bb29efde6d1e55ae704a1d932827 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 @@ -1224,9 +889,9 @@ index 9bd0bb77ad5b..0c7a8d6b9ea8 100644 /* -------------------------------------------------------------------------- */ -- -2.29.2 +2.30.0 -From 58c1dec868e59bc7c7cbbd1b7fb88e176b7a6d6e Mon Sep 17 00:00:00 2001 +From 978da96368c650761c10c831f75c8a6d70f7d280 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 @@ -1258,9 +923,9 @@ index 7ac87f18a10f..7d60f24240a4 100644 static void __init -- -2.29.2 +2.30.0 -From 02035310ef8d574c08feb6de158c62278f59f565 Mon Sep 17 00:00:00 2001 +From 325fd20fa2707b688748b9cc4e3e984c56dd0700 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 @@ -1287,9 +952,9 @@ index 281de213ef47..5a1c6e959aa8 100644 F: drivers/media/pci/intel/ipu3/ -- -2.29.2 +2.30.0 -From 1b58ed79094bd9768b007c45a6689b088105db70 Mon Sep 17 00:00:00 2001 +From 38dcf34032f38521a24e767d6b9224d15fd456b8 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 to allow module to be built @@ -1321,9 +986,9 @@ similarity index 100% rename from drivers/media/pci/intel/ipu3/ipu3-cio2.c rename to drivers/media/pci/intel/ipu3/ipu3-cio2-main.c -- -2.29.2 +2.30.0 -From 9539d61838f947dc109cd2503f97743c1e605986 Mon Sep 17 00:00:00 2001 +From 74556421e7287ffce9ff0155df832094dd352ed1 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 possible match in @@ -1360,9 +1025,9 @@ index e3ab003a6c85..6486dbde784f 100644 * Otherwise, check if the sd fwnode and the asd fwnode refer to an * endpoint or a device. If they're of the same type, there's no match. -- -2.29.2 +2.30.0 -From 40715cb60c093f415ee4dbcc2803e8c5f464cc00 Mon Sep 17 00:00:00 2001 +From 902528ae0440be5e64107effc15efe0b8b4fcc71 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 15 Nov 2020 08:15:34 +0000 Subject: [PATCH] acpi: Add acpi_dev_get_next_match_dev() and macro to iterate @@ -1446,10 +1111,10 @@ index d5411a166685..c177165c8db2 100644 /* diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index a3abcc4b7d9f..0a028ba967d3 100644 +index 6d1879bf9440..02a716a0af5d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h -@@ -688,9 +688,16 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev) +@@ -683,9 +683,16 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev) bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2); @@ -1467,9 +1132,9 @@ index a3abcc4b7d9f..0a028ba967d3 100644 { put_device(&adev->dev); -- -2.29.2 +2.30.0 -From a9bc6600acd912e323f543667ba1e37793769618 Mon Sep 17 00:00:00 2001 +From fe93b62c3e4bd129fe8e47c935e637f06e0e412a Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 21 Oct 2020 21:53:44 +0100 Subject: [PATCH] ipu3-cio2: Add functionality allowing software_node @@ -1983,9 +1648,9 @@ index ccf0b85ae36f..520a27c9cdad 100644 + #endif -- -2.29.2 +2.30.0 -From 3f11464475af9e734b03b8675e0d684e31ff5004 Mon Sep 17 00:00:00 2001 +From d47ca9659358677aea827a0f403cfc7ccf9ccf6d 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 @@ -2090,10 +1755,10 @@ index c177165c8db2..7099529121db 100644 * acpi_dev_get_next_match_dev - Return the next match of ACPI device * @adev: Pointer to the previous acpi_device matching this hid, uid and hrv diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index 0a028ba967d3..f5dfeb030b9c 100644 +index 02a716a0af5d..33deb22294f2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h -@@ -688,6 +688,8 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev) +@@ -683,6 +683,8 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev) bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2); @@ -2103,9 +1768,9 @@ index 0a028ba967d3..f5dfeb030b9c 100644 acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); struct acpi_device * -- -2.29.2 +2.30.0 -From bcdba54f63ea3119b1466c657e1b8f0aaeb35646 Mon Sep 17 00:00:00 2001 +From 6ed8bea5378b79afcf7fe349b3fc90a794eb92a4 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 16 Nov 2020 21:38:49 +0000 Subject: [PATCH] i2c: i2c-core-acpi: Add i2c_acpi_dev_name() @@ -2173,9 +1838,9 @@ index 56622658b215..ab0e505b2ca6 100644 { return NULL; -- -2.29.2 +2.30.0 -From 48d9cf49b2118f42631a0422afb1d4b3706fc14e Mon Sep 17 00:00:00 2001 +From ede2c404c07285093e1ee9bca9cf354f1df565c8 Mon Sep 17 00:00:00 2001 From: Dan Scally Date: Mon, 16 Nov 2020 21:45:22 +0000 Subject: [PATCH] i2c: i2c-core-base: Use the new i2c_acpi_dev_name() in @@ -2204,9 +1869,9 @@ index 573b5da145d1..a6d4ceb01077 100644 } -- -2.29.2 +2.30.0 -From b7f74359f23210fda6a907cf0aaf6960639456f2 Mon Sep 17 00:00:00 2001 +From dcad0ec65ef469c373bfe3083f39e1450d038df3 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() @@ -2268,9 +1933,9 @@ index 39263c6b52e1..737115a93138 100644 /* Device properties */ -- -2.29.2 +2.30.0 -From db4246bf78f77d8e7fe4826c586c789e4abbc71c Mon Sep 17 00:00:00 2001 +From 3216ecb9f47705838a2d9ba67ec9c56058c81839 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 27 Nov 2020 10:18:10 +0000 Subject: [PATCH] ipu3: Add driver for dummy INT3472 ACPI device @@ -2835,9 +2500,9 @@ index 000000000000..6964726e8e1f + { "MSHW0070", 2, surface_book_ov5693 }, +}; -- -2.29.2 +2.30.0 -From 1ed9a7521b330f7adbb0efb55e4552f479b71667 Mon Sep 17 00:00:00 2001 +From 240c902de0691faccd3a3c636500857c59a2cac3 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 10 Dec 2020 17:45:49 +0100 Subject: [PATCH] ipu3: int3472: Add missing IDs for Surface Book 1 @@ -2880,9 +2545,9 @@ index 6964726e8e1f..d9f74a0c94c9 100644 + { "MSHW0072", 2, surface_ov7251 }, /* Surface Book 1/Pro 4, IR */ }; -- -2.29.2 +2.30.0 -From ba31d14c1bdd8e5ef5fa70761075efdca049cfa5 Mon Sep 17 00:00:00 2001 +From 5453a46fbf2a7ef478fe32f3e6a9e2baedb4f387 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 10 Dec 2020 17:46:22 +0100 Subject: [PATCH] ipu3: int3472: Add IDs for Surface Book 2 @@ -2908,9 +2573,9 @@ index d9f74a0c94c9..242cc82b9e95 100644 + { "MSHW0152", 2, surface_ov7251 }, /* Surface Book 2 (15"), IR */ }; -- -2.29.2 +2.30.0 -From 2da3d4b53a3b805e9202d23dfea61662bdeda6d8 Mon Sep 17 00:00:00 2001 +From 8788286d80675ef68270ab3298d6cc390ab3687c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 15 Dec 2020 17:43:00 +0100 Subject: [PATCH] ipu3: int3472: Add IDs for Surface Pro 5 and Pro 6 @@ -2935,9 +2600,9 @@ index 242cc82b9e95..1d2e9cea54f4 100644 { "MSHW0141", 2, surface_ov8865 }, /* Surface Book 2 (13"), rear */ { "MSHW0142", 2, surface_ov7251 }, /* Surface Book 2 (13"), IR */ -- -2.29.2 +2.30.0 -From 67979a1c25b79e77103008d55c782dc15556e15d Mon Sep 17 00:00:00 2001 +From 6b375d2165926370501769b1c3b570741db4f091 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 10 Dec 2020 18:42:44 +0100 Subject: [PATCH] media: i2c: Add driver for OV5693 sensor @@ -2949,9 +2614,9 @@ Patchset: cameras drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/ad5823.h | 63 ++ - drivers/media/i2c/ov5693.c | 1606 ++++++++++++++++++++++++++++++++++++ + drivers/media/i2c/ov5693.c | 1610 ++++++++++++++++++++++++++++++++++++ drivers/media/i2c/ov5693.h | 1415 +++++++++++++++++++++++++++++++ - 5 files changed, 3098 insertions(+) + 5 files changed, 3102 insertions(+) create mode 100644 drivers/media/i2c/ad5823.h create mode 100644 drivers/media/i2c/ov5693.c create mode 100644 drivers/media/i2c/ov5693.h @@ -3063,10 +2728,10 @@ index 000000000000..f1362cd69f6e +#endif diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c new file mode 100644 -index 000000000000..0b2b76781b11 +index 000000000000..d6e20909d35e --- /dev/null +++ b/drivers/media/i2c/ov5693.c -@@ -0,0 +1,1606 @@ +@@ -0,0 +1,1610 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Support for OmniVision OV5693 1080p HD camera sensor. @@ -3206,8 +2871,8 @@ index 000000000000..0b2b76781b11 + return -ENODEV; + } + -+ if (data_length != OV5693_8BIT && data_length != OV5693_16BIT -+ && data_length != OV5693_32BIT) { ++ if (data_length != OV5693_8BIT && data_length != OV5693_16BIT && ++ data_length != OV5693_32BIT) { + dev_err(&client->dev, "%s error, invalid data length\n", + __func__); + return -EINVAL; @@ -3434,8 +3099,8 @@ index 000000000000..0b2b76781b11 +} + +static int __ov5693_write_reg_is_consecutive(struct i2c_client *client, -+ struct ov5693_write_ctrl *ctrl, -+ const struct ov5693_reg *next) ++ struct ov5693_write_ctrl *ctrl, ++ const struct ov5693_reg *next) +{ + if (ctrl->index == 0) + return 1; @@ -3652,13 +3317,13 @@ index 000000000000..0b2b76781b11 +{ + u16 index; + int ret; -+ u16 *pVal = NULL; ++ u16 *p_val = NULL; + + for (index = 0; index <= size; index++) { -+ pVal = (u16 *)(buf + index); ++ p_val = (u16 *)(buf + index); + ret = + ov5693_read_reg(client, OV5693_8BIT, addr + index, -+ pVal); ++ p_val); + if (ret) + return ret; + } @@ -3707,8 +3372,9 @@ index 000000000000..0b2b76781b11 + + //dev_dbg(&client->dev, + // "BANK[%2d] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", -+ // i, *b, *(b+1), *(b+2), *(b+3), *(b+4), *(b+5), *(b+6), *(b+7), -+ // *(b+8), *(b+9), *(b+10), *(b+11), *(b+12), *(b+13), *(b+14), *(b+15)); ++ // i, *b, *(b + 1), *(b + 2), *(b + 3), *(b + 4), *(b + 5), ++ // *(b + 6), *(b + 7), *(b + 8), *(b + 9), *(b + 10), ++ // *(b + 11), *(b + 12), *(b + 13), *(b + 14), *(b + 15)); + + //Intel OTP map, try to read 320byts first. + if (i == 21) { @@ -3719,8 +3385,9 @@ index 000000000000..0b2b76781b11 + /* (*b) != 0 */ + b = buf; + continue; -+ } else if (i == -+ 24) { //if the first 320bytes data doesn't not exist, try to read the next 32bytes data. ++ } else if (i == 24) { ++ // if the first 320bytes data doesn't not exist, ++ // try to read the next 32bytes data. + if ((*b) == 0) { + dev->otp_size = 32; + break; @@ -3728,8 +3395,9 @@ index 000000000000..0b2b76781b11 + /* (*b) != 0 */ + b = buf; + continue; -+ } else if (i == -+ 27) { //if the prvious 32bytes data doesn't exist, try to read the next 32bytes data again. ++ } else if (i == 27) { ++ // if the prvious 32bytes data doesn't exist, ++ // try to read the next 32bytes data again. + if ((*b) == 0) { + dev->otp_size = 32; + break; @@ -3883,9 +3551,9 @@ index 000000000000..0b2b76781b11 + dev->number_of_steps = value - dev->focus; + dev->focus = value; + dev->timestamp_t_focus_abs = ktime_get(); -+ } else -+ dev_err(&client->dev, -+ "%s: i2c failed. ret %d\n", __func__, ret); ++ } else { ++ dev_err(&client->dev, "%s: i2c failed. ret %d\n", __func__, ret); ++ } + + return ret; +} @@ -4036,8 +3704,8 @@ index 000000000000..0b2b76781b11 + struct ov5693_device *sensor = to_ov5693_sensor(sd); + int ret; + -+ if (sensor->indicator_led) -+ gpiod_set_value_cansleep(sensor->indicator_led, 1); ++ if (sensor->indicator_led) ++ gpiod_set_value_cansleep(sensor->indicator_led, 1); + + ret = regulator_bulk_enable(OV5693_NUM_SUPPLIES, sensor->supplies); + if (ret) @@ -4048,8 +3716,8 @@ index 000000000000..0b2b76781b11 + return 0; + +fail_power: -+ if (sensor->indicator_led) -+ gpiod_set_value_cansleep(sensor->indicator_led, 0); ++ if (sensor->indicator_led) ++ gpiod_set_value_cansleep(sensor->indicator_led, 0); + dev_err(&client->dev, "sensor power-up failed\n"); + + return ret; @@ -4061,8 +3729,8 @@ index 000000000000..0b2b76781b11 + + dev->focus = OV5693_INVALID_CONFIG; + -+ if (dev->indicator_led) -+ gpiod_set_value_cansleep(dev->indicator_led, 0); ++ if (dev->indicator_led) ++ gpiod_set_value_cansleep(dev->indicator_led, 0); + + return regulator_bulk_disable(OV5693_NUM_SUPPLIES, dev->supplies); +} @@ -4500,15 +4168,15 @@ index 000000000000..0b2b76781b11 +{ + struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct ov5693_device *ov5693 = to_ov5693_sensor(sd); -+ unsigned int i = OV5693_NUM_SUPPLIES; ++ unsigned int i = OV5693_NUM_SUPPLIES; + + dev_info(&client->dev, "%s...\n", __func__); + -+ gpiod_put(ov5693->reset); -+ gpiod_put(ov5693->indicator_led); ++ gpiod_put(ov5693->reset); ++ gpiod_put(ov5693->indicator_led); + -+ while (i--) -+ regulator_put(ov5693->supplies[i].consumer); ++ while (i--) ++ regulator_put(ov5693->supplies[i].consumer); + + v4l2_async_unregister_subdev(sd); + @@ -4563,20 +4231,21 @@ index 000000000000..0b2b76781b11 + +static int ov5693_configure_gpios(struct ov5693_device *ov5693) +{ -+ ov5693->reset = gpiod_get_index(&ov5693->client->dev, "reset", 0, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(ov5693->reset)) { -+ dev_err(&ov5693->client->dev, "Couldn't find reset GPIO\n"); -+ return -EINVAL; -+ } ++ ov5693->reset = gpiod_get_index(&ov5693->client->dev, "reset", 0, ++ GPIOD_OUT_HIGH); ++ if (IS_ERR(ov5693->reset)) { ++ dev_err(&ov5693->client->dev, "Couldn't find reset GPIO\n"); ++ return -EINVAL; ++ } + -+ ov5693->indicator_led = gpiod_get_index_optional(&ov5693->client->dev, "indicator-led", 0, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(ov5693->indicator_led)) { -+ dev_err(&ov5693->client->dev, "Couldn't find indicator-led GPIO\n"); -+ return -EINVAL; -+ } -+ return 0; ++ ov5693->indicator_led = gpiod_get_index_optional(&ov5693->client->dev, ++ "indicator-led", 0, GPIOD_OUT_HIGH); ++ ++ if (IS_ERR(ov5693->indicator_led)) { ++ dev_err(&ov5693->client->dev, "Couldn't find indicator-led GPIO\n"); ++ return -EINVAL; ++ } ++ return 0; +} + +static int ov5693_get_regulators(struct ov5693_device *ov5693) @@ -4588,7 +4257,7 @@ index 000000000000..0b2b76781b11 + + return regulator_bulk_get(&ov5693->client->dev, + OV5693_NUM_SUPPLIES, -+ ov5693->supplies); ++ ov5693->supplies); +} + +static int ov5693_probe(struct i2c_client *client) @@ -4602,7 +4271,7 @@ index 000000000000..0b2b76781b11 + if (!ov5693) + return -ENOMEM; + -+ ov5693->client = client; ++ ov5693->client = client; + + /* check if VCM device exists */ + /* TODO: read from SSDB */ @@ -4612,13 +4281,13 @@ index 000000000000..0b2b76781b11 + + v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); + -+ ret = ov5693_configure_gpios(ov5693); -+ if (ret) -+ goto out_free; ++ ret = ov5693_configure_gpios(ov5693); ++ if (ret) ++ goto out_free; + -+ ret = ov5693_get_regulators(ov5693); -+ if (ret) -+ goto out_put_reset; ++ ret = ov5693_get_regulators(ov5693); ++ if (ret) ++ goto out_put_reset; + + ret = ov5693_s_config(&ov5693->sd, client->irq); + if (ret) @@ -4648,7 +4317,7 @@ index 000000000000..0b2b76781b11 +media_entity_cleanup: + media_entity_cleanup(&ov5693->sd.entity); +out_put_reset: -+ gpiod_put(ov5693->reset); ++ gpiod_put(ov5693->reset); +out_free: + v4l2_device_unregister_subdev(&ov5693->sd); + kfree(ov5693); @@ -4675,7 +4344,7 @@ index 000000000000..0b2b76781b11 +MODULE_LICENSE("GPL"); diff --git a/drivers/media/i2c/ov5693.h b/drivers/media/i2c/ov5693.h new file mode 100644 -index 000000000000..9ad9bbe67d0d +index 000000000000..839b0773e2bc --- /dev/null +++ b/drivers/media/i2c/ov5693.h @@ -0,0 +1,1415 @@ @@ -4781,9 +4450,9 @@ index 000000000000..9ad9bbe67d0d +/*Bit[7:4] Group control, Bit[3:0] Group ID*/ +#define OV5693_GROUP_ACCESS 0x3208 +/* -+*Bit[3:0] Bit[19:16] of exposure, -+*remaining 16 bits lies in Reg0x3501&Reg0x3502 -+*/ ++ * Bit[3:0] Bit[19:16] of exposure, ++ * remaining 16 bits lies in Reg0x3501&Reg0x3502 ++ */ +#define OV5693_EXPOSURE_H 0x3500 +#define OV5693_EXPOSURE_M 0x3501 +#define OV5693_EXPOSURE_L 0x3502 @@ -4841,11 +4510,11 @@ index 000000000000..9ad9bbe67d0d +#define VCM_PROTECTION_OFF 0xeca3 +#define VCM_PROTECTION_ON 0xdc51 +#define VCM_DEFAULT_S 0x0 -+#define vcm_step_s(a) (u8)(a & 0xf) -+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3) -+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104) -+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200) -+#define vcm_val(data, s) (u16)(data << 4 | s) ++#define vcm_step_s(a) ((u8)((a) & 0xf)) ++#define vcm_step_mclk(a) ((u8)(((a) >> 4) & 0x3)) ++#define vcm_dlc_mclk(dlc, mclk) ((u16)(((dlc) << 3) | (mclk) | 0xa104)) ++#define vcm_tsrc(tsrc) ((u16)((tsrc) << 3 | 0xf200)) ++#define vcm_val(data, s) ((u16)((data) << 4 | (s))) +#define DIRECT_VCM vcm_dlc_mclk(0, 0) + +/* Defines for OTP Data Registers */ @@ -4869,15 +4538,15 @@ index 000000000000..9ad9bbe67d0d +/* pixel_rate = link_freq * 2 * nr_of_lanes / bits_per_sample + * To avoid integer overflow, dividing by bits_per_sample first. + */ -+#define OV5693_PIXEL_RATE (OV5693_LINK_FREQ_640MHZ / 10) * 2 * 2 ++#define OV5693_PIXEL_RATE ((OV5693_LINK_FREQ_640MHZ / 10) * 2 * 2) +static const s64 link_freq_menu_items[] = { + OV5693_LINK_FREQ_640MHZ +}; + -+#define OV5693_NUM_SUPPLIES 2 -+static const char * const ov5693_supply_names[] = { -+ "avdd", -+ "dovdd", ++#define OV5693_NUM_SUPPLIES 2 ++static const char *const ov5693_supply_names[] = { ++ "avdd", ++ "dovdd", +}; + +struct regval_list { @@ -4917,16 +4586,16 @@ index 000000000000..9ad9bbe67d0d + * ov5693 device structure. + */ +struct ov5693_device { -+ struct i2c_client *client; ++ struct i2c_client *client; + struct v4l2_subdev sd; + struct media_pad pad; + struct v4l2_mbus_framefmt format; + struct mutex input_lock; + struct v4l2_ctrl_handler ctrl_handler; + -+ struct gpio_desc *reset; -+ struct gpio_desc *indicator_led; -+ struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES]; ++ struct gpio_desc *reset; ++ struct gpio_desc *indicator_led; ++ struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES]; + + struct camera_sensor_platform_data *platform_data; + ktime_t timestamp_t_focus_abs; @@ -5246,8 +4915,8 @@ index 000000000000..9ad9bbe67d0d + +/* + * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling) -+*DS from 2592x1952 -+*/ ++ * DS from 2592x1952 ++ */ +static struct ov5693_reg const ov5693_1296x976[] = { + {OV5693_8BIT, 0x3501, 0x7b}, + {OV5693_8BIT, 0x3502, 0x00}, @@ -6095,5 +5764,142 @@ index 000000000000..9ad9bbe67d0d +static unsigned long N_RES = N_RES_PREVIEW; +#endif -- -2.29.2 +2.30.0 + +From 2e5b7ad9aa07ba9431afe9ebbc743f4b6e026953 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20W=C3=BCthrich?= +Date: Mon, 28 Dec 2020 22:49:17 +0100 +Subject: [PATCH] ov5693: Add user controls to flip image + +Patchset: cameras +--- + drivers/media/i2c/ov5693.c | 63 ++++++++++++++++++++++++++++++++++++++ + drivers/media/i2c/ov5693.h | 10 ++++++ + 2 files changed, 73 insertions(+) + +diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c +index d6e20909d35e..1d3ee422f37a 100644 +--- a/drivers/media/i2c/ov5693.c ++++ b/drivers/media/i2c/ov5693.c +@@ -831,6 +831,29 @@ static int ov5693_t_focus_rel(struct v4l2_subdev *sd, s32 value) + return ov5693_t_focus_abs(sd, dev->focus + value); + } + ++static int ov5693_update_hflip(struct v4l2_subdev *sd) ++{ ++ struct ov5693_device *dev = to_ov5693_sensor(sd); ++ struct i2c_client *client = v4l2_get_subdevdata(sd); ++ ++ u8 hflip = dev->hflip ? OV5693_TIMING_REG21_FLIP : ++ OV5693_TIMING_REG21_NORMAL; ++ ++ return ov5693_write_reg(client, OV5693_8BIT, OV5693_TIMING_REG21, ++ hflip); ++} ++ ++static int ov5693_update_vflip(struct v4l2_subdev *sd) ++{ ++ struct ov5693_device *dev = to_ov5693_sensor(sd); ++ struct i2c_client *client = v4l2_get_subdevdata(sd); ++ ++ u8 vflip = dev->vflip ? OV5693_TIMING_REG20_FLIP : ++ OV5693_TIMING_REG20_NORMAL; ++ return ov5693_write_reg(client, OV5693_8BIT, OV5693_TIMING_REG20, ++ vflip); ++} ++ + #define DELAY_PER_STEP_NS 1000000 + #define DELAY_MAX_PER_STEP_NS (1000000 * 1023) + +@@ -852,6 +875,18 @@ static int ov5693_s_ctrl(struct v4l2_ctrl *ctrl) + __func__, ctrl->val); + ret = ov5693_t_focus_rel(&dev->sd, ctrl->val); + break; ++ case V4L2_CID_HFLIP: ++ dev_info(&client->dev, "%s: CID_HFLIP:%d.\n", __func__, ++ ctrl->val); ++ dev->hflip = ctrl->val; ++ ret = ov5693_update_hflip(&dev->sd); ++ break; ++ case V4L2_CID_VFLIP: ++ dev_info(&client->dev, "%s: CID_VFLIP:%d.\n", __func__, ++ ctrl->val); ++ dev->vflip = ctrl->val; ++ ret = ov5693_update_vflip(&dev->sd); ++ break; + default: + ret = -EINVAL; + } +@@ -917,6 +952,22 @@ static const struct v4l2_ctrl_config ov5693_controls[] = { + .def = 0, + .flags = 0, + }, ++ { ++ .ops = &ctrl_ops, ++ .id = V4L2_CID_HFLIP, ++ .type = V4L2_CTRL_TYPE_BOOLEAN, ++ .name = "sensor flipped horizontally", ++ .max = 1, ++ .step = 1, ++ }, ++ { ++ .ops = &ctrl_ops, ++ .id = V4L2_CID_VFLIP, ++ .type = V4L2_CTRL_TYPE_BOOLEAN, ++ .name = "sensor flipped vertically", ++ .max = 1, ++ .step = 1, ++ }, + }; + + static int ov5693_init(struct v4l2_subdev *sd) +@@ -1147,6 +1198,18 @@ static int startup(struct v4l2_subdev *sd) + return ret; + } + ++ ret = ov5693_update_hflip(sd); ++ if (ret) { ++ dev_err(&client->dev, "ov5693 hflip err.\n"); ++ return ret; ++ } ++ ++ ret = ov5693_update_vflip(sd); ++ if (ret) { ++ dev_err(&client->dev, "ov5693 vflip err.\n"); ++ return ret; ++ } ++ + return ret; + } + +diff --git a/drivers/media/i2c/ov5693.h b/drivers/media/i2c/ov5693.h +index 839b0773e2bc..e788a8068f50 100644 +--- a/drivers/media/i2c/ov5693.h ++++ b/drivers/media/i2c/ov5693.h +@@ -136,6 +136,13 @@ + #define OV5693_MWB_BLUE_GAIN_H 0x3404 + #define OV5693_MWB_GAIN_MAX 0x0fff + ++#define OV5693_TIMING_REG21 0x3821 /* horizontal flip */ ++#define OV5693_TIMING_REG21_NORMAL 0x18 ++#define OV5693_TIMING_REG21_FLIP 0x1E ++#define OV5693_TIMING_REG20 0x3820 /* vertical flip */ ++#define OV5693_TIMING_REG20_NORMAL 0x10 ++#define OV5693_TIMING_REG20_FLIP 0x16 ++ + #define OV5693_START_STREAMING 0x01 + #define OV5693_STOP_STREAMING 0x00 + +@@ -261,6 +268,9 @@ struct ov5693_device { + bool vcm_update; + enum vcm_type vcm; + ++ bool hflip; ++ bool vflip; ++ + bool has_vcm; + }; + +-- +2.30.0