From patchwork Wed Dec 9 15:59:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 7809671 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0B1DBEEE1 for ; Wed, 9 Dec 2015 16:00:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 089A2203C1 for ; Wed, 9 Dec 2015 16:00:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0771204AE for ; Wed, 9 Dec 2015 16:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751949AbbLIQAO (ORCPT ); Wed, 9 Dec 2015 11:00:14 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:34758 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbbLIQAO (ORCPT ); Wed, 9 Dec 2015 11:00:14 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tB9G0BQ1017330; Wed, 9 Dec 2015 10:00:11 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tB9G0BlB029328; Wed, 9 Dec 2015 10:00:11 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Wed, 9 Dec 2015 10:00:11 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id tB9G02K8028647; Wed, 9 Dec 2015 10:00:10 -0600 From: Tomi Valkeinen To: , Laurent Pinchart CC: Manisha Agrawal , Tomi Valkeinen Subject: [PATCH 05/23] OMAPDSS: tpd12s015: CT_CP_HPD as optional gpio Date: Wed, 9 Dec 2015 17:59:33 +0200 Message-ID: <1449676791-26304-6-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449676791-26304-1-git-send-email-tomi.valkeinen@ti.com> References: <1449676791-26304-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Manisha Agrawal tpd12s015 HW has LS_OE, CT_CP_HPD and HPD gpios. Out of these gpios, driver only handled LS_OE as optional. The CT_CP_HPD gpio should also be treated as optional gpio as it is just a power saving feature. Some boards hardwire this gpio to be always enable. In this patch, all access to CT_CP_HPD gpio is made optional. Signed-off-by: Manisha Agrawal Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart --- drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c index 93f95eaeadad..45a0b8e8d320 100644 --- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c @@ -46,9 +46,11 @@ static int tpd_connect(struct omap_dss_device *dssdev, dst->src = dssdev; dssdev->dst = dst; - gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1); - /* DC-DC converter needs at max 300us to get to 90% of 5V */ - udelay(300); + if (ddata->ct_cp_hpd_gpio) { + gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1); + /* DC-DC converter needs at max 300us to get to 90% of 5V */ + udelay(300); + } return 0; } @@ -64,7 +66,8 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, if (dst != dssdev->dst) return; - gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0); + if (ddata->ct_cp_hpd_gpio) + gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0); dst->src = NULL; dssdev->dst = NULL; @@ -240,7 +243,7 @@ static int tpd_probe(struct platform_device *pdev) } - gpio = devm_gpiod_get_index(&pdev->dev, NULL, 0, + gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0, GPIOD_OUT_LOW); if (IS_ERR(gpio)) goto err_gpio;