* 1. Write '1' to ReadState bit in KEYP_SCAN register * 2. Wait 2*32KHz clocks, so that HW can successfully enter read mode * synchronously * 3. Read rows in old array first if events are more than one * 4. Read rows in recent array * 5. Wait 4*32KHz clocks * 6. Write ...
这些函数包括regmap_read、regmap_write、regmap_bulk_read、regmap_bulk_write等。以下是一个简单的例子: #include<linux/regmap.h> // Reading a register unsignedint int0x10 // Writing to a register 0x200xFF 1 有时,你可能需要一次性读写多个寄存器,regmap提供了相应的函数支持。例如,regmap_bulk_read...
ret = jsa1212_als_enable(data, JSA1212_CONF_ALS_ENABLE);if(ret <0)returnret;/* Delay for data output */msleep(JSA1212_ALS_DELAY_MS);/* Read 12 bit data */ret =regmap_bulk_read(data->regmap, JSA1212_ALS_DT1_REG, &als_data,2);if(ret <0) { dev_err(&data->client->dev,"a...
当使用regmap的时候就不需要手动将寄存器地址的bit7置 1,在初始化regmap_config的时候直接将read_flag_mask设置为0X80即可,这样通过regmap读取SPI内部寄存器的时候就会将寄存器地址与read_flag_mask进行或运算,结果就是将bit7置1,但是整个过程不需要自行操作,全部由regmap框架来完成的。 同理write_flag_mask用法也一样...
ret = regmap_read(max77686->regmap, MAX77686_REG_DEVICE_ID, &data);if(ret <0) { dev_err(max77686->dev,"device not found on this channel (this is not an error)\n");return-ENODEV; } ret = devm_regmap_add_irq_chip(&i2c->dev, max77686->regmap, ...
ret = regmap_read(arizona->regmap, fll->base +1, );if(ret !=0) { arizona_fll_err(fll,"Failed to read current state: %d\n", ret);returnret; } ena = reg & ARIZONA_FLL1_ENA;if(Fout) {/* Do we have a 32kHz reference? */regmap_read(arizona->regmap, ARIZONA_CLOCK_32K_1,...
}if(of_property_read_u32(dev->of_node,"qcom,id", &gmac->id) <0) { dev_err(dev,"missing qcom id property\n");returnERR_PTR(-EINVAL); }/* The GMACs are called 1 to 4 in the documentation, but to simplify the * code and keep it consistent with the Linux convention, we'll ...
ret =regmap_bulk_read(data->regmap, LTR501_ALS_THRESH_LOW, &thresh_data,2);if(ret <0)returnret; *val = thresh_data & LTR501_ALS_THRESH_MASK;returnIIO_VAL_INT;default:return-EINVAL; }caseIIO_PROXIMITY:switch(dir) {caseIIO_EV_DIR_RISING: ...
tps65910->read = tps65910_i2c_read; tps65910->write = tps65910_i2c_write; mutex_init(&tps65910->io_mutex); tps65910->regmap = regmap_init_i2c(i2c, &tps65910_regmap_config);if(IS_ERR(tps65910->regmap)) { ret = PTR_ERR(tps65910->regmap); ...