diff options
author | Jarkko Nikula <jarkko.nikula@bitmer.com> | 2011-09-26 10:45:39 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-09-26 17:46:48 -0700 |
commit | cdc71514a0f4f3e8c995f18d1119cef01a501dac (patch) | |
tree | ffc6ae60449339619d92dda064051052da7ededb /arch/arm/mach-omap2 | |
parent | 40246e0003f02160a116db249270129b0c600e95 (diff) | |
download | linux-cdc71514a0f4f3e8c995f18d1119cef01a501dac.tar.bz2 |
ARM: OMAP: mcbsp: Implement generic register access
Register access can be made more generic by calculating register address
offsets runtime from common register definitions and by using reg_size and
reg_step variables that are passed via platform data. Common register
definitions are possible since McBSP registers are ordered similarly between
OMAP versions.
Remove also references to OMAP2+ specific config_type variable from generic
McBSP code since other variables and feature flags are better to carry needed
information from platform code.
Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 7a42f32bd87d..43b9ccffba9e 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c @@ -126,7 +126,11 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) return -ENOMEM; } - pdata->mcbsp_config_type = oh->class->rev; + pdata->reg_step = 4; + if (oh->class->rev < MCBSP_CONFIG_TYPE2) + pdata->reg_size = 2; + else + pdata->reg_size = 4; if (oh->class->rev == MCBSP_CONFIG_TYPE3) { if (id == 2) |