From eb4a219d19fde99616f120f5655a7121c918cd49 Mon Sep 17 00:00:00 2001 From: James Kelly Date: Tue, 15 May 2018 10:59:58 +1000 Subject: regmap: Skip clk_put for attached clocks when freeing context Capability to attach an existing clk to a MMIO regmap was introduced in 4.17rc1. However, when using attached clk, regmap does not do the clk_get. Therefore it should not do the clk_put when freeing the MMIO regmap context. There does not appear to be any users of attached clocks yet so this would be a good time to make this change before anything depends on the existing behaviour. Signed-off-by: James Kelly Acked-by: Maxime Ripard Signed-off-by: Mark Brown --- drivers/base/regmap/regmap-mmio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c index 5cadfd3394d8..8741fb5f8f54 100644 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c @@ -206,7 +206,8 @@ static void regmap_mmio_free_context(void *context) if (!IS_ERR(ctx->clk)) { clk_unprepare(ctx->clk); - clk_put(ctx->clk); + if (!ctx->attached_clk) + clk_put(ctx->clk); } kfree(context); } -- cgit v1.2.3 From cbdd39ca498f6b2b221614d9c1d105f2948f1dbb Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Fri, 25 May 2018 14:50:37 +0100 Subject: regmap: slimbus: allow register offsets up to 16 bits As per SLIMBus specs Value Elements and Information Elements address map ranges from 0x000 - 0xFFF. So allow register addresses up to 16 bits Fixes: 7d6f7fb053ad ("regmap: add SLIMbus support") Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown --- drivers/base/regmap/regmap-slimbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/regmap/regmap-slimbus.c b/drivers/base/regmap/regmap-slimbus.c index c90bee81d954..91d501eda8a9 100644 --- a/drivers/base/regmap/regmap-slimbus.c +++ b/drivers/base/regmap/regmap-slimbus.c @@ -41,7 +41,7 @@ static struct regmap_bus regmap_slimbus_bus = { static const struct regmap_bus *regmap_get_slimbus(struct slim_device *slim, const struct regmap_config *config) { - if (config->val_bits == 8 && config->reg_bits == 8) + if (config->val_bits == 8 && config->reg_bits == 16) return ®map_slimbus_bus; return ERR_PTR(-ENOTSUPP); -- cgit v1.2.3