[alsa-devel] [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver

Jyri Sarha jsarha at ti.com
Fri Jun 27 17:33:21 CEST 2014


On 06/27/2014 02:39 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
>> +	/* drvdata is only used by HDMI audio */
>> +	hdmi.audio.hdmi_lock = &hdmi.lock;
>> +	hdmi.audio.wp = &hdmi.wp;
>> +	hdmi.audio.core = &hdmi.core;
>> +	hdmi.audio.cfg = &hdmi.cfg;
>> +	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
>> +	hdmi.audio.audio_start = hdmi4_audio_start;
>> +	hdmi.audio.audio_stop = hdmi4_audio_stop;
>> +	hdmi.audio.audio_config = hdmi4_audio_config;
>> +	dev_set_drvdata(&pdev->dev, &hdmi.audio);
>> +	r = hdmi_audio_register(pdev);
>> +	if (r) {
>> +		DSSERR("Registering HDMI audio failed\n");
>> +		hdmi_uninit_output(pdev);
>> +		pm_runtime_disable(&pdev->dev);
>> +		return r;
>> +	}
>> +#endif
>
> I don't think it's a good idea to reserve the driver data for audio. We
> need to change the hdmi drivers sooner or later to support multiple
> instances, and at that point having drvdata for audio will cause problems.
>
> If you don't want to make the hdmi struct public yet, maybe just add a
> function to this file which takes a pointer to the hdmi struct and
> returns the audio part. That way you can set the whole hdmi struct as
> driver data, which should be future safe.
>

Adding a function is not as simple as that because the OMAP4 and OMAP5 
structs are subtly different and hdmi_audio.c is common to both. I'll 
make the minimal changes to make the struct public.

Cheers,
Jyri


More information about the Alsa-devel mailing list