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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad7380: enable regmap cache

Enable regmap cache, to avoid useless access on spi bus.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20250108-ad7380-add-alert-support-v4-2-1751802471ba@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Julien Stephan and committed by
Jonathan Cameron
85e56052 39bc50e0

+18
+18
drivers/iio/adc/ad7380.c
··· 663 663 return 0; 664 664 } 665 665 666 + static const struct reg_default ad7380_reg_defaults[] = { 667 + { AD7380_REG_ADDR_ALERT_LOW_TH, 0x800 }, 668 + { AD7380_REG_ADDR_ALERT_HIGH_TH, 0x7FF }, 669 + }; 670 + 671 + static const struct regmap_range ad7380_volatile_reg_ranges[] = { 672 + regmap_reg_range(AD7380_REG_ADDR_CONFIG2, AD7380_REG_ADDR_ALERT), 673 + }; 674 + 675 + static const struct regmap_access_table ad7380_volatile_regs = { 676 + .yes_ranges = ad7380_volatile_reg_ranges, 677 + .n_yes_ranges = ARRAY_SIZE(ad7380_volatile_reg_ranges), 678 + }; 679 + 666 680 static const struct regmap_config ad7380_regmap_config = { 667 681 .reg_bits = 3, 668 682 .val_bits = 12, ··· 684 670 .reg_write = ad7380_regmap_reg_write, 685 671 .max_register = AD7380_REG_ADDR_ALERT_HIGH_TH, 686 672 .can_sleep = true, 673 + .reg_defaults = ad7380_reg_defaults, 674 + .num_reg_defaults = ARRAY_SIZE(ad7380_reg_defaults), 675 + .volatile_table = &ad7380_volatile_regs, 676 + .cache_type = REGCACHE_MAPLE, 687 677 }; 688 678 689 679 static int ad7380_debugfs_reg_access(struct iio_dev *indio_dev, u32 reg,