From patchwork Wed Sep 19 08:30:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1476401 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 999033FE65 for ; Wed, 19 Sep 2012 08:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311Ab2ISIbz (ORCPT ); Wed, 19 Sep 2012 04:31:55 -0400 Received: from na3sys009aog124.obsmtp.com ([74.125.149.151]:47613 "EHLO na3sys009aog124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754335Ab2ISIbS (ORCPT ); Wed, 19 Sep 2012 04:31:18 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKUFmC1dqOVo3nVq3/NZ8vRlhhqud2I6ea@postini.com; Wed, 19 Sep 2012 01:31:17 PDT Received: by lagy9 with SMTP id y9so510699lag.19 for ; Wed, 19 Sep 2012 01:31:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=UGAOmOvPNXHqWzZJlotNyyp3tZJn5hXWbzOvV8a35B0=; b=RVXCO+ZlB2DtWwRUgleV+YLTbZqVMf86hnc9FDdEYuoWW0jj1x9kzPv0tXpYR2/VZI rk/ObenAUblKOkm73iA1YgzvA5wjyPGh59hHrJ/gnmKBiJQYwRiqn0e19QMKkVlbKPCG y3+vPL2Pds5eEVBqAv4sYOcrcgPgWv57J5P8/Rbi/VMK3IueyN8sfmsFgMxXY8xUM8bc Ry0EPqCvsFm2yTcD/QsnaTfHFNFAZfybVzxSvXRF2ed/Vdro2I2XPJigSkbWg+74z+uM G8s41SXUVITkIZ2rAmQsltymLGartb70ox3rBTLxg5MydJB7AnSrWxiTRMcV7mb37Ivd 6kBQ== Received: by 10.152.112.136 with SMTP id iq8mr2051734lab.18.1348043475601; Wed, 19 Sep 2012 01:31:15 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id r8sm589958lba.15.2012.09.19.01.31.13 (version=SSLv3 cipher=OTHER); Wed, 19 Sep 2012 01:31:14 -0700 (PDT) From: Tomi Valkeinen To: archit@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 8/8] OMAPDSS: alloc dssdevs dynamically Date: Wed, 19 Sep 2012 11:30:38 +0300 Message-Id: <1348043438-2624-9-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348043438-2624-1-git-send-email-tomi.valkeinen@ti.com> References: <1348043438-2624-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQnlgYA5hN+DC9PiQ3lplFbTpdH119pAZOCADaFZEP22/zcZ5uavqMXzbF49NyhhXxJpZTRy Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org We currently create omap_dss_devices statically in board files, and use those devices directly in the omapdss driver. This model prevents us from having the platform data (which the dssdevs in board files practically are) as read-only, and it's also different than what we will use with device tree. This patch changes the model to be in line with DT model: we allocate the dssdevs dynamically, and initialize them according to the data in the board file's dssdev (basically we memcopy the dssdev fields). The allocation and registration is done in the following steps in the output drivers: - Use dss_alloc_and_init_device to allocate and initialize the device. The function uses kalloc and device_initialize to accomplish this. - Call dss_copy_device_pdata to copy the data from the board file's dssdev - Use dss_add_device to register the device. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/core.c | 72 ++++++++++++++++++++-------------------- drivers/video/omap2/dss/dpi.c | 17 +++++++--- drivers/video/omap2/dss/dsi.c | 15 +++++++-- drivers/video/omap2/dss/dss.h | 11 +++--- drivers/video/omap2/dss/hdmi.c | 15 +++++++-- drivers/video/omap2/dss/rfbi.c | 17 +++++++--- drivers/video/omap2/dss/sdi.c | 17 +++++++--- drivers/video/omap2/dss/venc.c | 17 +++++++--- 8 files changed, 119 insertions(+), 62 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index c4fd768..b2af72d 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -33,6 +33,7 @@ #include #include #include +#include #include