All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Schulman, James" <James.Schulman@cirrus.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"Austin, Brian" <Brian.Austin@cirrus.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"Handrigan, Paul" <Paul.Handrigan@cirrus.com>,
	"Schulman, James" <James.Schulman@cirrus.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>
Subject: Re: [PATCH v2 1/2] ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier
Date: Thu, 13 Dec 2018 22:47:56 +0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1812131641360.988@james-tower> (raw)
In-Reply-To: <20181212170741.GS16508@imbe.wolfsonmicro.main>



On Wed, 12 Dec 2018, Charles Keepax wrote:

> On Thu, Dec 06, 2018 at 03:04:46PM -0600, James Schulman wrote:
>> Add driver support for Cirrus Logic CS35L36 boosted
>> speaker amplifier
>>
>> Signed-off-by: James Schulman <james.schulman@cirrus.com>
>> ---
>
> Again just a couple of very minor nit picks from me.
>
>> +static int cs35l36_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
>> +				  unsigned int freq, int dir)
>> +{
>> +	struct snd_soc_component *component = dai->component;
>> +	struct cs35l36_private *cs35l36 =
>> +			snd_soc_component_get_drvdata(component);
>> +	int fs1, fs2, reg;
>> +
>> +	if (freq > CS35L36_FS_NOM_6MHZ) {
>> +		fs1 = CS35L36_FS1_DEFAULT_VAL;
>> +		fs2 = CS35L36_FS2_DEFAULT_VAL;
>> +	} else {
>> +		fs1 = 3 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4;
>> +		fs2 = 5 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4;
>> +	}
>> +
>> +	regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL,
>> +			CS35L36_TEST_UNLOCK1);
>> +	regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL,
>> +			CS35L36_TEST_UNLOCK2);
>> +
>> +	regmap_read(cs35l36->regmap, CS35L36_TST_FS_MON0, &reg);
>> +	reg &= ~(CS35L36_FS1_WINDOW_MASK | CS35L36_FS2_WINDOW_MASK);
>> +	reg |= ((fs1 & CS35L36_FS1_WINDOW_MASK) |
>> +		(fs2 << CS35L36_FS2_WINDOW_SHIFT & CS35L36_FS2_WINDOW_MASK));
>> +	regmap_write(cs35l36->regmap, CS35L36_TST_FS_MON0, reg);
>
> This is just open coding update_bits probably better to just use
> update_bits.
>

I did this because it's a register that we didn't want to be visible in 
userspace, but now I realize that just means it's precious. Will add it to 
the precious register list and resubmit.

>> +
>> +	regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL,
>> +			CS35L36_TEST_LOCK1);
>> +	regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL,
>> +			CS35L36_TEST_LOCK2);
>> +	return 0;
>> +}
>> +
>
>> +typedef char CS35L36_MAX_NUM_REGS[__LINE__];
>
> Not sure I am the greatest fan of this, is it perhaps just worth
> combining the tables file and the regular file? Then you don't
> need any fancyness.
>

Ya it's probably not worth trying to get fancy... I'll just nuke the 
tables file.

> Thanks,
> Charles
>

  reply	other threads:[~2018-12-13 22:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 21:04 [PATCH v2 1/2] ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier James Schulman
2018-12-06 21:04 ` [PATCH v2 2/2] ASoC: cs35l36: Add device tree documentation for CS35L36 James Schulman
2018-12-12 16:55   ` Charles Keepax
2018-12-12 17:07 ` [PATCH v2 1/2] ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier Charles Keepax
2018-12-13 22:47   ` Schulman, James [this message]
2019-02-06 19:06 James Schulman
2019-02-07 11:54 ` Charles Keepax
2019-02-07 17:26   ` Schulman, James

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=alpine.DEB.2.10.1812131641360.988@james-tower \
    --to=james.schulman@cirrus.com \
    --cc=Brian.Austin@cirrus.com \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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.