msm: footswitch-8x60: Move SoC-specific data to device files
The number of footswitch-related differences between SoCs (such as clocks
and bus ports) is large enough that it no longer makes sense to treat
them as exceptions in footswitch_probe().
Instead of using cpu_is_xxx() to manage these differences, move all
SoC-specific data to the SoC-specific device files and pass it to the
footswitch driver through platform data.
Change-Id: I30e2ec885e0340e4efec2bc5adc3fdd255cc7bb0
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/devices-8960.c b/arch/arm/mach-msm/devices-8960.c
index 7fb4b01..5200dd0 100644
--- a/arch/arm/mach-msm/devices-8960.c
+++ b/arch/arm/mach-msm/devices-8960.c
@@ -1977,19 +1977,111 @@
.id = -1,
};
-struct platform_device *msm_footswitch_devices[] = {
- FS_8X60(FS_MDP, "fs_mdp"),
- FS_8X60(FS_ROT, "fs_rot"),
- FS_8X60(FS_IJPEG, "fs_ijpeg"),
- FS_8X60(FS_VFE, "fs_vfe"),
- FS_8X60(FS_VPE, "fs_vpe"),
- FS_8X60(FS_GFX3D, "fs_gfx3d"),
- FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
- FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
- FS_8X60(FS_VED, "fs_ved"),
+static struct fs_driver_data gfx2d0_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
};
-unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
+static struct fs_driver_data gfx2d1_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
+};
+
+static struct fs_driver_data gfx3d_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk", .reset_rate = 27000000 },
+ { .name = "iface_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
+};
+
+static struct fs_driver_data ijpeg_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
+};
+
+static struct fs_driver_data mdp_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { .name = "vsync_clk" },
+ { .name = "lut_clk" },
+ { .name = "tv_src_clk" },
+ { .name = "tv_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
+ .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
+};
+
+static struct fs_driver_data rot_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_ROTATOR,
+};
+
+static struct fs_driver_data ved_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
+ .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
+};
+
+static struct fs_driver_data vfe_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_VFE,
+};
+
+static struct fs_driver_data vpe_fs_data = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_VPE,
+};
+
+struct platform_device *msm8960_footswitch[] __initdata = {
+ FS_8X60(FS_MDP, "fs_mdp", &mdp_fs_data),
+ FS_8X60(FS_ROT, "fs_rot", &rot_fs_data),
+ FS_8X60(FS_IJPEG, "fs_ijpeg", &ijpeg_fs_data),
+ FS_8X60(FS_VFE, "fs_vfe", &vfe_fs_data),
+ FS_8X60(FS_VPE, "fs_vpe", &vpe_fs_data),
+ FS_8X60(FS_GFX3D, "fs_gfx3d", &gfx3d_fs_data),
+ FS_8X60(FS_GFX2D0, "fs_gfx2d0", &gfx2d0_fs_data),
+ FS_8X60(FS_GFX2D1, "fs_gfx2d1", &gfx2d1_fs_data),
+ FS_8X60(FS_VED, "fs_ved", &ved_fs_data),
+};
+unsigned msm8960_num_footswitch __initdata = ARRAY_SIZE(msm8960_footswitch);
#ifdef CONFIG_MSM_ROTATOR
static struct msm_bus_vectors rotator_init_vectors[] = {