[PATCH v6 04/10] omap2: Fix camera resources for multiomap
From: Sergio Aguirre saagui...@ti.com Make sure the kernel can be compiled with both OMAP2 and OMAP3 camera support linked in, and give public symbols proper omap2/omap3 prefixes. Signed-off-by: Sergio Aguirre saagui...@ti.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Acked-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/devices.c | 25 - 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { { .start = OMAP24XX_CAMERA_BASE, .end= OMAP24XX_CAMERA_BASE + 0xfff, @@ -50,21 +50,12 @@ static struct resource cam_resources[] = { } }; -static struct platform_device omap_cam_device = { +static struct platform_device omap2cam_device = { .name = omap24xxcam, .id = -1, - .num_resources = ARRAY_SIZE(cam_resources), - .resource = cam_resources, + .num_resources = ARRAY_SIZE(omap2cam_resources), + .resource = omap2cam_resources, }; - -static inline void omap_init_camera(void) -{ - platform_device_register(omap_cam_device); -} -#else -static inline void omap_init_camera(void) -{ -} #endif static struct resource omap3isp_resources[] = { @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata) } EXPORT_SYMBOL_GPL(omap3_init_camera); +static inline void omap_init_camera(void) +{ +#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) + if (cpu_is_omap24xx()) + platform_device_register(omap2cam_device); +#endif +} + #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) #define MBOX_REG_SIZE 0x120 -- 1.7.3.4 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 04/10] omap2: Fix camera resources for multiomap
Hi, On Mon, Feb 14, 2011 at 01:21:31PM +0100, Laurent Pinchart wrote: diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { should this be __initdata ?? @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata) } EXPORT_SYMBOL_GPL(omap3_init_camera); +static inline void omap_init_camera(void) why inline ? also, should this be marked __init ? -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 04/10] omap2: Fix camera resources for multiomap
Hi Felipe, Thanks for the review. On Monday 14 February 2011 13:35:59 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 01:21:31PM +0100, Laurent Pinchart wrote: diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { should this be __initdata ?? The resources will be used when the OMAP3 ISP module is loaded. Won't they be discared if marked as __initdata ? @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata) } EXPORT_SYMBOL_GPL(omap3_init_camera); +static inline void omap_init_camera(void) why inline ? also, should this be marked __init ? I suppose because it was inline, so it has been kept as inline. The function is used in a single place, so the compiler will probably auto-inline it. Is it an issue to keep it as inline ? -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 04/10] omap2: Fix camera resources for multiomap
Hi, On Mon, Feb 14, 2011 at 02:19:24PM +0100, Laurent Pinchart wrote: Thanks for the review. np. On Monday 14 February 2011 13:35:59 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 01:21:31PM +0100, Laurent Pinchart wrote: diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { should this be __initdata ?? The resources will be used when the OMAP3 ISP module is loaded. Won't they be discared if marked as __initdata ? I believe driver core makes a copy of those, no ? not sure. @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata) } EXPORT_SYMBOL_GPL(omap3_init_camera); +static inline void omap_init_camera(void) why inline ? also, should this be marked __init ? I suppose because it was inline, so it has been kept as inline. The function is used in a single place, so the compiler will probably auto-inline it. Is it an issue to keep it as inline ? not really, you can forget about this comment ;-) -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 04/10] omap2: Fix camera resources for multiomap
Hi Felipe, On Monday 14 February 2011 14:41:16 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 02:19:24PM +0100, Laurent Pinchart wrote: On Monday 14 February 2011 13:35:59 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 01:21:31PM +0100, Laurent Pinchart wrote: diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { should this be __initdata ?? The resources will be used when the OMAP3 ISP module is loaded. Won't they be discared if marked as __initdata ? I believe driver core makes a copy of those, no ? not sure. Not that I know of, but I may be wrong. @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata) } EXPORT_SYMBOL_GPL(omap3_init_camera); +static inline void omap_init_camera(void) why inline ? also, should this be marked __init ? I suppose because it was inline, so it has been kept as inline. The function is used in a single place, so the compiler will probably auto-inline it. Is it an issue to keep it as inline ? not really, you can forget about this comment ;-) -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 04/10] omap2: Fix camera resources for multiomap
On Mon, Feb 14, 2011 at 3:50 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Felipe, Hello, On Monday 14 February 2011 14:41:16 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 02:19:24PM +0100, Laurent Pinchart wrote: On Monday 14 February 2011 13:35:59 Felipe Balbi wrote: On Mon, Feb 14, 2011 at 01:21:31PM +0100, Laurent Pinchart wrote: diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4cf48ea..5d844bd 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { should this be __initdata ?? The resources will be used when the OMAP3 ISP module is loaded. Won't they be discared if marked as __initdata ? I believe driver core makes a copy of those, no ? not sure. Not that I know of, but I may be wrong. I don't think omap2cam_resources would be used at all. AFAIK, it belongs to omap2xxcam, isn't it? :) Br, David -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html