From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330Ab1LBJNx (ORCPT ); Fri, 2 Dec 2011 04:13:53 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:52426 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158Ab1LBJNt (ORCPT ); Fri, 2 Dec 2011 04:13:49 -0500 From: Ming Lei To: Mauro Carvalho Chehab , Tony Lindgren Cc: Sylwester Nawrocki , Greg KH , Alan Cox , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ming Lei Subject: [RFC PATCH v1 2/7] omap4: build fdif omap device from hwmod Date: Fri, 2 Dec 2011 17:12:53 +0800 Message-Id: <1322817178-8931-3-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322817178-8931-1-git-send-email-ming.lei@canonical.com> References: <1322817178-8931-1-git-send-email-ming.lei@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Ming Lei --- arch/arm/mach-omap2/devices.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 1166bdc..a392af5 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -728,6 +728,38 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) #endif +static struct platform_device* __init omap4_init_fdif(void) +{ + int id = -1; + struct platform_device *pd; + struct omap_hwmod *oh; + const char *dev_name = "fdif"; + + oh = omap_hwmod_lookup("fdif"); + if (!oh) { + pr_err("Could not look up fdif hwmod\n"); + return NULL; + } + + pd = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0); + WARN(IS_ERR(pd), "Can't build omap_device for %s.\n", + dev_name); + return pd; +} + +static void __init omap_init_fdif(void) +{ + if (cpu_is_omap44xx()) { + struct platform_device *pd; + + pd = omap4_init_fdif(); + if (!pd) + return; + + pm_runtime_enable(&pd->dev); + } +} + /*-------------------------------------------------------------------------*/ #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) @@ -808,6 +840,7 @@ static int __init omap2_init_devices(void) omap_init_sham(); omap_init_aes(); omap_init_vout(); + omap_init_fdif(); return 0; } -- 1.7.5.4