• Waqar Hameed's avatar
    regmap: Add debugfs file for forcing field writes · b629c698
    Waqar Hameed authored
    `_regmap_update_bits()` checks if the current register value differs
    from the new value, and only writes to the register if they differ. When
    testing hardware drivers, it might be desirable to always force a
    register write, for example when writing to a `regmap_field`. This
    enables and simplifies testing and verification of the hardware
    interaction. For example, when using a hardware mock/simulation model,
    one can then more easily verify that the driver makes the correct
    expected register writes during certain events.
    
    Add a bool variable `force_write_field` and a corresponding debugfs
    entry to enable this. Since this feature could interfere with driver
    operation, guard it with a macro.
    Signed-off-by: default avatarWaqar Hameed <waqar.hameed@axis.com>
    Link: https://lore.kernel.org/r/pnd1qifa7sj.fsf@axis.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    b629c698
internal.h 9.6 KB