regmap: MMIO regmap clock configuration
This patch provides a mechanism for specifying a different clock to be used with the regmap clock integration. -----BEGIN PGP SIGNATURE----- iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlqUBzMTHGJyb29uaWVA a2VybmVsLm9yZwAKCRAk1otyXVSH0OKXB/oD1vSo9XV8toEoRlz/HtQKJqB7Usee nFu3pc8qtIqQfvauE2hJwqiJp6BjpOyp0aOfgCXEziuHKg/W5MnLAOFUTkqRcPWC 3HeZbP1wDVu4oJVGZjYMt2XqtoD97tuRnuu/k0845jWRfILaEsCjXnAEOpkn80CZ A7+c8oUkTgjz0EPspCBBpFLQaObLPNIXZvB3E1dHP9H43NL42N9uh3YXfMGx//uJ l2rrwZV6/2Zyf0SksFjGoDKOPTo05jkWZEwj4uyPk5dauSMrDddBU9pAfWjQHE1L t/vfYv7JCV0ijZfqtHR4r4oxMC4yvOCiboFbnRQPNCcOTg8ctDs4nMEA =Ycvc -----END PGP SIGNATURE----- Merge tag 'mmio-clk-config' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into drm-misc-next regmap: MMIO regmap clock configuration This patch provides a mechanism for specifying a different clock to be used with the regmap clock integration. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180226131207.GB6681@sirena.org.uk
This commit is contained in:
commit
1d0397d602
@ -28,6 +28,8 @@
|
|||||||
struct regmap_mmio_context {
|
struct regmap_mmio_context {
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
unsigned val_bytes;
|
unsigned val_bytes;
|
||||||
|
|
||||||
|
bool attached_clk;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
|
||||||
void (*reg_write)(struct regmap_mmio_context *ctx,
|
void (*reg_write)(struct regmap_mmio_context *ctx,
|
||||||
@ -363,4 +365,26 @@ struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(__devm_regmap_init_mmio_clk);
|
EXPORT_SYMBOL_GPL(__devm_regmap_init_mmio_clk);
|
||||||
|
|
||||||
|
int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk)
|
||||||
|
{
|
||||||
|
struct regmap_mmio_context *ctx = map->bus_context;
|
||||||
|
|
||||||
|
ctx->clk = clk;
|
||||||
|
ctx->attached_clk = true;
|
||||||
|
|
||||||
|
return clk_prepare(ctx->clk);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(regmap_mmio_attach_clk);
|
||||||
|
|
||||||
|
void regmap_mmio_detach_clk(struct regmap *map)
|
||||||
|
{
|
||||||
|
struct regmap_mmio_context *ctx = map->bus_context;
|
||||||
|
|
||||||
|
clk_unprepare(ctx->clk);
|
||||||
|
|
||||||
|
ctx->attached_clk = false;
|
||||||
|
ctx->clk = NULL;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(regmap_mmio_detach_clk);
|
||||||
|
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <linux/lockdep.h>
|
#include <linux/lockdep.h>
|
||||||
|
|
||||||
struct module;
|
struct module;
|
||||||
|
struct clk;
|
||||||
struct device;
|
struct device;
|
||||||
struct i2c_client;
|
struct i2c_client;
|
||||||
struct irq_domain;
|
struct irq_domain;
|
||||||
@ -905,6 +906,8 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
|
|||||||
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
|
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
|
||||||
sdw, config)
|
sdw, config)
|
||||||
|
|
||||||
|
int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
|
||||||
|
void regmap_mmio_detach_clk(struct regmap *map);
|
||||||
void regmap_exit(struct regmap *map);
|
void regmap_exit(struct regmap *map);
|
||||||
int regmap_reinit_cache(struct regmap *map,
|
int regmap_reinit_cache(struct regmap *map,
|
||||||
const struct regmap_config *config);
|
const struct regmap_config *config);
|
||||||
|
Loading…
Reference in New Issue
Block a user