msm: camera: Convert VFE into platform device
Make VFE platform devices as well as
v4l2 sub-devices. They are created at system boot-up,
and registered during camera open.
The subdevices are decoupled from the v4l2 devices by
using device model APIs to find and register them.
Change-Id: I91a7144794505af23a6f32de58f1c7cc340f4882
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
diff --git a/arch/arm/mach-msm/devices-8960.c b/arch/arm/mach-msm/devices-8960.c
index 725e1c2..edaa008 100644
--- a/arch/arm/mach-msm/devices-8960.c
+++ b/arch/arm/mach-msm/devices-8960.c
@@ -983,18 +983,6 @@
#ifdef CONFIG_MSM_CAMERA
struct resource msm_camera_resources[] = {
{
- .name = "vfe",
- .start = 0x04500000,
- .end = 0x04500000 + SZ_1M - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "vfe",
- .start = VFE_IRQ,
- .end = VFE_IRQ,
- .flags = IORESOURCE_IRQ,
- },
- {
.name = "vpe",
.start = 0x05300000,
.end = 0x05300000 + SZ_1M - 1,
@@ -1140,6 +1128,28 @@
.resource = msm_ispif_resources,
.num_resources = ARRAY_SIZE(msm_ispif_resources),
};
+
+static struct resource msm_vfe_resources[] = {
+ {
+ .name = "vfe32",
+ .start = 0x04500000,
+ .end = 0x04500000 + SZ_1M - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "vfe32",
+ .start = VFE_IRQ,
+ .end = VFE_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device msm8960_device_vfe = {
+ .name = "msm_vfe",
+ .id = 0,
+ .resource = msm_vfe_resources,
+ .num_resources = ARRAY_SIZE(msm_vfe_resources),
+};
#endif
static struct resource resources_ssbi_pm8921[] = {