From 852fcb1c2f7be2ac8e115984432761e0edaa7801 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Sat, 9 Mar 2024 21:08:04 +0100 Subject: [PATCH] Update v6.7 patches Changes: - Add driver for changing the fan profile (Surface Pro 9) - Added fixes for IPU3 cameras - Reverted DW9719 driver to previous version (Surface Go 2) Links: - kernel: https://github.com/linux-surface/kernel/commit/530f557890610acf822388c6580cea7ebdb082b6 - fan profile driver: https://github.com/linux-surface/kernel/pull/145 - camera fixes: https://github.com/linux-surface/kernel/pull/146 --- patches/6.7/0001-surface3-oemb.patch | 2 +- patches/6.7/0002-mwifiex.patch | 6 +- patches/6.7/0003-ath10k.patch | 2 +- patches/6.7/0004-ipts.patch | 6 +- patches/6.7/0005-ithc.patch | 4 +- patches/6.7/0006-surface-sam.patch | 340 +++++++++++- patches/6.7/0007-surface-sam-over-hid.patch | 4 +- patches/6.7/0008-surface-button.patch | 4 +- patches/6.7/0009-surface-typecover.patch | 6 +- patches/6.7/0010-surface-shutdown.patch | 2 +- patches/6.7/0011-surface-gpe.patch | 2 +- patches/6.7/0012-cameras.patch | 560 +++++++++++++++++++- patches/6.7/0013-amd-gpio.patch | 4 +- patches/6.7/0014-rtc.patch | 2 +- 14 files changed, 906 insertions(+), 38 deletions(-) diff --git a/patches/6.7/0001-surface3-oemb.patch b/patches/6.7/0001-surface3-oemb.patch index 6a2c3b79f..d3e9f474e 100644 --- a/patches/6.7/0001-surface3-oemb.patch +++ b/patches/6.7/0001-surface3-oemb.patch @@ -97,5 +97,5 @@ index 5e2ec60e2954..207868c699f2 100644 }; -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0002-mwifiex.patch b/patches/6.7/0002-mwifiex.patch index ae218e0a7..50c939b78 100644 --- a/patches/6.7/0002-mwifiex.patch +++ b/patches/6.7/0002-mwifiex.patch @@ -163,7 +163,7 @@ index d6ff964aec5b..5d30ae39d65e 100644 void mwifiex_initialize_quirks(struct pcie_service_card *card); int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); -- -2.43.0 +2.44.0 From 86149f1c99b17f67d717419af83f3ec76315e35b Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto @@ -318,7 +318,7 @@ index 5d30ae39d65e..c14eb56eb911 100644 void mwifiex_initialize_quirks(struct pcie_service_card *card); int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); -- -2.43.0 +2.44.0 From 23775dc0be26e58d04574ab75768cedd8b0076f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= @@ -396,5 +396,5 @@ index b8e9de887b5d..66a418ae9584 100644 (id->driver_info & BTUSB_MEDIATEK)) { hdev->setup = btusb_mtk_setup; -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0003-ath10k.patch b/patches/6.7/0003-ath10k.patch index 7deaf5164..8321891ba 100644 --- a/patches/6.7/0003-ath10k.patch +++ b/patches/6.7/0003-ath10k.patch @@ -117,5 +117,5 @@ index 6cdb225b7eac..19c036751fb1 100644 ret = firmware_request_nowarn(&fw, filename, ar->dev); ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n", -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0004-ipts.patch b/patches/6.7/0004-ipts.patch index 0a2f9ed83..caea1aa2f 100644 --- a/patches/6.7/0004-ipts.patch +++ b/patches/6.7/0004-ipts.patch @@ -34,7 +34,7 @@ index 676d566f38dd..6b37dd1f8b2a 100644 {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, -- -2.43.0 +2.44.0 From 4c91dcde022856325e3babe1a1b9e01fcc21ab0f Mon Sep 17 00:00:00 2001 From: Liban Hannan @@ -134,7 +134,7 @@ index 897159dba47d..cc6569613255 100644 { if (risky_device(dev)) -- -2.43.0 +2.44.0 From 7a9591af425eafbb76700f7ab1ab3ae0c3a08e4c Mon Sep 17 00:00:00 2001 From: Dorian Stoll @@ -3226,5 +3226,5 @@ index 000000000000..1f966b8b32c4 + +#endif /* IPTS_THREAD_H */ -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0005-ithc.patch b/patches/6.7/0005-ithc.patch index 6a7ac8ebc..10f9b735a 100644 --- a/patches/6.7/0005-ithc.patch +++ b/patches/6.7/0005-ithc.patch @@ -37,7 +37,7 @@ index 29b9e55dcf26..986e91c813ae 100644 * DMA alias provides us with a PCI device and alias. The only case * where the it will return an alias on a different bus than the -- -2.43.0 +2.44.0 From fe08b40d122fdb102c2cc4876d2d68ac19d74ae3 Mon Sep 17 00:00:00 2001 From: quo @@ -1816,5 +1816,5 @@ index 000000000000..028e55a4ec53 +void ithc_log_regs(struct ithc *ithc); + -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0006-surface-sam.patch b/patches/6.7/0006-surface-sam.patch index 832e832dc..35bc6e354 100644 --- a/patches/6.7/0006-surface-sam.patch +++ b/patches/6.7/0006-surface-sam.patch @@ -29,7 +29,7 @@ index aeb3feae40ff..2bc4977037fc 100644 { "MSHW0123", (unsigned long)ssam_node_group_sls }, -- -2.43.0 +2.44.0 From 2de16abc5d0d2334e2935b1bdb3667a95d0009f2 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -99,7 +99,7 @@ index 2bc4977037fc..26cb6229ad16 100644 { }, }; -- -2.43.0 +2.44.0 From c06e370b5ed873b603aa0dc2faafe24a9e63b3e8 Mon Sep 17 00:00:00 2001 From: Ivor Wanders @@ -144,7 +144,7 @@ index 26cb6229ad16..f02a933160ff 100644 &ssam_node_hid_kip_keyboard, &ssam_node_hid_kip_penstash, -- -2.43.0 +2.44.0 From 63dcbbcad69219e1487db46a5c26c1ebdd9ef6be Mon Sep 17 00:00:00 2001 From: Ivor Wanders @@ -367,7 +367,7 @@ index 000000000000..7c2e3ae3eb40 +MODULE_DESCRIPTION("Fan Driver for Surface System Aggregator Module"); +MODULE_LICENSE("GPL"); -- -2.43.0 +2.44.0 From 5f549c253e4df330fa8f311fe151df80e199bec4 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -595,7 +595,7 @@ index 000000000000..48c3e826713f +MODULE_DESCRIPTION("Thermal sensor subsystem driver for Surface System Aggregator Module"); +MODULE_LICENSE("GPL"); -- -2.43.0 +2.44.0 From 3ccfa3b6be4794f247488f7e665ba91793ec09c7 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -790,7 +790,7 @@ index 48c3e826713f..4c08926139db 100644 "surface_thermal", ssam_temp, &ssam_temp_hwmon_chip_info, NULL); -- -2.43.0 +2.44.0 From 8ccf7b86ad270655bd1e8cd0ab8d2ff475ad0ea7 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -833,5 +833,331 @@ index f02a933160ff..67686042e009 100644 &ssam_node_pos_tablet_switch, &ssam_node_hid_kip_keyboard, -- -2.43.0 +2.44.0 + +From 8907607c42c94186e3be8c385cf82493f2abd164 Mon Sep 17 00:00:00 2001 +From: Ivor Wanders +Date: Sat, 16 Dec 2023 15:56:39 -0500 +Subject: [PATCH] platform/surface: platform_profile: add fan profile switching + +Change naming from tmp to platform profile to clarify the module may +interact with both the TMP and FAN subystems. Add functionality that +switches the fan profile when the platform profile is changed. + +Signed-off-by: Ivor Wanders +--- + .../surface/surface_aggregator_registry.c | 38 +++++--- + .../surface/surface_platform_profile.c | 86 ++++++++++++++++--- + 2 files changed, 100 insertions(+), 24 deletions(-) + +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index 67686042e009..058b6654a91a 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -68,8 +68,8 @@ static const struct software_node ssam_node_bat_sb3base = { + .parent = &ssam_node_hub_base, + }; + +-/* Platform profile / performance-mode device. */ +-static const struct software_node ssam_node_tmp_pprof = { ++/* Platform profile / performance-mode device without a fan. */ ++static const struct software_node ssam_node_tmp_perf_profile = { + .name = "ssam:01:03:01:00:01", + .parent = &ssam_node_root, + }; +@@ -86,6 +86,20 @@ static const struct software_node ssam_node_fan_speed = { + .parent = &ssam_node_root, + }; + ++/* Platform profile / performance-mode device with a fan, such that ++ * the fan controller profile can also be switched. ++ */ ++static const struct property_entry ssam_node_tmp_perf_profile_has_fan[] = { ++ PROPERTY_ENTRY_BOOL("has_fan"), ++ { } ++}; ++ ++static const struct software_node ssam_node_tmp_perf_profile_with_fan = { ++ .name = "ssam:01:03:01:00:01", ++ .parent = &ssam_node_root, ++ .properties = ssam_node_tmp_perf_profile_has_fan, ++}; ++ + /* Tablet-mode switch via KIP subsystem. */ + static const struct software_node ssam_node_kip_tablet_switch = { + .name = "ssam:01:0e:01:00:01", +@@ -214,7 +228,7 @@ static const struct software_node ssam_node_pos_tablet_switch = { + */ + static const struct software_node *ssam_node_group_gen5[] = { + &ssam_node_root, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + NULL, + }; + +@@ -225,7 +239,7 @@ static const struct software_node *ssam_node_group_sb3[] = { + &ssam_node_bat_ac, + &ssam_node_bat_main, + &ssam_node_bat_sb3base, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_bas_dtx, + &ssam_node_hid_base_keyboard, + &ssam_node_hid_base_touchpad, +@@ -239,7 +253,7 @@ static const struct software_node *ssam_node_group_sl3[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_hid_main_keyboard, + &ssam_node_hid_main_touchpad, + &ssam_node_hid_main_iid5, +@@ -251,7 +265,7 @@ static const struct software_node *ssam_node_group_sl5[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_hid_main_keyboard, + &ssam_node_hid_main_touchpad, + &ssam_node_hid_main_iid5, +@@ -264,7 +278,7 @@ static const struct software_node *ssam_node_group_sls1[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_pos_tablet_switch, + &ssam_node_hid_sam_keyboard, + &ssam_node_hid_sam_penstash, +@@ -280,7 +294,7 @@ static const struct software_node *ssam_node_group_sls2[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_pos_tablet_switch, + &ssam_node_hid_sam_keyboard, + &ssam_node_hid_sam_penstash, +@@ -294,7 +308,7 @@ static const struct software_node *ssam_node_group_slg1[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + NULL, + }; + +@@ -303,7 +317,7 @@ static const struct software_node *ssam_node_group_sp7[] = { + &ssam_node_root, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + NULL, + }; + +@@ -313,7 +327,7 @@ static const struct software_node *ssam_node_group_sp8[] = { + &ssam_node_hub_kip, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile, + &ssam_node_kip_tablet_switch, + &ssam_node_hid_kip_keyboard, + &ssam_node_hid_kip_penstash, +@@ -330,7 +344,7 @@ static const struct software_node *ssam_node_group_sp9[] = { + &ssam_node_hub_kip, + &ssam_node_bat_ac, + &ssam_node_bat_main, +- &ssam_node_tmp_pprof, ++ &ssam_node_tmp_perf_profile_with_fan, + &ssam_node_tmp_sensors, + &ssam_node_fan_speed, + &ssam_node_pos_tablet_switch, +diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c +index a5a3941b3f43..e54d0a8f7daa 100644 +--- a/drivers/platform/surface/surface_platform_profile.c ++++ b/drivers/platform/surface/surface_platform_profile.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0+ + /* + * Surface Platform Profile / Performance Mode driver for Surface System +- * Aggregator Module (thermal subsystem). ++ * Aggregator Module (thermal and fan subsystem). + * + * Copyright (C) 2021-2022 Maximilian Luz + */ +@@ -14,6 +14,7 @@ + + #include + ++// Enum for the platform performance profile sent to the TMP module. + enum ssam_tmp_profile { + SSAM_TMP_PROFILE_NORMAL = 1, + SSAM_TMP_PROFILE_BATTERY_SAVER = 2, +@@ -21,15 +22,26 @@ enum ssam_tmp_profile { + SSAM_TMP_PROFILE_BEST_PERFORMANCE = 4, + }; + ++// Enum for the fan profile sent to the FAN module. This fan profile is ++// only sent to the EC if the 'has_fan' property is set. The integers are ++// not a typo, they differ from the performance profile indices. ++enum ssam_fan_profile { ++ SSAM_FAN_PROFILE_NORMAL = 2, ++ SSAM_FAN_PROFILE_BATTERY_SAVER = 1, ++ SSAM_FAN_PROFILE_BETTER_PERFORMANCE = 3, ++ SSAM_FAN_PROFILE_BEST_PERFORMANCE = 4, ++}; ++ + struct ssam_tmp_profile_info { + __le32 profile; + __le16 unknown1; + __le16 unknown2; + } __packed; + +-struct ssam_tmp_profile_device { ++struct ssam_platform_profile_device { + struct ssam_device *sdev; + struct platform_profile_handler handler; ++ bool has_fan; + }; + + SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_tmp_profile_get, struct ssam_tmp_profile_info, { +@@ -42,6 +54,13 @@ SSAM_DEFINE_SYNC_REQUEST_CL_W(__ssam_tmp_profile_set, __le32, { + .command_id = 0x03, + }); + ++SSAM_DEFINE_SYNC_REQUEST_W(__ssam_fan_profile_set, char, { ++ .target_category = SSAM_SSH_TC_FAN, ++ .target_id = SSAM_SSH_TID_SAM, ++ .command_id = 0x0e, ++ .instance_id = 0x01, ++}); ++ + static int ssam_tmp_profile_get(struct ssam_device *sdev, enum ssam_tmp_profile *p) + { + struct ssam_tmp_profile_info info; +@@ -62,7 +81,14 @@ static int ssam_tmp_profile_set(struct ssam_device *sdev, enum ssam_tmp_profile + return ssam_retry(__ssam_tmp_profile_set, sdev, &profile_le); + } + +-static int convert_ssam_to_profile(struct ssam_device *sdev, enum ssam_tmp_profile p) ++static int ssam_fan_profile_set(struct ssam_device *sdev, enum ssam_fan_profile p) ++{ ++ char profile = p; ++ ++ return ssam_retry(__ssam_fan_profile_set, sdev->ctrl, &profile); ++} ++ ++static int convert_ssam_tmp_to_profile(struct ssam_device *sdev, enum ssam_tmp_profile p) + { + switch (p) { + case SSAM_TMP_PROFILE_NORMAL: +@@ -83,7 +109,8 @@ static int convert_ssam_to_profile(struct ssam_device *sdev, enum ssam_tmp_profi + } + } + +-static int convert_profile_to_ssam(struct ssam_device *sdev, enum platform_profile_option p) ++ ++static int convert_profile_to_ssam_tmp(struct ssam_device *sdev, enum platform_profile_option p) + { + switch (p) { + case PLATFORM_PROFILE_LOW_POWER: +@@ -105,20 +132,42 @@ static int convert_profile_to_ssam(struct ssam_device *sdev, enum platform_profi + } + } + ++static int convert_profile_to_ssam_fan(struct ssam_device *sdev, enum platform_profile_option p) ++{ ++ switch (p) { ++ case PLATFORM_PROFILE_LOW_POWER: ++ return SSAM_FAN_PROFILE_BATTERY_SAVER; ++ ++ case PLATFORM_PROFILE_BALANCED: ++ return SSAM_FAN_PROFILE_NORMAL; ++ ++ case PLATFORM_PROFILE_BALANCED_PERFORMANCE: ++ return SSAM_FAN_PROFILE_BETTER_PERFORMANCE; ++ ++ case PLATFORM_PROFILE_PERFORMANCE: ++ return SSAM_FAN_PROFILE_BEST_PERFORMANCE; ++ ++ default: ++ /* This should have already been caught by platform_profile_store(). */ ++ WARN(true, "unsupported platform profile"); ++ return -EOPNOTSUPP; ++ } ++} ++ + static int ssam_platform_profile_get(struct platform_profile_handler *pprof, + enum platform_profile_option *profile) + { +- struct ssam_tmp_profile_device *tpd; ++ struct ssam_platform_profile_device *tpd; + enum ssam_tmp_profile tp; + int status; + +- tpd = container_of(pprof, struct ssam_tmp_profile_device, handler); ++ tpd = container_of(pprof, struct ssam_platform_profile_device, handler); + + status = ssam_tmp_profile_get(tpd->sdev, &tp); + if (status) + return status; + +- status = convert_ssam_to_profile(tpd->sdev, tp); ++ status = convert_ssam_tmp_to_profile(tpd->sdev, tp); + if (status < 0) + return status; + +@@ -129,21 +178,32 @@ static int ssam_platform_profile_get(struct platform_profile_handler *pprof, + static int ssam_platform_profile_set(struct platform_profile_handler *pprof, + enum platform_profile_option profile) + { +- struct ssam_tmp_profile_device *tpd; ++ struct ssam_platform_profile_device *tpd; + int tp; + +- tpd = container_of(pprof, struct ssam_tmp_profile_device, handler); ++ tpd = container_of(pprof, struct ssam_platform_profile_device, handler); ++ ++ tp = convert_profile_to_ssam_tmp(tpd->sdev, profile); ++ if (tp < 0) ++ return tp; + +- tp = convert_profile_to_ssam(tpd->sdev, profile); ++ tp = ssam_tmp_profile_set(tpd->sdev, tp); + if (tp < 0) + return tp; + +- return ssam_tmp_profile_set(tpd->sdev, tp); ++ if (tpd->has_fan) { ++ tp = convert_profile_to_ssam_fan(tpd->sdev, profile); ++ if (tp < 0) ++ return tp; ++ tp = ssam_fan_profile_set(tpd->sdev, tp); ++ } ++ ++ return tp; + } + + static int surface_platform_profile_probe(struct ssam_device *sdev) + { +- struct ssam_tmp_profile_device *tpd; ++ struct ssam_platform_profile_device *tpd; + + tpd = devm_kzalloc(&sdev->dev, sizeof(*tpd), GFP_KERNEL); + if (!tpd) +@@ -154,6 +214,8 @@ static int surface_platform_profile_probe(struct ssam_device *sdev) + tpd->handler.profile_get = ssam_platform_profile_get; + tpd->handler.profile_set = ssam_platform_profile_set; + ++ tpd->has_fan = device_property_read_bool(&sdev->dev, "has_fan"); ++ + set_bit(PLATFORM_PROFILE_LOW_POWER, tpd->handler.choices); + set_bit(PLATFORM_PROFILE_BALANCED, tpd->handler.choices); + set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices); +-- +2.44.0 diff --git a/patches/6.7/0007-surface-sam-over-hid.patch b/patches/6.7/0007-surface-sam-over-hid.patch index 37504bc99..805e5df8f 100644 --- a/patches/6.7/0007-surface-sam-over-hid.patch +++ b/patches/6.7/0007-surface-sam-over-hid.patch @@ -108,7 +108,7 @@ index d6037a328669..a290ebc77aea 100644 dev_warn(&adapter->dev, "protocol 0x%02x not supported for client 0x%02x\n", accessor_type, client->addr); -- -2.43.0 +2.44.0 From f4ad3e5c368c11503d8b7af6a703f3972ebd5e98 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -331,5 +331,5 @@ index 000000000000..8b816ed8f35c +MODULE_DESCRIPTION("Discrete GPU Power-Switch for Surface Book 1"); +MODULE_LICENSE("GPL"); -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0008-surface-button.patch b/patches/6.7/0008-surface-button.patch index 1fb8191a4..671c729ff 100644 --- a/patches/6.7/0008-surface-button.patch +++ b/patches/6.7/0008-surface-button.patch @@ -73,7 +73,7 @@ index f6d060377d18..b8603f74eb28 100644 /* -- -2.43.0 +2.44.0 From 7909f30b15796e8df43a6d4ea32cbbd40627c410 Mon Sep 17 00:00:00 2001 From: Sachi King @@ -145,5 +145,5 @@ index 2755601f979c..4240c98ca226 100644 -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0009-surface-typecover.patch b/patches/6.7/0009-surface-typecover.patch index 161008870..24fecd093 100644 --- a/patches/6.7/0009-surface-typecover.patch +++ b/patches/6.7/0009-surface-typecover.patch @@ -37,7 +37,7 @@ index 15e9bd180a1d..0d70461d01e1 100644 { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, -- -2.43.0 +2.44.0 From 039ed906cfe0578e78c40d786433e9b144c56785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= @@ -270,7 +270,7 @@ index fd5b0637dad6..0f49d8fa6333 100644 { .driver_data = MT_CLS_GOOGLE, HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE, -- -2.43.0 +2.44.0 From 97419c9be08b7b3e4311aa989fa8f91d0549a469 Mon Sep 17 00:00:00 2001 From: PJungkamp @@ -569,5 +569,5 @@ index 0f49d8fa6333..1fad1199775b 100644 unregister_pm_notifier(&td->pm_notifier); del_timer_sync(&td->release_timer); -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0010-surface-shutdown.patch b/patches/6.7/0010-surface-shutdown.patch index 010ba8234..63abf4ed5 100644 --- a/patches/6.7/0010-surface-shutdown.patch +++ b/patches/6.7/0010-surface-shutdown.patch @@ -93,5 +93,5 @@ index bc80960fad7c..eec5704d1000 100644 atomic_t enable_cnt; /* pci_enable_device has been called */ -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0011-surface-gpe.patch b/patches/6.7/0011-surface-gpe.patch index 264e757ad..1f8e4b6a1 100644 --- a/patches/6.7/0011-surface-gpe.patch +++ b/patches/6.7/0011-surface-gpe.patch @@ -47,5 +47,5 @@ index 62fd4004db31..103fc4468262 100644 .ident = "Surface Book 1", .matches = { -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0012-cameras.patch b/patches/6.7/0012-cameras.patch index d411ef76e..775360d3e 100644 --- a/patches/6.7/0012-cameras.patch +++ b/patches/6.7/0012-cameras.patch @@ -72,7 +72,7 @@ index 02bb2cce423f..b123138d3dc0 100644 * Do not enumerate devices with enumeration_by_parent flag set as * they will be enumerated by their respective parents. -- -2.43.0 +2.44.0 From eb19f5e13f14a8973920d406125f205945558fb9 Mon Sep 17 00:00:00 2001 From: zouxiaoh @@ -189,7 +189,7 @@ index cc6569613255..8a532d32efdd 100644 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9D3E, quirk_iommu_ipts); -- -2.43.0 +2.44.0 From 1b16e7cbcbf699e4d841424568e0de1cee048d93 Mon Sep 17 00:00:00 2001 From: Daniel Scally @@ -226,7 +226,7 @@ index 1e107fd49f82..e3e1696e7f0e 100644 return 0; -- -2.43.0 +2.44.0 From a856e6ec1aa1ce0e88abdd423a151f2bbddb8134 Mon Sep 17 00:00:00 2001 From: Daniel Scally @@ -281,7 +281,7 @@ index 07b302e09340..1d3097bc7e48 100644 agpio, func, polarity); if (ret) -- -2.43.0 +2.44.0 From a7a10c4493fe0a381f12fd6a20a024e7797bd37c Mon Sep 17 00:00:00 2001 From: Daniel Scally @@ -320,7 +320,7 @@ index 6582cc0e2384..fd0796b6e07e 100644 V4L2_CID_TEST_PATTERN, ARRAY_SIZE(ov7251_test_pattern_menu) - 1, -- -2.43.0 +2.44.0 From e96fa67c9172fac9aa6e68199cf7e29d074c21e6 Mon Sep 17 00:00:00 2001 From: Daniel Scally @@ -371,7 +371,7 @@ index 7f181fbbb140..1c0347de4e21 100644 if (ret < 0) goto out_cleanup; -- -2.43.0 +2.44.0 From 68dac72bec1c99890d35d6bfd1b1f66e0cf8789c Mon Sep 17 00:00:00 2001 From: Kate Hsuan @@ -412,7 +412,7 @@ index e3e1696e7f0e..423dc555093f 100644 for (i = 0; i < board_data->n_gpiod_lookups; i++) gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); -- -2.43.0 +2.44.0 From 3f446f24aecaba808693f0173e28972e651fa87d Mon Sep 17 00:00:00 2001 From: Kate Hsuan @@ -453,7 +453,7 @@ index 7807fa329db0..2d2abb25b944 100644 + #endif /* __LINUX_MFD_TPS68470_H */ -- -2.43.0 +2.44.0 From a0fe4ec438c5edb9f4360c8a2a5f5269d05c44ef Mon Sep 17 00:00:00 2001 From: Kate Hsuan @@ -704,5 +704,547 @@ index 000000000000..35aeb5db89c8 +MODULE_DESCRIPTION("LED driver for TPS68470 PMIC"); +MODULE_LICENSE("GPL v2"); -- -2.43.0 +2.44.0 + +From 16cc6c6241fb32dcb09bae700dba0b2dc7b6c0df Mon Sep 17 00:00:00 2001 +From: Hidenori Kobayashi +Date: Tue, 9 Jan 2024 17:09:09 +0900 +Subject: [PATCH] media: staging: ipu3-imgu: Set fields before + media_entity_pads_init() + +The imgu driver fails to probe with the following message because it +does not set the pad's flags before calling media_entity_pads_init(). + +[ 14.596315] ipu3-imgu 0000:00:05.0: failed initialize subdev media entity (-22) +[ 14.596322] ipu3-imgu 0000:00:05.0: failed to register subdev0 ret (-22) +[ 14.596327] ipu3-imgu 0000:00:05.0: failed to register pipes (-22) +[ 14.596331] ipu3-imgu 0000:00:05.0: failed to create V4L2 devices (-22) + +Fix the initialization order so that the driver probe succeeds. The ops +initialization is also moved together for readability. + +Fixes: a0ca1627b450 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework") +Cc: # 6.7 +Cc: Dan Carpenter +Signed-off-by: Hidenori Kobayashi +Signed-off-by: Sakari Ailus +Signed-off-by: Hans Verkuil +--- + drivers/staging/media/ipu3/ipu3-v4l2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c +index e530767e80a5..55cc44a401bc 100644 +--- a/drivers/staging/media/ipu3/ipu3-v4l2.c ++++ b/drivers/staging/media/ipu3/ipu3-v4l2.c +@@ -1069,6 +1069,11 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu, + struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe]; + + /* Initialize subdev media entity */ ++ imgu_sd->subdev.entity.ops = &imgu_media_ops; ++ for (i = 0; i < IMGU_NODE_NUM; i++) { ++ imgu_sd->subdev_pads[i].flags = imgu_pipe->nodes[i].output ? ++ MEDIA_PAD_FL_SINK : MEDIA_PAD_FL_SOURCE; ++ } + r = media_entity_pads_init(&imgu_sd->subdev.entity, IMGU_NODE_NUM, + imgu_sd->subdev_pads); + if (r) { +@@ -1076,11 +1081,6 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu, + "failed initialize subdev media entity (%d)\n", r); + return r; + } +- imgu_sd->subdev.entity.ops = &imgu_media_ops; +- for (i = 0; i < IMGU_NODE_NUM; i++) { +- imgu_sd->subdev_pads[i].flags = imgu_pipe->nodes[i].output ? +- MEDIA_PAD_FL_SINK : MEDIA_PAD_FL_SOURCE; +- } + + /* Initialize subdev */ + v4l2_subdev_init(&imgu_sd->subdev, &imgu_subdev_ops); +@@ -1177,15 +1177,15 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe, + } + + /* Initialize media entities */ ++ node->vdev_pad.flags = node->output ? ++ MEDIA_PAD_FL_SOURCE : MEDIA_PAD_FL_SINK; ++ vdev->entity.ops = NULL; + r = media_entity_pads_init(&vdev->entity, 1, &node->vdev_pad); + if (r) { + dev_err(dev, "failed initialize media entity (%d)\n", r); + mutex_destroy(&node->lock); + return r; + } +- node->vdev_pad.flags = node->output ? +- MEDIA_PAD_FL_SOURCE : MEDIA_PAD_FL_SINK; +- vdev->entity.ops = NULL; + + /* Initialize vbq */ + vbq->type = node->vdev_fmt.type; +-- +2.44.0 + +From 2c1c03f035d43f5642f2985980cb4700ac9b7912 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Thu, 25 May 2023 14:12:04 +0300 +Subject: [PATCH] media: ipu3-cio2: Further clean up async subdev link creation + +Use v4l2_create_fwnode_links_to_pad() to create links from async +sub-devices to the CSI-2 receiver subdevs. + +Signed-off-by: Sakari Ailus +Reviewed-by: Laurent Pinchart +Signed-off-by: Hans Verkuil +--- + drivers/media/pci/intel/ipu3/ipu3-cio2.c | 22 +++++----------------- + 1 file changed, 5 insertions(+), 17 deletions(-) + +diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c +index 5dd69a251b6a..c6c31215967b 100644 +--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c ++++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -1421,7 +1422,6 @@ static void cio2_notifier_unbind(struct v4l2_async_notifier *notifier, + static int cio2_notifier_complete(struct v4l2_async_notifier *notifier) + { + struct cio2_device *cio2 = to_cio2_device(notifier); +- struct device *dev = &cio2->pci_dev->dev; + struct sensor_async_subdev *s_asd; + struct v4l2_async_connection *asd; + struct cio2_queue *q; +@@ -1431,23 +1431,10 @@ static int cio2_notifier_complete(struct v4l2_async_notifier *notifier) + s_asd = to_sensor_asd(asd); + q = &cio2->queue[s_asd->csi2.port]; + +- ret = media_entity_get_fwnode_pad(&q->sensor->entity, +- s_asd->asd.match.fwnode, +- MEDIA_PAD_FL_SOURCE); +- if (ret < 0) { +- dev_err(dev, "no pad for endpoint %pfw (%d)\n", +- s_asd->asd.match.fwnode, ret); +- return ret; +- } +- +- ret = media_create_pad_link(&q->sensor->entity, ret, +- &q->subdev.entity, CIO2_PAD_SINK, +- 0); +- if (ret) { +- dev_err(dev, "failed to create link for %s (endpoint %pfw, error %d)\n", +- q->sensor->name, s_asd->asd.match.fwnode, ret); ++ ret = v4l2_create_fwnode_links_to_pad(asd->sd, ++ &q->subdev_pads[CIO2_PAD_SINK], 0); ++ if (ret) + return ret; +- } + } + + return v4l2_device_register_subdev_nodes(&cio2->v4l2_dev); +@@ -1586,6 +1573,7 @@ static int cio2_queue_init(struct cio2_device *cio2, struct cio2_queue *q) + v4l2_subdev_init(subdev, &cio2_subdev_ops); + subdev->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; + subdev->owner = THIS_MODULE; ++ subdev->dev = dev; + snprintf(subdev->name, sizeof(subdev->name), + CIO2_ENTITY_NAME " %td", q - cio2->queue); + subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; +-- +2.44.0 + +From f4f07d5f5560318a32311d135ac0463ad81d44c1 Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Sat, 3 Feb 2024 12:53:33 +0900 +Subject: [PATCH] media: i2c: Revert DW9719 driver + +--- + drivers/media/i2c/dw9719.c | 199 +++++++++++++++++++++++++------------ + 1 file changed, 137 insertions(+), 62 deletions(-) + +diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c +index c626ed845928..d5f585dabb60 100644 +--- a/drivers/media/i2c/dw9719.c ++++ b/drivers/media/i2c/dw9719.c +@@ -6,13 +6,14 @@ + * https://github.com/ZenfoneArea/android_kernel_asus_zenfone5 + */ + ++#include ++ + #include + #include + #include + #include + #include + +-#include + #include + #include + #include +@@ -20,31 +21,29 @@ + #define DW9719_MAX_FOCUS_POS 1023 + #define DW9719_CTRL_STEPS 16 + #define DW9719_CTRL_DELAY_US 1000 ++#define DELAY_MAX_PER_STEP_NS (1000000 * 1023) + +-#define DW9719_INFO CCI_REG8(0) ++#define DW9719_INFO 0 + #define DW9719_ID 0xF1 ++#define DW9719_CONTROL 2 ++#define DW9719_VCM_CURRENT 3 + +-#define DW9719_CONTROL CCI_REG8(2) +-#define DW9719_ENABLE_RINGING 0x02 +- +-#define DW9719_VCM_CURRENT CCI_REG16(3) +- +-#define DW9719_MODE CCI_REG8(6) +-#define DW9719_MODE_SAC_SHIFT 4 +-#define DW9719_MODE_SAC3 4 ++#define DW9719_MODE 6 ++#define DW9719_VCM_FREQ 7 + +-#define DW9719_VCM_FREQ CCI_REG8(7) ++#define DW9719_MODE_SAC3 0x40 + #define DW9719_DEFAULT_VCM_FREQ 0x60 ++#define DW9719_ENABLE_RINGING 0x02 ++ ++#define NUM_REGULATORS 2 + + #define to_dw9719_device(x) container_of(x, struct dw9719_device, sd) + + struct dw9719_device { +- struct v4l2_subdev sd; + struct device *dev; +- struct regmap *regmap; +- struct regulator *regulator; +- u32 sac_mode; +- u32 vcm_freq; ++ struct i2c_client *client; ++ struct regulator_bulk_data regulators[NUM_REGULATORS]; ++ struct v4l2_subdev sd; + + struct dw9719_v4l2_ctrls { + struct v4l2_ctrl_handler handler; +@@ -52,18 +51,79 @@ struct dw9719_device { + } ctrls; + }; + ++static int dw9719_i2c_rd8(struct i2c_client *client, u8 reg, u8 *val) ++{ ++ struct i2c_msg msg[2]; ++ u8 buf[2] = { reg }; ++ int ret; ++ ++ msg[0].addr = client->addr; ++ msg[0].flags = 0; ++ msg[0].len = 1; ++ msg[0].buf = buf; ++ ++ msg[1].addr = client->addr; ++ msg[1].flags = I2C_M_RD; ++ msg[1].len = 1; ++ msg[1].buf = &buf[1]; ++ *val = 0; ++ ++ ret = i2c_transfer(client->adapter, msg, 2); ++ if (ret < 0) ++ return ret; ++ ++ *val = buf[1]; ++ ++ return 0; ++} ++ ++static int dw9719_i2c_wr8(struct i2c_client *client, u8 reg, u8 val) ++{ ++ struct i2c_msg msg; ++ int ret; ++ ++ u8 buf[2] = { reg, val }; ++ ++ msg.addr = client->addr; ++ msg.flags = 0; ++ msg.len = sizeof(buf); ++ msg.buf = buf; ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ ++ return ret < 0 ? ret : 0; ++} ++ ++static int dw9719_i2c_wr16(struct i2c_client *client, u8 reg, u16 val) ++{ ++ struct i2c_msg msg; ++ u8 buf[3] = { reg }; ++ int ret; ++ ++ put_unaligned_be16(val, buf + 1); ++ ++ msg.addr = client->addr; ++ msg.flags = 0; ++ msg.len = sizeof(buf); ++ msg.buf = buf; ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ ++ return ret < 0 ? ret : 0; ++} ++ + static int dw9719_detect(struct dw9719_device *dw9719) + { + int ret; +- u64 val; ++ u8 val; + +- ret = cci_read(dw9719->regmap, DW9719_INFO, &val, NULL); ++ ret = dw9719_i2c_rd8(dw9719->client, DW9719_INFO, &val); + if (ret < 0) + return ret; + + if (val != DW9719_ID) { + dev_err(dw9719->dev, "Failed to detect correct id\n"); +- return -ENXIO; ++ ret = -ENXIO; + } + + return 0; +@@ -71,37 +131,54 @@ static int dw9719_detect(struct dw9719_device *dw9719) + + static int dw9719_power_down(struct dw9719_device *dw9719) + { +- return regulator_disable(dw9719->regulator); ++ return regulator_bulk_disable(NUM_REGULATORS, dw9719->regulators); + } + + static int dw9719_power_up(struct dw9719_device *dw9719) + { + int ret; + +- ret = regulator_enable(dw9719->regulator); ++ ret = regulator_bulk_enable(NUM_REGULATORS, dw9719->regulators); + if (ret) + return ret; + + /* Jiggle SCL pin to wake up device */ +- cci_write(dw9719->regmap, DW9719_CONTROL, 1, &ret); ++ ret = dw9719_i2c_wr8(dw9719->client, DW9719_CONTROL, 1); + +- /* Need 100us to transit from SHUTDOWN to STANDBY */ +- fsleep(100); ++ /* Need 100us to transit from SHUTDOWN to STANDBY*/ ++ usleep_range(100, 1000); + +- cci_write(dw9719->regmap, DW9719_CONTROL, DW9719_ENABLE_RINGING, &ret); +- cci_write(dw9719->regmap, DW9719_MODE, +- dw9719->sac_mode << DW9719_MODE_SAC_SHIFT, &ret); +- cci_write(dw9719->regmap, DW9719_VCM_FREQ, dw9719->vcm_freq, &ret); ++ ret = dw9719_i2c_wr8(dw9719->client, DW9719_CONTROL, ++ DW9719_ENABLE_RINGING); ++ if (ret < 0) ++ goto fail_powerdown; + +- if (ret) +- dw9719_power_down(dw9719); ++ ret = dw9719_i2c_wr8(dw9719->client, DW9719_MODE, DW9719_MODE_SAC3); ++ if (ret < 0) ++ goto fail_powerdown; ++ ++ ret = dw9719_i2c_wr8(dw9719->client, DW9719_VCM_FREQ, ++ DW9719_DEFAULT_VCM_FREQ); ++ if (ret < 0) ++ goto fail_powerdown; ++ ++ return 0; + ++fail_powerdown: ++ dw9719_power_down(dw9719); + return ret; + } + + static int dw9719_t_focus_abs(struct dw9719_device *dw9719, s32 value) + { +- return cci_write(dw9719->regmap, DW9719_VCM_CURRENT, value, NULL); ++ int ret; ++ ++ value = clamp(value, 0, DW9719_MAX_FOCUS_POS); ++ ret = dw9719_i2c_wr16(dw9719->client, DW9719_VCM_CURRENT, value); ++ if (ret < 0) ++ return ret; ++ ++ return 0; + } + + static int dw9719_set_ctrl(struct v4l2_ctrl *ctrl) +@@ -132,7 +209,7 @@ static const struct v4l2_ctrl_ops dw9719_ctrl_ops = { + .s_ctrl = dw9719_set_ctrl, + }; + +-static int dw9719_suspend(struct device *dev) ++static int __maybe_unused dw9719_suspend(struct device *dev) + { + struct v4l2_subdev *sd = dev_get_drvdata(dev); + struct dw9719_device *dw9719 = to_dw9719_device(sd); +@@ -151,7 +228,7 @@ static int dw9719_suspend(struct device *dev) + return dw9719_power_down(dw9719); + } + +-static int dw9719_resume(struct device *dev) ++static int __maybe_unused dw9719_resume(struct device *dev) + { + struct v4l2_subdev *sd = dev_get_drvdata(dev); + struct dw9719_device *dw9719 = to_dw9719_device(sd); +@@ -201,7 +278,9 @@ static int dw9719_init_controls(struct dw9719_device *dw9719) + const struct v4l2_ctrl_ops *ops = &dw9719_ctrl_ops; + int ret; + +- v4l2_ctrl_handler_init(&dw9719->ctrls.handler, 1); ++ ret = v4l2_ctrl_handler_init(&dw9719->ctrls.handler, 1); ++ if (ret) ++ return ret; + + dw9719->ctrls.focus = v4l2_ctrl_new_std(&dw9719->ctrls.handler, ops, + V4L2_CID_FOCUS_ABSOLUTE, 0, +@@ -214,7 +293,8 @@ static int dw9719_init_controls(struct dw9719_device *dw9719) + } + + dw9719->sd.ctrl_handler = &dw9719->ctrls.handler; +- return 0; ++ ++ return ret; + + err_free_handler: + v4l2_ctrl_handler_free(&dw9719->ctrls.handler); +@@ -232,26 +312,24 @@ static int dw9719_probe(struct i2c_client *client) + if (!dw9719) + return -ENOMEM; + +- dw9719->regmap = devm_cci_regmap_init_i2c(client, 8); +- if (IS_ERR(dw9719->regmap)) +- return PTR_ERR(dw9719->regmap); +- ++ dw9719->client = client; + dw9719->dev = &client->dev; +- dw9719->sac_mode = DW9719_MODE_SAC3; +- dw9719->vcm_freq = DW9719_DEFAULT_VCM_FREQ; + +- /* Optional indication of SAC mode select */ +- device_property_read_u32(&client->dev, "dongwoon,sac-mode", +- &dw9719->sac_mode); +- +- /* Optional indication of VCM frequency */ +- device_property_read_u32(&client->dev, "dongwoon,vcm-freq", +- &dw9719->vcm_freq); ++ dw9719->regulators[0].supply = "vdd"; ++ /* ++ * The DW9719 has only the 1 VDD voltage input, but some PMICs such as ++ * the TPS68470 PMIC have I2C passthrough capability, to disconnect the ++ * sensor's I2C pins from the I2C bus when the sensors VSIO (Sensor-IO) ++ * is off, because some sensors then short these pins to ground; ++ * and the DW9719 might sit behind this passthrough, this it needs to ++ * enable VSIO as that will also enable the I2C passthrough. ++ */ ++ dw9719->regulators[1].supply = "vsio"; + +- dw9719->regulator = devm_regulator_get(&client->dev, "vdd"); +- if (IS_ERR(dw9719->regulator)) +- return dev_err_probe(&client->dev, PTR_ERR(dw9719->regulator), +- "getting regulator\n"); ++ ret = devm_regulator_bulk_get(&client->dev, NUM_REGULATORS, ++ dw9719->regulators); ++ if (ret) ++ return dev_err_probe(&client->dev, ret, "getting regulators\n"); + + v4l2_i2c_subdev_init(&dw9719->sd, client, &dw9719_ops); + dw9719->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; +@@ -312,17 +390,13 @@ static int dw9719_probe(struct i2c_client *client) + static void dw9719_remove(struct i2c_client *client) + { + struct v4l2_subdev *sd = i2c_get_clientdata(client); +- struct dw9719_device *dw9719 = +- container_of(sd, struct dw9719_device, sd); ++ struct dw9719_device *dw9719 = container_of(sd, struct dw9719_device, ++ sd); + ++ pm_runtime_disable(&client->dev); + v4l2_async_unregister_subdev(sd); + v4l2_ctrl_handler_free(&dw9719->ctrls.handler); + media_entity_cleanup(&dw9719->sd.entity); +- +- pm_runtime_disable(&client->dev); +- if (!pm_runtime_status_suspended(&client->dev)) +- dw9719_power_down(dw9719); +- pm_runtime_set_suspended(&client->dev); + } + + static const struct i2c_device_id dw9719_id_table[] = { +@@ -331,13 +405,14 @@ static const struct i2c_device_id dw9719_id_table[] = { + }; + MODULE_DEVICE_TABLE(i2c, dw9719_id_table); + +-static DEFINE_RUNTIME_DEV_PM_OPS(dw9719_pm_ops, dw9719_suspend, dw9719_resume, +- NULL); ++static const struct dev_pm_ops dw9719_pm_ops = { ++ SET_RUNTIME_PM_OPS(dw9719_suspend, dw9719_resume, NULL) ++}; + + static struct i2c_driver dw9719_i2c_driver = { + .driver = { + .name = "dw9719", +- .pm = pm_sleep_ptr(&dw9719_pm_ops), ++ .pm = &dw9719_pm_ops, + }, + .probe = dw9719_probe, + .remove = dw9719_remove, +-- +2.44.0 + +From bdbff69075918d01d32a57820aa845bde7be7611 Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Sat, 3 Feb 2024 12:59:53 +0900 +Subject: [PATCH] media: staging: ipu3-imgu: Fix multiple calls of s_stream on + stream stop + +Adapt to 009905e "media: v4l2-subdev: Document and enforce .s_stream() requirements" +--- + drivers/staging/media/ipu3/ipu3-v4l2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c +index 55cc44a401bc..9c5627c48cf2 100644 +--- a/drivers/staging/media/ipu3/ipu3-v4l2.c ++++ b/drivers/staging/media/ipu3/ipu3-v4l2.c +@@ -538,18 +538,18 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq) + + WARN_ON(!node->enabled); + +- pipe = node->pipe; +- dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); +- imgu_pipe = &imgu->imgu_pipe[pipe]; +- r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); +- if (r) +- dev_err(&imgu->pci_dev->dev, +- "failed to stop subdev streaming\n"); +- + mutex_lock(&imgu->streaming_lock); + /* Was this the first node with streaming disabled? */ + if (imgu->streaming && imgu_all_nodes_streaming(imgu, node)) { + /* Yes, really stop streaming now */ ++ pipe = node->pipe; ++ dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); ++ imgu_pipe = &imgu->imgu_pipe[pipe]; ++ r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); ++ if (r) ++ dev_err(&imgu->pci_dev->dev, ++ "failed to stop subdev streaming\n"); ++ + dev_dbg(dev, "IMGU streaming is ready to stop"); + r = imgu_s_stream(imgu, false); + if (!r) +-- +2.44.0 diff --git a/patches/6.7/0013-amd-gpio.patch b/patches/6.7/0013-amd-gpio.patch index cc3bf62eb..33d40d134 100644 --- a/patches/6.7/0013-amd-gpio.patch +++ b/patches/6.7/0013-amd-gpio.patch @@ -63,7 +63,7 @@ index 85a3ce2a3666..2c0e04a3a697 100644 mp_config_acpi_legacy_irqs(); -- -2.43.0 +2.44.0 From 8e2f2b852776fca1dd0ab8728be2303051cb19e1 Mon Sep 17 00:00:00 2001 From: Maximilian Luz @@ -105,5 +105,5 @@ index 2c0e04a3a697..b0e1dab3d2ec 100644 }; -- -2.43.0 +2.44.0 diff --git a/patches/6.7/0014-rtc.patch b/patches/6.7/0014-rtc.patch index 2dd52a8c1..7a5dc7893 100644 --- a/patches/6.7/0014-rtc.patch +++ b/patches/6.7/0014-rtc.patch @@ -106,5 +106,5 @@ index 33c3b16af556..900445d06623 100644 ret = sysfs_create_group(&dev->kobj, &acpi_tad_dc_attr_group); if (ret) -- -2.43.0 +2.44.0