// 1.构建regmap_config结构staticconststructregmap_configmlx90632_regmap={// 寄存器地址位宽.reg_bits=16,// 寄存器值的位宽,必须填写.val_bits=16,// 可选,判断寄存器是否可写,可读,是否可缓冲等回调.volatile_table=&mlx90632_volatile_regs_tbl,.rd_table=&mlx90632_readable_regs_tbl,.wr_table=&mlx9...
// include/linux/regmap.hstructregmap_config{constchar*name;// 可选,寄存器名字intreg_bits;// 寄存器地址位宽,必须填写intreg_stride;// 寄存器操作宽度,比如为1时,所有寄存器可操作,为2时,只有2^n可操作intpad_bits;intval_bits;// 寄存器值的位宽,必须填写// 可选,判断寄存器是否可写,可读,是否可缓冲...
+static void regmap_field_init(struct regmap_field *rm_field, + struct regmap *regmap, struct reg_field reg_field) +{ + int field_bits = reg_field.msb - reg_field.lsb + 1; + rm_field->regmap = regmap; + rm_field->reg = reg_field.reg; + rm_field->shift = reg_field.lsb; ...
{ return regmap_update_bits_base(map, reg, mask, val, change, false, false); } static inline int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change) { return regmap_update_bits_base(map, reg, mask, val, change, ...
* @val_bits: Number of bits in a register value, mandatory. * * @writeable_reg: Optional callback returning true if the register * can be written to. If this field is NULL but wr_table * (see below) is not, the check is performed on such table ...
1、什么是 Regmap Linux 下大部分设备的驱动开发都是操作其内部寄存器,比如 I2C/SPI 设备的本质都是一样的,通过 I2C/SPI 接口读写芯片内部寄存器。...regmap 是 Linux 内核为了减少慢速 I/O 在驱动上的冗余开销,提供了一种通用的接口来操作硬件寄存器。...2、regmap 结构
player->valid_sel = regmap_field_alloc(regmap, regfield[1]);return0; } 开发者ID:AshishNamdev,项目名称:linux,代码行数:26,代码来源:uniperif_player.c 示例9: of_flash_probe_gemini ▲点赞 1▼ intof_flash_probe_gemini(struct platform_device *pdev, ...