From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/bridge: synopsys: dw-dp: Add audio support Date: Tue, 05 May 2026 09:49:48 +1000 Message-ID: In-Reply-To: <20260501-synopsys-dw-dp-improvements-v2-12-d7e7f6bac77f@collabora.com> References: <20260501-synopsys-dw-dp-improvements-v2-0-d7e7f6bac77f@collabora.com> <20260501-synopsys-dw-dp-improvements-v2-12-d7e7f6bac77f@collabora.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review The main audio implementation. Uses the `drm_bridge_funcs` DP audio callbac= ks. **Issue =E2=80=94 `AUDIO_DATA_IN_EN_CHANNEL*` bit definitions overlap with = `AUDIO_INF_SELECT`:** ```c #define AUDIO_DATA_IN_EN GENMASK(4, 1) +#define AUDIO_DATA_IN_EN_CHANNEL12 BIT(0) +#define AUDIO_DATA_IN_EN_CHANNEL34 BIT(1) +#define AUDIO_DATA_IN_EN_CHANNEL56 BIT(2) +#define AUDIO_DATA_IN_EN_CHANNEL78 BIT(3) #define AUDIO_INF_SELECT BIT(0) ``` These `CHANNEL*` defines are *field values* used inside `FIELD_PREP(AUDIO_D= ATA_IN_EN, ...)`, not raw register bits. This is correct usage, but the nam= ing convention (`BIT(0)` etc. placed right next to raw register bit defines= ) is confusing. A comment or renaming (e.g., `DW_DP_AUD_CH12_EN =3D BIT(0)`= ) would improve readability. **Issue =E2=80=94 both clocks enabled then one disabled:** ```c + clk_prepare_enable(dp->spdif_clk); + clk_prepare_enable(dp->i2s_clk); + /* ... configure registers ... */ + if (dp->audio_interface =3D=3D DW_DP_AUDIO_I2S) + clk_disable_unprepare(dp->spdif_clk); + else if (dp->audio_interface =3D=3D DW_DP_AUDIO_SPDIF) + clk_disable_unprepare(dp->i2s_clk); ``` Both clocks are enabled, registers are configured, then the unused one is d= isabled. The comment says "Wait for inf switch" with a `usleep_range(20, 40= )`. No error handling on `clk_prepare_enable` calls here either. **Issue =E2=80=94 channel count support is limited:** ```c + switch (params->cea.channels) { + case 1: + case 2: + audio_data_in_en =3D AUDIO_DATA_IN_EN_CHANNEL12; + break; + case 8: + audio_data_in_en =3D ...all channels...; + break; + default: + dev_err(dp->dev, "invalid audio channels %d\n", ...); + return -EINVAL; + } ``` Only 1/2 and 8 channels are supported. 4 and 6 channel configurations (comm= on for surround sound) are rejected. This is likely intentional for initial= implementation but worth noting. **Audio startup/shutdown PM:** `pm_runtime_get_sync` in `startup` and `pm_r= untime_put_autosuspend` in `shutdown` =E2=80=94 same lack of error handling= as noted in patch 9. **The `hdmi_audio_dai_port =3D 1` assignment:** This assumes port@1 is the = audio DAI port, which aligns with the DT binding change in patch 11 that de= fines `#sound-dai-cells =3D <1>`. Overall the audio implementation follows established patterns from other DR= M bridge audio drivers and looks functionally correct for SST use cases. --- Generated by Claude Code Patch Reviewer