diff options
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
| -rw-r--r-- | arch/arm/mach-omap2/devices.c | 59 | 
1 files changed, 25 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c00c68961bb..1b7e1c6e535 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -17,21 +17,21 @@  #include <linux/err.h>  #include <linux/slab.h>  #include <linux/of.h> +#include <linux/pinctrl/machine.h>  #include <linux/platform_data/omap4-keypad.h> -#include <mach/hardware.h> -#include <mach/irqs.h>  #include <asm/mach-types.h>  #include <asm/mach/map.h>  #include <asm/pmu.h>  #include "iomap.h" -#include <plat/board.h>  #include <plat/dma.h>  #include <plat/omap_hwmod.h>  #include <plat/omap_device.h>  #include <plat/omap4-keypad.h> +#include "soc.h" +#include "common.h"  #include "mux.h"  #include "control.h"  #include "devices.h" @@ -112,7 +112,7 @@ static struct resource omap2cam_resources[] = {  		.flags		= IORESOURCE_MEM,  	},  	{ -		.start		= INT_24XX_CAM_IRQ, +		.start		= 24 + OMAP_INTC_START,  		.flags		= IORESOURCE_IRQ,  	}  }; @@ -201,7 +201,7 @@ static struct resource omap3isp_resources[] = {  		.flags		= IORESOURCE_MEM,  	},  	{ -		.start		= INT_34XX_CAM_IRQ, +		.start		= 24 + OMAP_INTC_START,  		.flags		= IORESOURCE_IRQ,  	}  }; @@ -434,37 +434,24 @@ static void omap_init_mcspi(void)  static inline void omap_init_mcspi(void) {}  #endif -static struct resource omap2_pmu_resource = { -	.start	= 3, -	.end	= 3, -	.flags	= IORESOURCE_IRQ, -}; - -static struct resource omap3_pmu_resource = { -	.start	= INT_34XX_BENCH_MPU_EMUL, -	.end	= INT_34XX_BENCH_MPU_EMUL, -	.flags	= IORESOURCE_IRQ, -}; - -static struct platform_device omap_pmu_device = { -	.name		= "arm-pmu", -	.id		= ARM_PMU_DEVICE_CPU, -	.num_resources	= 1, -}; - -static void omap_init_pmu(void) +/** + * omap_init_rng - bind the RNG hwmod to the RNG omap_device + * + * Bind the RNG hwmod to the RNG omap_device.  No return value. + */ +static void omap_init_rng(void)  { -	if (cpu_is_omap24xx()) -		omap_pmu_device.resource = &omap2_pmu_resource; -	else if (cpu_is_omap34xx()) -		omap_pmu_device.resource = &omap3_pmu_resource; -	else +	struct omap_hwmod *oh; +	struct platform_device *pdev; + +	oh = omap_hwmod_lookup("rng"); +	if (!oh)  		return; -	platform_device_register(&omap_pmu_device); +	pdev = omap_device_build("omap_rng", -1, oh, NULL, 0, NULL, 0, 0); +	WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");  } -  #if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)  #ifdef CONFIG_ARCH_OMAP2 @@ -475,7 +462,7 @@ static struct resource omap2_sham_resources[] = {  		.flags	= IORESOURCE_MEM,  	},  	{ -		.start	= INT_24XX_SHA1MD5, +		.start	= 51 + OMAP_INTC_START,  		.flags	= IORESOURCE_IRQ,  	}  }; @@ -493,7 +480,7 @@ static struct resource omap3_sham_resources[] = {  		.flags	= IORESOURCE_MEM,  	},  	{ -		.start	= INT_34XX_SHA1MD52_IRQ, +		.start	= 49 + OMAP_INTC_START,  		.flags	= IORESOURCE_IRQ,  	},  	{ @@ -631,6 +618,10 @@ static inline void omap_init_vout(void) {}  static int __init omap2_init_devices(void)  { +	/* Enable dummy states for those platforms without pinctrl support */ +	if (!of_have_populated_dt()) +		pinctrl_provide_dummies(); +  	/*  	 * please keep these calls, and their implementations above,  	 * in alphabetical order so they're easier to sort through. @@ -645,8 +636,8 @@ static int __init omap2_init_devices(void)  		omap_init_mcpdm();  		omap_init_mcspi();  	} -	omap_init_pmu();  	omap_init_sti(); +	omap_init_rng();  	omap_init_sham();  	omap_init_aes();  	omap_init_vout();  |