Skip to content

Commit c136d4c

Browse files
amboarlinusw
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Joel Stanley <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 9979346 commit c136d4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/aspeed/pinmux-aspeed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ struct aspeed_pin_desc {
508508
* @idx: The bit index in the register
509509
*/
510510
#define SIG_DESC_SET(reg, idx) SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, 1)
511-
#define SIG_DESC_CLEAR(reg, idx) SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, 0)
511+
#define SIG_DESC_CLEAR(reg, idx) { ASPEED_IP_SCU, reg, BIT_MASK(idx), 0, 0 }
512512

513513
#define SIG_DESC_LIST_SYM(sig, group) sig_descs_ ## sig ## _ ## group
514514
#define SIG_DESC_LIST_DECL(sig, group, ...) \

0 commit comments

Comments
 (0)