public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: "Li.Xiubo@freescale.com" <Li.Xiubo@freescale.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"perex@perex.cz" <perex@perex.cz>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"tiwai@suse.de" <tiwai@suse.de>,
	"moinejf@free.fr" <moinejf@free.fr>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"kuninori.morimoto.gx@renesas.com"
	<kuninori.morimoto.gx@renesas.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2 1/4] ASoC: simple-card: add asoc_simple_card_fmt_master() to simplify the code.
Date: Wed, 3 Sep 2014 11:36:39 +0300	[thread overview]
Message-ID: <5406D317.5000403@ti.com> (raw)
In-Reply-To: <707d1400a4514be9b599d4b7a6449ba7@BY2PR0301MB0613.namprd03.prod.outlook.com>

On 09/03/2014 05:37 AM, Li.Xiubo@freescale.com wrote:
>> Subject: Re: [PATCHv2 1/4] ASoC: simple-card: add asoc_simple_card_fmt_master()
...
>>
>> This won't work. The logic for cpu node needs to be negated for codec node.
>>
>
> Yes, actually it should be.
>
> As my previous patches about this:
> ----
> Since from the DAI format micro SND_SOC_DAIFMT_CBx_CFx, the 'CBx'
> mean Codec's bit clock is as master/slave and the 'CFx' mean Codec's
> frame clock is as master/slave.
>
> So these same DAI formats should be informed to CPU and CODE DAIs at
> the same time. For the Codec driver will set the bit clock and frame
> clock as the DAI formats said, but for the CPU driver, if the the
> bit clock or frame clock is as Codec master, so it should be set CPU
> DAI device as bit clock or frame clock as slave, and vice versa.
>
> The old code will cause confusion, and we should be clear that the
> letter 'C' here mean to Codec.
> ----
>
> For the master format, no matter for CPU or CODEC, it always means Codec
> is master or slave for bit/frame clock, not means the local DAI device's
> bit/frame clock as master or slave.
>
> So your CPU DAI device driver should negate this locally as the existed
> Ones do.
>


Yes, but there is double negation in this patch. The switch-case
assignments depend on whether the bitclkmaster and framemaster
DT-node pointers are compared to a cpu-dai-node or
codec-dai-node. When your patch compares the codec-node, it does
the decisions like it was a cpu-node, which produces inverted CBM
and CFM setting.

However, Kurinori-san's patch fixes this problem because it just
uses the daifmt generated by comparing to codec node for both cpu
and codec nodes.

The reason why I did the comparison per node basis, was to make
the code more ready for tdm setups with multiple codecs on a same
wire. But writing code for something that is not really needed
yet is usually a bad idea, like it was this time too.

Kurinori-san's version of the fix should be fine and it cleans up
the code quite nicely.

Best regards,
Jyri


  reply	other threads:[~2014-09-03  8:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02  9:26 [PATCHv2 0/4] simple-card: simplify the code Xiubo Li
2014-09-02  9:26 ` [PATCHv2 1/4] ASoC: simple-card: add asoc_simple_card_fmt_master() to " Xiubo Li
2014-09-02 10:21   ` Varka Bhadram
2014-09-02 10:38     ` Jean-Francois Moine
2014-09-02 10:42       ` Varka Bhadram
2014-09-02 11:04         ` Takashi Iwai
2014-09-02 11:09         ` Jean-Francois Moine
2014-09-02 11:32           ` Jyri Sarha
2014-09-02 11:10   ` Jyri Sarha
2014-09-03  2:37     ` Li.Xiubo
2014-09-03  8:36       ` Jyri Sarha [this message]
2014-09-03  8:39         ` Li.Xiubo
2014-09-03  0:26   ` [alsa-devel] " Kuninori Morimoto
2014-09-03  2:21     ` Li.Xiubo
2014-09-03  3:36       ` Kuninori Morimoto
2014-09-03  3:41         ` Li.Xiubo
2014-09-03  3:37     ` Li.Xiubo
2014-09-03  4:13       ` Kuninori Morimoto
2014-09-03  5:33         ` Li.Xiubo
2014-09-03  6:48         ` Jean-Francois Moine
2014-09-02  9:26 ` [PATCHv2 2/4] ASoC: simple-card: Merge single and muti DAI link(s) code Xiubo Li
2014-09-02  9:26 ` [PATCHv2 3/4] ASoC: simple-card: Adjust the comments of simple card Xiubo Li
2014-09-02 10:44   ` Jean-Francois Moine
2014-09-03  1:55     ` Li.Xiubo
2014-09-03  2:14       ` [alsa-devel] " Kuninori Morimoto
2014-09-03  2:24         ` Li.Xiubo
2014-09-02  9:26 ` [PATCHv2 4/4] ASoC: simple-card: binding: update binding to support the new style Xiubo Li
2014-09-02 10:41   ` Jean-Francois Moine
2014-09-03  1:54     ` Li.Xiubo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5406D317.5000403@ti.com \
    --to=jsarha@ti.com \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=moinejf@free.fr \
    --cc=pawel.moll@arm.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox