All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Mark Brown <broonie@kernel.org>
Cc: robh@kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, b.zolnierkie@samsung.com,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	inki.dae@samsung.com, ideal.song@samsung.com
Subject: Re: [PATCH v2 4/6] ASoC: max98504: Add max98504 speaker amplifier driver
Date: Tue, 28 Jun 2016 19:59:35 +0200	[thread overview]
Message-ID: <5772BB07.4000609@samsung.com> (raw)
In-Reply-To: <20160627163312.GB17217@sirena.org.uk>

On 06/27/2016 06:33 PM, Mark Brown wrote:
> On Thu, Jun 23, 2016 at 12:45:13PM +0200, Sylwester Nawrocki wrote:
> 
>> > +	/* Select analog input by default */
>> > +	regmap_write(map, MAX98504_REG_SPEAKER_SOURCE_SELECT, 0x1);
>
> This should be done by userspace configuration, just leave the chip at
> power on defaults.  This is policy so that we don't have people trying
> to patch their configurations into the kernel.

OK, I will remove this and update the UCM configuration files instead.

>> > +	/* Brownout protection enable */
>> > +	regmap_write(map, MAX98504_REG_PVDD_BROWNOUT_ENABLE, 0x1);
>> > +	/* Threshold 2.9V, 3dB speaker attenuation*/
>> > +	regmap_write(map, MAX98504_REG_PVDD_BROWNOUT_CONFIG(1), 0x33);
>> > +	/* Attack hold time 10 ms */
>> > +	regmap_write(map, MAX98504_REG_PVDD_BROWNOUT_CONFIG(2), 0x0a);
>> > +	/* Brownout hold time 255 ms, brownout release time 255 ms */
>> > +	regmap_write(map, MAX98504_REG_PVDD_BROWNOUT_CONFIG(3), 0xff);
>> > +	regmap_write(map, MAX98504_REG_PVDD_BROWNOUT_CONFIG(4), 0xff);
>
> Should these be DT properties?

I'm not sure, these properties define the speaker gain decrease pattern
during VBAT brownout, it seems a system integration detail and will most
likely differ from board to board.  I'd assume it's acceptable to put
these in DT, looking at other bindings.  I've prepared something like
this:

------8<--------
Optional properties:

- maxim,brownout-threshold - the VBAT brownout threshold, the value must be
  from 0, 1...21 range, corresponding to 2.6V, 2.65V...3.65V voltage range
- maxim,brownout-attenuation - the brownout attenuation to the speaker gain
  applied during the "attack hold" and "timed hold" phase, the value must be
  from 0...6 (dB) range
- maxim,brownout-attack-hold-ms - the brownout attack hold phase time in ms,
  0...255 (VBATBROWN_ATTK_HOLD, register 0x0018)
- maxim,brownout-timed-hold-ms - the brownout timed hold phase time in ms,
  0...255 (VBATBROWN_TIME_HOLD, register 0x0019)
- maxim,brownout-release-rate-ms - the brownout release phase step time in ms,
  0...255 (VBATBROWN_RELEASE, register 0x001A)

The default value when the above properties are not specified is 0,
the maxim,brownout-level property must be specified to actually enable
the VBAT brownout protection.
------8<--------

  reply	other threads:[~2016-06-28 17:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 10:45 [PATCH v2 0/6] Sound support for Exynos5433 TM2(E) boards Sylwester Nawrocki
     [not found] ` <1466678715-19962-1-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-23 10:45   ` [PATCH v2 1/6] ASoC: samsung: Add DT bindings documentation for LPASS Sylwester Nawrocki
2016-06-23 10:45   ` [PATCH v2 2/6] ASoC: samsung: Add Samsung Low Power Audio Subsystem driver Sylwester Nawrocki
     [not found]     ` <1466678715-19962-3-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-29 21:57       ` Mark Brown
2016-06-30 17:16         ` Sylwester Nawrocki
     [not found]           ` <577553FE.6080803-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-07-01 10:35             ` [alsa-devel] " Sylwester Nawrocki
2016-07-01 15:07           ` Mark Brown
2016-07-01 16:31             ` Sylwester Nawrocki
     [not found]               ` <57769AE5.4050407-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-07-02  8:25                 ` [alsa-devel] " Mark Brown
     [not found]                   ` <20160702082548.GF6247-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-07-04 16:16                     ` Sylwester Nawrocki
     [not found]                       ` <577A8BF7.8090900-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-07-05 14:25                         ` Mark Brown
     [not found]                           ` <20160705142524.GW6247-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-07-05 14:58                             ` Sylwester Nawrocki
2016-06-23 10:45   ` [PATCH v2 3/6] ASoC: Add DT bindings documentation for max98504 amplifier Sylwester Nawrocki
     [not found]     ` <1466678715-19962-4-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-28 20:55       ` Rob Herring
2016-06-23 10:45   ` [PATCH v2 4/6] ASoC: max98504: Add max98504 speaker amplifier driver Sylwester Nawrocki
     [not found]     ` <1466678715-19962-5-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-27 16:33       ` Mark Brown
2016-06-28 17:59         ` Sylwester Nawrocki [this message]
     [not found]           ` <5772BB07.4000609-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-28 19:31             ` [alsa-devel] " Mark Brown
2016-06-23 10:45   ` [PATCH v2 5/6] ASoC: samsung: Add DT bindings documentation for TM2 sound subsystem Sylwester Nawrocki
     [not found]     ` <1466678715-19962-6-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-28 20:55       ` Rob Herring
2016-06-23 10:45   ` [PATCH v2 6/6] ASoC: samsung: Add machine driver for Exynos5433 based TM2 board Sylwester Nawrocki

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=5772BB07.4000609@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ideal.song@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=robh@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.