diff --git a/patches/5.12/0001-surface3-oemb.patch b/patches/5.12/0001-surface3-oemb.patch index f5665a466..79f5cb72b 100644 --- a/patches/5.12/0001-surface3-oemb.patch +++ b/patches/5.12/0001-surface3-oemb.patch @@ -1,4 +1,4 @@ -From cc92b681616a329c3a0898f68c18595d0c97bf83 Mon Sep 17 00:00:00 2001 +From e2d267339b6a7a90cff14d7242b2a54564a23605 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.12/0002-mwifiex.patch b/patches/5.12/0002-mwifiex.patch index 6b863e15b..d26564382 100644 --- a/patches/5.12/0002-mwifiex.patch +++ b/patches/5.12/0002-mwifiex.patch @@ -1,4 +1,4 @@ -From e41d64051fa974194578aa3c282019883903710b Mon Sep 17 00:00:00 2001 +From 17534d5354f5e1c10be5557dfdb69561bc44c269 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.31.1 -From 05d2ca97d1f7f9e0f6e6a8f54216b11207da319f Mon Sep 17 00:00:00 2001 +From 8cfbfe456faf1f9e949e1228c465984f4cda9dc6 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.31.1 -From 99449a41ccfcf131aecf74167bcfd4728155e532 Mon Sep 17 00:00:00 2001 +From bb56130a31a13e63f88b9adcd456b3e26aa9a2a3 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.31.1 -From 189fdd3a11c3ff03f589bedef9b9788d4d117672 Mon Sep 17 00:00:00 2001 +From 251232495085b1fb5f154313b915cc9e4dd88a0b 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.31.1 -From b3eeb60bfd7889b907f0311251a53c6d7b042b4a Mon Sep 17 00:00:00 2001 +From 0297c7d4b856848b1d2e371ad0c414cf9bd3620e 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+ @@ -803,7 +803,7 @@ index 3ef7440418e3..a95ebac06e13 100644 -- 2.31.1 -From 7350fdbdcb54feb567aba9bd6308e568f3a536b8 Mon Sep 17 00:00:00 2001 +From 6435507bd543ebb700ce073e113cd26f4cb291fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 3 Nov 2020 13:28:04 +0100 Subject: [PATCH] mwifiex: Add quirk resetting the PCI bridge on MS Surface @@ -970,7 +970,7 @@ index a95ebac06e13..4ec2ae72f632 100644 -- 2.31.1 -From c9a2c5d1e4db40a776572033cbe7f51d416e0008 Mon Sep 17 00:00:00 2001 +From f2809e3aba2b55cd50c7acf0c93c62cd277d2451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 25 Mar 2021 11:33:02 +0100 Subject: [PATCH] Bluetooth: btusb: Lower passive lescan interval on Marvell @@ -1006,7 +1006,7 @@ Patchset: mwifiex 1 file changed, 15 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 5cbfbd948f67..824512fafa23 100644 +index 4a901508e48e..e69ebe224566 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -61,6 +61,7 @@ static struct usb_driver btusb_driver; @@ -1025,7 +1025,7 @@ index 5cbfbd948f67..824512fafa23 100644 /* Intel Bluetooth devices */ { USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW | -@@ -4713,6 +4715,19 @@ static int btusb_probe(struct usb_interface *intf, +@@ -4715,6 +4717,19 @@ static int btusb_probe(struct usb_interface *intf, if (id->driver_info & BTUSB_MARVELL) hdev->set_bdaddr = btusb_set_bdaddr_marvell; @@ -1048,7 +1048,7 @@ index 5cbfbd948f67..824512fafa23 100644 -- 2.31.1 -From 5040dfdf71903e468c9048b2d17bda4e86456183 Mon Sep 17 00:00:00 2001 +From 5e58d8fbd159a7fac28add77babcf8c02f36afe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 12:31:26 +0100 Subject: [PATCH] mwifiex: Small cleanup for handling virtual interface type @@ -1149,7 +1149,7 @@ index a2ed268ce0da..789de1b0c5b1 100644 -- 2.31.1 -From ef4bf467f59627fb7a8c8c6a420f00754c0c1bea Mon Sep 17 00:00:00 2001 +From 75e369c819d171a9edd4e6079e1f039d938120e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 10 Nov 2020 12:49:56 +0100 Subject: [PATCH] mwifiex: Use non-posted PCI register writes @@ -1206,7 +1206,7 @@ index 8a99e243aff2..84b1d30e07e4 100644 -- 2.31.1 -From b882dd1b4434b879d6bd0df0df1d77d4e1b50c88 Mon Sep 17 00:00:00 2001 +From 21b6a03d819d5786f374b7ab508f665be5a2e05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 12:44:39 +0100 Subject: [PATCH] mwifiex: Use function to check whether interface type change @@ -1439,7 +1439,7 @@ index 789de1b0c5b1..13698818e58a 100644 -- 2.31.1 -From d90a13d24191c93e3e5735c215084986cd5b5525 Mon Sep 17 00:00:00 2001 +From 2afeeec6bd034146686aab8b17e2aba3c146c75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 13:33:04 +0100 Subject: [PATCH] mwifiex: Run SET_BSS_MODE when changing from P2P to STATION @@ -1507,7 +1507,7 @@ index 13698818e58a..f5b9f1d26114 100644 -- 2.31.1 -From d02f72ed2bb12c7d5685a0e7732cf9d915cf3057 Mon Sep 17 00:00:00 2001 +From d998fa8bff2c033fe7fd970c14c51d659a867f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 14:42:54 +0100 Subject: [PATCH] mwifiex: Use helper function for counting interface types @@ -1683,7 +1683,7 @@ index f5b9f1d26114..44cff715bf29 100644 -- 2.31.1 -From c3429bccaa9f0f5c0bc94fab7fe49592b0c4c6ce Mon Sep 17 00:00:00 2001 +From c1676f9bf62637c03a2a2299540be2f60dcfc95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 26 Mar 2021 15:56:58 +0100 Subject: [PATCH] mwifiex: Update virtual interface counters right after @@ -1786,7 +1786,7 @@ index 44cff715bf29..e637129a411f 100644 -- 2.31.1 -From d5a359f4f8f1147a8f5a9bf37a735db5dddd8a61 Mon Sep 17 00:00:00 2001 +From 9c3f42c4a9c140bd92fe906db673559bd7492795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 13:42:40 +0100 Subject: [PATCH] mwifiex: Allow switching interface type from P2P_CLIENT to @@ -1875,7 +1875,7 @@ index e637129a411f..395573db6405 100644 -- 2.31.1 -From 77ae5f7bc2e57354b5309f3344581ff7b3ff5ce2 Mon Sep 17 00:00:00 2001 +From 15d330d3a062c905df6676588247195e06fdde2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 26 Mar 2021 15:31:08 +0100 Subject: [PATCH] mwifiex: Handle interface type changes from AP to STATION @@ -1902,7 +1902,7 @@ index 395573db6405..90a757aa0b25 100644 -- 2.31.1 -From ea851788f36bea7782b5bbc21d736e24ff2d998e Mon Sep 17 00:00:00 2001 +From 374c78e7261cc83cbbb697f247f1d62bad894c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 26 Mar 2021 15:32:16 +0100 Subject: [PATCH] mwifiex: Properly initialize private structure on interface @@ -1957,7 +1957,7 @@ index 90a757aa0b25..0c01d8f9048e 100644 -- 2.31.1 -From 92df90cba905bbca6a882f8458c81f80c70b0023 Mon Sep 17 00:00:00 2001 +From d56c63359e92bf5dec73b5723dbebecfb03babe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sat, 27 Mar 2021 12:19:14 +0100 Subject: [PATCH] mwifiex: Fix copy-paste mistake when creating virtual @@ -1989,7 +1989,7 @@ index 0c01d8f9048e..8c472b2d982a 100644 -- 2.31.1 -From 533699803eda2041076cf6a300e1f3f5732009e1 Mon Sep 17 00:00:00 2001 +From 170c7fb0c62b7b45728d2981ac328fdf2f2315fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sun, 28 Mar 2021 21:10:06 +0200 Subject: [PATCH] mwifiex: Try waking the firmware until we get an interrupt @@ -2078,7 +2078,7 @@ index 84b1d30e07e4..88d30ec6d57d 100644 -- 2.31.1 -From d8acf846d6469ed7d8bf66a3ee94825c02cd27e1 Mon Sep 17 00:00:00 2001 +From e35cc575bce95779c7f4392d0a9ce3eb2eb7cf8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 13 Apr 2021 14:30:28 +0200 Subject: [PATCH] mwifiex: Deactive host sleep using HSCFG after it was @@ -2234,7 +2234,7 @@ index d3a968ef21ef..76db9a7b8199 100644 -- 2.31.1 -From 3dc682996cbe561cb7d74534237c195fc8cb193d Mon Sep 17 00:00:00 2001 +From e2b489088c1ed41ed9dafbd339a5a628ef72d97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 13 Apr 2021 14:23:05 +0200 Subject: [PATCH] mwifiex: Add quirk to disable deep sleep with certain @@ -2337,7 +2337,7 @@ index 6b5d35d9e69f..8e49ebca1847 100644 -- 2.31.1 -From c3c96da7c632c88cf7e2a778325aff68475d34af Mon Sep 17 00:00:00 2001 +From a2cd79957f83371c81831f9b7f57502054b0ef1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 11 Nov 2020 15:17:07 +0100 Subject: [PATCH] mwifiex: Don't log error on suspend if wake-on-wlan is @@ -2369,7 +2369,7 @@ index 8c472b2d982a..153025d1b2fa 100644 -- 2.31.1 -From fa2b6c9f6d650e4799463505b46cfc7aae6fdae7 Mon Sep 17 00:00:00 2001 +From 18ccbf4876674a349353ac82f5669152196711a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sun, 28 Mar 2021 21:42:54 +0200 Subject: [PATCH] mwifiex: Log an error on command failure during key-material @@ -2409,7 +2409,7 @@ index 153025d1b2fa..ef6ce3f63aec 100644 -- 2.31.1 -From 13ba182d09683220efaf82755d6e3e00b78e0b87 Mon Sep 17 00:00:00 2001 +From e29aa878a9f32cefed3ee35d8168e0e61c6df9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 13 Apr 2021 12:44:03 +0200 Subject: [PATCH] mwifiex: Fix an incorrect comment @@ -2437,7 +2437,7 @@ index 6696bce56178..b0695432b26a 100644 -- 2.31.1 -From 3bda721df0c91676950c6495e81ad2962c1b6a18 Mon Sep 17 00:00:00 2001 +From 547b8a0757cb27df4fd3833e9bdf8c6077cd096b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 13 Apr 2021 12:45:59 +0200 Subject: [PATCH] mwifiex: Send DELBA requests according to spec @@ -2480,7 +2480,7 @@ index b0695432b26a..9ff2058bcd7e 100644 -- 2.31.1 -From 3359075cbe34012408a202dfff3b49be25e6056d Mon Sep 17 00:00:00 2001 +From 116f8062175ed3aa4b9d6be02765aad7909a154c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 13 Apr 2021 12:57:41 +0200 Subject: [PATCH] mwifiex: Ignore BTCOEX events from the firmware @@ -2518,3 +2518,105 @@ index 68c63268e2e6..933111a3511c 100644 -- 2.31.1 +From ee46aef5be747df10d6d9c3d40b50277b58504c5 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Fri, 14 May 2021 19:42:27 -0700 +Subject: [PATCH] mwifiex: bring down link before deleting interface + +We can deadlock when rmmod'ing the driver or going through firmware +reset, because the cfg80211_unregister_wdev() has to bring down the link +for us, ... which then grab the same wiphy lock. + +nl80211_del_interface() already handles a very similar case, with a nice +description: + + /* + * We hold RTNL, so this is safe, without RTNL opencount cannot + * reach 0, and thus the rdev cannot be deleted. + * + * We need to do it for the dev_close(), since that will call + * the netdev notifiers, and we need to acquire the mutex there + * but don't know if we get there from here or from some other + * place (e.g. "ip link set ... down"). + */ + mutex_unlock(&rdev->wiphy.mtx); +... + +Do similarly for mwifiex teardown, by ensuring we bring the link down +first. + +Sample deadlock trace: + +[ 247.103516] INFO: task rmmod:2119 blocked for more than 123 seconds. +[ 247.110630] Not tainted 5.12.4 #5 +[ 247.115796] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. +[ 247.124557] task:rmmod state:D stack: 0 pid: 2119 ppid: 2114 flags:0x00400208 +[ 247.133905] Call trace: +[ 247.136644] __switch_to+0x130/0x170 +[ 247.140643] __schedule+0x714/0xa0c +[ 247.144548] schedule_preempt_disabled+0x88/0xf4 +[ 247.149714] __mutex_lock_common+0x43c/0x750 +[ 247.154496] mutex_lock_nested+0x5c/0x68 +[ 247.158884] cfg80211_netdev_notifier_call+0x280/0x4e0 [cfg80211] +[ 247.165769] raw_notifier_call_chain+0x4c/0x78 +[ 247.170742] call_netdevice_notifiers_info+0x68/0xa4 +[ 247.176305] __dev_close_many+0x7c/0x138 +[ 247.180693] dev_close_many+0x7c/0x10c +[ 247.184893] unregister_netdevice_many+0xfc/0x654 +[ 247.190158] unregister_netdevice_queue+0xb4/0xe0 +[ 247.195424] _cfg80211_unregister_wdev+0xa4/0x204 [cfg80211] +[ 247.201816] cfg80211_unregister_wdev+0x20/0x2c [cfg80211] +[ 247.208016] mwifiex_del_virtual_intf+0xc8/0x188 [mwifiex] +[ 247.214174] mwifiex_uninit_sw+0x158/0x1b0 [mwifiex] +[ 247.219747] mwifiex_remove_card+0x38/0xa0 [mwifiex] +[ 247.225316] mwifiex_pcie_remove+0xd0/0xe0 [mwifiex_pcie] +[ 247.231451] pci_device_remove+0x50/0xe0 +[ 247.235849] device_release_driver_internal+0x110/0x1b0 +[ 247.241701] driver_detach+0x5c/0x9c +[ 247.245704] bus_remove_driver+0x84/0xb8 +[ 247.250095] driver_unregister+0x3c/0x60 +[ 247.254486] pci_unregister_driver+0x2c/0x90 +[ 247.259267] cleanup_module+0x18/0xcdc [mwifiex_pcie] + +Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/linux-wireless/98392296-40ee-6300-369c-32e16cff3725@gmail.com/ +Link: https://lore.kernel.org/linux-wireless/ab4d00ce52f32bd8e45ad0448a44737e@bewaar.me/ +Reported-by: Maximilian Luz +Reported-by: dave@bewaar.me +Cc: Johannes Berg +Signed-off-by: Brian Norris +Patchset: mwifiex +--- + drivers/net/wireless/marvell/mwifiex/main.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c +index a6be59ac1e27..be40813ffa5c 100644 +--- a/drivers/net/wireless/marvell/mwifiex/main.c ++++ b/drivers/net/wireless/marvell/mwifiex/main.c +@@ -1477,11 +1477,18 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter) + if (!priv) + continue; + rtnl_lock(); +- wiphy_lock(adapter->wiphy); + if (priv->netdev && +- priv->wdev.iftype != NL80211_IFTYPE_UNSPECIFIED) ++ priv->wdev.iftype != NL80211_IFTYPE_UNSPECIFIED) { ++ /* ++ * Close the netdev now, because if we do it later, the ++ * netdev notifiers will need to acquire the wiphy lock ++ * again --> deadlock. ++ */ ++ dev_close(priv->wdev.netdev); ++ wiphy_lock(adapter->wiphy); + mwifiex_del_virtual_intf(adapter->wiphy, &priv->wdev); +- wiphy_unlock(adapter->wiphy); ++ wiphy_unlock(adapter->wiphy); ++ } + rtnl_unlock(); + } + +-- +2.31.1 + diff --git a/patches/5.12/0003-ath10k.patch b/patches/5.12/0003-ath10k.patch index dbc9ce44c..526ea2859 100644 --- a/patches/5.12/0003-ath10k.patch +++ b/patches/5.12/0003-ath10k.patch @@ -1,4 +1,4 @@ -From 6597ac50d11f3c6e0720088135cec5ae1e955f8c Mon Sep 17 00:00:00 2001 +From b0b31a0401d1c19aba9b17904d743d9f973ff957 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 diff --git a/patches/5.12/0004-ipts.patch b/patches/5.12/0004-ipts.patch index 51c7caaec..936202445 100644 --- a/patches/5.12/0004-ipts.patch +++ b/patches/5.12/0004-ipts.patch @@ -1,4 +1,4 @@ -From 62a84bf5ae4f90b5ee6425a1b1af9b9008c5a213 Mon Sep 17 00:00:00 2001 +From e20ab3c287e5cc3f3ab3a829744f50c84200252f 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 @@ -36,7 +36,7 @@ index c3393b383e59..0098f98426c1 100644 -- 2.31.1 -From e6644bf0c58ccb2301d567590761fa1d5a860c68 Mon Sep 17 00:00:00 2001 +From c3a5c0cfac3913c1f1c9c2a64287669de9065c92 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 diff --git a/patches/5.12/0005-surface-sam-over-hid.patch b/patches/5.12/0005-surface-sam-over-hid.patch index 9af821a76..acfcb221e 100644 --- a/patches/5.12/0005-surface-sam-over-hid.patch +++ b/patches/5.12/0005-surface-sam-over-hid.patch @@ -1,4 +1,4 @@ -From 9c9e3cbb258bcd9ffa9d34d44fb7aeeba2706eb0 Mon Sep 17 00:00:00 2001 +From 2be1146d1b8ac5fb54f5329cca285e044aff6284 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 8ceaa88dd78f..deceed0d76c6 100644 -- 2.31.1 -From 21aad0125779d4828050c4c6dc77cb24d0c10f62 Mon Sep 17 00:00:00 2001 +From 76b8deeab3bc5016ad9dd3b97331a2d15361b4f4 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.12/0006-surface-sam.patch b/patches/5.12/0006-surface-sam.patch index 69804882b..c979fc364 100644 --- a/patches/5.12/0006-surface-sam.patch +++ b/patches/5.12/0006-surface-sam.patch @@ -1,4 +1,4 @@ -From 71af2529df7a873e906944e30c6ee2fd96276051 Mon Sep 17 00:00:00 2001 +From 9405b29ae42eb82fac05cf5374770c7877c8983d Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:34 +0100 Subject: [PATCH] platform/surface: Set up Surface Aggregator device registry @@ -396,7 +396,7 @@ index 000000000000..a051d941ad96 -- 2.31.1 -From f9f59d226fdb643e6d136ddadc0040b594174623 Mon Sep 17 00:00:00 2001 +From b7e8b99142fcb05ebe55a3bbcc3fde33ac5d00d9 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:35 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add base device hub @@ -725,7 +725,7 @@ index a051d941ad96..6c23d75a044c 100644 -- 2.31.1 -From 77d0eb721463484c22c7700355985aa3ff7e72c2 Mon Sep 17 00:00:00 2001 +From d9885e35bbc7edb1c6994c0a61575729e69af276 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:36 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add battery subsystem @@ -814,7 +814,7 @@ index 6c23d75a044c..cde279692842 100644 -- 2.31.1 -From 9850764bc9908858c8ae0292fe0c07589803803f Mon Sep 17 00:00:00 2001 +From 6230e5622832ed611bc7e126ae1f92fcc9462af0 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:37 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add platform profile @@ -916,7 +916,7 @@ index cde279692842..33904613dd4b 100644 -- 2.31.1 -From 64f866b5702ffb3fa8f1820753109af01ae271f5 Mon Sep 17 00:00:00 2001 +From 93f9ceb899724b500023a627c83b81c9c2938824 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:38 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add DTX device @@ -960,7 +960,7 @@ index 33904613dd4b..dc044d06828b 100644 -- 2.31.1 -From 31833a307a36926c7aebce35c7be4c08d1522ca5 Mon Sep 17 00:00:00 2001 +From f61c2b2e75748a8d040454f7dfd24150b13a4f02 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 12 Feb 2021 12:54:39 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add HID subsystem @@ -1056,7 +1056,7 @@ index dc044d06828b..caee90d135c5 100644 -- 2.31.1 -From c130068f4a980f5d7ad6e655c9299cb1b747a7ba Mon Sep 17 00:00:00 2001 +From 03394108faca73ad34694b17fe8a2cd43ffa3d75 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 11 Feb 2021 21:17:03 +0100 Subject: [PATCH] platform/surface: Add platform profile driver @@ -1342,7 +1342,7 @@ index 000000000000..0081b01a5b0f -- 2.31.1 -From 2035a53463aa515cd76d615de6229f1ba4c02281 Mon Sep 17 00:00:00 2001 +From a32b1497c56b5f2944726124a98c607dba62fe85 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 @@ -1721,7 +1721,7 @@ index 02f3e06c0a60..4441ad667c3f 100644 -- 2.31.1 -From 349394726da739c934ca9f67fecbd2ffed88e013 Mon Sep 17 00:00:00 2001 +From 860aa64d0b1e7c98202fa951185738edf6660c2e Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 8 Mar 2021 19:48:17 +0100 Subject: [PATCH] platform/surface: Add DTX driver @@ -3216,7 +3216,7 @@ index 000000000000..0833aab0d819 -- 2.31.1 -From a2fa661f97077f34d67468bbc645144f59134fe3 Mon Sep 17 00:00:00 2001 +From 5e38984fd3f00e0690252ffd9b6fcce1171d1366 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 8 Mar 2021 19:48:18 +0100 Subject: [PATCH] platform/surface: dtx: Add support for native SSAM devices @@ -3360,7 +3360,7 @@ index 1301fab0ea14..85451eb94d98 100644 -- 2.31.1 -From bc764eb22303f1a8b5919abcf7b34fae0083519b Mon Sep 17 00:00:00 2001 +From 8c1cfab071bac86333323ff9906f34728c6be6b5 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 8 Mar 2021 19:48:19 +0100 Subject: [PATCH] docs: driver-api: Add Surface DTX driver documentation @@ -4131,7 +4131,7 @@ index 3917e7363520..da1487d672a8 100644 -- 2.31.1 -From 2bab8e6866b5abd357b15d0941e35500957a8d08 Mon Sep 17 00:00:00 2001 +From 0cd05fd02af8e8910953314a36016ece705d4638 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 9 Mar 2021 13:15:00 +0000 Subject: [PATCH] platform/surface: aggregator_registry: Make symbol @@ -4172,7 +4172,7 @@ index cdb4a95af3e8..86cff5fce3cd 100644 -- 2.31.1 -From 13c24e8cf534ee4c35a00486f11b696295181ffc Mon Sep 17 00:00:00 2001 +From 1494bdf43e16222acf1d73a9a359f641dc094751 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 9 Mar 2021 17:25:50 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add support for @@ -4215,7 +4215,7 @@ index 86cff5fce3cd..eccb9d1007cd 100644 -- 2.31.1 -From 14402dfc92f94872ecc684295d7ce91c0fc19ee4 Mon Sep 17 00:00:00 2001 +From dca5149dc5635c66a6a98c170fb51d1b1c0fbe7d Mon Sep 17 00:00:00 2001 From: kernel test robot Date: Fri, 19 Mar 2021 13:19:19 +0800 Subject: [PATCH] platform/surface: fix semicolon.cocci warnings @@ -4254,7 +4254,7 @@ index 85451eb94d98..1fedacf74050 100644 -- 2.31.1 -From eb6b89a681467ca6f9ab63e7b7ded69af2032c30 Mon Sep 17 00:00:00 2001 +From 66be3631a517ddd6484f47f499be3ddde5b8ee6c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 26 Mar 2021 15:28:48 +0300 Subject: [PATCH] platform/surface: clean up a variable in surface_dtx_read() @@ -4287,7 +4287,7 @@ index 1fedacf74050..63ce587e79e3 100644 -- 2.31.1 -From 249d35e4c768ab3204232758bdcc1081512205d2 Mon Sep 17 00:00:00 2001 +From 0cbff8b3b864943237f186ad5fc0ddad1547870a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 6 Apr 2021 01:12:22 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Give devices time to @@ -4530,7 +4530,7 @@ index eccb9d1007cd..685d37a7add1 100644 -- 2.31.1 -From a6be18a2e6a37d75b5fffd7fc19912d5b9a56944 Mon Sep 17 00:00:00 2001 +From a9ad064e01d2b09f7cf0b3a0b8458144f671f467 Mon Sep 17 00:00:00 2001 From: Barry Song Date: Wed, 3 Mar 2021 11:49:15 +1300 Subject: [PATCH] genirq: Add IRQF_NO_AUTOEN for request_irq/nmi() @@ -4632,7 +4632,7 @@ index 21ea370fccda..49288e941365 100644 -- 2.31.1 -From 92d7d1462eb709aed1a4620f0a2cf1b976f7a1b1 Mon Sep 17 00:00:00 2001 +From 28bc28aae45befdb11bffefdb2a526165c613e4e Mon Sep 17 00:00:00 2001 From: Tian Tao Date: Wed, 7 Apr 2021 15:00:52 +0800 Subject: [PATCH] platform/surface: aggregator: move to use request_irq by @@ -4679,7 +4679,7 @@ index 88ec47cae5bf..69e86cd599d3 100644 -- 2.31.1 -From 5d87d26872336e61301f895710f7dcfd7e67c070 Mon Sep 17 00:00:00 2001 +From 9aa23166e42b48cfbf964ea8ec60f80c779a37b4 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 5 May 2021 14:53:45 +0200 Subject: [PATCH] platform/surface: aggregator: Do not mark interrupt as shared @@ -4713,7 +4713,119 @@ index 69e86cd599d3..8a70df60142c 100644 -- 2.31.1 -From d8c132bd854d4950aa39dd6f7522b8d5cd0810c8 Mon Sep 17 00:00:00 2001 +From cc34e75d2c6f14b61bf4c19fdce4faef1f618436 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 14 May 2021 22:04:36 +0200 +Subject: [PATCH] platform/surface: aggregator: avoid clang + -Wconstant-conversion warning + +Clang complains about the assignment of SSAM_ANY_IID to +ssam_device_uid->instance: + +drivers/platform/surface/surface_aggregator_registry.c:478:25: error: implicit conversion from 'int' to '__u8' (aka 'unsigned char') changes value from 65535 to 255 [-Werror,-Wconstant-conversion] + { SSAM_VDEV(HUB, 0x02, SSAM_ANY_IID, 0x00) }, + ~ ^~~~~~~~~~~~ +include/linux/surface_aggregator/device.h:71:23: note: expanded from macro 'SSAM_ANY_IID' + #define SSAM_ANY_IID 0xffff + ^~~~~~ +include/linux/surface_aggregator/device.h:126:63: note: expanded from macro 'SSAM_VDEV' + SSAM_DEVICE(SSAM_DOMAIN_VIRTUAL, SSAM_VIRTUAL_TC_##cat, tid, iid, fun) + ^~~ +include/linux/surface_aggregator/device.h:102:41: note: expanded from macro 'SSAM_DEVICE' + .instance = ((iid) != SSAM_ANY_IID) ? (iid) : 0, \ + ^~~ + +The assignment doesn't actually happen, but clang checks the type limits +before checking whether this assignment is reached. Replace the ?: +operator with a __builtin_choose_expr() invocation that avoids the +warning for the untaken part. + +Fixes: eb0e90a82098 ("platform/surface: aggregator: Add dedicated bus and device type") +Cc: platform-driver-x86@vger.kernel.org +Signed-off-by: Arnd Bergmann +Reviewed-by: Nathan Chancellor +Reviewed-by: Maximilian Luz +Link: https://lore.kernel.org/r/20210514200453.1542978-1-arnd@kernel.org +Signed-off-by: Hans de Goede +Patchset: surface-sam +--- + include/linux/surface_aggregator/device.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/linux/surface_aggregator/device.h b/include/linux/surface_aggregator/device.h +index 4441ad667c3f..6ff9c58b3e17 100644 +--- a/include/linux/surface_aggregator/device.h ++++ b/include/linux/surface_aggregator/device.h +@@ -98,9 +98,9 @@ struct ssam_device_uid { + | (((fun) != SSAM_ANY_FUN) ? SSAM_MATCH_FUNCTION : 0), \ + .domain = d, \ + .category = cat, \ +- .target = ((tid) != SSAM_ANY_TID) ? (tid) : 0, \ +- .instance = ((iid) != SSAM_ANY_IID) ? (iid) : 0, \ +- .function = ((fun) != SSAM_ANY_FUN) ? (fun) : 0 \ ++ .target = __builtin_choose_expr((tid) != SSAM_ANY_TID, (tid), 0), \ ++ .instance = __builtin_choose_expr((iid) != SSAM_ANY_IID, (iid), 0), \ ++ .function = __builtin_choose_expr((fun) != SSAM_ANY_FUN, (fun), 0) + + /** + * SSAM_VDEV() - Initialize a &struct ssam_device_id as virtual device with +-- +2.31.1 + +From b551922be9669f52eeea1bffe101a765e2443316 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Thu, 13 May 2021 15:44:37 +0200 +Subject: [PATCH] platform/surface: dtx: Fix poll function + +The poll function should not return -ERESTARTSYS. + +Furthermore, locking in this function is completely unnecessary. The +ddev->lock protects access to the main device and controller (ddev->dev +and ddev->ctrl), ensuring that both are and remain valid while being +accessed by clients. Both are, however, never accessed in the poll +function. The shutdown test (via atomic bit flags) be safely done +without locking, so drop locking here entirely. + +Reported-by: kernel test robot +Fixes: 1d609992832e ("platform/surface: Add DTX driver) +Signed-off-by: Maximilian Luz +Link: https://lore.kernel.org/r/20210513134437.2431022-1-luzmaximilian@gmail.com +Signed-off-by: Hans de Goede +Patchset: surface-sam +--- + drivers/platform/surface/surface_dtx.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/drivers/platform/surface/surface_dtx.c b/drivers/platform/surface/surface_dtx.c +index 63ce587e79e3..5d9b758a99bb 100644 +--- a/drivers/platform/surface/surface_dtx.c ++++ b/drivers/platform/surface/surface_dtx.c +@@ -527,20 +527,14 @@ static __poll_t surface_dtx_poll(struct file *file, struct poll_table_struct *pt + struct sdtx_client *client = file->private_data; + __poll_t events = 0; + +- if (down_read_killable(&client->ddev->lock)) +- return -ERESTARTSYS; +- +- if (test_bit(SDTX_DEVICE_SHUTDOWN_BIT, &client->ddev->flags)) { +- up_read(&client->ddev->lock); ++ if (test_bit(SDTX_DEVICE_SHUTDOWN_BIT, &client->ddev->flags)) + return EPOLLHUP | EPOLLERR; +- } + + poll_wait(file, &client->ddev->waitq, pt); + + if (!kfifo_is_empty(&client->buffer)) + events |= EPOLLIN | EPOLLRDNORM; + +- up_read(&client->ddev->lock); + return events; + } + +-- +2.31.1 + +From 674eb0ea55289da5670aa0cb8a742e76dbff5566 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 10 Mar 2021 23:53:28 +0100 Subject: [PATCH] HID: Add support for Surface Aggregator Module HID transport @@ -5460,7 +5572,7 @@ index 000000000000..4b1a7b57e035 -- 2.31.1 -From 340f05cab02d45f1b87906e007328b8b6bf29a51 Mon Sep 17 00:00:00 2001 +From e15c02a7a035c13197ce9cc2b7e9cc0743951972 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 10 Mar 2021 23:53:29 +0100 Subject: [PATCH] HID: surface-hid: Add support for legacy keyboard interface @@ -5831,7 +5943,7 @@ index 000000000000..0635341bc517 -- 2.31.1 -From cb0c6ca32fa6eef32a3de17d43d065e5ad45a40b Mon Sep 17 00:00:00 2001 +From 63be35d078bc6a1560f97d732158b5f8ce3f476a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 23 Apr 2021 00:51:22 +0200 Subject: [PATCH] HID: surface-hid: Fix integer endian conversion @@ -5870,7 +5982,7 @@ index 7b27ec392232..5571e74abe91 100644 -- 2.31.1 -From b66f48a5c7a971a5fc0f41d5c96620f25c2df81d Mon Sep 17 00:00:00 2001 +From 5526fc8fb5ced772c73b0a55e88d515d52e7fe4c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 6 Apr 2021 01:41:25 +0200 Subject: [PATCH] power: supply: Add battery driver for Surface Aggregator @@ -6852,7 +6964,7 @@ index 000000000000..4116dd839ecd -- 2.31.1 -From 0b7e636936451ccf7e0bd7fa8c6e5331ffd53424 Mon Sep 17 00:00:00 2001 +From ed1db4e5a46cce7bcab09249fa89f3d59cf7a554 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 6 Apr 2021 01:41:26 +0200 Subject: [PATCH] power: supply: Add AC driver for Surface Aggregator Module @@ -7220,7 +7332,7 @@ index 000000000000..c2dd7e604d14 -- 2.31.1 -From b45091742f2fae559b4091a0c4d2a0660b03a98a Mon Sep 17 00:00:00 2001 +From 0c62c455aa35520f98fb50f55bc00fd72be59317 Mon Sep 17 00:00:00 2001 From: Qiheng Lin Date: Sat, 10 Apr 2021 12:12:46 +0800 Subject: [PATCH] power: supply: surface-battery: Make some symbols static @@ -7269,7 +7381,7 @@ index 4116dd839ecd..7efa431a62b2 100644 -- 2.31.1 -From 6202c110bfad78f064d8687d5b433146cde21cd3 Mon Sep 17 00:00:00 2001 +From 00a1bfd64364c150f8fc8ce1293a084ebf52d3fe Mon Sep 17 00:00:00 2001 From: Qiheng Lin Date: Sat, 10 Apr 2021 12:12:49 +0800 Subject: [PATCH] power: supply: surface-charger: Make symbol @@ -7308,7 +7420,7 @@ index c2dd7e604d14..81a5b79822c9 100644 -- 2.31.1 -From 47f3073898bb0e27542ec5dddca2816b44fdda5a Mon Sep 17 00:00:00 2001 +From 30d2b20d7b1df31cbf0f4d23745ac8b6adcbb277 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 4 May 2021 20:00:46 +0200 Subject: [PATCH] power: supply: surface_battery: Fix battery event handling @@ -7365,7 +7477,7 @@ index 7efa431a62b2..5ec2e6bb2465 100644 -- 2.31.1 -From c747b2f975ecd2b3fe4e129ef6d644edfb1f8bda Mon Sep 17 00:00:00 2001 +From b549c514ca33ad14d04e071491b889b16e1afdeb Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Tue, 11 May 2021 11:24:21 +0200 Subject: [PATCH] power: supply: surface-charger: Fix type of integer variable @@ -7397,7 +7509,7 @@ index 81a5b79822c9..a060c36c7766 100644 -- 2.31.1 -From cc579fa79a6e8ebc837dc3e469210fcfc454191e Mon Sep 17 00:00:00 2001 +From 409d23b2885134d02f51bc833a187ff3bc86bb74 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 5 May 2021 18:17:04 +0200 Subject: [PATCH] serial: 8250_dw: Add device HID for new AMD UART controller @@ -7443,7 +7555,7 @@ index 9e204f9b799a..a3a0154da567 100644 -- 2.31.1 -From c559b9d8aca9eab3a2c29bae5976404318f15e24 Mon Sep 17 00:00:00 2001 +From 9190a4e6101802dee5445ad798c1b08e8310e517 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 5 May 2021 18:22:04 +0200 Subject: [PATCH] pinctrl/amd: Add device HID for new AMD GPIO controller @@ -7475,7 +7587,7 @@ index 2d4acf21117c..c5950a3b4e4c 100644 -- 2.31.1 -From a09349d48459ca05841738c4c0a3be9c0072e9ce Mon Sep 17 00:00:00 2001 +From 587a4dcd042c9783b6656df33c52c94373f41fc7 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 10 May 2021 23:33:17 +0200 Subject: [PATCH] x86/i8259: Work around buggy legacy PIC diff --git a/patches/5.12/0007-surface-typecover.patch b/patches/5.12/0007-surface-typecover.patch index 709f06724..cf9a010cc 100644 --- a/patches/5.12/0007-surface-typecover.patch +++ b/patches/5.12/0007-surface-typecover.patch @@ -1,4 +1,4 @@ -From 122de5ff935f4a8ff52f8b4960a72a8c043343f6 Mon Sep 17 00:00:00 2001 +From 4d854b9bd74796d5d9637bd59f6e9d2747ae85c2 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.12/0008-cameras.patch b/patches/5.12/0008-cameras.patch index f68a405bd..5fb24b92c 100644 --- a/patches/5.12/0008-cameras.patch +++ b/patches/5.12/0008-cameras.patch @@ -1,6 +1,6 @@ -From 591d6d107d8f1a4509370a6805b2507992568977 Mon Sep 17 00:00:00 2001 +From 922db188178980c73bbc4fbe032763a921553315 Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:30 +0000 +Date: Thu, 20 May 2021 15:09:21 +0100 Subject: [PATCH] ACPI: scan: Extend acpi_walk_dep_device_list() The acpi_walk_dep_device_list() is not as generalisable as its name @@ -10,26 +10,23 @@ a callback which can be applied to all the dependencies in acpi_dep_list. Replace all existing calls to the function with calls to a wrapper, passing a callback that applies the same dependency reduction. -Suggested-by: Rafael J. Wysocki Signed-off-by: Daniel Scally -Reviewed-by: Andy Shevchenko -Acked-by: Wolfram Sang # for changing I2C core Patchset: cameras --- drivers/acpi/ec.c | 2 +- drivers/acpi/pmic/intel_pmic_chtdc_ti.c | 2 +- - drivers/acpi/scan.c | 58 +++++++++++++------ - drivers/gpio/gpiolib-acpi.c | 2 +- - drivers/i2c/i2c-core-acpi.c | 2 +- - drivers/platform/surface/aggregator/core.c | 2 +- - drivers/platform/surface/surface3_power.c | 2 +- - .../platform/surface/surface_acpi_notify.c | 2 +- - include/acpi/acpi_bus.h | 7 +++ + drivers/acpi/scan.c | 69 ++++++++++++++----- + drivers/gpio/gpiolib-acpi.c | 10 +-- + drivers/i2c/i2c-core-acpi.c | 8 +-- + drivers/platform/surface/aggregator/core.c | 6 +- + drivers/platform/surface/surface3_power.c | 22 +++--- + .../platform/surface/surface_acpi_notify.c | 7 +- + include/acpi/acpi_bus.h | 7 ++ include/linux/acpi.h | 4 +- - 10 files changed, 57 insertions(+), 26 deletions(-) + 10 files changed, 90 insertions(+), 47 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c -index 13565629ce0a..a258db713bd2 100644 +index 13565629ce0a..3f7680a007a3 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1627,7 +1627,7 @@ static int acpi_ec_add(struct acpi_device *device) @@ -37,12 +34,12 @@ index 13565629ce0a..a258db713bd2 100644 /* Reprobe devices depending on the EC */ - acpi_walk_dep_device_list(ec->handle); -+ acpi_dev_flag_dependency_met(ec->handle); ++ acpi_dev_clear_dependencies(device); acpi_handle_debug(ec->handle, "enumerated.\n"); return 0; diff --git a/drivers/acpi/pmic/intel_pmic_chtdc_ti.c b/drivers/acpi/pmic/intel_pmic_chtdc_ti.c -index a5101b07611a..59cca504325e 100644 +index a5101b07611a..fef7831d0d63 100644 --- a/drivers/acpi/pmic/intel_pmic_chtdc_ti.c +++ b/drivers/acpi/pmic/intel_pmic_chtdc_ti.c @@ -117,7 +117,7 @@ static int chtdc_ti_pmic_opregion_probe(struct platform_device *pdev) @@ -50,12 +47,12 @@ index a5101b07611a..59cca504325e 100644 /* Re-enumerate devices depending on PMIC */ - acpi_walk_dep_device_list(ACPI_HANDLE(pdev->dev.parent)); -+ acpi_dev_flag_dependency_met(ACPI_HANDLE(pdev->dev.parent)); ++ acpi_dev_clear_dependencies(ACPI_COMPANION(pdev->dev.parent)); return 0; } diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 6efe7edd7b1e..44e4783d8e95 100644 +index 345777bf7af9..f5440729ffe9 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -47,12 +47,6 @@ static DEFINE_MUTEX(acpi_hp_context_lock); @@ -71,13 +68,12 @@ index 6efe7edd7b1e..44e4783d8e95 100644 void acpi_scan_lock_acquire(void) { mutex_lock(&acpi_scan_lock); -@@ -2141,30 +2135,58 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass) +@@ -2142,30 +2136,69 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass) device->handler->hotplug.notify_online(device); } -void acpi_walk_dep_device_list(acpi_handle handle) -+static int __acpi_dev_flag_dependency_met(struct acpi_dep_data *dep, -+ void *data) ++static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data) { - struct acpi_dep_data *dep, *tmp; struct acpi_device *adev; @@ -92,12 +88,25 @@ index 6efe7edd7b1e..44e4783d8e95 100644 + + list_del(&dep->node); + kfree(dep); ++ + return 0; +} + -+void acpi_walk_dep_device_list(acpi_handle handle, -+ int (*callback)(struct acpi_dep_data *, void *), -+ void *data) ++/** ++ * acpi_walk_dep_device_list - Apply a callback to every entry in acpi_dep_list ++ * @handle: The ACPI handle of the supplier device ++ * @callback: Pointer to the callback function to apply ++ * @data: Pointer to some data to pass to the callback ++ * ++ * The return value of the callback determines this function's behaviour. If 0 ++ * is returned we continue to iterate over acpi_dep_list. If a positive value ++ * is returned then the loop is broken but this function returns 0. If a ++ * negative value is returned by the callback then the loop is broken and that ++ * value is returned as the final error. ++ */ ++int acpi_walk_dep_device_list(acpi_handle handle, ++ int (*callback)(struct acpi_dep_data *, void *), ++ void *data) +{ + struct acpi_dep_data *dep, *tmp; + int ret; @@ -121,94 +130,215 @@ index 6efe7edd7b1e..44e4783d8e95 100644 } } mutex_unlock(&acpi_dep_list_lock); ++ ++ return ret > 0 ? 0 : ret; } EXPORT_SYMBOL_GPL(acpi_walk_dep_device_list); +/** -+ * acpi_dev_flag_dependency_met() - Inform consumers of @handle that the device -+ * is now active -+ * @handle: acpi_handle for the supplier device ++ * acpi_dev_clear_dependencies - Inform consumers that the device is now active ++ * @supplier: Pointer to the supplier &struct acpi_device + * -+ * This function walks through the dependencies list and informs each consumer -+ * of @handle that their dependency upon it is now met. Devices with no more -+ * unmet dependencies will be attached to the acpi bus. ++ * Clear dependencies on the given device. + */ -+void acpi_dev_flag_dependency_met(acpi_handle handle) ++void acpi_dev_clear_dependencies(struct acpi_device *supplier) +{ -+ acpi_walk_dep_device_list(handle, __acpi_dev_flag_dependency_met, NULL); ++ acpi_walk_dep_device_list(supplier->handle, acpi_scan_clear_dep, NULL); +} -+EXPORT_SYMBOL_GPL(acpi_dev_flag_dependency_met); ++EXPORT_SYMBOL_GPL(acpi_dev_clear_dependencies); + /** * acpi_bus_scan - Add ACPI device node objects in a given namespace scope. * @handle: Root of the namespace scope to scan. diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c -index 1aacd2a5a1fd..4a16e0d9b257 100644 +index 1aacd2a5a1fd..ad4609467db0 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c +@@ -1233,14 +1233,14 @@ static void acpi_gpiochip_scan_gpios(struct acpi_gpio_chip *achip) + void acpi_gpiochip_add(struct gpio_chip *chip) + { + struct acpi_gpio_chip *acpi_gpio; +- acpi_handle handle; ++ struct acpi_device *adev; + acpi_status status; + + if (!chip || !chip->parent) + return; + +- handle = ACPI_HANDLE(chip->parent); +- if (!handle) ++ adev = ACPI_COMPANION(chip->parent); ++ if (!adev) + return; + + acpi_gpio = kzalloc(sizeof(*acpi_gpio), GFP_KERNEL); +@@ -1254,7 +1254,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip) + INIT_LIST_HEAD(&acpi_gpio->events); + INIT_LIST_HEAD(&acpi_gpio->deferred_req_irqs_list_entry); + +- status = acpi_attach_data(handle, acpi_gpio_chip_dh, acpi_gpio); ++ status = acpi_attach_data(adev->handle, acpi_gpio_chip_dh, acpi_gpio); + if (ACPI_FAILURE(status)) { + dev_err(chip->parent, "Failed to attach ACPI GPIO chip\n"); + kfree(acpi_gpio); @@ -1263,7 +1263,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip) acpi_gpiochip_request_regions(acpi_gpio); acpi_gpiochip_scan_gpios(acpi_gpio); - acpi_walk_dep_device_list(handle); -+ acpi_dev_flag_dependency_met(handle); ++ acpi_dev_clear_dependencies(adev); } void acpi_gpiochip_remove(struct gpio_chip *chip) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c -index deceed0d76c6..1e7ae3421de1 100644 +index deceed0d76c6..13eb5ac82729 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c -@@ -279,7 +279,7 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap) - if (!handle) +@@ -259,8 +259,8 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level, + */ + void i2c_acpi_register_devices(struct i2c_adapter *adap) + { ++ struct acpi_device *adev; + acpi_status status; +- acpi_handle handle; + + if (!has_acpi_companion(&adap->dev)) + return; +@@ -275,11 +275,11 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap) + if (!adap->dev.parent) + return; + +- handle = ACPI_HANDLE(adap->dev.parent); +- if (!handle) ++ adev = ACPI_COMPANION(adap->dev.parent); ++ if (!adev) return; - acpi_walk_dep_device_list(handle); -+ acpi_dev_flag_dependency_met(handle); ++ acpi_dev_clear_dependencies(adev); } static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c -index 8dc2c267bcd6..f8c691720caf 100644 +index 8dc2c267bcd6..517f774a6e60 100644 --- a/drivers/platform/surface/aggregator/core.c +++ b/drivers/platform/surface/aggregator/core.c +@@ -621,8 +621,8 @@ static const struct acpi_gpio_mapping ssam_acpi_gpios[] = { + + static int ssam_serial_hub_probe(struct serdev_device *serdev) + { ++ struct acpi_device *ssh = ACPI_COMPANION(&serdev->dev); + struct ssam_controller *ctrl; +- acpi_handle *ssh = ACPI_HANDLE(&serdev->dev); + acpi_status astatus; + int status; + +@@ -652,7 +652,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev) + if (status) + goto err_devopen; + +- astatus = ssam_serdev_setup_via_acpi(ssh, serdev); ++ astatus = ssam_serdev_setup_via_acpi(ssh->handle, serdev); + if (ACPI_FAILURE(astatus)) { + status = -ENXIO; + goto err_devinit; @@ -706,7 +706,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev) * For now let's thus default power/wakeup to false. */ device_set_wakeup_capable(&serdev->dev, true); - acpi_walk_dep_device_list(ssh); -+ acpi_dev_flag_dependency_met(ssh); ++ acpi_dev_clear_dependencies(ssh); return 0; diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c -index cc4f9cba6856..ad895285d3e9 100644 +index cc4f9cba6856..dea82aa1abd4 100644 --- a/drivers/platform/surface/surface3_power.c +++ b/drivers/platform/surface/surface3_power.c -@@ -478,7 +478,7 @@ static int mshw0011_install_space_handler(struct i2c_client *client) +@@ -446,12 +446,12 @@ mshw0011_space_handler(u32 function, acpi_physical_address command, + + static int mshw0011_install_space_handler(struct i2c_client *client) + { +- acpi_handle handle; ++ struct acpi_device *adev; + struct mshw0011_handler_data *data; + acpi_status status; + +- handle = ACPI_HANDLE(&client->dev); +- if (!handle) ++ adev = ACPI_COMPANION(&client->dev); ++ if (!adev) + return -ENODEV; + + data = kzalloc(sizeof(struct mshw0011_handler_data), +@@ -460,25 +460,25 @@ static int mshw0011_install_space_handler(struct i2c_client *client) + return -ENOMEM; + + data->client = client; +- status = acpi_bus_attach_private_data(handle, (void *)data); ++ status = acpi_bus_attach_private_data(adev->handle, (void *)data); + if (ACPI_FAILURE(status)) { + kfree(data); + return -ENOMEM; + } + +- status = acpi_install_address_space_handler(handle, +- ACPI_ADR_SPACE_GSBUS, +- &mshw0011_space_handler, +- NULL, +- data); ++ status = acpi_install_address_space_handler(adev->handle, ++ ACPI_ADR_SPACE_GSBUS, ++ &mshw0011_space_handler, ++ NULL, ++ data); + if (ACPI_FAILURE(status)) { + dev_err(&client->dev, "Error installing i2c space handler\n"); +- acpi_bus_detach_private_data(handle); ++ acpi_bus_detach_private_data(adev->handle); + kfree(data); return -ENOMEM; } - acpi_walk_dep_device_list(handle); -+ acpi_dev_flag_dependency_met(handle); ++ acpi_dev_clear_dependencies(adev); return 0; } diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platform/surface/surface_acpi_notify.c -index ef9c1f8e8336..e18dc4e30af2 100644 +index ef9c1f8e8336..8339988d95c1 100644 --- a/drivers/platform/surface/surface_acpi_notify.c +++ b/drivers/platform/surface/surface_acpi_notify.c -@@ -835,7 +835,7 @@ static int san_probe(struct platform_device *pdev) +@@ -798,7 +798,7 @@ static int san_consumer_links_setup(struct platform_device *pdev) + + static int san_probe(struct platform_device *pdev) + { +- acpi_handle san = ACPI_HANDLE(&pdev->dev); ++ struct acpi_device *san = ACPI_COMPANION(&pdev->dev); + struct ssam_controller *ctrl; + struct san_data *data; + acpi_status astatus; +@@ -821,7 +821,8 @@ static int san_probe(struct platform_device *pdev) + + platform_set_drvdata(pdev, data); + +- astatus = acpi_install_address_space_handler(san, ACPI_ADR_SPACE_GSBUS, ++ astatus = acpi_install_address_space_handler(san->handle, ++ ACPI_ADR_SPACE_GSBUS, + &san_opreg_handler, NULL, + &data->info); + if (ACPI_FAILURE(astatus)) +@@ -835,7 +836,7 @@ static int san_probe(struct platform_device *pdev) if (status) goto err_install_dev; - acpi_walk_dep_device_list(san); -+ acpi_dev_flag_dependency_met(san); ++ acpi_dev_clear_dependencies(san); return 0; err_install_dev: diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index f28b097c658f..128eec2a26f6 100644 +index f28b097c658f..849f3540ed53 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -279,6 +279,12 @@ struct acpi_device_power { @@ -228,12 +358,12 @@ index f28b097c658f..128eec2a26f6 100644 bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2); -+void acpi_dev_flag_dependency_met(acpi_handle handle); ++void acpi_dev_clear_dependencies(struct acpi_device *supplier); struct acpi_device * acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); struct acpi_device * diff --git a/include/linux/acpi.h b/include/linux/acpi.h -index 3bdcfc4401b7..b560e47b700c 100644 +index 3bdcfc4401b7..c2da6b8939c0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -666,7 +666,9 @@ extern bool acpi_driver_match_device(struct device *dev, @@ -241,18 +371,18 @@ index 3bdcfc4401b7..b560e47b700c 100644 int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); int acpi_device_modalias(struct device *, char *, int); -void acpi_walk_dep_device_list(acpi_handle handle); -+void acpi_walk_dep_device_list(acpi_handle handle, -+ int (*callback)(struct acpi_dep_data *, void *), -+ void *data); ++int acpi_walk_dep_device_list(acpi_handle handle, ++ int (*callback)(struct acpi_dep_data *, void *), ++ void *data); struct platform_device *acpi_create_platform_device(struct acpi_device *, struct property_entry *); -- 2.31.1 -From 33c9cac05908772acd83bf10c261f60602087f7c Mon Sep 17 00:00:00 2001 +From 5031cd19554014c4e0853233975d02e9b19dcc92 Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:31 +0000 +Date: Thu, 20 May 2021 15:09:22 +0100 Subject: [PATCH] ACPI: scan: Add function to fetch dependent of acpi device In some ACPI tables we encounter, devices use the _DEP method to assert @@ -261,23 +391,23 @@ specification intends. We need to be able to find those devices "from" the dependee, so add a callback and a wrapper to walk over the acpi_dep_list and return the dependent ACPI device. -Signed-off-by: Daniel Scally Reviewed-by: Andy Shevchenko +Signed-off-by: Daniel Scally Patchset: cameras --- - drivers/acpi/scan.c | 34 ++++++++++++++++++++++++++++++++++ + drivers/acpi/scan.c | 38 ++++++++++++++++++++++++++++++++++++++ include/acpi/acpi_bus.h | 1 + - 2 files changed, 35 insertions(+) + 2 files changed, 39 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 44e4783d8e95..a4735a479249 100644 +index f5440729ffe9..4fcc7c95af78 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c -@@ -2135,6 +2135,21 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass) +@@ -2136,6 +2136,21 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass) device->handler->hotplug.notify_online(device); } -+static int __acpi_dev_get_dependent_dev(struct acpi_dep_data *dep, void *data) ++static int acpi_return_dep_dev(struct acpi_dep_data *dep, void *data) +{ + struct acpi_device *adev; + int ret; @@ -292,27 +422,31 @@ index 44e4783d8e95..a4735a479249 100644 + return 1; +} + - static int __acpi_dev_flag_dependency_met(struct acpi_dep_data *dep, - void *data) + static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data) { -@@ -2187,6 +2202,25 @@ void acpi_dev_flag_dependency_met(acpi_handle handle) + struct acpi_device *adev; +@@ -2199,6 +2214,29 @@ void acpi_dev_clear_dependencies(struct acpi_device *supplier) } - EXPORT_SYMBOL_GPL(acpi_dev_flag_dependency_met); + EXPORT_SYMBOL_GPL(acpi_dev_clear_dependencies); +/** -+ * acpi_dev_get_dependent_dev - Return ACPI device dependent on @adev -+ * @adev: Pointer to the dependee device ++ * acpi_dev_get_dependent_dev - Return ACPI device dependent on @supplier ++ * @supplier: Pointer to the dependee device + * + * Returns the first &struct acpi_device which declares itself dependent on -+ * @adev via the _DEP buffer, parsed from the acpi_dep_list. ++ * @supplier via the _DEP buffer, parsed from the acpi_dep_list. ++ * ++ * The caller is responsible for putting the reference to adev when it is no ++ * longer needed. + */ -+struct acpi_device * -+acpi_dev_get_dependent_dev(struct acpi_device *supplier) ++struct acpi_device *acpi_dev_get_dependent_dev(struct acpi_device *supplier) +{ + struct acpi_device *adev = NULL; + -+ acpi_walk_dep_device_list(supplier->handle, -+ __acpi_dev_get_dependent_dev, &adev); ++ acpi_walk_dep_device_list(supplier->handle, acpi_return_dep_dev, &adev); ++ ++ if (adev) ++ get_device(&adev->dev); + + return adev; +} @@ -322,13 +456,13 @@ index 44e4783d8e95..a4735a479249 100644 * acpi_bus_scan - Add ACPI device node objects in a given namespace scope. * @handle: Root of the namespace scope to scan. diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index 128eec2a26f6..d00dec1ad9fb 100644 +index 849f3540ed53..b531750eb422 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -691,6 +691,7 @@ 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); - void acpi_dev_flag_dependency_met(acpi_handle handle); + void acpi_dev_clear_dependencies(struct acpi_device *supplier); +struct acpi_device *acpi_dev_get_dependent_dev(struct acpi_device *supplier); struct acpi_device * acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); @@ -336,9 +470,9 @@ index 128eec2a26f6..d00dec1ad9fb 100644 -- 2.31.1 -From 08df91b22b4fec76672d805eeb9dce4b53fb06c2 Mon Sep 17 00:00:00 2001 +From 86138e2d23adeb4c89e1798fa7e99215e82bf41f Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:32 +0000 +Date: Thu, 20 May 2021 15:09:23 +0100 Subject: [PATCH] i2c: core: Add a format macro for I2C device names Some places in the kernel allow users to map resources to a device @@ -349,12 +483,12 @@ users to refer to an I2C device by name before it has been instantiated, so create a macro for the format that's accessible outside the I2C layer and use it in i2c_dev_set_name(). +Acked-by: Wolfram Sang Suggested-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Reviewed-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Daniel Scally -Acked-by: Wolfram Sang # for changing I2C core Patchset: cameras --- drivers/i2c/i2c-core-base.c | 4 ++-- @@ -381,7 +515,7 @@ index f21362355973..e2cf16f27d65 100644 } diff --git a/include/linux/i2c.h b/include/linux/i2c.h -index 56622658b215..4d40a4b46810 100644 +index a670ae129f4b..a2f6ee71b5be 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -39,6 +39,9 @@ enum i2c_slave_event; @@ -397,71 +531,53 @@ index 56622658b215..4d40a4b46810 100644 -- 2.31.1 -From 003452ecb0e7726fe2442869ce6ac30182f33b29 Mon Sep 17 00:00:00 2001 +From f942d86b5b3fcbe6b96157a4fcb6753226826f80 Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:33 +0000 +Date: Thu, 20 May 2021 15:09:24 +0100 Subject: [PATCH] gpiolib: acpi: Export acpi_get_gpiod() -I need to be able to translate GPIO resources in an ACPI device's _CRS +We need to be able to translate GPIO resources in an ACPI device's _CRS into GPIO descriptor array. Those are represented in _CRS as a pathname -to a GPIO device plus the pin's index number: this function is perfect -for that purpose. +to a GPIO device plus the pin's index number: the acpi_get_gpiod() +function is perfect for that purpose. As it's currently only used internally within the GPIO layer, provide and export a wrapper function that additionally holds a reference to the GPIO device. -Signed-off-by: Daniel Scally Reviewed-by: Andy Shevchenko +Signed-off-by: Daniel Scally Patchset: cameras --- - drivers/gpio/gpiolib-acpi.c | 36 +++++++++++++++++++++++++++++++---- - include/linux/gpio/consumer.h | 7 +++++++ - 2 files changed, 39 insertions(+), 4 deletions(-) + drivers/gpio/gpiolib-acpi.c | 28 ++++++++++++++++++++++++++++ + include/linux/gpio/consumer.h | 2 ++ + 2 files changed, 30 insertions(+) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c -index 4a16e0d9b257..5f99d698f60d 100644 +index ad4609467db0..f401f3b1d5d2 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c -@@ -102,7 +102,8 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) - } - - /** -- * acpi_get_gpiod() - Translate ACPI GPIO pin to GPIO descriptor usable with GPIO API -+ * __acpi_get_gpiod() - Translate ACPI GPIO pin to GPIO descriptor usable with -+ * GPIO API - * @path: ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1") - * @pin: ACPI GPIO pin number (0-based, controller-relative) - * -@@ -111,7 +112,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) - * controller does not have GPIO chip registered at the moment. This is to - * support probe deferral. - */ --static struct gpio_desc *acpi_get_gpiod(char *path, int pin) -+static struct gpio_desc *__acpi_get_gpiod(char *path, int pin) - { - struct gpio_chip *chip; - acpi_handle handle; -@@ -128,6 +129,33 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin) +@@ -128,6 +128,34 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin) return gpiochip_get_desc(chip, pin); } +/** -+ * acpi_get_gpiod() - Translate ACPI GPIO pin to GPIO descriptor usable with -+ * GPIO API, and hold a refcount to the GPIO device. -+ * @path: ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1") -+ * @pin: ACPI GPIO pin number (0-based, controller-relative) -+ * @label: Label to pass to gpiod_request() ++ * acpi_get_and_request_gpiod() - Translate ACPI GPIO pin to GPIO descriptor ++ * and hold a refcount to the GPIO device. ++ * @path: ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1") ++ * @pin: ACPI GPIO pin number (0-based, controller-relative) ++ * @label: Label to pass to gpiod_request() + * -+ * This function is a simple pass-through to __acpi_get_gpiod(), except that as -+ * it is intended for use outside of the GPIO layer (in a similar fashion to ++ * This function is a simple pass-through to acpi_get_gpiod(), except that ++ * as it is intended for use outside of the GPIO layer (in a similar fashion to + * gpiod_get_index() for example) it also holds a reference to the GPIO device. + */ -+struct gpio_desc *acpi_get_gpiod(char *path, int pin, char *label) ++struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label) +{ -+ struct gpio_desc *gpio = __acpi_get_gpiod(path, pin); ++ struct gpio_desc *gpio; + int ret; + ++ gpio = acpi_get_gpiod(path, pin); + if (IS_ERR(gpio)) + return gpio; + @@ -471,53 +587,139 @@ index 4a16e0d9b257..5f99d698f60d 100644 + + return gpio; +} -+EXPORT_SYMBOL_GPL(acpi_get_gpiod); ++EXPORT_SYMBOL_GPL(acpi_get_and_request_gpiod); + static irqreturn_t acpi_gpio_irq_handler(int irq, void *data) { struct acpi_gpio_event *event = data; -@@ -693,8 +721,8 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) - if (lookup->info.quirks & ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER) - desc = gpio_to_desc(agpio->pin_table[pin_index]); - else -- desc = acpi_get_gpiod(agpio->resource_source.string_ptr, -- agpio->pin_table[pin_index]); -+ desc = __acpi_get_gpiod(agpio->resource_source.string_ptr, -+ agpio->pin_table[pin_index]); - lookup->desc = desc; - lookup->info.pin_config = agpio->pin_config; - lookup->info.debounce = agpio->debounce_timeout; diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h -index c73b25bc9213..e26fb586b6c8 100644 +index c73b25bc9213..566feb56601f 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -692,6 +692,8 @@ int devm_acpi_dev_add_driver_gpios(struct device *dev, const struct acpi_gpio_mapping *gpios); void devm_acpi_dev_remove_driver_gpios(struct device *dev); -+struct gpio_desc *acpi_get_gpiod(char *path, int pin, char *label); ++struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label); + #else /* CONFIG_GPIOLIB && CONFIG_ACPI */ struct acpi_device; -@@ -710,6 +712,11 @@ static inline int devm_acpi_dev_add_driver_gpios(struct device *dev, - } - static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {} - -+struct gpio_desc *acpi_get_gpiod(char *path, int pin, char *label) -+{ -+ return NULL; -+} -+ - #endif /* CONFIG_GPIOLIB && CONFIG_ACPI */ - - -- 2.31.1 -From 3ab66500a16f4876900c8f82a1b96af94936c366 Mon Sep 17 00:00:00 2001 +From 8bac3adcdc94701e226fc91b5be81230576971a8 Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:34 +0000 +Date: Thu, 20 May 2021 15:09:25 +0100 +Subject: [PATCH] clkdev: Make clkdev_drop() null aware + +To simplify error handling paths, many functions are no-ops when passed +NULL pointers, for example gpiod_remove_lookup_table(). Mirror that +behaviour for clkdev_drop(). + +Signed-off-by: Daniel Scally +Patchset: cameras +--- + drivers/clk/clkdev.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c +index 0f2e3fcf0f19..c082720f8ade 100644 +--- a/drivers/clk/clkdev.c ++++ b/drivers/clk/clkdev.c +@@ -286,6 +286,9 @@ EXPORT_SYMBOL(clk_add_alias); + */ + void clkdev_drop(struct clk_lookup *cl) + { ++ if (!cl) ++ return; ++ + mutex_lock(&clocks_mutex); + list_del(&cl->node); + mutex_unlock(&clocks_mutex); +-- +2.31.1 + +From f87df429bfdc16395f3a12284972b7842c2ef081 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Thu, 20 May 2021 15:09:26 +0100 +Subject: [PATCH] gpiolib: acpi: Add acpi_gpio_get_io_resource() + +Add a function to verify that a given acpi_resource represents an IO +type GPIO resource, and return it if so. + +Signed-off-by: Daniel Scally +Patchset: cameras +--- + drivers/gpio/gpiolib-acpi.c | 23 +++++++++++++++++++++++ + include/linux/acpi.h | 7 +++++++ + 2 files changed, 30 insertions(+) + +diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c +index f401f3b1d5d2..9004b0c7cada 100644 +--- a/drivers/gpio/gpiolib-acpi.c ++++ b/drivers/gpio/gpiolib-acpi.c +@@ -196,6 +196,29 @@ bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, + } + EXPORT_SYMBOL_GPL(acpi_gpio_get_irq_resource); + ++/** ++ * acpi_gpio_get_io_resource - Fetch details of an ACPI resource if it is a GPIO ++ * I/O resource or return False if not. ++ * @ares: Pointer to the ACPI resource to fetch ++ * @agpio: Pointer to a &struct acpi_resource_gpio to store the output pointer ++ */ ++bool acpi_gpio_get_io_resource(struct acpi_resource *ares, ++ struct acpi_resource_gpio **agpio) ++{ ++ struct acpi_resource_gpio *gpio; ++ ++ if (ares->type != ACPI_RESOURCE_TYPE_GPIO) ++ return false; ++ ++ gpio = &ares->data.gpio; ++ if (gpio->connection_type != ACPI_RESOURCE_GPIO_TYPE_IO) ++ return false; ++ ++ *agpio = gpio; ++ return true; ++} ++EXPORT_SYMBOL_GPL(acpi_gpio_get_io_resource); ++ + static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio, + struct acpi_gpio_event *event) + { +diff --git a/include/linux/acpi.h b/include/linux/acpi.h +index c2da6b8939c0..07a0044397e1 100644 +--- a/include/linux/acpi.h ++++ b/include/linux/acpi.h +@@ -1088,6 +1088,8 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c + #if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB) + bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, + struct acpi_resource_gpio **agpio); ++bool acpi_gpio_get_io_resource(struct acpi_resource *ares, ++ struct acpi_resource_gpio **agpio); + int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, const char *name, int index); + #else + static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, +@@ -1095,6 +1097,11 @@ static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, + { + return false; + } ++static inline bool acpi_gpio_get_io_resource(struct acpi_resource *ares, ++ struct acpi_resource_gpio **agpio) ++{ ++ return false; ++} + static inline int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, + const char *name, int index) + { +-- +2.31.1 + +From ac17eb1c7e6c21f956e69e3226779839ce0d23e0 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Thu, 20 May 2021 15:09:27 +0100 Subject: [PATCH] platform/x86: Add intel_skl_int3472 driver ACPI devices with _HID INT3472 are currently matched to the tps68470 @@ -546,15 +748,17 @@ Patchset: cameras MAINTAINERS | 5 + drivers/platform/x86/Kconfig | 2 + drivers/platform/x86/Makefile | 1 + - drivers/platform/x86/intel-int3472/Kconfig | 31 + - drivers/platform/x86/intel-int3472/Makefile | 4 + - .../intel-int3472/intel_skl_int3472_common.c | 106 ++++ - .../intel-int3472/intel_skl_int3472_common.h | 110 ++++ - .../intel_skl_int3472_discrete.c | 592 ++++++++++++++++++ - .../intel_skl_int3472_tps68470.c | 113 ++++ - 9 files changed, 964 insertions(+) + drivers/platform/x86/intel-int3472/Kconfig | 31 ++ + drivers/platform/x86/intel-int3472/Makefile | 5 + + .../intel_skl_int3472_clk_and_regulator.c | 195 +++++++++ + .../intel-int3472/intel_skl_int3472_common.c | 106 +++++ + .../intel-int3472/intel_skl_int3472_common.h | 113 +++++ + .../intel_skl_int3472_discrete.c | 409 ++++++++++++++++++ + .../intel_skl_int3472_tps68470.c | 109 +++++ + 10 files changed, 976 insertions(+) create mode 100644 drivers/platform/x86/intel-int3472/Kconfig create mode 100644 drivers/platform/x86/intel-int3472/Makefile + create mode 100644 drivers/platform/x86/intel-int3472/intel_skl_int3472_clk_and_regulator.c create mode 100644 drivers/platform/x86/intel-int3472/intel_skl_int3472_common.c create mode 100644 drivers/platform/x86/intel-int3472/intel_skl_int3472_common.h create mode 100644 drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c @@ -603,17 +807,17 @@ index 60d554073749..4cbcff47a571 100644 # MSI diff --git a/drivers/platform/x86/intel-int3472/Kconfig b/drivers/platform/x86/intel-int3472/Kconfig new file mode 100644 -index 000000000000..b94622245c21 +index 000000000000..f0fd0df65e4d --- /dev/null +++ b/drivers/platform/x86/intel-int3472/Kconfig @@ -0,0 +1,31 @@ +config INTEL_SKL_INT3472 + tristate "Intel SkyLake ACPI INT3472 Driver" + depends on ACPI -+ depends on REGULATOR -+ depends on GPIOLIB + depends on COMMON_CLK && CLKDEV_LOOKUP + depends on I2C ++ depends on GPIOLIB ++ depends on REGULATOR + select MFD_CORE + select REGMAP_I2C + help @@ -640,17 +844,219 @@ index 000000000000..b94622245c21 + The module will be named "intel-skl-int3472" diff --git a/drivers/platform/x86/intel-int3472/Makefile b/drivers/platform/x86/intel-int3472/Makefile new file mode 100644 -index 000000000000..c887ee7d52ca +index 000000000000..48bd97f0a04e --- /dev/null +++ b/drivers/platform/x86/intel-int3472/Makefile -@@ -0,0 +1,4 @@ +@@ -0,0 +1,5 @@ +obj-$(CONFIG_INTEL_SKL_INT3472) += intel_skl_int3472.o +intel_skl_int3472-objs := intel_skl_int3472_common.o \ + intel_skl_int3472_discrete.o \ -+ intel_skl_int3472_tps68470.o ++ intel_skl_int3472_tps68470.o \ ++ intel_skl_int3472_clk_and_regulator.o +diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_clk_and_regulator.c b/drivers/platform/x86/intel-int3472/intel_skl_int3472_clk_and_regulator.c +new file mode 100644 +index 000000000000..82b95f753549 +--- /dev/null ++++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_clk_and_regulator.c +@@ -0,0 +1,195 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* Author: Dan Scally */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "intel_skl_int3472_common.h" ++ ++/* ++ * The regulators have to have .ops to be valid, but the only ops we actually ++ * support are .enable and .disable which are handled via .ena_gpiod. Pass an ++ * empty struct to clear the check without lying about capabilities. ++ */ ++static const struct regulator_ops int3472_gpio_regulator_ops; ++ ++static int skl_int3472_clk_prepare(struct clk_hw *hw) ++{ ++ struct int3472_gpio_clock *clk = to_int3472_clk(hw); ++ ++ gpiod_set_value(clk->ena_gpio, 1); ++ gpiod_set_value(clk->led_gpio, 1); ++ ++ return 0; ++} ++ ++static void skl_int3472_clk_unprepare(struct clk_hw *hw) ++{ ++ struct int3472_gpio_clock *clk = to_int3472_clk(hw); ++ ++ gpiod_set_value(clk->ena_gpio, 0); ++ gpiod_set_value(clk->led_gpio, 0); ++} ++ ++static int skl_int3472_clk_enable(struct clk_hw *hw) ++{ ++ /* ++ * We're just turning a GPIO on to enable the clock, which operation ++ * has the potential to sleep. Given .enable() cannot sleep, but ++ * .prepare() can, we toggle the GPIO in .prepare() instead. Thus, ++ * nothing to do here. ++ */ ++ return 0; ++} ++ ++static void skl_int3472_clk_disable(struct clk_hw *hw) ++{ ++ /* Likewise, nothing to do here... */ ++} ++ ++static unsigned int skl_int3472_get_clk_frequency(struct int3472_discrete_device *int3472) ++{ ++ union acpi_object *obj; ++ unsigned int freq; ++ ++ obj = skl_int3472_get_acpi_buffer(int3472->sensor, "SSDB"); ++ if (IS_ERR(obj)) ++ return 0; /* report rate as 0 on error */ ++ ++ if (obj->buffer.length < CIO2_SENSOR_SSDB_MCLKSPEED_OFFSET + sizeof(u32)) { ++ dev_err(int3472->dev, "The buffer is too small\n"); ++ goto out_free_buff; ++ } ++ ++ freq = *(u32 *)(obj->buffer.pointer + CIO2_SENSOR_SSDB_MCLKSPEED_OFFSET); ++ ++out_free_buff: ++ kfree(obj); ++ return freq; ++} ++ ++static unsigned long skl_int3472_clk_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ struct int3472_gpio_clock *clk = to_int3472_clk(hw); ++ ++ return clk->frequency; ++} ++ ++static const struct clk_ops skl_int3472_clock_ops = { ++ .prepare = skl_int3472_clk_prepare, ++ .unprepare = skl_int3472_clk_unprepare, ++ .enable = skl_int3472_clk_enable, ++ .disable = skl_int3472_clk_disable, ++ .recalc_rate = skl_int3472_clk_recalc_rate, ++}; ++ ++int skl_int3472_register_clock(struct int3472_discrete_device *int3472) ++{ ++ struct clk_init_data init = { ++ .ops = &skl_int3472_clock_ops, ++ .flags = CLK_GET_RATE_NOCACHE, ++ }; ++ int ret = 0; ++ ++ init.name = kasprintf(GFP_KERNEL, "%s-clk", ++ acpi_dev_name(int3472->adev)); ++ if (!init.name) ++ return -ENOMEM; ++ ++ int3472->clock.frequency = skl_int3472_get_clk_frequency(int3472); ++ ++ int3472->clock.clk_hw.init = &init; ++ int3472->clock.clk = clk_register(&int3472->adev->dev, ++ &int3472->clock.clk_hw); ++ if (IS_ERR(int3472->clock.clk)) { ++ ret = PTR_ERR(int3472->clock.clk); ++ goto out_free_init_name; ++ } ++ ++ int3472->clock.cl = clkdev_create(int3472->clock.clk, NULL, ++ int3472->sensor_name); ++ if (!int3472->clock.cl) { ++ ret = -ENOMEM; ++ goto err_unregister_clk; ++ } ++ ++ goto out_free_init_name; ++ ++err_unregister_clk: ++ clk_unregister(int3472->clock.clk); ++out_free_init_name: ++ kfree(init.name); ++ ++ return ret; ++} ++ ++int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, ++ struct acpi_resource *ares) ++{ ++ char *path = ares->data.gpio.resource_source.string_ptr; ++ const struct int3472_sensor_config *sensor_config; ++ struct regulator_consumer_supply supply_map; ++ struct regulator_init_data init_data = { }; ++ struct regulator_config cfg = { }; ++ int ret; ++ ++ sensor_config = int3472->sensor_config; ++ if (IS_ERR(sensor_config)) { ++ dev_err(int3472->dev, "No sensor module config\n"); ++ return PTR_ERR(sensor_config); ++ } ++ ++ if (!sensor_config->supply_map.supply) { ++ dev_err(int3472->dev, "No supply name defined\n"); ++ return -ENODEV; ++ } ++ ++ init_data.constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS; ++ init_data.num_consumer_supplies = 1; ++ supply_map = sensor_config->supply_map; ++ supply_map.dev_name = int3472->sensor_name; ++ init_data.consumer_supplies = &supply_map; ++ ++ snprintf(int3472->regulator.regulator_name, ++ sizeof(int3472->regulator.regulator_name), "%s-regulator", ++ acpi_dev_name(int3472->adev)); ++ snprintf(int3472->regulator.supply_name, ++ GPIO_REGULATOR_SUPPLY_NAME_LENGTH, "supply-0"); ++ ++ int3472->regulator.rdesc = INT3472_REGULATOR( ++ int3472->regulator.regulator_name, ++ int3472->regulator.supply_name, ++ &int3472_gpio_regulator_ops); ++ ++ int3472->regulator.gpio = acpi_get_and_request_gpiod(path, ++ ares->data.gpio.pin_table[0], ++ "int3472,regulator"); ++ if (IS_ERR(int3472->regulator.gpio)) { ++ dev_err(int3472->dev, "Failed to get regulator GPIO line\n"); ++ return PTR_ERR(int3472->regulator.gpio); ++ } ++ ++ cfg.dev = &int3472->adev->dev; ++ cfg.init_data = &init_data; ++ cfg.ena_gpiod = int3472->regulator.gpio; ++ ++ int3472->regulator.rdev = regulator_register(&int3472->regulator.rdesc, ++ &cfg); ++ if (IS_ERR(int3472->regulator.rdev)) { ++ ret = PTR_ERR(int3472->regulator.rdev); ++ goto err_free_gpio; ++ } ++ ++ return 0; ++ ++err_free_gpio: ++ gpiod_put(int3472->regulator.gpio); ++ ++ return ret; ++} diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.c b/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.c new file mode 100644 -index 000000000000..f61166b6c497 +index 000000000000..8712ef9d8f59 --- /dev/null +++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.c @@ -0,0 +1,106 @@ @@ -681,7 +1087,7 @@ index 000000000000..f61166b6c497 + return ERR_PTR(-ENODEV); + + if (obj->type != ACPI_TYPE_BUFFER) { -+ dev_err(&adev->dev, "%s object is not an ACPI buffer\n", id); ++ acpi_handle_err(handle, "%s object is not an ACPI buffer\n", id); + kfree(obj); + return ERR_PTR(-EINVAL); + } @@ -699,7 +1105,7 @@ index 000000000000..f61166b6c497 + return PTR_ERR(obj); + + if (obj->buffer.length > sizeof(*cldb)) { -+ dev_err(&adev->dev, "The CLDB buffer is too large\n"); ++ acpi_handle_err(adev->handle, "The CLDB buffer is too large\n"); + ret = -EINVAL; + goto out_free_obj; + } @@ -736,7 +1142,7 @@ index 000000000000..f61166b6c497 + +static int skl_int3472_init(void) +{ -+ int ret = 0; ++ int ret; + + ret = platform_driver_register(&int3472_discrete); + if (ret) @@ -762,10 +1168,10 @@ index 000000000000..f61166b6c497 +MODULE_LICENSE("GPL v2"); diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.h b/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.h new file mode 100644 -index 000000000000..9169356cd522 +index 000000000000..4c923d15e3b1 --- /dev/null +++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_common.h -@@ -0,0 +1,110 @@ +@@ -0,0 +1,113 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Author: Dan Scally */ + @@ -808,9 +1214,9 @@ index 000000000000..9169356cd522 +#define to_int3472_device(clk) \ + container_of(clk, struct int3472_discrete_device, clock) + -+struct platform_device; -+struct i2c_client; +struct acpi_device; ++struct i2c_client; ++struct platform_device; + +struct int3472_cldb { + u8 version; @@ -828,8 +1234,8 @@ index 000000000000..9169356cd522 +}; + +struct int3472_gpio_function_remap { -+ char *documented; -+ char *actual; ++ const char *documented; ++ const char *actual; +}; + +struct int3472_sensor_config { @@ -844,7 +1250,7 @@ index 000000000000..9169356cd522 + struct acpi_device *sensor; + const char *sensor_name; + -+ struct int3472_sensor_config *sensor_config; ++ const struct int3472_sensor_config *sensor_config; + + struct int3472_gpio_regulator { + char regulator_name[GPIO_REGULATOR_NAME_LENGTH]; @@ -874,27 +1280,32 @@ index 000000000000..9169356cd522 +union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev, + char *id); +int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb); ++int skl_int3472_register_clock(struct int3472_discrete_device *int3472); ++int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, ++ struct acpi_resource *ares); + +#endif diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c b/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c new file mode 100644 -index 000000000000..40652161bbbf +index 000000000000..cb91ab9e65cc --- /dev/null +++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c -@@ -0,0 +1,592 @@ +@@ -0,0 +1,409 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Author: Dan Scally */ + +#include +#include ++#include ++#include +#include ++#include +#include +#include +#include +#include +#include -+#include -+#include ++#include + +#include "intel_skl_int3472_common.h" + @@ -937,99 +1348,19 @@ index 000000000000..40652161bbbf + { } +}; + -+static struct int3472_sensor_config int3472_sensor_configs[] = { ++static const struct int3472_sensor_config int3472_sensor_configs[] = { + /* Lenovo Miix 510-12ISK - OV2680, Front */ -+ { "GNDF140809R", { 0 }, ov2680_gpio_function_remaps}, ++ { "GNDF140809R", { 0 }, ov2680_gpio_function_remaps }, + /* Lenovo Miix 510-12ISK - OV5648, Rear */ -+ { "GEFF150023R", REGULATOR_SUPPLY("avdd", NULL), NULL}, ++ { "GEFF150023R", REGULATOR_SUPPLY("avdd", NULL), NULL }, + /* Surface Go 1&2 - OV5693, Front */ -+ { "YHCU", REGULATOR_SUPPLY("avdd", NULL), NULL}, ++ { "YHCU", REGULATOR_SUPPLY("avdd", NULL), NULL }, +}; + -+/* -+ * The regulators have to have .ops to be valid, but the only ops we actually -+ * support are .enable and .disable which are handled via .ena_gpiod. Pass an -+ * empty struct to clear the check without lying about capabilities. -+ */ -+static const struct regulator_ops int3472_gpio_regulator_ops = { 0 }; -+ -+static int skl_int3472_clk_prepare(struct clk_hw *hw) -+{ -+ struct int3472_gpio_clock *clk = to_int3472_clk(hw); -+ -+ gpiod_set_value(clk->ena_gpio, 1); -+ if (clk->led_gpio) -+ gpiod_set_value(clk->led_gpio, 1); -+ -+ return 0; -+} -+ -+static void skl_int3472_clk_unprepare(struct clk_hw *hw) -+{ -+ struct int3472_gpio_clock *clk = to_int3472_clk(hw); -+ -+ gpiod_set_value(clk->ena_gpio, 0); -+ if (clk->led_gpio) -+ gpiod_set_value(clk->led_gpio, 0); -+} -+ -+static int skl_int3472_clk_enable(struct clk_hw *hw) -+{ -+ /* -+ * We're just turning a GPIO on to enable, which operation has the -+ * potential to sleep. Given enable cannot sleep, but prepare can, -+ * we toggle the GPIO in prepare instead. Thus, nothing to do here. -+ */ -+ return 0; -+} -+ -+static void skl_int3472_clk_disable(struct clk_hw *hw) -+{ -+ /* Likewise, nothing to do here... */ -+} -+ -+static unsigned int skl_int3472_get_clk_frequency(struct int3472_discrete_device *int3472) -+{ -+ union acpi_object *obj; -+ unsigned int ret = 0; -+ -+ obj = skl_int3472_get_acpi_buffer(int3472->sensor, "SSDB"); -+ if (IS_ERR(obj)) -+ return 0; /* report rate as 0 on error */ -+ -+ if (obj->buffer.length < CIO2_SENSOR_SSDB_MCLKSPEED_OFFSET + sizeof(u32)) { -+ dev_err(int3472->dev, "The buffer is too small\n"); -+ goto out_free_buff; -+ } -+ -+ ret = *(u32 *)(obj->buffer.pointer + CIO2_SENSOR_SSDB_MCLKSPEED_OFFSET); -+ -+out_free_buff: -+ kfree(obj); -+ return ret; -+} -+ -+static unsigned long skl_int3472_clk_recalc_rate(struct clk_hw *hw, -+ unsigned long parent_rate) -+{ -+ struct int3472_gpio_clock *clk = to_int3472_clk(hw); -+ struct int3472_discrete_device *int3472 = to_int3472_device(clk); -+ -+ return int3472->clock.frequency; -+} -+ -+static const struct clk_ops skl_int3472_clock_ops = { -+ .prepare = skl_int3472_clk_prepare, -+ .unprepare = skl_int3472_clk_unprepare, -+ .enable = skl_int3472_clk_enable, -+ .disable = skl_int3472_clk_disable, -+ .recalc_rate = skl_int3472_clk_recalc_rate, -+}; -+ -+static struct int3472_sensor_config * ++static const struct int3472_sensor_config * +skl_int3472_get_sensor_module_config(struct int3472_discrete_device *int3472) +{ -+ struct int3472_sensor_config *ret; ++ const struct int3472_sensor_config *ret; + union acpi_object *obj; + unsigned int i; + @@ -1050,7 +1381,7 @@ index 000000000000..40652161bbbf + goto out_free_obj; + } + -+ ret = NULL; ++ ret = ERR_PTR(-EINVAL); + for (i = 0; i < ARRAY_SIZE(int3472_sensor_configs); i++) { + if (!strcmp(int3472_sensor_configs[i].sensor_module_name, + obj->string.pointer)) { @@ -1066,7 +1397,7 @@ index 000000000000..40652161bbbf + +static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472, + struct acpi_resource *ares, -+ char *func, u32 polarity) ++ const char *func, u32 polarity) +{ + char *path = ares->data.gpio.resource_source.string_ptr; + const struct int3472_sensor_config *sensor_config; @@ -1082,15 +1413,15 @@ index 000000000000..40652161bbbf + } + + sensor_config = int3472->sensor_config; -+ if (!IS_ERR_OR_NULL(sensor_config) && sensor_config->function_maps) { -+ const struct int3472_gpio_function_remap *remap = -+ sensor_config->function_maps; ++ if (!IS_ERR(sensor_config) && sensor_config->function_maps) { ++ const struct int3472_gpio_function_remap *remap; + -+ for (; remap->documented; ++remap) ++ for (remap = sensor_config->function_maps; remap->documented; remap++) { + if (!strcmp(func, remap->documented)) { + func = remap->actual; + break; + } ++ } + } + + /* Functions mapped to NULL should not be mapped to the sensor */ @@ -1125,23 +1456,23 @@ index 000000000000..40652161bbbf + + switch (type) { + case INT3472_GPIO_TYPE_CLK_ENABLE: -+ gpio = acpi_get_gpiod(path, ares->data.gpio.pin_table[0], -+ "int3472,clk-enable"); ++ gpio = acpi_get_and_request_gpiod(path, ares->data.gpio.pin_table[0], ++ "int3472,clk-enable"); + if (IS_ERR(gpio)) + return (PTR_ERR(gpio)); + + int3472->clock.ena_gpio = gpio; + break; + case INT3472_GPIO_TYPE_PRIVACY_LED: -+ gpio = acpi_get_gpiod(path, ares->data.gpio.pin_table[0], -+ "int3472,privacy-led"); ++ gpio = acpi_get_and_request_gpiod(path, ares->data.gpio.pin_table[0], ++ "int3472,privacy-led"); + if (IS_ERR(gpio)) + return (PTR_ERR(gpio)); + + int3472->clock.led_gpio = gpio; + break; + default: -+ dev_err(int3472->dev, "Invalid GPIO type 0x%hx for clock\n", ++ dev_err(int3472->dev, "Invalid GPIO type 0x%02x for clock\n", + type); + break; + } @@ -1149,109 +1480,6 @@ index 000000000000..40652161bbbf + return 0; +} + -+static int skl_int3472_register_clock(struct int3472_discrete_device *int3472) -+{ -+ struct clk_init_data init = { -+ .ops = &skl_int3472_clock_ops, -+ .flags = CLK_GET_RATE_NOCACHE, -+ }; -+ int ret = 0; -+ -+ init.name = kasprintf(GFP_KERNEL, "%s-clk", -+ acpi_dev_name(int3472->adev)); -+ if (!init.name) -+ return -ENOMEM; -+ -+ int3472->clock.frequency = skl_int3472_get_clk_frequency(int3472); -+ -+ int3472->clock.clk_hw.init = &init; -+ int3472->clock.clk = clk_register(&int3472->adev->dev, -+ &int3472->clock.clk_hw); -+ if (IS_ERR(int3472->clock.clk)) { -+ ret = PTR_ERR(int3472->clock.clk); -+ goto out_free_init_name; -+ } -+ -+ int3472->clock.cl = clkdev_create(int3472->clock.clk, NULL, -+ int3472->sensor_name); -+ if (!int3472->clock.cl) { -+ ret = -ENOMEM; -+ goto err_unregister_clk; -+ } -+ -+ goto out_free_init_name; -+ -+err_unregister_clk: -+ clk_unregister(int3472->clock.clk); -+out_free_init_name: -+ kfree(init.name); -+ -+ return ret; -+} -+ -+static int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, -+ struct acpi_resource *ares) -+{ -+ char *path = ares->data.gpio.resource_source.string_ptr; -+ struct int3472_sensor_config *sensor_config; -+ struct regulator_init_data init_data = { }; -+ struct regulator_config cfg = { }; -+ int ret; -+ -+ sensor_config = int3472->sensor_config; -+ if (IS_ERR_OR_NULL(sensor_config)) { -+ dev_err(int3472->dev, "No sensor module config\n"); -+ return PTR_ERR(sensor_config); -+ } -+ -+ if (!sensor_config->supply_map.supply) { -+ dev_err(int3472->dev, "No supply name defined\n"); -+ return -ENODEV; -+ } -+ -+ init_data.constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS; -+ init_data.num_consumer_supplies = 1; -+ sensor_config->supply_map.dev_name = int3472->sensor_name; -+ init_data.consumer_supplies = &sensor_config->supply_map; -+ -+ snprintf(int3472->regulator.regulator_name, -+ sizeof(int3472->regulator.regulator_name), "%s-regulator", -+ acpi_dev_name(int3472->adev)); -+ snprintf(int3472->regulator.supply_name, -+ GPIO_REGULATOR_SUPPLY_NAME_LENGTH, "supply-0"); -+ -+ int3472->regulator.rdesc = INT3472_REGULATOR( -+ int3472->regulator.regulator_name, -+ int3472->regulator.supply_name, -+ &int3472_gpio_regulator_ops); -+ -+ int3472->regulator.gpio = acpi_get_gpiod(path, -+ ares->data.gpio.pin_table[0], -+ "int3472,regulator"); -+ if (IS_ERR(int3472->regulator.gpio)) { -+ dev_err(int3472->dev, "Failed to get regulator GPIO lines\n"); -+ return PTR_ERR(int3472->regulator.gpio); -+ } -+ -+ cfg.dev = &int3472->adev->dev; -+ cfg.init_data = &init_data; -+ cfg.ena_gpiod = int3472->regulator.gpio; -+ -+ int3472->regulator.rdev = regulator_register(&int3472->regulator.rdesc, -+ &cfg); -+ if (IS_ERR(int3472->regulator.rdev)) { -+ ret = PTR_ERR(int3472->regulator.rdev); -+ goto err_free_gpio; -+ } -+ -+ return 0; -+ -+err_free_gpio: -+ gpiod_put(int3472->regulator.gpio); -+ -+ return ret; -+} -+ +/** + * skl_int3472_handle_gpio_resources: Map PMIC resources to consuming sensor + * @ares: A pointer to a &struct acpi_resource @@ -1287,14 +1515,13 @@ index 000000000000..40652161bbbf + void *data) +{ + struct int3472_discrete_device *int3472 = data; -+ u16 pin = ares->data.gpio.pin_table[0]; ++ struct acpi_resource_gpio *agpio; + union acpi_object *obj; -+ char *err_msg; -+ int ret = 0; ++ const char *err_msg; ++ int ret; + u8 type; + -+ if (ares->type != ACPI_RESOURCE_TYPE_GPIO || -+ ares->data.gpio.connection_type != ACPI_RESOURCE_GPIO_TYPE_IO) ++ if (!acpi_gpio_get_io_resource(ares, &agpio)) + return 1; /* Deliberately positive so parsing continues */ + + /* @@ -1307,7 +1534,8 @@ index 000000000000..40652161bbbf + NULL, ACPI_TYPE_INTEGER); + + if (!obj) { -+ dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n", pin); ++ dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n", ++ ares->data.gpio.pin_table[0]); + return 1; + } + @@ -1350,22 +1578,24 @@ index 000000000000..40652161bbbf + break; + } + -+ if (ret < 0 && ret != -EPROBE_DEFER) -+ dev_err(int3472->dev, err_msg); -+ + int3472->n_gpios++; + ACPI_FREE(obj); + -+ return ret; ++ if (ret) ++ return dev_err_probe(int3472->dev, ret, err_msg); ++ ++ return 0; +} + +static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) +{ -+ struct list_head resource_list; ++ LIST_HEAD(resource_list); + int ret; + -+ INIT_LIST_HEAD(&resource_list); -+ ++ /* ++ * No error check, because not having a sensor config is not necessarily ++ * a failure mode. ++ */ + int3472->sensor_config = skl_int3472_get_sensor_module_config(int3472); + + ret = acpi_dev_get_resources(int3472->adev, &resource_list, @@ -1413,8 +1643,8 @@ index 000000000000..40652161bbbf + } + + /* Max num GPIOs we've seen plus a terminator */ -+ int3472 = kzalloc(struct_size(int3472, gpios.table, -+ INT3472_MAX_SENSOR_GPIOS + 1), GFP_KERNEL); ++ int3472 = devm_kzalloc(&pdev->dev, struct_size(int3472, gpios.table, ++ INT3472_MAX_SENSOR_GPIOS + 1), GFP_KERNEL); + if (!int3472) + return -ENOMEM; + @@ -1423,16 +1653,24 @@ index 000000000000..40652161bbbf + platform_set_drvdata(pdev, int3472); + + int3472->sensor = acpi_dev_get_dependent_dev(adev); -+ if (IS_ERR_OR_NULL(int3472->sensor)) { -+ dev_err(&pdev->dev, -+ "INT3472 seems to have no dependents.\n"); -+ ret = -ENODEV; -+ goto err_free_int3472; ++ if (!int3472->sensor) { ++ dev_err(&pdev->dev, "INT3472 seems to have no dependents.\n"); ++ return -ENODEV; + } -+ get_device(&int3472->sensor->dev); + -+ int3472->sensor_name = kasprintf(GFP_KERNEL, I2C_DEV_NAME_FORMAT, -+ acpi_dev_name(int3472->sensor)); ++ int3472->sensor_name = devm_kasprintf(int3472->dev, GFP_KERNEL, ++ I2C_DEV_NAME_FORMAT, ++ acpi_dev_name(int3472->sensor)); ++ if (!int3472->sensor_name) { ++ ret = -ENOMEM; ++ goto err_put_sensor; ++ } ++ ++ /* ++ * Initialising this list means we can call gpiod_remove_lookup_table() ++ * in failure paths without issue. ++ */ ++ INIT_LIST_HEAD(&int3472->gpios.list); + + ret = skl_int3472_parse_crs(int3472); + if (ret) { @@ -1442,8 +1680,9 @@ index 000000000000..40652161bbbf + + return 0; + -+err_free_int3472: -+ kfree(int3472); ++err_put_sensor: ++ acpi_dev_put(int3472->sensor); ++ + return ret; +} + @@ -1451,35 +1690,22 @@ index 000000000000..40652161bbbf +{ + struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); + -+ if (int3472->gpios.dev_id) -+ gpiod_remove_lookup_table(&int3472->gpios); -+ -+ if (!IS_ERR(int3472->regulator.rdev)) -+ regulator_unregister(int3472->regulator.rdev); -+ -+ if (!IS_ERR(int3472->clock.clk)) -+ clk_unregister(int3472->clock.clk); -+ -+ if (int3472->clock.cl) -+ clkdev_drop(int3472->clock.cl); -+ ++ gpiod_remove_lookup_table(&int3472->gpios); ++ regulator_unregister(int3472->regulator.rdev); ++ clk_unregister(int3472->clock.clk); ++ clkdev_drop(int3472->clock.cl); + gpiod_put(int3472->regulator.gpio); + gpiod_put(int3472->clock.ena_gpio); + gpiod_put(int3472->clock.led_gpio); + -+ acpi_dev_put(int3472->sensor); -+ -+ kfree(int3472->sensor_name); -+ kfree(int3472); -+ + return 0; +} diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_tps68470.c b/drivers/platform/x86/intel-int3472/intel_skl_int3472_tps68470.c new file mode 100644 -index 000000000000..d0d2391e263f +index 000000000000..843eaa27e9da --- /dev/null +++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_tps68470.c -@@ -0,0 +1,113 @@ +@@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Author: Dan Scally */ + @@ -1491,15 +1717,15 @@ index 000000000000..d0d2391e263f + +#include "intel_skl_int3472_common.h" + -+static const struct mfd_cell tps68470_c[] = { ++static const struct mfd_cell tps68470_cros[] = { + { .name = "tps68470-gpio" }, + { .name = "tps68470_pmic_opregion" }, +}; + -+static const struct mfd_cell tps68470_w[] = { ++static const struct mfd_cell tps68470_win[] = { + { .name = "tps68470-gpio" }, + { .name = "tps68470-clk" }, -+ { .name = "tps68470-regulator"}, ++ { .name = "tps68470-regulator" }, +}; + +static const struct regmap_config tps68470_regmap_config = { @@ -1533,7 +1759,6 @@ index 000000000000..d0d2391e263f +{ + struct acpi_device *adev = ACPI_COMPANION(&client->dev); + struct int3472_cldb cldb = { 0 }; -+ bool cldb_present = true; + struct regmap *regmap; + int ret; + @@ -1575,15 +1800,12 @@ index 000000000000..d0d2391e263f + } + + if (ret) -+ cldb_present = false; -+ -+ if (cldb_present) + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, -+ tps68470_w, ARRAY_SIZE(tps68470_w), ++ tps68470_cros, ARRAY_SIZE(tps68470_cros), + NULL, 0, NULL); + else + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, -+ tps68470_c, ARRAY_SIZE(tps68470_c), ++ tps68470_win, ARRAY_SIZE(tps68470_win), + NULL, 0, NULL); + + if (ret) { @@ -1596,19 +1818,19 @@ index 000000000000..d0d2391e263f -- 2.31.1 -From c7b44f93abcfd82438c5b33d7383176be283a630 Mon Sep 17 00:00:00 2001 +From 01eaa6e97db7229d68ef869c3549e6a42b744dda Mon Sep 17 00:00:00 2001 From: Daniel Scally -Date: Mon, 22 Feb 2021 13:07:35 +0000 +Date: Thu, 20 May 2021 15:09:28 +0100 Subject: [PATCH] mfd: tps68470: Remove tps68470 MFD driver This driver only covered one scenario in which ACPI devices with _HID INT3472 are found, and its functionality has been taken over by the intel-skl-int3472 module, so remove it. -Reviewed-by: Laurent Pinchart -Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Acked-by: Lee Jones +Reviewed-by: Laurent Pinchart +Signed-off-by: Daniel Scally Patchset: cameras --- drivers/acpi/pmic/Kconfig | 2 +- @@ -1792,7 +2014,7 @@ index 4a4df4ffd18c..000000000000 -- 2.31.1 -From 8b4111b5d20b51965c1561c4316615db387f4e33 Mon Sep 17 00:00:00 2001 +From b7cce7551ed208e0884b5a7ce5454e630bbe1de6 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 5 Apr 2021 23:56:53 +0100 Subject: [PATCH] media: ipu3-cio2: Toggle sensor streaming in pm runtime ops @@ -1852,7 +2074,7 @@ index fecef85bd62e..9dafb9470708 100644 -- 2.31.1 -From dbf58a64ff8155205e2b3d9a96e1af4ef58acafe Mon Sep 17 00:00:00 2001 +From 6d57a64c0e0ef76eb51950d9b1e16e2c6230af25 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Mon, 5 Apr 2021 23:56:54 +0100 Subject: [PATCH] media: i2c: Add support for ov5693 sensor @@ -3495,7 +3717,7 @@ index 000000000000..da2ca99a7ad3 -- 2.31.1 -From f0059d1809d52b6b42a7100efe9e26f9df1249f5 Mon Sep 17 00:00:00 2001 +From a17b86c1fbc147311de52ffbeb3dd754d8d63c5c 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 @@ -3658,7 +3880,7 @@ index dd0ffcafa489..924d99d20328 100644 -- 2.31.1 -From 7d1ac2ea2079508ce20b4bf694275a4947499be8 Mon Sep 17 00:00:00 2001 +From fd66c84c310c0532e2155115677669b4ac28a3f8 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 @@ -3762,7 +3984,7 @@ index 924d99d20328..e1e388cc9f45 100644 -- 2.31.1 -From 117dcddf9a443ac3b7a579e7b427e3143e4d43c6 Mon Sep 17 00:00:00 2001 +From 75aa5e7a32043c82a48f906dd8ee6759bb485049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCthrich?= Date: Thu, 6 May 2021 07:52:44 +0200 Subject: [PATCH] cio2-bridge: Use correct dev_properties size @@ -3788,3 +4010,38 @@ index e1e388cc9f45..deaf5804f70d 100644 -- 2.31.1 +From b7c26cee187d11d2d2ac9e3812b0b9cc882f5f99 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Thu, 20 May 2021 23:31:04 +0100 +Subject: [PATCH] media: i2c: Fix vertical flip in ov5693 + +The pinkness experienced by users with rotated sensors in their laptops +was due to an incorrect setting for the vertical flip function; the +datasheet for the sensor gives the settings as bits 1&2 in one place and +bits 1&6 in another. + +Switch to flipping bit 6 instead of bit 2 for 0x3820 in the vertical +flip function to fix the pink hue. + +Signed-off-by: Daniel Scally +Patchset: cameras +--- + drivers/media/i2c/ov5693.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c +index da2ca99a7ad3..52279eeffc54 100644 +--- a/drivers/media/i2c/ov5693.c ++++ b/drivers/media/i2c/ov5693.c +@@ -133,7 +133,7 @@ + #define OV5693_SUB_INC_Y_REG 0x3815 + + #define OV5693_FORMAT1_REG 0x3820 +-#define OV5693_FORMAT1_FLIP_VERT_ISP_EN BIT(2) ++#define OV5693_FORMAT1_FLIP_VERT_ISP_EN BIT(6) + #define OV5693_FORMAT1_FLIP_VERT_SENSOR_EN BIT(1) + #define OV5693_FORMAT1_VBIN_EN BIT(0) + #define OV5693_FORMAT2_REG 0x3821 +-- +2.31.1 + diff --git a/pkg/arch/kernel/PKGBUILD b/pkg/arch/kernel/PKGBUILD index 16183da81..929a866e4 100644 --- a/pkg/arch/kernel/PKGBUILD +++ b/pkg/arch/kernel/PKGBUILD @@ -45,14 +45,14 @@ sha256sums=('ad6c408fefce32fa9589d273599afdff21205724ea41763bec58745aa42083b7' '55c4cb76754b1db234a0994806106d8481c171d4e3fead12793f0083a48511d4' '252c7a78ffb1efe9751aabc93cc79031ef69dbc95baa7970cbaabcd5474fe7d8' '9474de18769968c5558fedda5be354fe0babf1365541d4d0ac8e1ac47d4bbb88' - 'c573886e220db0ba64d3b53e317f38a8cdbb79da4a0536186436f7edc862a68c' - '54ca159b7e829ea9e2b8de061773521f9c4cf49ffff2ee1aa235d4c7ea302ac4' - '9bd561f50fa93c84a842ef9cb7ee83fadb3c6c5ee893836b4f0e8433767cd2ba' - 'a90795cb503ea7762b9b309e7fd3428940a67572b793b4a9914082b71dc4b44c' - '3561140af7e82419df978589a530ac75903bbe17615b03d4939a408ea2eab537' - '7d2b51b79f0868fc984e893607a3574ee3a273593a901f7ee8c9cbc211f6b0fe' - 'eaf882c116a2bde9c866ce62809fb36fd226380daa508bdd29966cc879a5f950' - '4c3aeb469544e780118b1c95044ae5f430327f2a1ff7fe3306a9c28f98fb60ee') + 'faf79f065bb5d1cc4ecebdd284acc9f734ce8791af09373c59d7f816156c789a' + '66fc944c1826717adbb1c414d15219601fd2784e0c42cf0fa320f554f4d7f3d3' + '1b704aac5e337f09e9b11d8ff13c20e37d5866b766287f9ba848cacaf8a326ed' + '256cf23dc42c7739b8f848f4d9cc6ed695ccbefe2352e2ad5546fade70013f40' + '2c6a0eb0292a96846ca21f6a15bdbed4c65d1b793927dfe7367dca862f157411' + 'eb8b344d2ff52f620ab33612665d3cf0ab20612f1818e616ad476fdb7fe87e12' + '46cd3a78da1c4cf7ce9699bf49892c63a92fa7e00c216a0a501a2125f6efd27e' + '5aa6889f8d5137dfcbd87718fc46cfe3e9964582af9c7d3bc8fb913c9b33d023') export KBUILD_BUILD_HOST=archlinux