@@ -69,6 +69,7 @@ static int snd_proto_probe(struct platform_device *pdev)
struct device_node *bitclkmaster = NULL;
struct device_node *framemaster = NULL;
unsigned int dai_fmt;
+ unsigned int bit_frame;
int ret = 0;
if (!np) {
@@ -120,19 +121,18 @@ static int snd_proto_probe(struct platform_device *pdev)
dai->cpus->of_node = cpu_np;
dai->platforms->of_node = cpu_np;
- dai_fmt = snd_soc_of_parse_daifmt(np, NULL,
- &bitclkmaster, &framemaster);
+ bit_frame = snd_soc_daifmt_parse_clock_provider(np, NULL, &bitclkmaster, &framemaster);
if (bitclkmaster != framemaster) {
dev_err(&pdev->dev, "Must be the same bitclock and frame master\n");
return -EINVAL;
}
- if (bitclkmaster) {
- dai_fmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
- if (codec_np == bitclkmaster)
- dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
- else
- dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
- }
+ if (bitclkmaster)
+ bit_frame = ((codec_np == bitclkmaster) << 4) +
+ (codec_np == framemaster);
+
+ dai_fmt = snd_soc_daifmt_parse_format(np, NULL) |
+ snd_soc_daifmt_clock_provider_pickup(bit_frame);
+
of_node_put(bitclkmaster);
of_node_put(framemaster);
dai->dai_fmt = dai_fmt;