mbox series

[0/6] ASoC: mediatek: mt8183: support DP audio

Message ID 20191022114505.196852-1-tzungbi@google.com
Headers show
Series ASoC: mediatek: mt8183: support DP audio | expand

Message

Tzung-Bi Shih Oct. 22, 2019, 11:44 a.m. UTC
(This series depends on https://lore.kernel.org/patchwork/patch/1126819/
 which has not applied to the maintainer's tree yet.)

This series makes mt8183-mt6358-ts3a227-max98357 support DP (display port)
audio output.

ASoC: hdmi-codec: add PCM trigger operator
- add a PCM trigger callback if codec driver is interested in PCM events.

drm: bridge: it6505: bridge to hdmi-codec
- add audio feature support of it6505.
- bridge to hdmi-codec so that ASoC can use the audio feature. 
- defer the "enabling" after receiving PCM START or RESUME event.

ASoC: dt-bindings: mt8183: add a property "mediatek,hdmi-codec"
ASoC: mediatek: mt8183: use hdmi-codec
- bind to hdmi-codec in mt8183-mt6358-ts3a227-max98357.

drm: bridge: it6505: report connector status
ASoC: mediatek: mt8183: support HDMI jack reporting
- use the mechanism from the following patch
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-September/155302.html
  to report jack status (from DRM to ASoC).

Allen Chen (1):
  drm: bridge: it6505: bridge to hdmi-codec

Tzung-Bi Shih (5):
  ASoC: hdmi-codec: add PCM trigger operator
  ASoC: dt-bindings: mt8183: add a property "mediatek,hdmi-codec"
  ASoC: mediatek: mt8183: use hdmi-codec
  drm: bridge: it6505: report connector status
  ASoC: mediatek: mt8183: support HDMI jack reporting

 .../sound/mt8183-mt6358-ts3a227-max98357.txt  |   2 +
 drivers/gpu/drm/bridge/ite-it6505.c           | 191 +++++++++++++++++-
 include/sound/hdmi-codec.h                    |  13 ++
 sound/soc/codecs/hdmi-codec.c                 |  31 +++
 sound/soc/mediatek/Kconfig                    |   3 +-
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   |  36 +++-
 6 files changed, 266 insertions(+), 10 deletions(-)

Comments

Allen-KH Cheng (程冠勳) Nov. 24, 2022, 5:52 a.m. UTC | #1
Hi Tzung-Bi,

We would want to confirm with you as we work on the hdmi-codec for the
mt8186.

Do you have any plan to continue working on this series? We may take
over as well.

Thanks,
Allen

On Tue, 2019-10-22 at 19:45 +0800, Tzung-Bi Shih wrote:
> HDMI codec may be also interested in PCM triggers.  Add PCM trigger
> operator.
> 
> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> ---
>  include/sound/hdmi-codec.h    | 13 +++++++++++++
>  sound/soc/codecs/hdmi-codec.c | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
> index 83b17682e01c..9de462ef170d 100644
> --- a/include/sound/hdmi-codec.h
> +++ b/include/sound/hdmi-codec.h
> @@ -50,6 +50,13 @@ struct hdmi_codec_params {
>  typedef void (*hdmi_codec_plugged_cb)(struct device *dev,
>  				      bool plugged);
>  
> +enum {
> +	HDMI_CODEC_TRIGGER_EVENT_STOP,
> +	HDMI_CODEC_TRIGGER_EVENT_START,
> +	HDMI_CODEC_TRIGGER_EVENT_SUSPEND,
> +	HDMI_CODEC_TRIGGER_EVENT_RESUME,
> +};
> +
>  struct hdmi_codec_pdata;
>  struct hdmi_codec_ops {
>  	/*
> @@ -66,6 +73,12 @@ struct hdmi_codec_ops {
>  			 struct hdmi_codec_daifmt *fmt,
>  			 struct hdmi_codec_params *hparms);
>  
> +	/*
> +	 * PCM trigger callback.
> +	 * Optional
> +	 */
> +	int (*trigger)(struct device *dev, int event);
> +
>  	/*
>  	 * Shuts down the audio stream.
>  	 * Mandatory
> diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-
> codec.c
> index b5fd8f08726e..1ba2fa26ba03 100644
> --- a/sound/soc/codecs/hdmi-codec.c
> +++ b/sound/soc/codecs/hdmi-codec.c
> @@ -565,12 +565,42 @@ static int hdmi_codec_digital_mute(struct
> snd_soc_dai *dai, int mute)
>  	return 0;
>  }
>  
> +static int hdmi_codec_trigger(struct snd_pcm_substream *substream,
> int cmd,
> +			      struct snd_soc_dai *dai)
> +{
> +	struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
> +	int event;
> +
> +	if (!hcp->hcd.ops->trigger)
> +		return 0;
> +
> +	switch (cmd) {
> +	case SNDRV_PCM_TRIGGER_STOP:
> +		event = HDMI_CODEC_TRIGGER_EVENT_STOP;
> +		break;
> +	case SNDRV_PCM_TRIGGER_START:
> +		event = HDMI_CODEC_TRIGGER_EVENT_START;
> +		break;
> +	case SNDRV_PCM_TRIGGER_SUSPEND:
> +		event = HDMI_CODEC_TRIGGER_EVENT_SUSPEND;
> +		break;
> +	case SNDRV_PCM_TRIGGER_RESUME:
> +		event = HDMI_CODEC_TRIGGER_EVENT_RESUME;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	return hcp->hcd.ops->trigger(dai->dev->parent, event);
> +}
> +
>  static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = {
>  	.startup	= hdmi_codec_startup,
>  	.shutdown	= hdmi_codec_shutdown,
>  	.hw_params	= hdmi_codec_hw_params,
>  	.set_fmt	= hdmi_codec_i2s_set_fmt,
>  	.digital_mute	= hdmi_codec_digital_mute,
> +	.trigger	= hdmi_codec_trigger,
>  };
>  
>  static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
> @@ -578,6 +608,7 @@ static const struct snd_soc_dai_ops
> hdmi_codec_spdif_dai_ops = {
>  	.shutdown	= hdmi_codec_shutdown,
>  	.hw_params	= hdmi_codec_hw_params,
>  	.digital_mute	= hdmi_codec_digital_mute,
> +	.trigger	= hdmi_codec_trigger,
>  };
>  
>  #define HDMI_RATES	(SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
Tzung-Bi Shih Nov. 24, 2022, 9:54 a.m. UTC | #2
On Thu, Nov 24, 2022 at 1:52 PM Allen-KH Cheng (程冠勳)
<Allen-KH.Cheng@mediatek.com> wrote:
> We would want to confirm with you as we work on the hdmi-codec for the
> mt8186.
>
> Do you have any plan to continue working on this series? We may take
> over as well.

No (from testing's perspective).  Please take over it as you require.