All of lore.kernel.org
 help / color / mirror / Atom feed
From: Code Kipper <codekipper@gmail.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	"Andrea Venturi (pers)" <be17068@iperbole.bo.it>
Subject: Re: [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample
Date: Thu, 25 Jan 2018 10:03:51 +0100	[thread overview]
Message-ID: <CAEKpxB=5nd2fqpAJQ4L6EFqxCZ=pkCvE9v5EYUR=6BGVYbwp_g@mail.gmail.com> (raw)
In-Reply-To: <20180125084145.f4otos2kavo6rg7t@flea.lan>

On 25 January 2018 at 09:41, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 03:11:01PM +0100, codekipper@gmail.com wrote:
>> From: Marcus Cooper <codekipper@gmail.com>
>>
>> On the newer SoCs this is set by default to transfer a 0 after
>> each sample in each slot. Add the regmap field to configure this
>> and set it so that it pads the sample with 0s.
>>
>> Signed-off-by: Marcus Cooper <codekipper@gmail.com>
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 626679057d0f..9fda1240b717 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -139,6 +139,7 @@
>>   * @field_fmt_bclk: regmap field to set clk polarity.
>>   * @field_fmt_lrclk: regmap field to set frame polarity.
>>   * @field_fmt_mode: regmap field to set the operational mode.
>> + * @field_fmt_sext: regmap field to set the sign extension.
>>   * @field_txchanmap: location of the tx channel mapping register.
>>   * @field_rxchanmap: location of the rx channel mapping register.
>>   * @field_txchansel: location of the tx channel select bit fields.
>> @@ -164,6 +165,7 @@ struct sun4i_i2s_quirks {
>>       struct reg_field                field_fmt_bclk;
>>       struct reg_field                field_fmt_lrclk;
>>       struct reg_field                field_fmt_mode;
>> +     struct reg_field                field_fmt_sext;
>>       struct reg_field                field_txchanmap;
>>       struct reg_field                field_rxchanmap;
>>       struct reg_field                field_txchansel;
>> @@ -188,6 +190,7 @@ struct sun4i_i2s {
>>       struct regmap_field     *field_fmt_bclk;
>>       struct regmap_field     *field_fmt_lrclk;
>>       struct regmap_field     *field_fmt_mode;
>> +     struct regmap_field     *field_fmt_sext;
>>       struct regmap_field     *field_txchanmap;
>>       struct regmap_field     *field_rxchanmap;
>>       struct regmap_field     *field_txchansel;
>> @@ -358,6 +361,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>
>> +     /* Set sign extension to pad out LSB with 0 */
>> +     regmap_field_write(i2s->field_fmt_sext, 0);
>> +
>
> Your commit log seems to suggest that it's only relevant for the newer
> SoCs (which ones?), yet you enable it for all the supported
> ones. Either the code or the commit log should be adjusted to be
> consistent with the other.
ACK
Thanks,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Code Kipper <codekipper@gmail.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Andrea Venturi (pers)" <be17068@iperbole.bo.it>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	Mark Brown <broonie@kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample
Date: Thu, 25 Jan 2018 10:03:51 +0100	[thread overview]
Message-ID: <CAEKpxB=5nd2fqpAJQ4L6EFqxCZ=pkCvE9v5EYUR=6BGVYbwp_g@mail.gmail.com> (raw)
In-Reply-To: <20180125084145.f4otos2kavo6rg7t@flea.lan>

On 25 January 2018 at 09:41, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 03:11:01PM +0100, codekipper@gmail.com wrote:
>> From: Marcus Cooper <codekipper@gmail.com>
>>
>> On the newer SoCs this is set by default to transfer a 0 after
>> each sample in each slot. Add the regmap field to configure this
>> and set it so that it pads the sample with 0s.
>>
>> Signed-off-by: Marcus Cooper <codekipper@gmail.com>
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 626679057d0f..9fda1240b717 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -139,6 +139,7 @@
>>   * @field_fmt_bclk: regmap field to set clk polarity.
>>   * @field_fmt_lrclk: regmap field to set frame polarity.
>>   * @field_fmt_mode: regmap field to set the operational mode.
>> + * @field_fmt_sext: regmap field to set the sign extension.
>>   * @field_txchanmap: location of the tx channel mapping register.
>>   * @field_rxchanmap: location of the rx channel mapping register.
>>   * @field_txchansel: location of the tx channel select bit fields.
>> @@ -164,6 +165,7 @@ struct sun4i_i2s_quirks {
>>       struct reg_field                field_fmt_bclk;
>>       struct reg_field                field_fmt_lrclk;
>>       struct reg_field                field_fmt_mode;
>> +     struct reg_field                field_fmt_sext;
>>       struct reg_field                field_txchanmap;
>>       struct reg_field                field_rxchanmap;
>>       struct reg_field                field_txchansel;
>> @@ -188,6 +190,7 @@ struct sun4i_i2s {
>>       struct regmap_field     *field_fmt_bclk;
>>       struct regmap_field     *field_fmt_lrclk;
>>       struct regmap_field     *field_fmt_mode;
>> +     struct regmap_field     *field_fmt_sext;
>>       struct regmap_field     *field_txchanmap;
>>       struct regmap_field     *field_rxchanmap;
>>       struct regmap_field     *field_txchansel;
>> @@ -358,6 +361,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>
>> +     /* Set sign extension to pad out LSB with 0 */
>> +     regmap_field_write(i2s->field_fmt_sext, 0);
>> +
>
> Your commit log seems to suggest that it's only relevant for the newer
> SoCs (which ones?), yet you enable it for all the supported
> ones. Either the code or the commit log should be adjusted to be
> consistent with the other.
ACK
Thanks,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: codekipper@gmail.com (Code Kipper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample
Date: Thu, 25 Jan 2018 10:03:51 +0100	[thread overview]
Message-ID: <CAEKpxB=5nd2fqpAJQ4L6EFqxCZ=pkCvE9v5EYUR=6BGVYbwp_g@mail.gmail.com> (raw)
In-Reply-To: <20180125084145.f4otos2kavo6rg7t@flea.lan>

On 25 January 2018 at 09:41, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 03:11:01PM +0100, codekipper at gmail.com wrote:
>> From: Marcus Cooper <codekipper@gmail.com>
>>
>> On the newer SoCs this is set by default to transfer a 0 after
>> each sample in each slot. Add the regmap field to configure this
>> and set it so that it pads the sample with 0s.
>>
>> Signed-off-by: Marcus Cooper <codekipper@gmail.com>
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 626679057d0f..9fda1240b717 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -139,6 +139,7 @@
>>   * @field_fmt_bclk: regmap field to set clk polarity.
>>   * @field_fmt_lrclk: regmap field to set frame polarity.
>>   * @field_fmt_mode: regmap field to set the operational mode.
>> + * @field_fmt_sext: regmap field to set the sign extension.
>>   * @field_txchanmap: location of the tx channel mapping register.
>>   * @field_rxchanmap: location of the rx channel mapping register.
>>   * @field_txchansel: location of the tx channel select bit fields.
>> @@ -164,6 +165,7 @@ struct sun4i_i2s_quirks {
>>       struct reg_field                field_fmt_bclk;
>>       struct reg_field                field_fmt_lrclk;
>>       struct reg_field                field_fmt_mode;
>> +     struct reg_field                field_fmt_sext;
>>       struct reg_field                field_txchanmap;
>>       struct reg_field                field_rxchanmap;
>>       struct reg_field                field_txchansel;
>> @@ -188,6 +190,7 @@ struct sun4i_i2s {
>>       struct regmap_field     *field_fmt_bclk;
>>       struct regmap_field     *field_fmt_lrclk;
>>       struct regmap_field     *field_fmt_mode;
>> +     struct regmap_field     *field_fmt_sext;
>>       struct regmap_field     *field_txchanmap;
>>       struct regmap_field     *field_rxchanmap;
>>       struct regmap_field     *field_txchansel;
>> @@ -358,6 +361,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>>                                  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>
>> +     /* Set sign extension to pad out LSB with 0 */
>> +     regmap_field_write(i2s->field_fmt_sext, 0);
>> +
>
> Your commit log seems to suggest that it's only relevant for the newer
> SoCs (which ones?), yet you enable it for all the supported
> ones. Either the code or the commit log should be adjusted to be
> consistent with the other.
ACK
Thanks,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

  reply	other threads:[~2018-01-25  9:03 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 14:10 [PATCH 0/3] ASoC: sun4i-i2s: Updates to the driver codekipper
2018-01-24 14:10 ` codekipper at gmail.com
2018-01-24 14:10 ` codekipper-Re5JQEeQqe8AvxtiuMwx3w
2018-01-24 14:10 ` [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality codekipper
2018-01-24 14:10   ` codekipper at gmail.com
2018-01-24 14:10   ` codekipper-Re5JQEeQqe8AvxtiuMwx3w
2018-01-29  1:50   ` [linux-sunxi] " Chen-Yu Tsai
2018-01-29  1:50     ` Chen-Yu Tsai
2018-01-29  1:50     ` Chen-Yu Tsai
2018-01-29  7:34     ` [linux-sunxi] " Code Kipper
2018-01-29  7:34       ` Code Kipper
2018-01-29  7:34       ` Code Kipper
2018-01-29  7:38       ` Chen-Yu Tsai
2018-01-29  7:38         ` Chen-Yu Tsai
2018-01-29  7:38         ` Chen-Yu Tsai
2018-01-29  7:52         ` [linux-sunxi] " Code Kipper
2018-01-29  7:52           ` Code Kipper
2018-01-29  7:52           ` Code Kipper
2018-01-29  8:40         ` [linux-sunxi] " Maxime Ripard
2018-01-29  8:40           ` Maxime Ripard
2018-01-29  8:40           ` Maxime Ripard
2018-01-29 11:32       ` Mark Brown
2018-01-29 11:32         ` Mark Brown
2018-01-29 11:32         ` Mark Brown
2018-01-29 12:28         ` Code Kipper
2018-01-29 12:28           ` Code Kipper
2018-01-29 12:28           ` Code Kipper
2018-01-29 12:31           ` [linux-sunxi] " Mark Brown
2018-01-29 12:31             ` Mark Brown
2018-01-24 14:11 ` [PATCH 2/3] ASoC: sun4i-i2s: Do not divide clocks when slave codekipper
2018-01-24 14:11   ` codekipper at gmail.com
2018-01-24 14:11   ` codekipper-Re5JQEeQqe8AvxtiuMwx3w
2018-01-25  2:33   ` [linux-sunxi] " Chen-Yu Tsai
2018-01-25  2:33     ` Chen-Yu Tsai
2018-01-25  2:33     ` Chen-Yu Tsai
2018-01-24 14:11 ` [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample codekipper
2018-01-24 14:11   ` codekipper at gmail.com
2018-01-24 14:11   ` codekipper-Re5JQEeQqe8AvxtiuMwx3w
2018-01-24 17:41   ` Code Kipper
2018-01-24 17:41     ` Code Kipper
2018-01-24 17:41     ` Code Kipper
2018-01-25  8:41   ` Maxime Ripard
2018-01-25  8:41     ` Maxime Ripard
2018-01-25  8:41     ` Maxime Ripard
2018-01-25  9:03     ` Code Kipper [this message]
2018-01-25  9:03       ` Code Kipper
2018-01-25  9:03       ` Code Kipper

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='CAEKpxB=5nd2fqpAJQ4L6EFqxCZ=pkCvE9v5EYUR=6BGVYbwp_g@mail.gmail.com' \
    --to=codekipper@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=be17068@iperbole.bo.it \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@free-electrons.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.