Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: iio: admv1013: add vcc regulators

Add regulators for the VCC supplies of the admv1013.

The patch aims to align the implementation with the current admv1014
driver where all the VCC supplies are handled as regulators.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20230731094455.26742-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
320b92a4 eaf3ada8

+14
+14
drivers/iio/frequency/admv1013.c
··· 379 379 .debugfs_reg_access = &admv1013_reg_access, 380 380 }; 381 381 382 + static const char * const admv1013_vcc_regs[] = { 383 + "vcc-drv", "vcc2-drv", "vcc-vva", "vcc-amp1", "vcc-amp2", 384 + "vcc-env", "vcc-bg", "vcc-bg2", "vcc-mixer", "vcc-quad" 385 + }; 386 + 382 387 static int admv1013_freq_change(struct notifier_block *nb, unsigned long action, void *data) 383 388 { 384 389 struct admv1013_state *st = container_of(nb, struct admv1013_state, nb); ··· 558 553 if (IS_ERR(st->reg)) 559 554 return dev_err_probe(&spi->dev, PTR_ERR(st->reg), 560 555 "failed to get the common-mode voltage\n"); 556 + 557 + ret = devm_regulator_bulk_get_enable(&st->spi->dev, 558 + ARRAY_SIZE(admv1013_vcc_regs), 559 + admv1013_vcc_regs); 560 + if (ret) { 561 + dev_err_probe(&spi->dev, ret, 562 + "Failed to request VCC regulators\n"); 563 + return ret; 564 + } 561 565 562 566 return 0; 563 567 }