]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: provide regmap_field helpers for simple bit operations
authorLi Chen <lchen@ambarella.com>
Mon, 23 May 2022 03:26:58 +0000 (20:26 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 15 Jun 2022 10:17:45 +0000 (11:17 +0100)
commitb2fbd50c984b42147de34e0c11713329bc028785
treea1f67aa5bf78bd775c9884c66c4e9f3db6454c20
parentf040cca4b0da0180bf9de9141ef5c95f60f85182
regmap: provide regmap_field helpers for simple bit operations

We have set/clear/test operations for regmap, but not for regmap_field yet.
So let's introduce regmap_field helpers too.

In many instances regmap_field_update_bits() is used for simple bit setting
and clearing. In these cases the last argument is redundant and we can
hide it with a static inline function.

This adds three new helpers for simple bit operations: set_bits,
clear_bits and test_bits (the last one defined as a regular function).

Signed-off-by: Li Chen <lchen@ambarella.com>
Link: https://lore.kernel.org/r/180eef422c3.deae9cd960729.8518395646822099769@zohomail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c
include/linux/regmap.h