//val_count:要读写的寄存器数量intregmap_bulk_read(structregmap *map,unsignedintreg,void*val,size_tval_count);intregmap_bulk_write(structregmap *map,unsignedintreg,constvoid*val,size_tval_count) 3.3 regmap_config 掩码设置 结构体regmap_config里面有三个关于掩码的成员变量:read_flag_mask和write_flag...
接下来看一下 regmap_bulk_read 函数,此函数用于读取多个寄存器的值,函数原型如下: intregmap_bulk_read(structregmap*map,unsignedintreg,void*val,size_tval_count) 函数参数和返回值含义如下: map:要操作的 regmap。 reg:要读取的第一个寄存器。 val:读取到的数据缓冲区。 val_count:要读取的寄存器数量。 返回...
regmap_config结构体就是用来初始化regmap的,这个结构体也定义在include/linux/regmap.h 文件中,结构体内容如下: 示例代码55.1.2.2regmap_config结构体352structregmap_config{353constchar*name;354355intreg_bits;356intreg_stride;357intpad_bits;358intval_bits;359360bool(*writeable_reg)(structdevice*dev,unsignedi...
接下来看一下regmap_bulk_read 函数,此函数用于读取多个寄存器的值,函数原型如下: int regmap_bulk_read (structregmap* map , unsigned int reg, void *val, size_t val_count) 函数参数和返回值含义如下: map:要操作的 regmap。 reg:要读取的第一个寄存器。 val:读取到的数据缓冲区。 val_count:要读取的...
Linux引入regmap是为了统一管理内核的i2c,spi等总线,将i2c、spi驱动做了一次重构,把I/O读写的重复逻辑在regmap中实现。只需初始化时指定总线类型、寄存器位宽等关键参数,即可通过regmap模型接口来操作器件寄存器。 将i2c、spi、mmio、irq等抽象出统一接口regmap_read,regmap_write,regmap_update_bits等接口,从而提高代码...
intregmap_bulk_read(struct regmap*map,unsigned int reg,void*val,size_t val_count) 函数参数和返回值含义如下: map:要操作的 regmap。 reg:要读取的第一个寄存器。 val:读取到的数据缓冲区。 val_count:要读取的寄存器数量。 返回值:0,写成功;其他值,读失败。
5. regmap_bulk_read(struct regmap *map, int reg, void *val, size_t val_count); // 读取从reg开始之后val_count个寄存器的数据到val中 6. regmap_update_bits(struct regmap *map, int reg, int mask, int val); // 更新reg寄存器中mask指定的位 ...
result = regmap_bulk_read(dev->regmap, reg + ind, (u8 *)&d, 2); if (result) return -EINVAL; *val = (short)be16_to_cpup(&d); return IIO_VAL_INT; } /* * @description : 读取 ICM20608 陀螺仪、加速度计、温度通道值 * @param - indio_dev : iio 设备 ...
The NVIDIA kernel driver supports regmap() bulk writes to as many as 16 consecutive registers, which can reduce the number of I2C/SPI transactions. Consult the sensor vendor to be sure you can do this without affecting sensor operations. Request a longer delay for the capture en...
_regmap_read: _regmap_read 先拿到context,在以后的map->reg_read会用到 如果不是bypass的,调用regcache_read从cache中读 如果不能从cache中read到,调用map->reg_read regmap_config原型 在regmap_config,定义了寄存器的各种信息,比如寄存器地址长度,寄存器值的长度,读写寄存器的地址范围的信息,寄存器地址和值的大...