Thread (15 messages) 15 messages, 1 author, 1d ago
WARM1d

[PATCH v8 00/14] drm/bridge: it6505: DP audio support + shared-DAI hw_params fix

From: Daniel Golle <daniel@makrotopia.org>
Date: 2026-09-27 23:49:53
Also in: dri-devel, linux-mediatek, lkml

Revive HDMI/DP audio support for the it6505, originally posted by
Jiaxin Yu [1], rebased onto current -next with the review feedback
addressed: &client->dev is gone (the driver gained it6505->dev) and
"#sound-dai-cells" has since been added by commit 325af1bef5b9
("dt-bindings: display: bridge: it6505: Add #sound-dai-cells").

Patches 1-12 fix pre-existing bugs found during review of earlier
versions of this series; they carry Fixes: tags and are ordered first
so stable trees can pick them.

Patch 13 wires up the it6505 audio helpers via hdmi_codec_ops,
unblocking the mt8186-mt6366 sound card which references it6505 as
the I2S3 codec. Patch 14 makes hw_params succeed with no display
attached, needed when the I2S bus is shared with another codec as on
MT8186 "steelix" Chromebooks, where the speaker path must keep
working regardless of the it6505 link state.

Tested on a MT8186 (google,steelix) Chromebook: the sound card comes
up, speakers, microphone and headset jack work. HDMI/DP audio output
itself could not be tested for lack of a suitable adapter cable.

[1] https://lore.kernel.org/all/20230730180803.22570-4-jiaxin.yu@mediatek.com/ (local)
---
v8:
 * patch 4: keep the DP AUX unregister in remove() as well, so an i2c
   unbind waits for in-flight AUX device users before the regmap is
   freed; flagged by the Sashiko AI review of v7
 * patch 5: terminate the new dev_err() messages with a newline
 * patch 13: it6505_poweron() sets the powered flag and runs the
   logic reset and init sequence under audio_lock, closing a race
   with the delayed enable work flagged by the Sashiko AI review of
   v7; newline for the new dev_err() message
 * rebased onto next-20260925
 * patches 1-3, 6-12 and 14: no changes

v7:
 * new patch 2: cancel link_works, hdcp_wait_ksv_list and hdcp_work
   in it6505_poweroff() so link training and HDCP authentication
   cannot run into a chip being powered off; pre-existing, found
   while assessing the Sashiko AI review of v6
 * patch 13 (was 12): it6505_poweroff() clears the powered flag
   under audio_lock, closing the race between the codec ops and a
   concurrent power-off flagged by the Sashiko AI review of v6; the
   it6505_enable_audio() wrapper is folded into the delayed work
 * the remaining v6 review findings are already fixed by later
   patches of this series (patches 3, 4, 6, 8, 11 and 12), concern
   pre-existing code outside its scope (whole-register restore in
   it6505_audio_input(), unchecked reads in it6505_aux_i2c_wait()
   and it6505_calc_video_info(), regulator disable order) or do not
   apply (AUX unregister on unbind, missing newline in dev_err())
 * rebased onto next-20260923
 * patches 1, 3-12 and 14: no changes

v6:
 * patch 1: track notifier registration in a flag instead of
   clearing notifier_call, which a chain traversal racing the
   unregistration could have called as NULL (extcon traverses its
   raw notifier chain unlocked); flagged by Sashiko AI review of v5.
   The in-flight-callback race also flagged there is an extcon core
   limitation affecting all its consumers and cannot be closed from
   a consumer driver.
 * patch 4: note that a failed regulator_disable() leaks the
   reference either way
 * new patches 10 and 11: two more pre-existing fixes from v5
   review, an uninitialised link-frequencies value and an error
   code written back to the reset register
 * patches 2, 3, 5-9, 12 and 13: no changes

v5:
 * patch 1: serialise notifier registration state with extcon_lock
 * patch 2: also drop the runtime PM usage ref held for a connected
   display; retitled
 * new patches 3-7 and 9: more pre-existing fixes from v4 review
   (AUX unregister symmetry, poweroff error path, IRQ status read
   errors, two divisions by zero, of_node_put before use)
 * patch 10 (was 4): update plugged_cb/codec_dev under mode_lock
 * patches 8 and 11: no changes

v4:
 * patch 1: quiesce extcon notifier and IRQ before cancelling work,
   initialise extcon_wq in probe; retitled
 * new patch 2: disable runtime PM on remove
 * patch 3 (was 2): collected Chen-Yu Tsai's Reviewed-by
 * patch 4 (was 3): start out muted; mute state and cached
   parameters updated under audio_lock; unregister codec after
   quiesce
 * patch 5 (was 4): apply audio defaults at probe time

v3:
 * new patches 1 and 2, fixing a pre-existing use-after-free on
   remove() and an out-of-bounds read with channel_count == 0
 * patch 3 (was 1): serialise audio enable/disable with audio_lock;
   track mute state so the FIFO-error IRQ cannot undo a mute
 * patch 4 (was 2): no changes

v2:
 * keep and unregister the hdmi-codec platform_device on remove
 * initialise delayed_audio before registering the codec device
 * cancel delayed_audio synchronously on shutdown and remove
 * disable audio immediately when muting
 * patch 2: drop the encoder check instead of returning 0 early

v1: https://lore.kernel.org/all/cover.1784393979.git.daniel@makrotopia.org/ (local)
v2: https://lore.kernel.org/all/cover.1784561622.git.daniel@makrotopia.org/ (local)
v3: https://lore.kernel.org/all/cover.1784600387.git.daniel@makrotopia.org/ (local)
v4: https://lore.kernel.org/all/cover.1784681487.git.daniel@makrotopia.org/ (local)
v5: https://lore.kernel.org/all/cover.1784717129.git.daniel@makrotopia.org/ (local)
v6: https://lore.kernel.org/all/cover.1784947240.git.daniel@makrotopia.org/ (local)
v7: https://lore.kernel.org/all/cover.1790275151.git.daniel@makrotopia.org/ (local)

Daniel Golle (13):
  drm/bridge: it6505: quiesce event sources and work on remove()
  drm/bridge: it6505: quiesce work items before powering off
  drm/bridge: it6505: balance and disable runtime PM on remove
  drm/bridge: it6505: unregister DP AUX adapter on bridge detach
  drm/bridge: it6505: complete poweroff even if disabling regulators
    fails
  drm/bridge: it6505: bail out of the IRQ handler when status reads fail
  drm/bridge: it6505: avoid division by zero in pixel clock calculation
  drm/bridge: it6505: avoid division by zero in audio FS debug print
  drm/bridge: it6505: guard against zero channel count in audio
    infoframe
  drm/bridge: it6505: hold endpoint OF node reference while parsing it
  drm/bridge: it6505: reject a too short link-frequencies property
  drm/bridge: it6505: don't write an error code back to the reset
    register
  drm/bridge: it6505: Don't reject audio hw_params without an encoder

Jiaxin Yu (1):
  drm/bridge: it6505: Add audio support

 drivers/gpu/drm/bridge/ite-it6505.c | 263 +++++++++++++++++++++-------
 1 file changed, 202 insertions(+), 61 deletions(-)


base-commit: f5f84daefcd92d7a630066635ecea1433ed5eac7
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help