All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: bridge: adv7511: Add set_jack handler
@ 2021-01-19  4:41   ` Jun Nie
  0 siblings, 0 replies; 6+ messages in thread
From: Jun Nie @ 2021-01-19  4:41 UTC (permalink / raw)
  To: a.hajda, john.stultz
  Cc: architt, lars, kuninori.morimoto.gx, airlied, broonie,
	alsa-devel, dri-devel, robh+dt, bogdan.togorean

With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
failure if set_jack handler is missing. Add set_jack handler to resolve
this failure.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
index f101dd2819b5..16de1a8ca7a0 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
@@ -217,22 +217,35 @@ static int adv7511_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
 	return -EINVAL;
 }
 
+static int adv7511_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
+					    hdmi_codec_plugged_cb fn,
+					    struct device *codec_dev)
+{
+	struct adv7511 *adv7511 = data;
+	bool plugged = adv7511->connector.status == connector_status_connected;
+
+	fn(codec_dev, plugged);
+	return 0;
+}
+
 static const struct hdmi_codec_ops adv7511_codec_ops = {
 	.hw_params	= adv7511_hdmi_hw_params,
 	.audio_shutdown = audio_shutdown,
 	.audio_startup	= audio_startup,
 	.get_dai_id	= adv7511_hdmi_i2s_get_dai_id,
-};
-
-static const struct hdmi_codec_pdata codec_data = {
-	.ops = &adv7511_codec_ops,
-	.max_i2s_channels = 2,
-	.i2s = 1,
-	.spdif = 1,
+	.hook_plugged_cb = adv7511_hdmi_i2s_hook_plugged_cb,
 };
 
 int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511)
 {
+	struct hdmi_codec_pdata codec_data = {
+		.ops = &adv7511_codec_ops,
+		.max_i2s_channels = 2,
+		.i2s = 1,
+		.spdif = 1,
+		.data = adv7511,
+	};
+
 	adv7511->audio_pdev = platform_device_register_data(dev,
 					HDMI_CODEC_DRV_NAME,
 					PLATFORM_DEVID_AUTO,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm: bridge: adv7511: Add set_jack handler
@ 2021-01-19  4:41   ` Jun Nie
  0 siblings, 0 replies; 6+ messages in thread
From: Jun Nie @ 2021-01-19  4:41 UTC (permalink / raw)
  To: a.hajda, john.stultz
  Cc: architt, kuninori.morimoto.gx, airlied, broonie, alsa-devel,
	dri-devel, robh+dt, bogdan.togorean

With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
failure if set_jack handler is missing. Add set_jack handler to resolve
this failure.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
index f101dd2819b5..16de1a8ca7a0 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
@@ -217,22 +217,35 @@ static int adv7511_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
 	return -EINVAL;
 }
 
+static int adv7511_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
+					    hdmi_codec_plugged_cb fn,
+					    struct device *codec_dev)
+{
+	struct adv7511 *adv7511 = data;
+	bool plugged = adv7511->connector.status == connector_status_connected;
+
+	fn(codec_dev, plugged);
+	return 0;
+}
+
 static const struct hdmi_codec_ops adv7511_codec_ops = {
 	.hw_params	= adv7511_hdmi_hw_params,
 	.audio_shutdown = audio_shutdown,
 	.audio_startup	= audio_startup,
 	.get_dai_id	= adv7511_hdmi_i2s_get_dai_id,
-};
-
-static const struct hdmi_codec_pdata codec_data = {
-	.ops = &adv7511_codec_ops,
-	.max_i2s_channels = 2,
-	.i2s = 1,
-	.spdif = 1,
+	.hook_plugged_cb = adv7511_hdmi_i2s_hook_plugged_cb,
 };
 
 int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511)
 {
+	struct hdmi_codec_pdata codec_data = {
+		.ops = &adv7511_codec_ops,
+		.max_i2s_channels = 2,
+		.i2s = 1,
+		.spdif = 1,
+		.data = adv7511,
+	};
+
 	adv7511->audio_pdev = platform_device_register_data(dev,
 					HDMI_CODEC_DRV_NAME,
 					PLATFORM_DEVID_AUTO,
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: bridge: adv7511: Add set_jack handler
  2021-01-19  4:41   ` Jun Nie
@ 2021-02-01 13:32     ` Jun Nie
  -1 siblings, 0 replies; 6+ messages in thread
From: Jun Nie @ 2021-02-01 13:32 UTC (permalink / raw)
  To: a.hajda, John Stultz
  Cc: alsa-devel, Lars-Peter Clausen, kuninori.morimoto.gx, airlied,
	Mark Brown, dri-devel, Rob Herring, bogdan.togorean

Jun Nie <jun.nie@linaro.org> 于2021年1月19日周二 下午12:42写道:
>
> With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
> failure if set_jack handler is missing. Add set_jack handler to resolve
> this failure.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
>  1 file changed, 20 insertions(+), 7 deletions(-)
>

Does anyone have comments on this patch?

Thanks!
Jun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: bridge: adv7511: Add set_jack handler
@ 2021-02-01 13:32     ` Jun Nie
  0 siblings, 0 replies; 6+ messages in thread
From: Jun Nie @ 2021-02-01 13:32 UTC (permalink / raw)
  To: a.hajda, John Stultz
  Cc: alsa-devel, kuninori.morimoto.gx, airlied, Mark Brown, dri-devel,
	Rob Herring, bogdan.togorean

Jun Nie <jun.nie@linaro.org> 于2021年1月19日周二 下午12:42写道:
>
> With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
> failure if set_jack handler is missing. Add set_jack handler to resolve
> this failure.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
>  1 file changed, 20 insertions(+), 7 deletions(-)
>

Does anyone have comments on this patch?

Thanks!
Jun
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: bridge: adv7511: Add set_jack handler
  2021-01-19  4:41   ` Jun Nie
@ 2021-02-04 18:49     ` Andrzej Hajda
  -1 siblings, 0 replies; 6+ messages in thread
From: Andrzej Hajda @ 2021-02-04 18:49 UTC (permalink / raw)
  To: Jun Nie, john.stultz
  Cc: architt, kuninori.morimoto.gx, airlied, alsa-devel, dri-devel,
	robh+dt, broonie, bogdan.togorean


W dniu 19.01.2021 o 05:41, Jun Nie pisze:
> With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
> failure if set_jack handler is missing. Add set_jack handler to resolve
> this failure.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>   .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
>   1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> index f101dd2819b5..16de1a8ca7a0 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> @@ -217,22 +217,35 @@ static int adv7511_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
>   	return -EINVAL;
>   }
>   
> +static int adv7511_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
> +					    hdmi_codec_plugged_cb fn,
> +					    struct device *codec_dev)
> +{
> +	struct adv7511 *adv7511 = data;
> +	bool plugged = adv7511->connector.status == connector_status_connected;

Maybe some locking, to protect access to adv7511->connector.status.

> +
> +	fn(codec_dev, plugged);
> +	return 0;
> +}
> +
>   static const struct hdmi_codec_ops adv7511_codec_ops = {
>   	.hw_params	= adv7511_hdmi_hw_params,
>   	.audio_shutdown = audio_shutdown,
>   	.audio_startup	= audio_startup,
>   	.get_dai_id	= adv7511_hdmi_i2s_get_dai_id,
> -};
> -
> -static const struct hdmi_codec_pdata codec_data = {
> -	.ops = &adv7511_codec_ops,
> -	.max_i2s_channels = 2,
> -	.i2s = 1,
> -	.spdif = 1,
> +	.hook_plugged_cb = adv7511_hdmi_i2s_hook_plugged_cb,
>   };
>   
>   int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511)
>   {
> +	struct hdmi_codec_pdata codec_data = {


I think const modifier should be OK here.


Regards

Andrzej


> +		.ops = &adv7511_codec_ops,
> +		.max_i2s_channels = 2,
> +		.i2s = 1,
> +		.spdif = 1,
> +		.data = adv7511,
> +	};
> +
>   	adv7511->audio_pdev = platform_device_register_data(dev,
>   					HDMI_CODEC_DRV_NAME,
>   					PLATFORM_DEVID_AUTO,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: bridge: adv7511: Add set_jack handler
@ 2021-02-04 18:49     ` Andrzej Hajda
  0 siblings, 0 replies; 6+ messages in thread
From: Andrzej Hajda @ 2021-02-04 18:49 UTC (permalink / raw)
  To: Jun Nie, john.stultz
  Cc: architt, kuninori.morimoto.gx, airlied, alsa-devel, dri-devel,
	robh+dt, broonie, bogdan.togorean


W dniu 19.01.2021 o 05:41, Jun Nie pisze:
> With commit 55c5cc63ab, the hdmi_codec_set_jack() will report unsupport
> failure if set_jack handler is missing. Add set_jack handler to resolve
> this failure.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>   .../gpu/drm/bridge/adv7511/adv7511_audio.c    | 27 ++++++++++++++-----
>   1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> index f101dd2819b5..16de1a8ca7a0 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
> @@ -217,22 +217,35 @@ static int adv7511_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
>   	return -EINVAL;
>   }
>   
> +static int adv7511_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
> +					    hdmi_codec_plugged_cb fn,
> +					    struct device *codec_dev)
> +{
> +	struct adv7511 *adv7511 = data;
> +	bool plugged = adv7511->connector.status == connector_status_connected;

Maybe some locking, to protect access to adv7511->connector.status.

> +
> +	fn(codec_dev, plugged);
> +	return 0;
> +}
> +
>   static const struct hdmi_codec_ops adv7511_codec_ops = {
>   	.hw_params	= adv7511_hdmi_hw_params,
>   	.audio_shutdown = audio_shutdown,
>   	.audio_startup	= audio_startup,
>   	.get_dai_id	= adv7511_hdmi_i2s_get_dai_id,
> -};
> -
> -static const struct hdmi_codec_pdata codec_data = {
> -	.ops = &adv7511_codec_ops,
> -	.max_i2s_channels = 2,
> -	.i2s = 1,
> -	.spdif = 1,
> +	.hook_plugged_cb = adv7511_hdmi_i2s_hook_plugged_cb,
>   };
>   
>   int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511)
>   {
> +	struct hdmi_codec_pdata codec_data = {


I think const modifier should be OK here.


Regards

Andrzej


> +		.ops = &adv7511_codec_ops,
> +		.max_i2s_channels = 2,
> +		.i2s = 1,
> +		.spdif = 1,
> +		.data = adv7511,
> +	};
> +
>   	adv7511->audio_pdev = platform_device_register_data(dev,
>   					HDMI_CODEC_DRV_NAME,
>   					PLATFORM_DEVID_AUTO,
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-04 18:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210119083817eucas1p2076a221a3d70372fb1a7dc55ed9b2ac3@eucas1p2.samsung.com>
2021-01-19  4:41 ` [PATCH] drm: bridge: adv7511: Add set_jack handler Jun Nie
2021-01-19  4:41   ` Jun Nie
2021-02-01 13:32   ` Jun Nie
2021-02-01 13:32     ` Jun Nie
2021-02-04 18:49   ` Andrzej Hajda
2021-02-04 18:49     ` Andrzej Hajda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.