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: 1476411 Return-Path: X-Original-To: patchwork-linux-omap@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 B81023FE79 for ; Wed, 19 Sep 2012 08:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755335Ab2ISIb4 (ORCPT ); Wed, 19 Sep 2012 04:31:56 -0400 Received: from na3sys009aog125.obsmtp.com ([74.125.149.153]:45252 "EHLO na3sys009aog125.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754506Ab2ISIbS (ORCPT ); Wed, 19 Sep 2012 04:31:18 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob125.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 y9so510698lag.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=Ao/mlbIwWFcGuSavn6ocb46hkes6s+EzYfrs5z1HLSO+uqROeVQH1vTn7c8hCOaer1 1yaG0ckjwCznVAoF16LYUI9otCFFMc3nIc0IU270LYxtJ3kmS4omq2GrRvmQRimI363X Nx/O6B7tvY+1pZeiOBTEhOyIRY/vVR8mo0GkejPZl6sgNkrmG3aq3NyJYh4/gNjYNlkd 8jnkCZ8QwQSg3v3Tpj9X47QYzb8nlUav8cAH50o7gNhMIBwDHDaLG3C8swOYDzq/KCpl MQrP7/fI/FBQ/x2EUrrGCZHviG8ECAsi4ddLirkrGrqM4P+pp0phkLnJsqMNj4KJCJP8 ERIw== 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: ALoCoQnYy0HyRYeQQ7zDV5BaAWfBXGuTUmGadTFx7dBtTNMkmgW79YWvZjNEsN+Hd1zVbfbIaOJK Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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