Commit a658efaa authored by Heiko Stübner's avatar Heiko Stübner Committed by Linus Walleij

pinctrl: rockchip: only map bank0-pull-region when pmu regmap missing

When the pmu registers are supplied through a syscon regmap we do not need
to map the registers ourself.
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Tested-by: default avatarMax Schwarz <max.schwarz@online.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 14dee867
...@@ -1464,9 +1464,13 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, ...@@ -1464,9 +1464,13 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank,
*/ */
if (of_device_is_compatible(bank->of_node, if (of_device_is_compatible(bank->of_node,
"rockchip,rk3188-gpio-bank0")) { "rockchip,rk3188-gpio-bank0")) {
struct device_node *node;
bank->bank_type = RK3188_BANK0; bank->bank_type = RK3188_BANK0;
node = of_parse_phandle(bank->of_node->parent,
"rockchip,pmu", 0);
if (!node) {
if (of_address_to_resource(bank->of_node, 1, &res)) { if (of_address_to_resource(bank->of_node, 1, &res)) {
dev_err(info->dev, "cannot find IO resource for bank\n"); dev_err(info->dev, "cannot find IO resource for bank\n");
return -ENOENT; return -ENOENT;
...@@ -1475,10 +1479,14 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, ...@@ -1475,10 +1479,14 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank,
base = devm_ioremap_resource(info->dev, &res); base = devm_ioremap_resource(info->dev, &res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
rockchip_regmap_config.max_register = resource_size(&res) - 4; rockchip_regmap_config.max_register =
rockchip_regmap_config.name = "rockchip,rk3188-gpio-bank0-pull"; resource_size(&res) - 4;
bank->regmap_pull = devm_regmap_init_mmio(info->dev, base, rockchip_regmap_config.name =
"rockchip,rk3188-gpio-bank0-pull";
bank->regmap_pull = devm_regmap_init_mmio(info->dev,
base,
&rockchip_regmap_config); &rockchip_regmap_config);
}
} else { } else {
bank->bank_type = COMMON_BANK; bank->bank_type = COMMON_BANK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment