From mboxrd@z Thu Jan 1 00:00:00 1970 From: Archit Taneja Subject: [PATCH v2 4/7] OMAP: DSS2: DSI: Use platform_device pointer to get dsi data Date: Thu, 12 May 2011 17:26:27 +0530 Message-ID: <1305201390-9724-5-git-send-email-archit@ti.com> References: <1305201390-9724-1-git-send-email-archit@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from arroyo.ext.ti.com ([192.94.94.40]:35132 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756027Ab1ELLwE (ORCPT ); Thu, 12 May 2011 07:52:04 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4CBq4wO019039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 May 2011 06:52:04 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id p4CBq38P009259 for ; Thu, 12 May 2011 06:52:03 -0500 (CDT) In-Reply-To: <1305201390-9724-1-git-send-email-archit@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: tomi.valkeinen@ti.com Cc: linux-omap@vger.kernel.org, Archit Taneja The dsi related data structure currently creates one global instance of itself which is accessed by dsi functions. Remove this global structure instance and declare the struct as dsi_data. Modify dsi_init() to allocate a "dsi_data" structure for each platform device instance. Link this data with the device's platform_device pointer. Create the function dsi_get_dsidrv_data() which takes the pdev and return a pointer to the device's dsi_data. Make dsi_get_dsidev_id() return only 0 for now, this will be removed once the name of the DSI platform device is changed to the device instance form, like "omapdss_dsi.0" and "omapdss_dsi.1" etc. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/dsi.c | 672 +++++++++++++++++++++++++---------------- 1 files changed, 409 insertions(+), 263 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 8d03eb6..61ee3db 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -34,6 +34,7 @@ #include #include #include +#include #include