Re: [PATCH] iio: magnetometer: mag3110: add optional vcc regulator operation support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Anson,

On Thu, Dec 6, 2018 at 3:05 AM Anson Huang <anson.huang@xxxxxxx> wrote:

>  static int mag3110_request(struct mag3110_data *data)
> @@ -469,17 +471,27 @@ static int mag3110_probe(struct i2c_client *client,
>         struct iio_dev *indio_dev;
>         int ret;
>
> +       indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
> +       if (!indio_dev)
> +               return -ENOMEM;
> +
> +       data = iio_priv(indio_dev);
> +
> +       data->vcc_reg = devm_regulator_get_optional(&client->dev, "vcc");
> +       if (!IS_ERR(data->vcc_reg)) {
> +               ret = regulator_enable(data->vcc_reg);
> +               if (ret) {
> +                       dev_err(&client->dev, "failed to enable VCC regulator\n");

Same comment as in the previous patch.

There is no VCC regulator as per the datasheet. There are VDD and
VDDIO power supplies, so better represent both and with the same name
they appear in the datasheet.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux