From patchwork Sun Feb 17 00:43:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 2152721 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 B15B83FDF1 for ; Sun, 17 Feb 2013 00:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755121Ab3BQAts (ORCPT ); Sat, 16 Feb 2013 19:49:48 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:42048 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394Ab3BQAtr (ORCPT ); Sat, 16 Feb 2013 19:49:47 -0500 Received: by mail-ea0-f178.google.com with SMTP id a14so1889494eaa.9 for ; Sat, 16 Feb 2013 16:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=u/uGYlTSSdvFLr8SUZOt1eoTqmakLrsrt4myNV2YFlI=; b=Y2N3TT0ZvvOsLNWSD9SOc3RbwXpEwFCNx44+neL+60dVxKRzEzzfgwcOayct0ccOiE MOHy/dvVvlb/fxHUaAMnWtDyB136ji+8TA3HLV9jPXQwHZlS27N+WlTvXz+JJGURRLHF osTljUkWRBHM+cj86qEPsHVOxeY7tTi95AFdC+R8deJQwr195E2yDj4Ed4D/wpQIL5sZ AOYOoXEVc4knMIO5Dc14GNGXJq1mgBwqNfFN4x0s9D19rWvZzlhoYnF9qxs6MYZEatpN S2Q9UVTUWF/tCkv4rpfiKIZkjBkINekSac0rZbBkdRKVuYGW1WGi9t54mwKDd+5rRR0i 1sQw== X-Received: by 10.14.214.66 with SMTP id b42mr26243935eep.34.1361061786342; Sat, 16 Feb 2013 16:43:06 -0800 (PST) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPS id 46sm21691476eea.3.2013.02.16.16.43.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Feb 2013 16:43:05 -0800 (PST) From: Grazvydas Ignotas To: linux-fbdev@vger.kernel.org Cc: linux-omap@vger.kernel.org, Tomi Valkeinen , Archit Taneja , Grazvydas Ignotas Subject: [PATCH] OMAPDSS: tpo-td043 panel: fix data passing between SPI/DSS parts Date: Sun, 17 Feb 2013 02:43:12 +0200 Message-Id: <1361061792-2350-1-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This driver uses omap_dss_device that it gets from a board file through SPI platfrom_data pointer to pass data from SPI to DSS portion of the driver by using dev_set_drvdata(). However this trick no longer works, as DSS core no longer uses omap_dss_device from a board file to create the real device, so use a global pointer to accomplish this instead, like other SPI panel drivers do. Signed-off-by: Grazvydas Ignotas --- .../video/omap2/displays/panel-tpo-td043mtea1.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index 6b66439..048c983 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c @@ -63,6 +63,9 @@ struct tpo_td043_device { u32 power_on_resume:1; }; +/* used to pass spi_device from SPI to DSS portion of the driver */ +static struct tpo_td043_device *g_tpo_td043; + static int tpo_td043_write(struct spi_device *spi, u8 addr, u8 data) { struct spi_message m; @@ -403,7 +406,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) static int tpo_td043_probe(struct omap_dss_device *dssdev) { - struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); + struct tpo_td043_device *tpo_td043 = g_tpo_td043; int nreset_gpio = dssdev->reset_gpio; int ret = 0; @@ -440,6 +443,8 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) if (ret) dev_warn(&dssdev->dev, "failed to create sysfs files\n"); + dev_set_drvdata(&dssdev->dev, tpo_td043); + return 0; fail_gpio_req: @@ -505,6 +510,9 @@ static int tpo_td043_spi_probe(struct spi_device *spi) return -ENODEV; } + if (g_tpo_td043 != NULL) + return -EBUSY; + spi->bits_per_word = 16; spi->mode = SPI_MODE_0; @@ -521,7 +529,7 @@ static int tpo_td043_spi_probe(struct spi_device *spi) tpo_td043->spi = spi; tpo_td043->nreset_gpio = dssdev->reset_gpio; dev_set_drvdata(&spi->dev, tpo_td043); - dev_set_drvdata(&dssdev->dev, tpo_td043); + g_tpo_td043 = tpo_td043; omap_dss_register_driver(&tpo_td043_driver); @@ -534,6 +542,7 @@ static int tpo_td043_spi_remove(struct spi_device *spi) omap_dss_unregister_driver(&tpo_td043_driver); kfree(tpo_td043); + g_tpo_td043 = NULL; return 0; }