From: Mircea <mircea.caprioru@xxxxxxxxxx>
This patch adds the posibility do read and write registers from userspace
using the kernel debug direct register access option.
[...]
Signed-off-by: Mircea Caprioru <mircea.caprioru@xxxxxxxxxx>
+static int ad7124_reg_access(struct iio_dev *indio_dev,
+ unsigned int reg,
+ unsigned int writeval,
+ unsigned int *readval)
+{
+ struct ad7124_state *st = iio_priv(indio_dev);
+ int ret;
+
+
+ if (readval)
+ ret = ad_sd_read_reg(&st->sd, reg, ad7124_reg_size[reg],
+ readval);
+ else
+ ret = ad_sd_write_reg(&st->sd, reg, ad7124_reg_size[reg],
+ writeval);