asahi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Martin Povišer" <povik+lin@cutebit.org>
To: Mark Brown <broonie@kernel.org>
Cc: "Liam Girdwood" <lgirdwood@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Nuno Sá" <nuno.sa@analog.com>,
	asahi@lists.linux.dev, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: ssm3515: Add new amp driver
Date: Wed, 10 May 2023 08:23:34 +0200	[thread overview]
Message-ID: <EA5B2980-917F-4F82-9302-F880B1B97ECD@cutebit.org> (raw)
In-Reply-To: <ZFr+e+bM86Rwj2LH@finisterre.sirena.org.uk>


> On 10. 5. 2023, at 4:16, Mark Brown <broonie@kernel.org> wrote:
> 
> On Tue, May 09, 2023 at 06:38:28PM +0200, Martin Povišer wrote:
> 
>> +static int ssm3515_setup(struct snd_soc_component *component)
>> +{
>> +	struct ssm3515_data *data =
>> +			snd_soc_component_get_drvdata(component);
>> +	int ret;
>> +
>> +	ret = snd_soc_component_update_bits(component, SSM3515_GEC,
>> +			SSM3515_GEC_ANA_GAIN,
>> +			FIELD_PREP(SSM3515_GEC_ANA_GAIN, data->ana_gain));
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	/* Start out muted */
>> +	ret = snd_soc_component_update_bits(component, SSM3515_DAC,
>> +			SSM3515_DAC_MUTE, SSM3515_DAC_MUTE);
>> +	if (ret < 0)
>> +		return ret;
> 
> Why are we not using the chip defaults here?  We use those for most
> things as what's appropraite for one user might not be appropriate for
> another and it's easier to agree to follow what the chip does than to
> select things.  There's some exceptions like for zero cross options but
> not typically for gains and mutes.

This bit is controlled by the mute DAI op, where it is expected the
component starts out muted. The datasheet promises pop-free experience
if this bit is sequenced with the disablement of clocks, so it seems
like a good fit for said op.

>> +static int ssm3515_probe(struct snd_soc_component *component)
>> +{
>> +	struct ssm3515_data *data =
>> +			snd_soc_component_get_drvdata(component);
>> +	int ret;
>> +
>> +	ret = ssm3515_reset(component);
>> +	if (ret < 0)
>> +		return ret;
>> +	regmap_reinit_cache(data->regmap, &ssm3515_i2c_regmap);
>> +
>> +	return ssm3515_setup(component);
>> +}
> 
> We don't normally reset things on component probe, only on bus level
> probe...

I don’t think I have a strong reason to do this.


  reply	other threads:[~2023-05-10  6:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 16:38 [PATCH 1/2] ASoC: dt-bindings: Add adi,ssm3515 amp schema Martin Povišer
2023-05-09 16:38 ` [PATCH 2/2] ASoC: ssm3515: Add new amp driver Martin Povišer
2023-05-10  2:16   ` Mark Brown
2023-05-10  6:23     ` Martin Povišer [this message]
2023-05-09 18:25 ` [PATCH 1/2] ASoC: dt-bindings: Add adi,ssm3515 amp schema Conor Dooley
2023-05-09 19:38   ` Martin Povišer
2023-05-10  2:10     ` Mark Brown
2023-05-10  7:51   ` Krzysztof Kozlowski
2023-05-11  1:11     ` Mark Brown
2023-05-10  7:51 ` Krzysztof Kozlowski
2023-05-10  8:15   ` Martin Povišer
2023-05-10  8:23     ` Krzysztof Kozlowski
2023-05-10  8:29       ` Martin Povišer
2023-05-10  8:30         ` Krzysztof Kozlowski

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=EA5B2980-917F-4F82-9302-F880B1B97ECD@cutebit.org \
    --to=povik+lin@cutebit.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=asahi@lists.linux.dev \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).