[1/2] ASoC: hdmi-codec: Allow drivers to restrict sample sizes.

Message ID 20170717140227.17312-2-srinivas.kandagatla@linaro.org
State New
Headers show
Series
  • ASoC: hdmi-codec: Allow driver to restrict sample size
Related show

Commit Message

Srinivas Kandagatla July 17, 2017, 2:02 p.m.
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


Currently hdmi client drivers does have means to limit the
sample sizes that it can only support. Having formats parameter
option would solve this.

This issue was noticed on DB410c board when adv7511 hdmi codec driver
failed to play a 32 bits audio samples, as it does not support them.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 include/sound/hdmi-codec.h    | 1 +
 sound/soc/codecs/hdmi-codec.c | 3 +++
 2 files changed, 4 insertions(+)

-- 
2.11.0

Comments

Srinivas Kandagatla July 27, 2017, 12:04 p.m. | #1
On 27/07/17 11:34, Jyri Sarha wrote:
> On 07/17/17 17:02, srinivas.kandagatla@linaro.org wrote:

>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

>>

>> Currently hdmi client drivers does have means to limit the

>> sample sizes that it can only support. Having formats parameter

>> option would solve this.

>>

>> This issue was noticed on DB410c board when adv7511 hdmi codec driver

>> failed to play a 32 bits audio samples, as it does not support them.

>>

>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> 

> I left this feature out because I did not need it. All the HDMI encoders

> I have used are able to take all the i2s formats I am able to send.

> 

> You should probably also update the comment above I2S_FORMATS

> definition. Othewise:

Make sense, I will update it and send a v2 patch.


> 

> Reviewed-by: Jyri Sarha <jsarha@ti.com>


thanks
--srini
> 

> 

>> ---

>>   include/sound/hdmi-codec.h    | 1 +

>>   sound/soc/codecs/hdmi-codec.c | 3 +++

>>   2 files changed, 4 insertions(+)

>>

>> diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h

>> index 9483c55f871b..89fc4cce5785 100644

>> --- a/include/sound/hdmi-codec.h

>> +++ b/include/sound/hdmi-codec.h

>> @@ -104,6 +104,7 @@ struct hdmi_codec_pdata {

>>   	uint i2s:1;

>>   	uint spdif:1;

>>   	int max_i2s_channels;

>> +	u64 formats;

>>   	void *data;

>>   };

>>   

>> diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c

>> index 22ed0dc88f0a..1ece73f4be92 100644

>> --- a/sound/soc/codecs/hdmi-codec.c

>> +++ b/sound/soc/codecs/hdmi-codec.c

>> @@ -780,6 +780,9 @@ static int hdmi_codec_probe(struct platform_device *pdev)

>>   		hcp->daidrv[i] = hdmi_i2s_dai;

>>   		hcp->daidrv[i].playback.channels_max =

>>   			hcd->max_i2s_channels;

>> +

>> +		if (hcd->formats)

>> +			hcp->daidrv[i].playback.formats = hcd->formats;

>>   		i++;

>>   	}

>>   

>>

>

Patch

diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
index 9483c55f871b..89fc4cce5785 100644
--- a/include/sound/hdmi-codec.h
+++ b/include/sound/hdmi-codec.h
@@ -104,6 +104,7 @@  struct hdmi_codec_pdata {
 	uint i2s:1;
 	uint spdif:1;
 	int max_i2s_channels;
+	u64 formats;
 	void *data;
 };
 
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 22ed0dc88f0a..1ece73f4be92 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -780,6 +780,9 @@  static int hdmi_codec_probe(struct platform_device *pdev)
 		hcp->daidrv[i] = hdmi_i2s_dai;
 		hcp->daidrv[i].playback.channels_max =
 			hcd->max_i2s_channels;
+
+		if (hcd->formats)
+			hcp->daidrv[i].playback.formats = hcd->formats;
 		i++;
 	}