Subject: [PATCHv9 38/43] ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT

From: [email-masked] (Nishanth Menon)
Date: Fri, 1 Nov 2013 16:07:36 -0500

On 10/25/2013 10:57 AM, Tero Kristo wrote:
[...]
> diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
> index 228b850..6fa74c6 100644
> --- a/arch/arm/mach-omap2/prm_common.c
> +++ b/arch/arm/mach-omap2/prm_common.c

[...]
> +/*
> + * XXX: implementation for the regmap read/write should be moved to
> + * individual PRCM IP drivers, once those are available.
> + */
> +static int ti_clk_regmap_read(void *context, unsigned int reg,
> +			      unsigned int *val)
> +{
> +	void __iomem *mem = context;
> +	*val = __raw_readl(mem + reg);
> +	return 0;
> +}
> +
> +static int ti_clk_regmap_write(void *context, unsigned int reg,
> +			       unsigned int val)
> +{
> +	void __iomem *mem = context;
> +	__raw_writel(val, mem + reg);
> +	return 0;
> +}
> +
> +static struct regmap_config ti_clk_regmap_config = {
> +	.reg_bits = 32,
> +	.reg_stride = 4,
> +	.val_bits = 32,
> +	.reg_read = ti_clk_regmap_read,
> +	.reg_write = ti_clk_regmap_write,
> +	.fast_io = true,
> +	.cache_type = REGCACHE_NONE,
> +	.reg_format_endian = REGMAP_ENDIAN_NATIVE,
> +	.val_format_endian = REGMAP_ENDIAN_NATIVE,
> +};

why not use regmap_mmio?

[...]

-- 
Regards,
Nishanth Menon