From patchwork Wed Feb 13 14:22:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 2137011 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 35B113FCF6 for ; Wed, 13 Feb 2013 14:24:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934132Ab3BMOYh (ORCPT ); Wed, 13 Feb 2013 09:24:37 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:39945 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934079Ab3BMOYg (ORCPT ); Wed, 13 Feb 2013 09:24:36 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1DEOZJW019338; Wed, 13 Feb 2013 08:24:35 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1DEOZ8t010231; Wed, 13 Feb 2013 08:24:35 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 13 Feb 2013 08:24:36 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1DEOZDC023928; Wed, 13 Feb 2013 08:24:35 -0600 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.137.46]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r1DEOXV16298; Wed, 13 Feb 2013 08:24:34 -0600 (CST) From: Archit Taneja To: CC: , , Archit Taneja Subject: [PATCH 27/33] OMAPDSS: n8x0 panel: handle gpio data in panel driver Date: Wed, 13 Feb 2013 19:52:19 +0530 Message-ID: <1360765345-19312-28-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360765345-19312-1-git-send-email-archit@ti.com> References: <1360765345-19312-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 The n8x0 panel driver leaves gpio configurations to the platform_enable and disable calls in the platform's board file. These should happen in the panel driver itself. A platform data struct called panel_n8x0_data already exists to hold gpio numbers and other platform data. However, the gpio requests are expected to be done in the board file and not the panel driver. Request all the gpios in the panel driver so that the board files which use the the panel don't need to do it. This will help in removing the need for the panel drivers to have platform related callbacks. Signed-off-by: Archit Taneja --- drivers/video/omap2/displays/panel-n8x0.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c index 9c55c91..c146a3d 100644 --- a/drivers/video/omap2/displays/panel-n8x0.c +++ b/drivers/video/omap2/displays/panel-n8x0.c @@ -426,6 +426,7 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) { struct panel_n8x0_data *bdata = get_board_data(dssdev); struct panel_drv_data *ddata; + int r; dev_dbg(&dssdev->dev, "probe\n"); @@ -444,6 +445,20 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) dssdev->ctrl.rfbi_timings = n8x0_panel_timings; dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; + if (gpio_is_valid(bdata->panel_reset)) { + r = devm_gpio_request_one(&dssdev->dev, bdata->panel_reset, + GPIOF_OUT_INIT_LOW, "PANEL RESET"); + if (r) + return r; + } + + if (gpio_is_valid(bdata->ctrl_pwrdown)) { + r = devm_gpio_request_one(&dssdev->dev, bdata->ctrl_pwrdown, + GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN"); + if (r) + return r; + } + return 0; }