aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2013-03-30 15:49:19 -0600
committerPaul Walmsley <paul@pwsan.com>2013-03-30 15:49:19 -0600
commite569e994b7b1f76324b9bd5f42ae477973687b72 (patch)
tree103e8dcfb69b125f2389a47fc089f2c17d7b4d56 /arch/arm/mach-omap2/devices.c
parent78e52e026d288aad88b46bff0d94b05e145c4583 (diff)
ARM: OMAP2xxx: hwmod: Convert SHAM crypto device data to hwmod
Convert the device data for the OMAP2 SHAM crypto IP from explicit platform_data to hwmod. CC: Paul Walmsley <paul@pwsan.com> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> [paul@pwsan.com: fixed lines causing sparse warnings] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1ec7f0597710..8d51c65bdfce 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -506,24 +506,6 @@ static void omap_init_rng(void)
#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_sham_resources[] = {
- {
- .start = OMAP24XX_SEC_SHA1MD5_BASE,
- .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = 51 + OMAP_INTC_START,
- .flags = IORESOURCE_IRQ,
- }
-};
-static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources);
-#else
-#define omap2_sham_resources NULL
-#define omap2_sham_resources_sz 0
-#endif
-
#ifdef CONFIG_ARCH_OMAP3
static struct resource omap3_sham_resources[] = {
{
@@ -554,16 +536,23 @@ static struct platform_device sham_device = {
static void omap_init_sham(void)
{
if (cpu_is_omap24xx()) {
- sham_device.resource = omap2_sham_resources;
- sham_device.num_resources = omap2_sham_resources_sz;
+ struct omap_hwmod *oh;
+ struct platform_device *pdev;
+
+ oh = omap_hwmod_lookup("sham");
+ if (!oh)
+ return;
+
+ pdev = omap_device_build("omap-sham", -1, oh, NULL, 0);
+ WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
} else if (cpu_is_omap34xx()) {
sham_device.resource = omap3_sham_resources;
sham_device.num_resources = omap3_sham_resources_sz;
+ platform_device_register(&sham_device);
} else {
pr_err("%s: platform not supported\n", __func__);
return;
}
- platform_device_register(&sham_device);
}
#else
static inline void omap_init_sham(void) { }