linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: manjunath.hadli@ti.com (Manjunath Hadli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 09/11] davinci: dm644x: move vpfe init from soc to board specific files
Date: Thu, 15 Dec 2011 17:41:58 +0530	[thread overview]
Message-ID: <1323951120-15876-10-git-send-email-manjunath.hadli@ti.com> (raw)
In-Reply-To: <1323951120-15876-1-git-send-email-manjunath.hadli@ti.com>

Move all vpfe platform device registrations to the board specific
file like the rest of the devices, and have all of them together.

This would remove the  restriction of inclusion and registration of
vpfe platform devices for non-vpfe boards.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
---
 arch/arm/mach-davinci/board-dm644x-evm.c |    3 +--
 arch/arm/mach-davinci/davinci.h          |    2 +-
 arch/arm/mach-davinci/dm644x.c           |   29 +++++++++++++++++------------
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index fbd3856..8884125 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -624,8 +624,6 @@ static struct davinci_uart_config uart_config __initdata = {
 static void __init
 davinci_evm_map_io(void)
 {
-	/* setup input configuration for VPFE input devices */
-	dm644x_set_vpfe_config(&dm644xevm_capture_cfg);
 	dm644x_init();
 }
 
@@ -697,6 +695,7 @@ static __init void davinci_evm_init(void)
 	evm_init_i2c();
 
 	davinci_setup_mmc(0, &dm6446evm_mmc_config);
+	dm644x_init_video(&dm644xevm_capture_cfg);
 
 	davinci_serial_init(&uart_config);
 	dm644x_init_asp(&dm644x_evm_snd_data);
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 06ed38a..13cb029 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -81,7 +81,7 @@ void dm365_set_vpfe_config(struct vpfe_config *cfg);
 /* DM644x function declarations */
 void __init dm644x_init(void);
 void __init dm644x_init_asp(struct snd_platform_data *pdata);
-void dm644x_set_vpfe_config(struct vpfe_config *cfg);
+int __init dm644x_init_video(struct vpfe_config *);
 
 /* DM646x function declarations */
 void __init dm646x_init(void);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 7144277..4606e5c 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -659,11 +659,6 @@ static struct platform_device dm644x_vpfe_dev = {
 	},
 };
 
-void dm644x_set_vpfe_config(struct vpfe_config *cfg)
-{
-	dm644x_vpfe_dev.dev.platform_data = cfg;
-}
-
 /*----------------------------------------------------------------------*/
 
 static struct map_desc dm644x_io_desc[] = {
@@ -792,14 +787,28 @@ void __init dm644x_init(void)
 	davinci_map_sysmod();
 }
 
+static struct platform_device *dm644x_video_devices[] __initdata = {
+	&dm644x_vpss_device,
+	&dm644x_ccdc_dev,
+	&dm644x_vpfe_dev,
+};
+
+int __init dm644x_init_video(struct vpfe_config *vpfe_cfg)
+{
+	dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
+	/* Add ccdc clock aliases */
+	clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
+	clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
+	platform_add_devices(dm644x_video_devices,
+				ARRAY_SIZE(dm644x_video_devices));
+	return 0;
+}
+
 static int __init dm644x_init_devices(void)
 {
 	if (!cpu_is_davinci_dm644x())
 		return 0;
 
-	/* Add ccdc clock aliases */
-	clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
-	clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
 	platform_device_register(&dm644x_edma_device);
 
 	platform_device_register(&dm644x_mdio_device);
@@ -807,10 +816,6 @@ static int __init dm644x_init_devices(void)
 	clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev),
 		      NULL, &dm644x_emac_device.dev);
 
-	platform_device_register(&dm644x_vpss_device);
-	platform_device_register(&dm644x_ccdc_dev);
-	platform_device_register(&dm644x_vpfe_dev);
-
 	return 0;
 }
 postcore_initcall(dm644x_init_devices);
-- 
1.6.2.4

  parent reply	other threads:[~2011-12-15 12:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 12:11 [PATCH v6 00/11] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
2011-12-15 12:11 ` [PATCH v6 01/11] davinci: vpif: remove obsolete header file inclusion Manjunath Hadli
2011-12-16 14:22   ` Hadli, Manjunath
2011-12-19 20:02   ` Nori, Sekhar
2011-12-15 12:11 ` [PATCH v6 02/11] ARM: davinci: dm644x: remove the macros from the header to move to c file Manjunath Hadli
2011-12-20  6:30   ` Nori, Sekhar
2011-12-15 12:11 ` [PATCH v6 03/11] ARM: davinci: dm365: " Manjunath Hadli
2011-12-20  9:02   ` Nori, Sekhar
2011-12-15 12:11 ` [PATCH v6 04/11] ARM: davinci: dm646x: " Manjunath Hadli
2011-12-20 13:19   ` Nori, Sekhar
2011-12-15 12:11 ` [PATCH v6 05/11] ARM: davinci: create new common platform header for davinci Manjunath Hadli
2011-12-20 19:15   ` Nori, Sekhar
2011-12-21  7:29     ` Hadli, Manjunath
2011-12-15 12:11 ` [PATCH v6 06/11] davinci: eliminate use of IO_ADDRESS() on sysmod Manjunath Hadli
2011-12-15 12:11 ` [PATCH v6 07/11] davinci: dm644x: Replace register base value with a defined macro Manjunath Hadli
2011-12-15 12:11 ` [PATCH v6 08/11] davinci: dm644x: change vpfe capture structure variables for consistency Manjunath Hadli
2011-12-15 12:11 ` Manjunath Hadli [this message]
2011-12-15 12:11 ` [PATCH v6 10/11] davinci: dm644x: add support for v4l2 video display Manjunath Hadli
2011-12-15 12:12 ` [PATCH v6 11/11] davinci: dm644x EVM: add support for VPBE display Manjunath Hadli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323951120-15876-10-git-send-email-manjunath.hadli@ti.com \
    --to=manjunath.hadli@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).