msm: camera: Convert VPE into platform device
Make VPE 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: I884b38f714df6f101d48b38219d274bf91fef4c6
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 edaa008..0765251 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 = "vpe",
- .start = 0x05300000,
- .end = 0x05300000 + SZ_1M - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "vpe",
- .start = VPE_IRQ,
- .end = VPE_IRQ,
- .flags = IORESOURCE_IRQ,
- },
- {
.name = "vid_buf",
.flags = IORESOURCE_DMA,
},
@@ -1150,6 +1138,28 @@
.resource = msm_vfe_resources,
.num_resources = ARRAY_SIZE(msm_vfe_resources),
};
+
+static struct resource msm_vpe_resources[] = {
+ {
+ .name = "vpe",
+ .start = 0x05300000,
+ .end = 0x05300000 + SZ_1M - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "vpe",
+ .start = VPE_IRQ,
+ .end = VPE_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device msm8960_device_vpe = {
+ .name = "msm_vpe",
+ .id = 0,
+ .resource = msm_vpe_resources,
+ .num_resources = ARRAY_SIZE(msm_vpe_resources),
+};
#endif
static struct resource resources_ssbi_pm8921[] = {