Skip to content

Commit a31895a

Browse files
committed
Merge tag 'regmap-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap updates from Mark Brown: "This is another quiet release for regmap, there's one minor feature improvement for the recently added slimbus support and a few minor fixes and cleanups" * tag 'regmap-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: slimbus: allow register offsets up to 16 bits regmap: add missing prototype for devm_init_slimbus regmap: Skip clk_put for attached clocks when freeing context regmap: include <linux/ktime.h> from include/linux/regmap.h
2 parents cfd12db + 869619e commit a31895a

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎drivers/base/regmap/regmap-mmio.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ static void regmap_mmio_free_context(void *context)
206206

207207
if (!IS_ERR(ctx->clk)) {
208208
clk_unprepare(ctx->clk);
209-
clk_put(ctx->clk);
209+
if (!ctx->attached_clk)
210+
clk_put(ctx->clk);
210211
}
211212
kfree(context);
212213
}

‎drivers/base/regmap/regmap-slimbus.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static struct regmap_bus regmap_slimbus_bus = {
4141
static const struct regmap_bus *regmap_get_slimbus(struct slim_device *slim,
4242
const struct regmap_config *config)
4343
{
44-
if (config->val_bits == 8 && config->reg_bits == 8)
44+
if (config->val_bits == 8 && config->reg_bits == 16)
4545
return &regmap_slimbus_bus;
4646

4747
return ERR_PTR(-ENOTSUPP);

‎include/linux/regmap.h‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <linux/list.h>
1717
#include <linux/rbtree.h>
18+
#include <linux/ktime.h>
1819
#include <linux/delay.h>
1920
#include <linux/err.h>
2021
#include <linux/bug.h>
@@ -587,7 +588,10 @@ struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,
587588
const struct regmap_config *config,
588589
struct lock_class_key *lock_key,
589590
const char *lock_name);
590-
591+
struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
592+
const struct regmap_config *config,
593+
struct lock_class_key *lock_key,
594+
const char *lock_name);
591595
/*
592596
* Wrapper for regmap_init macros to include a unique lockdep key and name
593597
* for each call. No-op if CONFIG_LOCKDEP is not set.
@@ -906,6 +910,19 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
906910
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
907911
sdw, config)
908912

913+
/**
914+
* devm_regmap_init_slimbus() - Initialise managed register map
915+
*
916+
* @slimbus: Device that will be interacted with
917+
* @config: Configuration for register map
918+
*
919+
* The return value will be an ERR_PTR() on error or a valid pointer
920+
* to a struct regmap. The regmap will be automatically freed by the
921+
* device management code.
922+
*/
923+
#define devm_regmap_init_slimbus(slimbus, config) \
924+
__regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config, \
925+
slimbus, config)
909926
int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
910927
void regmap_mmio_detach_clk(struct regmap *map);
911928
void regmap_exit(struct regmap *map);

0 commit comments

Comments
 (0)