lkml.org 
[lkml]   [2023]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] leds: aw2013: Add vddio regulator
Hi!

> Some LEDs controllers are used with external pull-up for the interrupt
> line and the I2C lines, so we might need to enable a regulator to bring
> the lines into usable state. Otherwise, this might cause spurious
> interrupts and reading from I2C will fail.
>
> Implement support for "vddio-supply" that is enabled by the aw2013 driver
> so that the regulator gets enabled when needed.
>
> Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>

> @@ -348,16 +350,20 @@ static int aw2013_probe(struct i2c_client *client)
> goto error;
> }
>
> - chip->vcc_regulator = devm_regulator_get(&client->dev, "vcc");
> - ret = PTR_ERR_OR_ZERO(chip->vcc_regulator);
> - if (ret) {
> + chip->regulators[0].supply = "vcc";
> + chip->regulators[1].supply = "vddio";
> + ret = devm_regulator_bulk_get(&client->dev,
> + ARRAY_SIZE(chip->regulators),
> + chip->regulators);
> + if (ret < 0) {
> if (ret != -EPROBE_DEFER)
> dev_err(&client->dev,
> "Failed to request regulator: %d\n", ret);
> goto error;

Won't this cause failures when optional vddio is unavailable?

BR,
Pavel

--
People of Russia, stop Putin before his war on Ukraine escalates.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 01:15    [W:0.068 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site