From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE45F47010D for ; Wed, 22 Jul 2026 15:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735157; cv=none; b=iwNWnCfwe09yHRF1HQSB4lzUWoDCAsVa86KA9zZMuiFVnCC+neiaDfZnPG4AtiCX5X0EltA7+Ziq8MkQ8Qy6EO1zRygNRgMZjSDT2VmXaq3zcwzKTnhTdu6GwlkdZjfAqgw6+VzqTUeqFbOFZPbcxX+HtKn+tawdz8kDsLFjgl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735157; c=relaxed/simple; bh=965+uUTmKb3CgKlzi4aiAEp8NlQVeVxEKGf9MMlETw4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TAWkaCOrak7RSQupwo7m4JEjAlODAyQ68Y7ppSji/OS1NnWemBecDW7xHEt7BX/K0Bv06X4kyG5VjBA+Yvjox28I9UEIoFkAy1+bBv2Gw2qb1hGGDlnFOTgzltDcxGxn3c24tdiRXeZaRnT5kGUZ6fjeoASTFOXIGwrXC4p16J0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ8d-000000006aS-3nj8; Wed, 22 Jul 2026 15:45:40 +0000 Date: Wed, 22 Jul 2026 16:45:36 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 01/11] drm/bridge: it6505: quiesce event sources and work on remove() Message-ID: <837efb37cc967fc0bb4371d1051dd33838425d2d.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct it6505 is freed by devres right after remove() returns, but remove() cancels none of the driver's work items, so link_works, hdcp_wait_ksv_list, hdcp_work and extcon_wq can still run afterwards and dereference freed memory. Cancelling alone would not be enough: the threaded IRQ and the extcon notifier stay live until devres teardown and can requeue the works. Unregister the extcon notifier and disable the IRQ first, then cancel all work. Make it6505_remove_notifier_module() idempotent, tracking registration in event_nb.notifier_call under extcon_lock, as both .detach() and remove() call it now. Also initialise extcon_wq in probe: cancel_work_sync() on a never-initialised work item trips WARN_ON(!work->func). Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: serialise notifier registration state with extcon_lock v4: * quiesce event sources before cancelling work; retitled * initialise extcon_wq in probe to avoid WARN_ON(!work->func) v3: new patch drivers/gpu/drm/bridge/ite-it6505.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 8ecb43611dba..e9c84e4fb3a0 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2934,15 +2934,18 @@ static int it6505_use_notifier_module(struct it6505= *it6505) int ret; struct device *dev =3D it6505->dev; =20 + mutex_lock(&it6505->extcon_lock); it6505->event_nb.notifier_call =3D it6505_extcon_notifier; - INIT_WORK(&it6505->extcon_wq, it6505_extcon_work); ret =3D devm_extcon_register_notifier(it6505->dev, it6505->extcon, EXTCON_DISP_DP, &it6505->event_nb); if (ret) { + it6505->event_nb.notifier_call =3D NULL; + mutex_unlock(&it6505->extcon_lock); dev_err(dev, "failed to register notifier for DP"); return ret; } + mutex_unlock(&it6505->extcon_lock); =20 schedule_work(&it6505->extcon_wq); =20 @@ -2951,13 +2954,16 @@ static int it6505_use_notifier_module(struct it6505= *it6505) =20 static void it6505_remove_notifier_module(struct it6505 *it6505) { - if (it6505->extcon) { - devm_extcon_unregister_notifier(it6505->dev, - it6505->extcon, EXTCON_DISP_DP, + mutex_lock(&it6505->extcon_lock); + if (it6505->extcon && it6505->event_nb.notifier_call) { + devm_extcon_unregister_notifier(it6505->dev, it6505->extcon, + EXTCON_DISP_DP, &it6505->event_nb); - - flush_work(&it6505->extcon_wq); + it6505->event_nb.notifier_call =3D NULL; } + mutex_unlock(&it6505->extcon_lock); + + flush_work(&it6505->extcon_wq); } =20 static void __maybe_unused it6505_delayed_audio(struct work_struct *work) @@ -3615,6 +3621,7 @@ static int it6505_i2c_probe(struct i2c_client *client) INIT_WORK(&it6505->link_works, it6505_link_training_work); INIT_WORK(&it6505->hdcp_wait_ksv_list, it6505_hdcp_wait_ksv_list); INIT_DELAYED_WORK(&it6505->hdcp_work, it6505_hdcp_work); + INIT_WORK(&it6505->extcon_wq, it6505_extcon_work); init_completion(&it6505->extcon_completion); memset(it6505->dpcd, 0, sizeof(it6505->dpcd)); it6505->powered =3D false; @@ -3647,6 +3654,12 @@ static void it6505_i2c_remove(struct i2c_client *cli= ent) drm_bridge_remove(&it6505->bridge); drm_dp_aux_unregister(&it6505->aux); it6505_debugfs_remove(it6505); + it6505_remove_notifier_module(it6505); + disable_irq(it6505->irq); + cancel_work_sync(&it6505->link_works); + cancel_work_sync(&it6505->hdcp_wait_ksv_list); + cancel_delayed_work_sync(&it6505->hdcp_work); + cancel_work_sync(&it6505->extcon_wq); it6505_poweroff(it6505); it6505_remove_edid(it6505); } --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E94443D9DBA for ; Wed, 22 Jul 2026 15:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735160; cv=none; b=Y1JMwjGPQZNXKLSPbiJiS100+AfBbKYxks2cY9dseNv74dHiX7V3Fq5MSM6i2Rm2JdgxudJq/nzL7I+5wHVoFwkwlZe3z2iz5RccGIC0SB7aGdgRgAvbNWPEsgljEWJoOqfzt2y+nF7wQrsLf7hsgs/BtWNJ9d5Nu9NSpHoTQSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735160; c=relaxed/simple; bh=olKZ9fZCjVG2wk6f6EDBskVkmTCvzN82uWyLrfmvklA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I5cg33jfil4EHrEC/Ahlho0J9Wvvo0Koyryx+xW5C6RX8BbWyHrlzcKwmgOdKFZgk9slpNvY9vQQFhtJMyVu8kNYbAbtbVCOMmMP+szZUZNwtgnBbu+jEO7M+tvrkG3uJ9r3BCEFvFz5xeP7Xmn4E6+UhWnwgqdYSxToDlko85M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ8n-000000006av-03Kc; Wed, 22 Jul 2026 15:45:49 +0000 Date: Wed, 22 Jul 2026 16:45:45 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 02/11] drm/bridge: it6505: balance and disable runtime PM on remove Message-ID: <2ba351075bfd63f0ea937080c37f417140a8c97a.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Runtime PM is enabled in probe but never disabled on remove, so rebinding the driver warns "Unbalanced pm_runtime_enable!". The extcon work also holds a usage reference while a display is connected, which unbinding leaks; the count survives in struct device, so after a rebind the device never runtime-suspends again. Drop the usage reference held for a connected display and disable runtime PM in remove(). Fixes: 10517777d302 ("drm/bridge: it6505: Adapt runtime power management fr= amework") Signed-off-by: Daniel Golle --- v5: also drop the usage ref held for a connected display; retitled v4: new patch drivers/gpu/drm/bridge/ite-it6505.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index e9c84e4fb3a0..6fcf2dc03d16 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -3660,6 +3660,9 @@ static void it6505_i2c_remove(struct i2c_client *clie= nt) cancel_work_sync(&it6505->hdcp_wait_ksv_list); cancel_delayed_work_sync(&it6505->hdcp_work); cancel_work_sync(&it6505->extcon_wq); + if (it6505->extcon_state) + pm_runtime_put_sync(&client->dev); + pm_runtime_disable(&client->dev); it6505_poweroff(it6505); it6505_remove_edid(it6505); } --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEBD6434E4E for ; Wed, 22 Jul 2026 15:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735169; cv=none; b=avqzV7l6qP2Awt2aiugXYKVOH4nhGj8c2gzThuAJc1vBr9xbw8g8ygvLhTatPZTNi3Dito09BurTVeFHe7Eqt3QYLn1I7uG6ZHUWNJkt5Zyhb3aW+sUlhI/KXPlSjsnou930c/UGfc3m+JlsCF1eaJNLV+WbuLCkp6QGFBRo6Vc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735169; c=relaxed/simple; bh=558DdycFNbvjlt9fvUnhY5XuXnXpYMiH99S+hl6SBTk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=j0wui/RZtHWEC5Sl2VXUAykYIlVBVVQP0Amd++MreUYCJ23lGPzk21pDeTShWAGAvckJqfusft0VAy4cFmC50aZ2qkWj09DHv0UrgQauUDLWW7bn7W3+rLYcjs6jzTD15T6wGBF/i3+mW0vUPp0EKwuttkfP+MfnvYrnWe/tk7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ8v-000000006ba-2fbo; Wed, 22 Jul 2026 15:45:57 +0000 Date: Wed, 22 Jul 2026 16:45:54 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 03/11] drm/bridge: it6505: unregister DP AUX adapter on bridge detach Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The DP AUX adapter is registered in .attach() but only unregistered in i2c remove(). Unbinding and rebinding the DRM device while the i2c driver stays bound registers the adapter a second time, which fails. Unregister it in .detach() instead, and also on the .attach() error path, which so far leaked the registration. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 6fcf2dc03d16..ff6471d3ef7a 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -3091,6 +3091,7 @@ static int it6505_bridge_attach(struct drm_bridge *br= idge, ret =3D it6505_use_notifier_module(it6505); if (ret < 0) { dev_err(dev, "use notifier module failed"); + drm_dp_aux_unregister(&it6505->aux); return ret; } } @@ -3104,6 +3105,7 @@ static void it6505_bridge_detach(struct drm_bridge *b= ridge) =20 flush_work(&it6505->link_works); it6505_remove_notifier_module(it6505); + drm_dp_aux_unregister(&it6505->aux); } =20 static enum drm_mode_status @@ -3652,7 +3654,6 @@ static void it6505_i2c_remove(struct i2c_client *clie= nt) struct it6505 *it6505 =3D i2c_get_clientdata(client); =20 drm_bridge_remove(&it6505->bridge); - drm_dp_aux_unregister(&it6505->aux); it6505_debugfs_remove(it6505); it6505_remove_notifier_module(it6505); disable_irq(it6505->irq); --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A698B43802E for ; Wed, 22 Jul 2026 15:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735183; cv=none; b=Ym3rcTZ3llp80C5GM/SI1nQnjF3yLP4/mK6tm+crjGNzhZh3lvk5TKNt+r81Nzq04IOIdTLCszw20KtfHG3a3XyWyGYsq47oqoNKoiCXY4ewsk1ej4zAt6YWqGi87UckAaP/6EmKkkTCBdKapMRE7tIjbC6OrjLxqjFFCNq3PT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735183; c=relaxed/simple; bh=EomlQooHAznWPuSIY0VyB6pnWN+LhWWfxwEbu5q0vbI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DJBpfW2FwUpk+ztN0KCw5J581UGOOguFEK+KSF3VWYYgnaNBttYGL24fnC67zx/tcI6sZoWY69bBLKf57S/m0w8ebx2k99cwyTCS/bcsterCBzN/HqDIN9t3j0tWcP2HgZERpoX3WMK3r8zDbVp9bcvyCGzXWxjvmh2LyEOFXj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ9B-000000006dY-2SFN; Wed, 22 Jul 2026 15:46:13 +0000 Date: Wed, 22 Jul 2026 16:46:10 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 04/11] drm/bridge: it6505: complete poweroff even if disabling regulators fails Message-ID: <51bec6ff870eb67415408268a798a934dcad6a6c.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" it6505_poweroff() returns early when regulator_disable() fails, leaving it6505->powered set with the IRQ already disabled. The next it6505_poweron() then takes its early return and never re-enables the IRQ, leaving the bridge deaf to hotplug and link training interrupts. Log the error and complete the power-off state transition instead. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index ff6471d3ef7a..0f79ddfd1501 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2810,13 +2810,15 @@ static int it6505_poweroff(struct it6505 *it6505) if (pdata->pwr18) { err =3D regulator_disable(pdata->pwr18); if (err) - return err; + dev_err(dev, "cannot disable pwr18 regulator: %d", + err); } =20 if (pdata->ovdd) { err =3D regulator_disable(pdata->ovdd); if (err) - return err; + dev_err(dev, "cannot disable ovdd regulator: %d", + err); } =20 it6505->powered =3D false; --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D4F148123A for ; Wed, 22 Jul 2026 15:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735192; cv=none; b=uofsdAPgFqBN4zjNo/M714YxGvScyKSMAmBPbPyPfoGhqFLSZ/TqEOqdzF6vDrxFoQCvLg3Q+FWY+8NSwXKqEnQBE/+T4YJqn/+js/BOpkIQARGlhs5Tqgp+LiffbcWXfxTg9uibo1+WLftNbdC4Uops9DGcs5Mi6PKCzJIsEd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735192; c=relaxed/simple; bh=6KlPhuaAhD9VsWMegjZbnhf6oiSFIgxi5J6Zv2P6wss=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k2a2M4BoSnV47LaxPEL97KAXehPpfqEMD9R0mj2y1bh2b9p1XkuIDbPk+p33PCSUP/+RKa7IGMJ7QPrQi99iMV4jrBh/cDJn5F2BtaWnfO5M0OEr4ip/64BWZ1ZdzH++94W3/4K725tPog3saAD6CaXS4Oy3DDPB5hS2V0r32dg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ9J-000000006e0-2uhX; Wed, 22 Jul 2026 15:46:21 +0000 Date: Wed, 22 Jul 2026 16:46:18 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 05/11] drm/bridge: it6505: bail out of the IRQ handler when status reads fail Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When reading the interrupt status registers fails, the negative error codes end up in int_status[], where it6505_test_bit() sees almost all bits set: every interrupt sub-handler runs on garbage and the error values are even written back to the status registers. Return IRQ_NONE instead. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 0f79ddfd1501..0e141310ed3c 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2713,6 +2713,11 @@ static irqreturn_t it6505_int_threaded_handler(int u= nused, void *data) int_status[1] =3D it6505_read(it6505, INT_STATUS_02); int_status[2] =3D it6505_read(it6505, INT_STATUS_03); =20 + if (int_status[0] < 0 || int_status[1] < 0 || int_status[2] < 0) { + pm_runtime_put_sync(dev); + return IRQ_NONE; + } + it6505_write(it6505, INT_STATUS_01, int_status[0]); it6505_write(it6505, INT_STATUS_02, int_status[1]); it6505_write(it6505, INT_STATUS_03, int_status[2]); --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 874584D90A6 for ; Wed, 22 Jul 2026 15:46:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735199; cv=none; b=o8s75tVFTTUDjuSEDJ+GNQQWJU8ONDAXv0ClMOoqca4H7o7ldHsKQ+lh488SLDlbyyaZGp22FQYZ7LYHUcZ1knG6EOafodXO5Wgj3C0g/7PFhxMhxU8cFg8pdMS9aSnEUFY/K82g8X1ED6th6J3CR1WfH7Cq6p7BFGO0ynlvlSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735199; c=relaxed/simple; bh=MZgA7h5tqq1ohLrBLwxP5Ga7b75ZmhKyXcpJh/q7pq4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e2g539ZdMkCkMHHQMZG2Zto8LtdkGRMgyBLGCYKohYDVqESdM7DlKKHHD/k/9YBkW5Nt9SPWsebPt204HJys9W19xEYBD5USnhjaIOGzUMn/0+EDwTJDBEtU/4dfdIG7rh1F8aAfTjtUySXQr5gpArbAR1z4t64Xnw8pHqt295Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ9S-000000006er-2bjZ; Wed, 22 Jul 2026 15:46:30 +0000 Date: Wed, 22 Jul 2026 16:46:27 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 06/11] drm/bridge: it6505: avoid division by zero in pixel clock calculation Message-ID: <66fbe7f9cb0efe2fb4b66dc4a4a632d46398eca8.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" it6505_calc_video_info() checks the sum of the three pixel clock counter samples for zero before dividing it by 3, so sums of 1 or 2 truncate to 0 and the following pixel clock calculation divides by zero. Divide first and check the result. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 0e141310ed3c..fc95f8d4f412 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -750,12 +750,13 @@ static void it6505_calc_video_info(struct it6505 *it6= 505) sum +=3D rddata; } =20 + sum /=3D 3; + if (sum =3D=3D 0) { DRM_DEV_DEBUG_DRIVER(dev, "calc video timing error"); return; } =20 - sum /=3D 3; pclk =3D 13500 * 2048 / sum; it6505->video_info.clock =3D pclk; it6505->video_info.hdisplay =3D hdew; --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C6763E3D85 for ; Wed, 22 Jul 2026 15:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735227; cv=none; b=sajJE0Eo305/urjuczUj5u86LWFtaEOSQzY7zjoblbVRHi1c3hNIfLp6lCgjEPd3AIYzQ1USJ/7CUd/FANEtLoM4a69NciehXRgU8jsUKCvkS1YOp/nsTMnqFnMS7ennmq0NPtU2uCIt+lbh1zdgq4G8qjIvEb01v5HgTK9kSP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735227; c=relaxed/simple; bh=Szla3iNWjtvexl82jDNJyWPG7O3MM/XMcMgOlyH/nro=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sEa8K7eSrwgVLJp8KnFqdtSfw/f4/f19P57+eFjfjhkyNtIwuDvTvbAuqteiHa5ksZH89Oj2zXa6pFTVCzRF4Hz0t50xwcDEOazgUiLdzwO7m9/cf3ultFaJeTxCGoXu9ijXAxxPTQIS5MNRDDpOuS9HNURGhamanrsLFScr7Ik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZ9v-000000006gR-23d8; Wed, 22 Jul 2026 15:46:59 +0000 Date: Wed, 22 Jul 2026 16:46:56 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 07/11] drm/bridge: it6505: avoid division by zero in audio FS debug print Message-ID: <699a55456c1eb21b450b01f9d55277f72ddf12d9.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" REG_AUDIO_INPUT_FREQ reads back 0 when no audio clock has been latched, and it6505_read() returns a negative errno on i2c failure. The debug print divides by the readback, and its arguments are evaluated even with debug output disabled. Only print when the value is usable as a divisor. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index fc95f8d4f412..81d2c9644531 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1622,8 +1622,11 @@ static void it6505_enable_audio(struct it6505 *it650= 5) it6505_set_bits(it6505, REG_AUDIO_SRC_CTRL, AUDIO_FIFO_RESET, 0x00); it6505_set_bits(it6505, REG_RESET_CTRL, AUDIO_RESET, 0x00); regbe =3D it6505_read(it6505, REG_AUDIO_INPUT_FREQ); - DRM_DEV_DEBUG_DRIVER(dev, "regbe:0x%02x audio input fs: %d.%d kHz", - regbe, 6750 / regbe, (6750 % regbe) * 10 / regbe); + if (regbe > 0) + DRM_DEV_DEBUG_DRIVER(dev, + "regbe:0x%02x audio input fs: %d.%d kHz", + regbe, 6750 / regbe, + (6750 % regbe) * 10 / regbe); it6505_set_bits(it6505, REG_DATA_MUTE_CTRL, EN_AUD_MUTE, 0x00); } =20 --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE4C24D2ED5 for ; Wed, 22 Jul 2026 15:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735238; cv=none; b=QDeVgqECsuJnAjiFeqI+kfEmB44TjKSSGXkq5xo7nWHucVlsyb5CsWnJBM4r9oSj8YsTQb1ChYlDsH5UPt+PXVV05JFbDIUqHHZtLyAhIVu5NsKjWrfTRQCZs9RIPjWvv2y/2hNQBo5/fiXAomv/SfAi0UdcrJ9AepzP8F0ip5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735238; c=relaxed/simple; bh=mmqxAnxHxmtFYtjhHc6zEpjzgKe0vzr1HpbswK5B7kE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=danbKByjJNLJjFywMjvAR8TJdMETRSWRs8iahVyYDZoCp+lie4gy1cFAtfT0UrB/ccuUCCMw+AO7iIMC2cUSoDE3CAMuLOdNOqGQLPAUfmy5rqB4gw6Dc1JMbA8onIhfcvJQqF3EDFzQNPiYhPFUT7Kdbo+6hOe5BUMGjQt1R4M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZA6-000000006gv-0kKd; Wed, 22 Jul 2026 15:47:10 +0000 Date: Wed, 22 Jul 2026 16:47:06 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 08/11] drm/bridge: it6505: guard against zero channel count in audio infoframe Message-ID: <7f2bb1e136950b855b92a58d2faa9a5810382d17.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" it6505->audio.channel_count stays 0 until link training or a valid hw_params call has run, but it6505_enable_audio() can be reached before that from the audio-FIFO-error IRQ, making it6505_enable_audio_infoframe() index the 8-entry audio_info_ca[] table with -1. Bail out while the channel count is not yet known. Also fix the debug print on the invalid-channel-count path, which logged the previously cached count instead of the rejected one. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle Reviewed-by: Chen-Yu Tsai --- v5: no changes v4: no changes, collected Chen-Yu Tsai's Reviewed-by v3: new patch drivers/gpu/drm/bridge/ite-it6505.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 81d2c9644531..e9208d827ce3 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1576,6 +1576,9 @@ static void it6505_enable_audio_infoframe(struct it65= 05 *it6505) struct device *dev =3D it6505->dev; u8 audio_info_ca[] =3D { 0x00, 0x00, 0x01, 0x03, 0x07, 0x0B, 0x0F, 0x1F }; =20 + if (!it6505->audio.channel_count) + return; + DRM_DEV_DEBUG_DRIVER(dev, "infoframe channel_allocation:0x%02x", audio_info_ca[it6505->audio.channel_count - 1]); =20 @@ -3007,7 +3010,7 @@ static int __maybe_unused it6505_audio_setup_hw_param= s(struct it6505 *it6505, =20 if (params->cea.channels <=3D 1 || params->cea.channels > 8) { DRM_DEV_DEBUG_DRIVER(dev, "channel number: %d not support", - it6505->audio.channel_count); + params->cea.channels); return -EINVAL; } =20 --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BE2A201113 for ; Wed, 22 Jul 2026 15:47:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735251; cv=none; b=RH9OyAMxlGfSndjVh8sUZI+zlkEsY64SPjpdFy02m388rWGYo74VlRD7F2IBISiCjxT/8AQmFi+Tziu4lGfVDxSff2qpKKRGEEWhxmbZsZpIoG66KlTo19rZsUqfXD+dy6AeGnjws+DHSV4iMGJ5iTLo1A/K79fp7akJW1nYGhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735251; c=relaxed/simple; bh=s/yVHps2FyLHyi2vB3TxS79OykfUq5grmQdJyi6j6Qo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sW+nHb3/qiDY4ObLxwpd89hLT9+pTP7N3OLmLH1MYC86SV6Qe+yWk8HqQN1dCg82vjkSsnlZdUkGbwNBvfhZToxuINpBeDn6E5EnwloXMM7ivgN3q4szu5kTXKgOtfGuKiDu4OFqPrUXDohbrHf7xwMs33elBpNCkJrRDazlo4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZAK-000000006i7-0ApZ; Wed, 22 Jul 2026 15:47:24 +0000 Date: Wed, 22 Jul 2026 16:47:20 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 09/11] drm/bridge: it6505: hold endpoint OF node reference while parsing it Message-ID: <8a9ec00b8464f0dec0242792f7f9d990d33589a0.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" it6505_parse_dt() drops the reference to each endpoint node right after looking it up and then keeps reading its properties, racing with the node being freed under CONFIG_OF_DYNAMIC. Put the node only once parsing is done. Fixes: 380d920b582d ("drm/bridge: add it6505 driver to read data-lanes and = link-frequencies from dt") Signed-off-by: Daniel Golle --- v5: new patch drivers/gpu/drm/bridge/ite-it6505.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index e9208d827ce3..6f23203d5f2a 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -3364,7 +3364,6 @@ static void it6505_parse_dt(struct it6505 *it6505) } =20 ep =3D of_graph_get_endpoint_by_regs(np, 1, 0); - of_node_put(ep); =20 if (ep) { len =3D it6505_get_data_lanes_count(ep, 1, 4); @@ -3377,13 +3376,13 @@ static void it6505_parse_dt(struct it6505 *it6505) *max_lane_count =3D MAX_LANE_COUNT; dev_err(dev, "error data-lanes, use default"); } + of_node_put(ep); } else { *max_lane_count =3D MAX_LANE_COUNT; dev_err(dev, "error endpoint, use default"); } =20 ep =3D of_graph_get_endpoint_by_regs(np, 0, 0); - of_node_put(ep); =20 if (ep) { len =3D of_property_read_variable_u64_array(ep, @@ -3403,6 +3402,7 @@ static void it6505_parse_dt(struct it6505 *it6505) dev_err(dev, "error link frequencies, use default"); *max_dpi_pixel_clock =3D DPI_PIXEL_CLK_MAX; } + of_node_put(ep); } else { dev_err(dev, "error endpoint, use default"); *max_dpi_pixel_clock =3D DPI_PIXEL_CLK_MAX; --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8A8B33A711 for ; Wed, 22 Jul 2026 15:47:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735266; cv=none; b=fWQN6YRvlcD7Rnwl1ZXlB8MAouzOjNdZqHYoUx+UGofD7kNU4hVpIoLucTIL0GHe2hH/bXpl2la1z//nhhM6NLSNr+ekK0jbmFSwBmvJWEmE1li+3M/ChRJBuVDJK2n5/8c8t7JR4M0iZeqAPSMJpGfEKpPdhXYiUHEMMutHsxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735266; c=relaxed/simple; bh=R19Xh7SYI6j/IwsgscmoBmAC2NodXNd6FXmvBl2s/Ic=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XbRYGyQk6b85WxWfl80IcGZzd3mPf2s4F0xh16eR1wUB48t19DVZ2XCi/gy4aAjF6GmMDVpuUp12eJJmGdsM81EhQ5oQpR60/nq79M1hDTWS/l+SOPG28t3hCCDAJV1MB/g8NlveMPyrxOR0sTSLnIW3ePF1ScU6/lUVcqlQdSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZAW-000000006iv-34zz; Wed, 22 Jul 2026 15:47:36 +0000 Date: Wed, 22 Jul 2026 16:47:33 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 10/11] drm/bridge: it6505: Add audio support Message-ID: <80ddba1acc32091567a13b360d2e407a283d10ac.1784717129.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jiaxin Yu Add audio support for it6505 by bridging to the hdmi-codec: register an "hdmi-audio-codec" platform device from probe and wire up the previously unused audio helpers via hdmi_codec_ops. This unblocks the mt8186-mt6366 sound card which references it6505 as the I2S3 codec. Audio starts out muted and is only enabled once the stream is unmuted, since some DP-to-HDMI dongles get into a bad state if the InfoFrame is sent without audio data. Enable/disable can race between the FIFO-error IRQ, the delayed enable work, the hdmi-codec ops and the HPD-low path, so the register sequences, the mute state and the cached stream parameters are serialised with a new audio_lock mutex. plugged_cb/codec_dev updates take mode_lock, the lock it6505_detect() holds when calling back into the codec. Signed-off-by: Jiaxin Yu Link: https://lore.kernel.org/all/20230730180803.22570-4-jiaxin.yu@mediatek= .com/ Signed-off-by: Daniel Golle --- v5: update plugged_cb/codec_dev under mode_lock v4: * start out muted * update mute state and cached parameters under audio_lock; the FIFO-error IRQ probes and enables audio in one locked section * unregister the codec device only after quiesce on remove v3: serialise enable/disable with audio_lock; track mute state so the FIFO-error IRQ cannot undo a mute v2 (respin of Jiaxin Yu's v3 on current -next): * drive enable/disable from .mute_stream (hdmi_codec_ops lost .trigger), use it6505->dev * keep and unregister the codec platform_device on remove, cancel delayed_audio on shutdown and remove, disable audio when muting drivers/gpu/drm/bridge/ite-it6505.c | 163 +++++++++++++++++++++++----- 1 file changed, 134 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 6f23203d5f2a..75b287cda801 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -407,6 +407,7 @@ struct it6505_audio_data { u8 i2s_data_delay; u8 i2s_ws_channel; u8 i2s_data_sequence; + bool mute; }; =20 struct it6505_audio_sample_rate_map { @@ -439,6 +440,7 @@ struct it6505 { struct mutex extcon_lock; struct mutex mode_lock; /* used to bridge_detect */ struct mutex aux_lock; /* used to aux data transfers */ + struct mutex audio_lock; /* serializes audio enable/disable */ struct regmap *regmap; struct drm_display_mode source_output_mode; struct drm_display_mode video_info; @@ -476,6 +478,7 @@ struct it6505 { bool enable_enhanced_frame; hdmi_codec_plugged_cb plugged_cb; struct device *codec_dev; + struct platform_device *audio_pdev; struct delayed_work delayed_audio; struct it6505_audio_data audio; struct dentry *debugfs; @@ -1595,7 +1598,7 @@ static void it6505_enable_audio_infoframe(struct it65= 05 *it6505) EN_AUD_CTRL_PKT); } =20 -static void it6505_disable_audio(struct it6505 *it6505) +static void __it6505_disable_audio(struct it6505 *it6505) { it6505_set_bits(it6505, REG_DATA_MUTE_CTRL, EN_AUD_MUTE, EN_AUD_MUTE); it6505_set_bits(it6505, REG_AUDIO_SRC_CTRL, M_AUDIO_I2S_EN, 0x00); @@ -1603,13 +1606,21 @@ static void it6505_disable_audio(struct it6505 *it6= 505) it6505_set_bits(it6505, REG_RESET_CTRL, AUDIO_RESET, AUDIO_RESET); } =20 -static void it6505_enable_audio(struct it6505 *it6505) +static void it6505_disable_audio(struct it6505 *it6505) +{ + mutex_lock(&it6505->audio_lock); + __it6505_disable_audio(it6505); + mutex_unlock(&it6505->audio_lock); +} + +static void __it6505_enable_audio(struct it6505 *it6505) { struct device *dev =3D it6505->dev; int regbe; =20 DRM_DEV_DEBUG_DRIVER(dev, "start"); - it6505_disable_audio(it6505); + + __it6505_disable_audio(it6505); =20 it6505_setup_audio_channel_status(it6505); it6505_setup_audio_format(it6505); @@ -1633,6 +1644,14 @@ static void it6505_enable_audio(struct it6505 *it650= 5) it6505_set_bits(it6505, REG_DATA_MUTE_CTRL, EN_AUD_MUTE, 0x00); } =20 +static void it6505_enable_audio(struct it6505 *it6505) +{ + mutex_lock(&it6505->audio_lock); + if (!it6505->audio.mute) + __it6505_enable_audio(it6505); + mutex_unlock(&it6505->audio_lock); +} + static bool it6505_use_step_train_check(struct it6505 *it6505) { if (it6505->link.revision >=3D 0x12) @@ -2327,19 +2346,12 @@ static void it6505_stop_link_train(struct it6505 *i= t6505) =20 static void it6505_link_train_ok(struct it6505 *it6505) { - struct device *dev =3D it6505->dev; - it6505->link_state =3D LINK_OK; /* disalbe mute enable avi info frame */ it6505_set_bits(it6505, REG_DATA_MUTE_CTRL, EN_VID_MUTE, 0x00); it6505_set_bits(it6505, REG_INFOFRAME_CTRL, EN_VID_CTRL_PKT, EN_VID_CTRL_PKT); =20 - if (it6505_audio_input(it6505)) { - DRM_DEV_DEBUG_DRIVER(dev, "Enable audio!"); - it6505_enable_audio(it6505); - } - if (it6505->hdcp_desired) it6505_start_hdcp(it6505); } @@ -2631,8 +2643,10 @@ static void it6505_irq_audio_fifo_error(struct it650= 5 *it6505) =20 DRM_DEV_DEBUG_DRIVER(dev, "audio fifo error Interrupt"); =20 - if (it6505_audio_input(it6505)) - it6505_enable_audio(it6505); + mutex_lock(&it6505->audio_lock); + if (!it6505->audio.mute && it6505_audio_input(it6505)) + __it6505_enable_audio(it6505); + mutex_unlock(&it6505->audio_lock); } =20 static void it6505_irq_link_train_fail(struct it6505 *it6505) @@ -2980,7 +2994,7 @@ static void it6505_remove_notifier_module(struct it65= 05 *it6505) flush_work(&it6505->extcon_wq); } =20 -static void __maybe_unused it6505_delayed_audio(struct work_struct *work) +static void it6505_delayed_audio(struct work_struct *work) { struct it6505 *it6505 =3D container_of(work, struct it6505, delayed_audio.work); @@ -2994,11 +3008,12 @@ static void __maybe_unused it6505_delayed_audio(str= uct work_struct *work) it6505_enable_audio(it6505); } =20 -static int __maybe_unused it6505_audio_setup_hw_params(struct it6505 *it65= 05, - struct hdmi_codec_params - *params) +static int it6505_audio_setup_hw_params(struct it6505 *it6505, + struct hdmi_codec_params + *params) { struct device *dev =3D it6505->dev; + u8 word_length; int i =3D 0; =20 DRM_DEV_DEBUG_DRIVER(dev, "%s %d Hz, %d bit, %d channels\n", __func__, @@ -3014,8 +3029,6 @@ static int __maybe_unused it6505_audio_setup_hw_param= s(struct it6505 *it6505, return -EINVAL; } =20 - it6505->audio.channel_count =3D params->cea.channels; - while (i < ARRAY_SIZE(audio_sample_rate_map) && params->sample_rate !=3D audio_sample_rate_map[i].sample_rate_value) { @@ -3026,21 +3039,20 @@ static int __maybe_unused it6505_audio_setup_hw_par= ams(struct it6505 *it6505, params->sample_rate); return -EINVAL; } - it6505->audio.sample_rate =3D audio_sample_rate_map[i].rate; =20 switch (params->sample_width) { case 16: - it6505->audio.word_length =3D WORD_LENGTH_16BIT; + word_length =3D WORD_LENGTH_16BIT; break; case 18: - it6505->audio.word_length =3D WORD_LENGTH_18BIT; + word_length =3D WORD_LENGTH_18BIT; break; case 20: - it6505->audio.word_length =3D WORD_LENGTH_20BIT; + word_length =3D WORD_LENGTH_20BIT; break; case 24: case 32: - it6505->audio.word_length =3D WORD_LENGTH_24BIT; + word_length =3D WORD_LENGTH_24BIT; break; default: DRM_DEV_DEBUG_DRIVER(dev, "wordlength: %d bit not support", @@ -3048,27 +3060,111 @@ static int __maybe_unused it6505_audio_setup_hw_pa= rams(struct it6505 *it6505, return -EINVAL; } =20 + mutex_lock(&it6505->audio_lock); + it6505->audio.channel_count =3D params->cea.channels; + it6505->audio.sample_rate =3D audio_sample_rate_map[i].rate; + it6505->audio.word_length =3D word_length; + mutex_unlock(&it6505->audio_lock); + return 0; } =20 -static void __maybe_unused it6505_audio_shutdown(struct device *dev, void = *data) +static void it6505_audio_shutdown(struct device *dev, void *data) { struct it6505 *it6505 =3D dev_get_drvdata(dev); =20 + mutex_lock(&it6505->audio_lock); + it6505->audio.mute =3D true; if (it6505->powered) - it6505_disable_audio(it6505); + __it6505_disable_audio(it6505); + mutex_unlock(&it6505->audio_lock); + cancel_delayed_work_sync(&it6505->delayed_audio); +} + +static int it6505_audio_hw_params(struct device *dev, void *data, + struct hdmi_codec_daifmt *daifmt, + struct hdmi_codec_params *params) +{ + struct it6505 *it6505 =3D dev_get_drvdata(dev); + + return it6505_audio_setup_hw_params(it6505, params); } =20 -static int __maybe_unused it6505_audio_hook_plugged_cb(struct device *dev, - void *data, - hdmi_codec_plugged_cb fn, - struct device *codec_dev) +static int it6505_audio_mute(struct device *dev, void *data, + bool enable, int direction) +{ + struct it6505 *it6505 =3D dev_get_drvdata(dev); + + DRM_DEV_DEBUG_DRIVER(dev, "mute: %d", enable); + + /* + * Delay enabling audio until the stream is unmuted; InfoFrames + * without audio data upset some DP-to-HDMI dongles. + */ + if (enable) { + mutex_lock(&it6505->audio_lock); + it6505->audio.mute =3D true; + if (it6505->powered) + __it6505_disable_audio(it6505); + mutex_unlock(&it6505->audio_lock); + cancel_delayed_work_sync(&it6505->delayed_audio); + } else { + mutex_lock(&it6505->audio_lock); + it6505->audio.mute =3D false; + mutex_unlock(&it6505->audio_lock); + queue_delayed_work(system_wq, &it6505->delayed_audio, + msecs_to_jiffies(180)); + } + + return 0; +} + +static int it6505_audio_hook_plugged_cb(struct device *dev, + void *data, + hdmi_codec_plugged_cb fn, + struct device *codec_dev) { struct it6505 *it6505 =3D data; =20 + mutex_lock(&it6505->mode_lock); it6505->plugged_cb =3D fn; it6505->codec_dev =3D codec_dev; it6505_plugged_status_to_codec(it6505); + mutex_unlock(&it6505->mode_lock); + + return 0; +} + +static const struct hdmi_codec_ops it6505_audio_codec_ops =3D { + .hw_params =3D it6505_audio_hw_params, + .mute_stream =3D it6505_audio_mute, + .audio_shutdown =3D it6505_audio_shutdown, + .hook_plugged_cb =3D it6505_audio_hook_plugged_cb, +}; + +static int it6505_register_audio_driver(struct device *dev) +{ + struct it6505 *it6505 =3D dev_get_drvdata(dev); + struct hdmi_codec_pdata codec_data =3D { + .ops =3D &it6505_audio_codec_ops, + .max_i2s_channels =3D 8, + .i2s =3D 1, + .no_capture_mute =3D 1, + .data =3D it6505, + }; + struct platform_device *pdev; + + it6505->audio.mute =3D true; + INIT_DELAYED_WORK(&it6505->delayed_audio, it6505_delayed_audio); + + pdev =3D platform_device_register_data(dev, HDMI_CODEC_DRV_NAME, + PLATFORM_DEVID_AUTO, &codec_data, + sizeof(codec_data)); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + + it6505->audio_pdev =3D pdev; + DRM_DEV_DEBUG_DRIVER(dev, "bound to %s", HDMI_CODEC_DRV_NAME); =20 return 0; } @@ -3584,6 +3680,7 @@ static int it6505_i2c_probe(struct i2c_client *client) mutex_init(&it6505->extcon_lock); mutex_init(&it6505->mode_lock); mutex_init(&it6505->aux_lock); + mutex_init(&it6505->audio_lock); =20 it6505->bridge.of_node =3D client->dev.of_node; it6505->connector_status =3D connector_status_disconnected; @@ -3634,6 +3731,12 @@ static int it6505_i2c_probe(struct i2c_client *clien= t) return err; } =20 + err =3D it6505_register_audio_driver(dev); + if (err < 0) { + dev_err(dev, "Failed to register audio driver: %d", err); + return err; + } + INIT_WORK(&it6505->link_works, it6505_link_training_work); INIT_WORK(&it6505->hdcp_wait_ksv_list, it6505_hdcp_wait_ksv_list); INIT_DELAYED_WORK(&it6505->hdcp_work, it6505_hdcp_work); @@ -3675,6 +3778,8 @@ static void it6505_i2c_remove(struct i2c_client *clie= nt) cancel_work_sync(&it6505->hdcp_wait_ksv_list); cancel_delayed_work_sync(&it6505->hdcp_work); cancel_work_sync(&it6505->extcon_wq); + platform_device_unregister(it6505->audio_pdev); + cancel_delayed_work_sync(&it6505->delayed_audio); if (it6505->extcon_state) pm_runtime_put_sync(&client->dev); pm_runtime_disable(&client->dev); --=20 2.55.0 From nobody Fri Jul 24 22:48:54 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ABE33E1208 for ; Wed, 22 Jul 2026 15:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735277; cv=none; b=HrKscV0giPwZy1hjg5OVIhz+QVmQO1HplqnQxZbgJJn1Y3f3a6ed8j6bl+2xI9dBalMEwgIDbtzLS8YmDEjPHn/fvYwINcgi3jJDY99l7pcPC6gmKhN4axF1yBnkIgv6yaeOOOAleRn3oZmoXDkmbRyEINTyrDzIwSeI6I4kqZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784735277; c=relaxed/simple; bh=Nwznlan8LFcPj1xp/j6U3lWY8DhpWxXj0OwDhbxLWCo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JOwtYX6owK7rEqTksR6y0tTTWwtu6XXOMVgLQmpUnhBLSYcnHB0eeaXj9fLP29sSD5WBKhEGGb7x0ycH/NgRkSLm+rcqUvmj00x4KoD9F5TMGXMJjtJlmA31WXa6SE6V7IzdP/S91Fzx5aIcZDjvq57eFQDHcloibmmJwUOISRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wmZAj-000000006jd-0Q9G; Wed, 22 Jul 2026 15:47:49 +0000 Date: Wed, 22 Jul 2026 16:47:45 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chen-Yu Tsai Subject: [PATCH v5 11/11] drm/bridge: it6505: Don't reject audio hw_params without an encoder Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" it6505_audio_setup_hw_params() returns -ENODEV when no encoder is attached. With it6505 registering an hdmi-audio-codec this runs for every stream on the I2S DAI, and on mt8186-corsola, where the rt1019 speaker amplifier shares I2S3, the error tears down the whole DPCM backend and breaks speaker playback whenever no display is attached. The function only caches stream parameters, which needs no encoder. Drop the check, and apply the audio defaults once at probe instead of in it6505_variable_config(), which would clobber the cached parameters again on every hotplug. Actual audio output remains gated by it6505->powered. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle --- v5: no changes v4: apply audio defaults at probe time instead of in it6505_variable_config() v3: no changes v2: drop the encoder check entirely instead of returning 0 early drivers/gpu/drm/bridge/ite-it6505.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 75b287cda801..ba8db1e36ff6 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1370,16 +1370,6 @@ static void it6505_variable_config(struct it6505 *it= 6505) it6505->link_state =3D LINK_IDLE; it6505->hdcp_desired =3D HDCP_DESIRED; it6505->auto_train_retry =3D AUTO_TRAIN_RETRY; - it6505->audio.select =3D AUDIO_SELECT; - it6505->audio.sample_rate =3D AUDIO_SAMPLE_RATE; - it6505->audio.channel_count =3D AUDIO_CHANNEL_COUNT; - it6505->audio.type =3D AUDIO_TYPE; - it6505->audio.i2s_input_format =3D I2S_INPUT_FORMAT; - it6505->audio.i2s_justified =3D I2S_JUSTIFIED; - it6505->audio.i2s_data_delay =3D I2S_DATA_DELAY; - it6505->audio.i2s_ws_channel =3D I2S_WS_CHANNEL; - it6505->audio.i2s_data_sequence =3D I2S_DATA_SEQUENCE; - it6505->audio.word_length =3D AUDIO_WORD_LENGTH; memset(it6505->sha1_input, 0, sizeof(it6505->sha1_input)); memset(it6505->bksvs, 0, sizeof(it6505->bksvs)); } @@ -3020,9 +3010,6 @@ static int it6505_audio_setup_hw_params(struct it6505= *it6505, params->sample_rate, params->sample_width, params->cea.channels); =20 - if (!it6505->bridge.encoder) - return -ENODEV; - if (params->cea.channels <=3D 1 || params->cea.channels > 8) { DRM_DEV_DEBUG_DRIVER(dev, "channel number: %d not support", params->cea.channels); @@ -3154,6 +3141,16 @@ static int it6505_register_audio_driver(struct devic= e *dev) }; struct platform_device *pdev; =20 + it6505->audio.select =3D AUDIO_SELECT; + it6505->audio.sample_rate =3D AUDIO_SAMPLE_RATE; + it6505->audio.channel_count =3D AUDIO_CHANNEL_COUNT; + it6505->audio.type =3D AUDIO_TYPE; + it6505->audio.i2s_input_format =3D I2S_INPUT_FORMAT; + it6505->audio.i2s_justified =3D I2S_JUSTIFIED; + it6505->audio.i2s_data_delay =3D I2S_DATA_DELAY; + it6505->audio.i2s_ws_channel =3D I2S_WS_CHANNEL; + it6505->audio.i2s_data_sequence =3D I2S_DATA_SEQUENCE; + it6505->audio.word_length =3D AUDIO_WORD_LENGTH; it6505->audio.mute =3D true; INIT_DELAYED_WORK(&it6505->delayed_audio, it6505_delayed_audio); =20 --=20 2.55.0