]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: aspeed-g6: Make SIG_DESC_CLEAR() behave intuitively
authorAndrew Jeffery <andrew@aj.id.au>
Tue, 8 Oct 2019 04:41:51 +0000 (15:11 +1030)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 Oct 2019 13:58:09 +0000 (15:58 +0200)
commit8fd06cbd87174dbd1858ecb35565943fa8da8ade
tree2a40afe05cd9c67ade505d3244230ea7f647d341
parentf00ca7dfce11a92a5fb24269535593226d5bd39b
pinctrl: aspeed-g6: Make SIG_DESC_CLEAR() behave intuitively

Signal descriptors can represent multi-bit bitfields and so have
explicit "enable" and "disable" states. However many descriptor
instances only describe a single bit, and so the SIG_DESC_SET() macro is
provides an abstraction for the single-bit cases: Its expansion
configures the "enable" state to set the bit and "disable" to clear.

SIG_DESC_CLEAR() was introduced to provide a similar single-bit
abstraction for for descriptors to clear the bit of interest. However
its behaviour was defined as the literal inverse of SIG_DESC_SET() - the
impact is the bit of interest is set in the disable path. This behaviour
isn't intuitive and doesn't align with how we want to use the macro in
practice, so make it clear the bit for both the enable and disable
paths.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Link: https://lore.kernel.org/r/20191008044153.12734-6-andrew@aj.id.au
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/aspeed/pinmux-aspeed.h