diff options
author | Heiko Stübner <heiko@sntech.de> | 2014-05-05 07:59:30 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-05-09 05:15:46 -0400 |
commit | a658efaa85f60422e7731a0dcac3696429f7deac (patch) | |
tree | 764ae96ab6191220be182aebaf92daf4fdb7b159 /drivers/pinctrl | |
parent | 14dee8677e197f08be33aef4820b78be992c683f (diff) |
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: Heiko Stuebner <heiko@sntech.de>
Tested-by: Max Schwarz <max.schwarz@online.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-rockchip.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 11ad6433034a..d6e240193e7e 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -1464,21 +1464,29 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, | |||
1464 | */ | 1464 | */ |
1465 | if (of_device_is_compatible(bank->of_node, | 1465 | if (of_device_is_compatible(bank->of_node, |
1466 | "rockchip,rk3188-gpio-bank0")) { | 1466 | "rockchip,rk3188-gpio-bank0")) { |
1467 | struct device_node *node; | ||
1467 | 1468 | ||
1468 | bank->bank_type = RK3188_BANK0; | 1469 | bank->bank_type = RK3188_BANK0; |
1469 | 1470 | ||
1470 | if (of_address_to_resource(bank->of_node, 1, &res)) { | 1471 | node = of_parse_phandle(bank->of_node->parent, |
1471 | dev_err(info->dev, "cannot find IO resource for bank\n"); | 1472 | "rockchip,pmu", 0); |
1472 | return -ENOENT; | 1473 | if (!node) { |
1473 | } | 1474 | if (of_address_to_resource(bank->of_node, 1, &res)) { |
1475 | dev_err(info->dev, "cannot find IO resource for bank\n"); | ||
1476 | return -ENOENT; | ||
1477 | } | ||
1474 | 1478 | ||
1475 | base = devm_ioremap_resource(info->dev, &res); | 1479 | base = devm_ioremap_resource(info->dev, &res); |
1476 | if (IS_ERR(base)) | 1480 | if (IS_ERR(base)) |
1477 | return PTR_ERR(base); | 1481 | return PTR_ERR(base); |
1478 | rockchip_regmap_config.max_register = resource_size(&res) - 4; | 1482 | rockchip_regmap_config.max_register = |
1479 | rockchip_regmap_config.name = "rockchip,rk3188-gpio-bank0-pull"; | 1483 | resource_size(&res) - 4; |
1480 | bank->regmap_pull = devm_regmap_init_mmio(info->dev, base, | 1484 | rockchip_regmap_config.name = |
1481 | &rockchip_regmap_config); | 1485 | "rockchip,rk3188-gpio-bank0-pull"; |
1486 | bank->regmap_pull = devm_regmap_init_mmio(info->dev, | ||
1487 | base, | ||
1488 | &rockchip_regmap_config); | ||
1489 | } | ||
1482 | 1490 | ||
1483 | } else { | 1491 | } else { |
1484 | bank->bank_type = COMMON_BANK; | 1492 | bank->bank_type = COMMON_BANK; |