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: ad7606: protect register access

Protect register (and bus) access from concurrent
read / write. Needed in the backend operating mode.

Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Link: https://patch.msgid.link/20250210-wip-bl-ad7606_add_backend_sw_mode-v4-7-160df18b1da7@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Angelo Dureghello and committed by
Jonathan Cameron
0f65f59e 79c47485

+10
+10
drivers/iio/adc/ad7606.c
··· 862 862 } 863 863 val = (val * MICRO) + val2; 864 864 i = find_closest(val, scale_avail_uv, cs->num_scales); 865 + 866 + ret = iio_device_claim_direct_mode(indio_dev); 867 + if (ret < 0) 868 + return ret; 865 869 ret = st->write_scale(indio_dev, ch, i + cs->reg_offset); 870 + iio_device_release_direct_mode(indio_dev); 866 871 if (ret < 0) 867 872 return ret; 868 873 cs->range = i; ··· 878 873 return -EINVAL; 879 874 i = find_closest(val, st->oversampling_avail, 880 875 st->num_os_ratios); 876 + 877 + ret = iio_device_claim_direct_mode(indio_dev); 878 + if (ret < 0) 879 + return ret; 881 880 ret = st->write_os(indio_dev, i); 881 + iio_device_release_direct_mode(indio_dev); 882 882 if (ret < 0) 883 883 return ret; 884 884 st->oversampling = st->oversampling_avail[i];