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

Nishanth Menon nm at ti.com
Fri Nov 1 17:07:36 EDT 2013


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



More information about the linux-arm-kernel mailing list