Re: [PATCH 1/4] ASoC: hdmi-codec: Add an op to set callback function for plug event
From: Tzung-Bi Shih
Date: Fri Jul 05 2019 - 03:08:53 EST
On Fri, Jul 5, 2019 at 12:26 PM Cheng-Yi Chiang <cychiang@xxxxxxxxxxxx> wrote:
> diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
> index 7fea496f1f34..26c02abb8eba 100644
> --- a/include/sound/hdmi-codec.h
> +++ b/include/sound/hdmi-codec.h
> @@ -47,6 +47,9 @@ struct hdmi_codec_params {
> int channels;
> };
>
> +typedef void (*hdmi_codec_plugged_cb)(struct platform_device *dev,
> + bool plugged);
> +
The callback prototype is "weird" by struct platform_device. Is it
possible to having snd_soc_component instead of platform_device?
> struct hdmi_codec_pdata;
> struct hdmi_codec_ops {
> /*
> @@ -88,6 +91,13 @@ struct hdmi_codec_ops {
> */
> int (*get_dai_id)(struct snd_soc_component *comment,
> struct device_node *endpoint);
> +
> + /*
> + * Hook callback function to handle connector plug event.
> + * Optional
> + */
> + int (*hook_plugged_cb)(struct device *dev, void *data,
> + hdmi_codec_plugged_cb fn);
> };
The first parameter dev could be removed. Not used.