[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c5f776d-bf17-ea3d-a4ee-3ac54194a215@opensource.cirrus.com>
Date: Fri, 26 May 2023 13:20:32 +0100
From: Richard Fitzgerald <rf@...nsource.cirrus.com>
To: <Claudiu.Beznea@...rochip.com>, <tiwai@...e.com>,
<broonie@...nel.org>, <perex@...ex.cz>
CC: <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>,
<patches@...nsource.cirrus.com>, <simont@...nsource.cirrus.com>
Subject: Re: [PATCH 13/13] ALSA: hda/cs35l56: Add driver for Cirrus Logic
CS35L56 amplifier
On 26/5/23 05:40, Claudiu.Beznea@...rochip.com wrote:
> On 25.05.2023 18:06, Richard Fitzgerald wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> From: Simon Trimmer <simont@...nsource.cirrus.com>
>>
>> Add a driver for the Cirrus Logic CS35L56 amplifier. This uses the same
>> component binding API as the CS35L41 driver. This is not a standalone
>> HDA device; it provides control of the CS35L56 for systems that use a
>> combination of an HDA codec and CS35L56 amplifiers with audio routed
>> through the HDA codec.
>>
<SNIP>
>> +
>> + cs35l56->base.reset_gpio = devm_gpiod_get_index_optional(cs35l56->base.dev,
>> + "reset",
>> + cs35l56->index,
>> + GPIOD_OUT_LOW);
>> + if (IS_ERR(cs35l56->base.reset_gpio)) {
>
> devm_gpiod_get_index_optional() can also return NULL.
>
Yes, that is expected. It's optional. It's not an error.
In that case cs35l56->base.reset_gpio will already be NULL.
>> + ret = PTR_ERR(cs35l56->base.reset_gpio);
>> +
>> + /*
>> + * If RESET is shared the first amp to probe will grab the reset
>> + * line and reset all the amps
>> + */
>> + if (ret != -EBUSY)
>> + return dev_err_probe(cs35l56->base.dev, ret, "Failed to get reset GPIO\n");
>> +
>> + dev_info(cs35l56->base.dev, "Reset GPIO busy, assume shared reset\n");
>> + cs35l56->base.reset_gpio = NULL;
>> + }
>> +
>> + return 0;
>> +
>> +err:
>> + dev_err(cs35l56->base.dev, "Failed property %s: %d\n", property, ret);
>> +
>> + return ret;
>> +}
Powered by blists - more mailing lists