summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/aspeed/pinctrl-aspeed.h
diff options
context:
space:
mode:
authorJohnny Huang <johnny_huang@aspeedtech.com>2019-12-02 09:14:31 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-12-13 11:40:37 +0300
commit5f52c853847ffdc9654e5b685e1a1ae5bee83e65 (patch)
tree39f05f901bf1f17777376e1f9c8648621cfa44bb /drivers/pinctrl/aspeed/pinctrl-aspeed.h
parent5b854f2842458d2bbb2a49c20d958c9f6f610465 (diff)
downloadlinux-5f52c853847ffdc9654e5b685e1a1ae5bee83e65.tar.xz
pinctrl: aspeed: Use masks to describe pinconf bitfields
Since some of the AST2600 pinconf setting are not just single bit, modified aspeed_pin_config @bit to @mask and add @mask to aspeed_pin_config_map to support configuring multiple bits. Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com> [AJ: Tweak commit message] Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Link: https://lore.kernel.org/r/20191202061432.3996-7-andrew@aj.id.au Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/aspeed/pinctrl-aspeed.h')
-rw-r--r--drivers/pinctrl/aspeed/pinctrl-aspeed.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.h b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
index 27d3929b6aca..6f0f03395617 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.h
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
@@ -24,8 +24,7 @@ struct aspeed_pin_config {
enum pin_config_param param;
unsigned int pins[2];
unsigned int reg;
- u8 bit;
- u8 value;
+ u32 mask;
};
#define ASPEED_PINCTRL_PIN(name_) \
@@ -39,7 +38,7 @@ struct aspeed_pin_config {
.param = param_, \
.pins = {pin0_, pin1_}, \
.reg = reg_, \
- .bit = bit_ \
+ .mask = BIT_MASK(bit_) \
}
/*
@@ -48,6 +47,7 @@ struct aspeed_pin_config {
* @param: pinconf configuration parameter
* @arg: The supported argument for @param, or -1 if any value is supported
* @val: The register value to write to configure @arg for @param
+ * @mask: The bitfield mask for @val
*
* The map is to be used in conjunction with the configuration array supplied
* by the driver implementation.
@@ -56,6 +56,7 @@ struct aspeed_pin_config_map {
enum pin_config_param param;
s32 arg;
u32 val;
+ u32 mask;
};
struct aspeed_pinctrl_data {