Skip to content

Commit

Permalink
ASoC: hdmi-codec: move no_capture_mute to struct hdmi_codec_pdata
Browse files Browse the repository at this point in the history
The no_capture_mute flag might differ from platform to platform,
especially in the case of the wrapping implementations, like the
upcoming DRM HDMI Codec framework. Move the flag next to all other flags
in struct hdmi_codec_pdata.

Acked-by: Mark Brown <broonie@kernel.org>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241224-drm-bridge-hdmi-connector-v10-2-dc89577cd438@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  • Loading branch information
Dmitry Baryshkov committed Jan 4, 2025
1 parent 6af45d7 commit bb1d67b
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/ite-it66121.c
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,6 @@ static const struct hdmi_codec_ops it66121_audio_codec_ops = {
.audio_shutdown = it66121_audio_shutdown,
.mute_stream = it66121_audio_mute,
.get_eld = it66121_audio_get_eld,
.no_capture_mute = 1,
};

static int it66121_audio_codec_init(struct it66121_ctx *ctx, struct device *dev)
Expand All @@ -1476,6 +1475,7 @@ static int it66121_audio_codec_init(struct it66121_ctx *ctx, struct device *dev)
.i2s = 1, /* Only i2s support for now */
.spdif = 0,
.max_i2s_channels = 8,
.no_capture_mute = 1,
};

dev_dbg(dev, "%s\n", __func__);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/sii902x.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,6 @@ static const struct hdmi_codec_ops sii902x_audio_codec_ops = {
.mute_stream = sii902x_audio_mute,
.get_eld = sii902x_audio_get_eld,
.get_dai_id = sii902x_audio_get_dai_id,
.no_capture_mute = 1,
};

static int sii902x_audio_codec_init(struct sii902x *sii902x,
Expand All @@ -864,6 +863,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
.i2s = 1, /* Only i2s support for now. */
.spdif = 0,
.max_i2s_channels = 0,
.no_capture_mute = 1,
};
u8 lanes[4];
int num_lanes, i;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
.audio_shutdown = hdmi_audio_shutdown,
.mute_stream = hdmi_audio_mute,
.get_eld = hdmi_audio_get_eld,
.no_capture_mute = 1,
};

static int hdmi_register_audio_device(struct hdmi_context *hdata)
Expand All @@ -1669,6 +1668,7 @@ static int hdmi_register_audio_device(struct hdmi_context *hdata)
.ops = &audio_codec_ops,
.max_i2s_channels = 6,
.i2s = 1,
.no_capture_mute = 1,
};

hdata->audio.pdev = platform_device_register_data(
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i2c/tda998x_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
.audio_shutdown = tda998x_audio_shutdown,
.mute_stream = tda998x_audio_mute_stream,
.get_eld = tda998x_audio_get_eld,
.no_capture_mute = 1,
};

static int tda998x_audio_codec_init(struct tda998x_priv *priv,
Expand All @@ -1176,6 +1175,7 @@ static int tda998x_audio_codec_init(struct tda998x_priv *priv,
.max_i2s_channels = 2,
.no_i2s_capture = 1,
.no_spdif_capture = 1,
.no_capture_mute = 1,
};

if (priv->audio_port_enable[AUDIO_ROUTE_I2S])
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mediatek/mtk_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,6 @@ static const struct hdmi_codec_ops mtk_dp_audio_codec_ops = {
.audio_shutdown = mtk_dp_audio_shutdown,
.get_eld = mtk_dp_audio_get_eld,
.hook_plugged_cb = mtk_dp_audio_hook_plugged_cb,
.no_capture_mute = 1,
};

static int mtk_dp_register_audio_driver(struct device *dev)
Expand All @@ -2626,6 +2625,7 @@ static int mtk_dp_register_audio_driver(struct device *dev)
.max_i2s_channels = 8,
.i2s = 1,
.data = mtk_dp,
.no_capture_mute = 1,
};

mtk_dp->audio_pdev = platform_device_register_data(dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mediatek/mtk_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,6 @@ static const struct hdmi_codec_ops mtk_hdmi_audio_codec_ops = {
.mute_stream = mtk_hdmi_audio_mute,
.get_eld = mtk_hdmi_audio_get_eld,
.hook_plugged_cb = mtk_hdmi_audio_hook_plugged_cb,
.no_capture_mute = 1,
};

static int mtk_hdmi_register_audio_driver(struct device *dev)
Expand All @@ -1671,6 +1670,7 @@ static int mtk_hdmi_register_audio_driver(struct device *dev)
.max_i2s_channels = 2,
.i2s = 1,
.data = hdmi,
.no_capture_mute = 1,
};
struct platform_device *pdev;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/rockchip/cdn-dp-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
.mute_stream = cdn_dp_audio_mute_stream,
.get_eld = cdn_dp_audio_get_eld,
.hook_plugged_cb = cdn_dp_audio_hook_plugged_cb,
.no_capture_mute = 1,
};

static int cdn_dp_audio_codec_init(struct cdn_dp_device *dp,
Expand All @@ -896,6 +895,7 @@ static int cdn_dp_audio_codec_init(struct cdn_dp_device *dp,
.spdif = 1,
.ops = &audio_codec_ops,
.max_i2s_channels = 8,
.no_capture_mute = 1,
};

dp->audio_pdev = platform_device_register_data(
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sti/sti_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
.audio_shutdown = hdmi_audio_shutdown,
.mute_stream = hdmi_audio_mute,
.get_eld = hdmi_audio_get_eld,
.no_capture_mute = 1,
};

static int sti_hdmi_register_audio_driver(struct device *dev,
Expand All @@ -1247,6 +1246,7 @@ static int sti_hdmi_register_audio_driver(struct device *dev,
.ops = &audio_codec_ops,
.max_i2s_channels = 8,
.i2s = 1,
.no_capture_mute = 1,
};

DRM_DEBUG_DRIVER("\n");
Expand Down
4 changes: 1 addition & 3 deletions include/sound/hdmi-codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ struct hdmi_codec_ops {
int (*hook_plugged_cb)(struct device *dev, void *data,
hdmi_codec_plugged_cb fn,
struct device *codec_dev);

/* bit field */
unsigned int no_capture_mute:1;
};

/* HDMI codec initalization data */
Expand All @@ -129,6 +126,7 @@ struct hdmi_codec_pdata {
uint spdif:1;
uint no_spdif_playback:1;
uint no_spdif_capture:1;
uint no_capture_mute:1;
int max_i2s_channels;
void *data;
};
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/hdmi-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction)
*/
if (hcp->hcd.ops->mute_stream &&
(direction == SNDRV_PCM_STREAM_PLAYBACK ||
!hcp->hcd.ops->no_capture_mute))
!hcp->hcd.no_capture_mute))
return hcp->hcd.ops->mute_stream(dai->dev->parent,
hcp->hcd.data,
mute, direction);
Expand Down

0 comments on commit bb1d67b

Please sign in to comment.