Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists

Add an updated set of registers listed in the core regmap_range volatile
ranges defined for the DA9062.

These new registers contain bits that cannot be considered under the full
control of software. Under various conditions the hardware will set and/or
automatically clear bit(s) contained in these registers.

When using a cached version of regmap, the volatility of these registers must
be identified otherwise the regmap operations may not ensure the registers
are explicitly altered.

As well as updating the list of volatile registers, this change will fix a
corner case discovered in the DA9063 ONKEY which is used by the DA9062 core.

In the ONKEY case, the CONTROL_B register is now listed as volatile in the
regmap_range because it contains the bit field NONKEY_LOCK. This bit can be
altered by hardware, in which case regmap must be notified of its ability
to be manpiulated outside of software control.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Steve Twiss and committed by
Lee Jones
bf742a53 2cd9ad0c

+22 -1
+22 -1
drivers/mfd/da9062-core.c
··· 388 388 .range_min = DA9062AA_STATUS_D, 389 389 .range_max = DA9062AA_EVENT_C, 390 390 }, { 391 - .range_min = DA9062AA_CONTROL_F, 391 + .range_min = DA9062AA_CONTROL_A, 392 + .range_max = DA9062AA_CONTROL_B, 393 + }, { 394 + .range_min = DA9062AA_CONTROL_E, 392 395 .range_max = DA9062AA_CONTROL_F, 396 + }, { 397 + .range_min = DA9062AA_BUCK2_CONT, 398 + .range_max = DA9062AA_BUCK4_CONT, 399 + }, { 400 + .range_min = DA9062AA_BUCK3_CONT, 401 + .range_max = DA9062AA_BUCK3_CONT, 402 + }, { 403 + .range_min = DA9062AA_LDO1_CONT, 404 + .range_max = DA9062AA_LDO4_CONT, 405 + }, { 406 + .range_min = DA9062AA_DVC_1, 407 + .range_max = DA9062AA_DVC_1, 393 408 }, { 394 409 .range_min = DA9062AA_COUNT_S, 395 410 .range_max = DA9062AA_SECOND_D, 411 + }, { 412 + .range_min = DA9062AA_SEQ, 413 + .range_max = DA9062AA_SEQ, 414 + }, { 415 + .range_min = DA9062AA_EN_32K, 416 + .range_max = DA9062AA_EN_32K, 396 417 }, 397 418 }; 398 419