Skip to content

drm/bridge: it6505: DP audio support + shared-DAI hw_params fix

Daniel Golle dri-devel linux-arm-kernel linux-mediatek lkml 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest14 patches 8 repliesIn review
  2. v714 patches 0 repliesSuperseded
  3. v613 patches 2 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v511 patches0 repliesSuperseded
v45 patches0 repliesSuperseded
v34 patches2 repliesSuperseded
v22 patches0 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v8 from the cover letter

* 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

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14drm/bridge: it6505: quiesce event sources and work on remove()drivers/gpu/drm/bridge/ite-it6505.c+21 -61 reply
2/14drm/bridge: it6505: quiesce work items before powering offdrivers/gpu/drm/bridge/ite-it6505.c+3 -01 reply
3/14drm/bridge: it6505: balance and disable runtime PM on removedrivers/gpu/drm/bridge/ite-it6505.c+3 -01 reply
4/14drm/bridge: it6505: unregister DP AUX adapter on bridge detachdrivers/gpu/drm/bridge/ite-it6505.c+2 -01 reply
5/14drm/bridge: it6505: complete poweroff even if disabling regulators failsdrivers/gpu/drm/bridge/ite-it6505.c+4 -21 reply
6/14drm/bridge: it6505: bail out of the IRQ handler when status reads faildrivers/gpu/drm/bridge/ite-it6505.c+5 -01 reply
7/14drm/bridge: it6505: avoid division by zero in pixel clock calculationdrivers/gpu/drm/bridge/ite-it6505.c+2 -11 reply
8/14drm/bridge: it6505: avoid division by zero in audio FS debug printdrivers/gpu/drm/bridge/ite-it6505.c+5 -21 reply
9/14drm/bridge: it6505: guard against zero channel count in audio infoframedrivers/gpu/drm/bridge/ite-it6505.c+4 -10 replies
10/14drm/bridge: it6505: hold endpoint OF node reference while parsing itdrivers/gpu/drm/bridge/ite-it6505.c+2 -20 replies
11/14drm/bridge: it6505: reject a too short link-frequencies propertydrivers/gpu/drm/bridge/ite-it6505.c+1 -10 replies
12/14drm/bridge: it6505: don't write an error code back to the reset registerdrivers/gpu/drm/bridge/ite-it6505.c+4 -10 replies
13/14drm/bridge: it6505: Add audio supportdrivers/gpu/drm/bridge/ite-it6505.c+136 -320 replies
14/14drm/bridge: it6505: Don't reject audio hw_params without an encoderdrivers/gpu/drm/bridge/ite-it6505.c+10 -130 replies

Reviews trailers per patch

6 of 14 patches have a Reviewed-by or Acked-by.

PatchChen-Yu TsaiLuca Ceresoli
1/14R-b
2/14R-b
3/14R-b
4/14
5/14R-b
6/14
7/14R-b
8/14
9/14R-b
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

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

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/[email protected]/
---
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/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v5: https://lore.kernel.org/all/[email protected]/
v6: https://lore.kernel.org/all/[email protected]/
v7: https://lore.kernel.org/all/[email protected]/

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

Signature · 1 line
2.55.0