Skip to content

Commit bb1d67b

Browse files
committed
ASoC: hdmi-codec: move no_capture_mute to struct hdmi_codec_pdata
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 <[email protected]> Tested-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 6af45d7 commit bb1d67b

File tree

10 files changed

+10
-12
lines changed

10 files changed

+10
-12
lines changed

drivers/gpu/drm/bridge/ite-it66121.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,6 @@ static const struct hdmi_codec_ops it66121_audio_codec_ops = {
14661466
.audio_shutdown = it66121_audio_shutdown,
14671467
.mute_stream = it66121_audio_mute,
14681468
.get_eld = it66121_audio_get_eld,
1469-
.no_capture_mute = 1,
14701469
};
14711470

14721471
static int it66121_audio_codec_init(struct it66121_ctx *ctx, struct device *dev)
@@ -1476,6 +1475,7 @@ static int it66121_audio_codec_init(struct it66121_ctx *ctx, struct device *dev)
14761475
.i2s = 1, /* Only i2s support for now */
14771476
.spdif = 0,
14781477
.max_i2s_channels = 8,
1478+
.no_capture_mute = 1,
14791479
};
14801480

14811481
dev_dbg(dev, "%s\n", __func__);

drivers/gpu/drm/bridge/sii902x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ static const struct hdmi_codec_ops sii902x_audio_codec_ops = {
841841
.mute_stream = sii902x_audio_mute,
842842
.get_eld = sii902x_audio_get_eld,
843843
.get_dai_id = sii902x_audio_get_dai_id,
844-
.no_capture_mute = 1,
845844
};
846845

847846
static int sii902x_audio_codec_init(struct sii902x *sii902x,
@@ -864,6 +863,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
864863
.i2s = 1, /* Only i2s support for now. */
865864
.spdif = 0,
866865
.max_i2s_channels = 0,
866+
.no_capture_mute = 1,
867867
};
868868
u8 lanes[4];
869869
int num_lanes, i;

drivers/gpu/drm/exynos/exynos_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
16601660
.audio_shutdown = hdmi_audio_shutdown,
16611661
.mute_stream = hdmi_audio_mute,
16621662
.get_eld = hdmi_audio_get_eld,
1663-
.no_capture_mute = 1,
16641663
};
16651664

16661665
static int hdmi_register_audio_device(struct hdmi_context *hdata)
@@ -1669,6 +1668,7 @@ static int hdmi_register_audio_device(struct hdmi_context *hdata)
16691668
.ops = &audio_codec_ops,
16701669
.max_i2s_channels = 6,
16711670
.i2s = 1,
1671+
.no_capture_mute = 1,
16721672
};
16731673

16741674
hdata->audio.pdev = platform_device_register_data(

drivers/gpu/drm/i2c/tda998x_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
11651165
.audio_shutdown = tda998x_audio_shutdown,
11661166
.mute_stream = tda998x_audio_mute_stream,
11671167
.get_eld = tda998x_audio_get_eld,
1168-
.no_capture_mute = 1,
11691168
};
11701169

11711170
static int tda998x_audio_codec_init(struct tda998x_priv *priv,
@@ -1176,6 +1175,7 @@ static int tda998x_audio_codec_init(struct tda998x_priv *priv,
11761175
.max_i2s_channels = 2,
11771176
.no_i2s_capture = 1,
11781177
.no_spdif_capture = 1,
1178+
.no_capture_mute = 1,
11791179
};
11801180

11811181
if (priv->audio_port_enable[AUDIO_ROUTE_I2S])

drivers/gpu/drm/mediatek/mtk_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2615,7 +2615,6 @@ static const struct hdmi_codec_ops mtk_dp_audio_codec_ops = {
26152615
.audio_shutdown = mtk_dp_audio_shutdown,
26162616
.get_eld = mtk_dp_audio_get_eld,
26172617
.hook_plugged_cb = mtk_dp_audio_hook_plugged_cb,
2618-
.no_capture_mute = 1,
26192618
};
26202619

26212620
static int mtk_dp_register_audio_driver(struct device *dev)
@@ -2626,6 +2625,7 @@ static int mtk_dp_register_audio_driver(struct device *dev)
26262625
.max_i2s_channels = 8,
26272626
.i2s = 1,
26282627
.data = mtk_dp,
2628+
.no_capture_mute = 1,
26292629
};
26302630

26312631
mtk_dp->audio_pdev = platform_device_register_data(dev,

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ static const struct hdmi_codec_ops mtk_hdmi_audio_codec_ops = {
16601660
.mute_stream = mtk_hdmi_audio_mute,
16611661
.get_eld = mtk_hdmi_audio_get_eld,
16621662
.hook_plugged_cb = mtk_hdmi_audio_hook_plugged_cb,
1663-
.no_capture_mute = 1,
16641663
};
16651664

16661665
static int mtk_hdmi_register_audio_driver(struct device *dev)
@@ -1671,6 +1670,7 @@ static int mtk_hdmi_register_audio_driver(struct device *dev)
16711670
.max_i2s_channels = 2,
16721671
.i2s = 1,
16731672
.data = hdmi,
1673+
.no_capture_mute = 1,
16741674
};
16751675
struct platform_device *pdev;
16761676

drivers/gpu/drm/rockchip/cdn-dp-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
885885
.mute_stream = cdn_dp_audio_mute_stream,
886886
.get_eld = cdn_dp_audio_get_eld,
887887
.hook_plugged_cb = cdn_dp_audio_hook_plugged_cb,
888-
.no_capture_mute = 1,
889888
};
890889

891890
static int cdn_dp_audio_codec_init(struct cdn_dp_device *dp,
@@ -896,6 +895,7 @@ static int cdn_dp_audio_codec_init(struct cdn_dp_device *dp,
896895
.spdif = 1,
897896
.ops = &audio_codec_ops,
898897
.max_i2s_channels = 8,
898+
.no_capture_mute = 1,
899899
};
900900

901901
dp->audio_pdev = platform_device_register_data(

drivers/gpu/drm/sti/sti_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,6 @@ static const struct hdmi_codec_ops audio_codec_ops = {
12371237
.audio_shutdown = hdmi_audio_shutdown,
12381238
.mute_stream = hdmi_audio_mute,
12391239
.get_eld = hdmi_audio_get_eld,
1240-
.no_capture_mute = 1,
12411240
};
12421241

12431242
static int sti_hdmi_register_audio_driver(struct device *dev,
@@ -1247,6 +1246,7 @@ static int sti_hdmi_register_audio_driver(struct device *dev,
12471246
.ops = &audio_codec_ops,
12481247
.max_i2s_channels = 8,
12491248
.i2s = 1,
1249+
.no_capture_mute = 1,
12501250
};
12511251

12521252
DRM_DEBUG_DRIVER("\n");

include/sound/hdmi-codec.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ struct hdmi_codec_ops {
115115
int (*hook_plugged_cb)(struct device *dev, void *data,
116116
hdmi_codec_plugged_cb fn,
117117
struct device *codec_dev);
118-
119-
/* bit field */
120-
unsigned int no_capture_mute:1;
121118
};
122119

123120
/* HDMI codec initalization data */
@@ -129,6 +126,7 @@ struct hdmi_codec_pdata {
129126
uint spdif:1;
130127
uint no_spdif_playback:1;
131128
uint no_spdif_capture:1;
129+
uint no_capture_mute:1;
132130
int max_i2s_channels;
133131
void *data;
134132
};

sound/soc/codecs/hdmi-codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction)
714714
*/
715715
if (hcp->hcd.ops->mute_stream &&
716716
(direction == SNDRV_PCM_STREAM_PLAYBACK ||
717-
!hcp->hcd.ops->no_capture_mute))
717+
!hcp->hcd.no_capture_mute))
718718
return hcp->hcd.ops->mute_stream(dai->dev->parent,
719719
hcp->hcd.data,
720720
mute, direction);

0 commit comments

Comments
 (0)