From patchwork Mon Sep 16 07:18:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 2895731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73635BFF05 for ; Mon, 16 Sep 2013 07:20:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D78F620205 for ; Mon, 16 Sep 2013 07:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E6A120204 for ; Mon, 16 Sep 2013 07:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844Ab3IPHUJ (ORCPT ); Mon, 16 Sep 2013 03:20:09 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:52985 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752444Ab3IPHUI (ORCPT ); Mon, 16 Sep 2013 03:20:08 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r8G7JcmY014115; Mon, 16 Sep 2013 02:19:38 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8G7Jc4v009233; Mon, 16 Sep 2013 02:19:38 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 16 Sep 2013 02:19:37 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8G7Jbf2030376; Mon, 16 Sep 2013 02:19:37 -0500 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.145.166]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r8G7Jat18727; Mon, 16 Sep 2013 02:19:36 -0500 (CDT) From: Archit Taneja To: , CC: , Archit Taneja Subject: [PATCH v2 4/4] arm: omap: display: Create omap_vout device inside omap_display_init Date: Mon, 16 Sep 2013 12:48:31 +0530 Message-ID: <1379315911-24634-5-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1379315911-24634-1-git-send-email-archit@ti.com> References: <1379315911-24634-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move omap_vout device creation inside the omap_display_init so that we can correctly create the device based on the presence of omapdss within the platform. For example, on a kernel image supporting multiple platforms, omap_init_vout will create a omapdrm platform device on a AM33xx platform even though it doesn't have a DSS block. Signed-off-by: Archit Taneja --- arch/arm/mach-omap2/devices.c | 10 +++++----- arch/arm/mach-omap2/display.c | 7 +++++++ arch/arm/mach-omap2/display.h | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 3c1279f..520a4be 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -37,6 +37,7 @@ #include "mux.h" #include "control.h" #include "devices.h" +#include "display.h" #define L3_MODULES_MAX_LEN 12 #define L3_MODULES 3 @@ -504,13 +505,13 @@ static struct platform_device omap_vout_device = { .resource = &omap_vout_resource[0], .id = -1, }; -static void omap_init_vout(void) + +int __init omap_init_vout(void) { - if (platform_device_register(&omap_vout_device) < 0) - printk(KERN_ERR "Unable to register OMAP-VOUT device\n"); + return platform_device_register(&omap_vout_device); } #else -static inline void omap_init_vout(void) {} +int __init omap_init_vout(void) { return 0; } #endif #if IS_ENABLED(CONFIG_WL12XX) @@ -576,7 +577,6 @@ static int __init omap2_init_devices(void) } omap_init_sti(); omap_init_rng(); - omap_init_vout(); return 0; } diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index fb66e5a..a4e536b 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -437,6 +437,13 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) return r; } + /* create V4L2 display device */ + r = omap_init_vout(); + if (r < 0) { + pr_err("Unable to register omap_vout device\n"); + return r; + } + return 0; } diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h index bc7af40..f3d2ce4 100644 --- a/arch/arm/mach-omap2/display.h +++ b/arch/arm/mach-omap2/display.h @@ -29,4 +29,5 @@ struct omap_dss_dispc_dev_attr { int omap_init_drm(void); int omap_init_vrfb(void); int omap_init_fb(void); +int omap_init_vout(void); #endif