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: dac: adi-axi-dac: support debugfs direct_reg_access

Make it possible to read/write registers on the backend using the
debugfs interface for it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806-dev-backend-dac-direct-reg-access-v1-1-b84a6e8ee8a0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sa and committed by
Jonathan Cameron
24a9453c 1e2ae3ce

+12
+12
drivers/iio/dac/adi-axi-dac.c
··· 507 507 return 0; 508 508 } 509 509 510 + static int axi_dac_reg_access(struct iio_backend *back, unsigned int reg, 511 + unsigned int writeval, unsigned int *readval) 512 + { 513 + struct axi_dac_state *st = iio_backend_get_priv(back); 514 + 515 + if (readval) 516 + return regmap_read(st->regmap, reg, readval); 517 + 518 + return regmap_write(st->regmap, reg, writeval); 519 + } 520 + 510 521 static const struct iio_backend_ops axi_dac_generic_ops = { 511 522 .enable = axi_dac_enable, 512 523 .disable = axi_dac_disable, ··· 528 517 .ext_info_get = axi_dac_ext_info_get, 529 518 .data_source_set = axi_dac_data_source_set, 530 519 .set_sample_rate = axi_dac_set_sample_rate, 520 + .debugfs_reg_access = iio_backend_debugfs_ptr(axi_dac_reg_access), 531 521 }; 532 522 533 523 static const struct iio_backend_info axi_dac_generic = {