Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Paul Handrigan <paulha@opensource.cirrus.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: <broonie@kernel.org>, <lgirdwood@gmail.com>,
	<linux-sound@vger.kernel.org>, <patches@opensource.cirrus.com>,
	<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/2] ASoC: cs530x: Support for cs530x ADCs
Date: Thu, 13 Jun 2024 17:55:16 +0000	[thread overview]
Message-ID: <ZmsyhKiuRI1Dg8l4@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <9876e617-68d1-4e1c-ba9e-2c235a57b0a9@kernel.org>

On Mon, Jun 10, 2024 at 10:46:26AM +0200, Krzysztof Kozlowski wrote:
> > +
> > +	cs530x = devm_kzalloc(&client->dev, sizeof(struct cs530x_priv),
> 
> sizeof(*)
> 
Ack

> > +
> > +	if (client->dev.of_node) {
> > +		const struct of_device_id *match;
> > +
> > +		match = of_match_node(cs530x_of_match, client->dev.of_node);
> > +		if (match == NULL)
> > +			return -EINVAL;
> > +		cs530x->devtype = (enum cs530x_type)match->data;
> 
> I think you open-coded device_get_match_data
> 
> 
> > +	} else {
> > +		const struct i2c_device_id *id =
> > +			i2c_match_id(cs530x_i2c_id, client);
> > +
> > +		cs530x->devtype = id->driver_data;
> > +	}
> 
> and for all of this there is a helper i2c_get_device_match_data.
> 
Ack

> > +	if (ret != 0) {
> > +		dev_err(dev, "Failed to request supplies: %d\n", ret);
> 
> return dev_err_probe()
Ack

> > +	if (ret != 0) {
> > +		dev_err(dev, "Failed to enable supplies: %d\n", ret);
> 
> return dev_err_probe()
Ack

> > +	if (IS_ERR(cs530x->reset_gpio)) {
> > +		dev_err(dev, "Reset gpio not available\n");
> 
> return dev_err_probe()
Ack

> > +
> > +	if (cs530x->reset_gpio) {
> > +		usleep_range(2000, 2100);
> > +		gpiod_set_value_cansleep(cs530x->reset_gpio, 1);
> 
> 1 is to keep device in reset? This looks like you are using logical
> values inverted.
Thanks.  The reset pin is active low. I will also change the dt binding
example to reflect that.

> > +
> > +	cs530x->dev_dai = devm_kmemdup(dev, &cs530x_dai,
> > +					sizeof(struct snd_soc_dai_driver),
> 
> sizeof(*)
> 
Ack

Regards,
Paul

  reply	other threads:[~2024-06-13 17:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 20:27 [PATCH 0/2] Cirrus Logic family of ADCs Paul Handrigan
2024-06-07 20:27 ` [PATCH 1/2] ASoC: dt-bindings: cirrus,cs530x: Add initial DT binding Paul Handrigan
2024-06-10  8:48   ` Krzysztof Kozlowski
2024-06-07 20:27 ` [PATCH 2/2] ASoC: cs530x: Support for cs530x ADCs Paul Handrigan
2024-06-09  9:34   ` kernel test robot
2024-06-10  8:46   ` Krzysztof Kozlowski
2024-06-13 17:55     ` Paul Handrigan [this message]
2024-06-14  8:17       ` 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=ZmsyhKiuRI1Dg8l4@ediswmail9.ad.cirrus.com \
    --to=paulha@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox