From patchwork Mon Aug 10 11:59:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 52222 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 4F64522919 for ; Mon, 10 Aug 2015 11:59:50 +0000 (UTC) Received: by labia3 with SMTP id ia3sf38820476lab.1 for ; Mon, 10 Aug 2015 04:59:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=pCKjO14xSU03/dxQ2jR9pzuZIRooWEswFzrClUte74Q=; b=DssbqSKPc2Rpf+etWtimWnsbO7YKUSSep9p/ZadoJ3Nc1fnXSvlUnHrnNVX2V0GFIH IP2oCl+RxfuAgZMMHsfgQoKB2DGye6+0c66UdzWAaIM8X7dQK7TRw488RceinQtDfnXc 6HIWybxf2uc3S2clJDN10XV9h2fMYbxx1R6LypVINqGwhgHIEu2K6aex0/L2wzTUqIVp 3Y2eMvuiC1P4uv77s160etcIon7QKxFiRIOV8ERseebVjYq/G6tkSCfWZGIYnFlMF2Np epD/HTIuCr2nDcyM4C1Pte3P0cIrhLx8UReMvGwcVipi6H7WQiLmTbs8BT73Q6wp7q50 IFYg== X-Gm-Message-State: ALoCoQne+M0rnN8aHN00D6yE088U/xSBZ+5u0XiUN+wXeE5H0U7F8zqSRO7zhv+nUCuMaliCe6sw X-Received: by 10.112.13.200 with SMTP id j8mr6310566lbc.14.1439207989261; Mon, 10 Aug 2015 04:59:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.201 with SMTP id p9ls365443lae.42.gmail; Mon, 10 Aug 2015 04:59:48 -0700 (PDT) X-Received: by 10.112.140.132 with SMTP id rg4mr19364355lbb.49.1439207988946; Mon, 10 Aug 2015 04:59:48 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ey6si13872132lbc.148.2015.08.10.04.59.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 04:59:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbtg9 with SMTP id tg9so55799907lbb.1 for ; Mon, 10 Aug 2015 04:59:48 -0700 (PDT) X-Received: by 10.112.176.228 with SMTP id cl4mr19876124lbc.106.1439207988857; Mon, 10 Aug 2015 04:59:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1888213lba; Mon, 10 Aug 2015 04:59:47 -0700 (PDT) X-Received: by 10.68.134.169 with SMTP id pl9mr44145510pbb.164.1439207987793; Mon, 10 Aug 2015 04:59:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hi6si32833536pac.81.2015.08.10.04.59.44; Mon, 10 Aug 2015 04:59:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbbHJL7n (ORCPT + 28 others); Mon, 10 Aug 2015 07:59:43 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:38349 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753759AbbHJL7h (ORCPT ); Mon, 10 Aug 2015 07:59:37 -0400 Received: by wicja10 with SMTP id ja10so22257012wic.1 for ; Mon, 10 Aug 2015 04:59:36 -0700 (PDT) X-Received: by 10.180.88.196 with SMTP id bi4mr24749934wib.70.1439207976341; Mon, 10 Aug 2015 04:59:36 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id lk16sm13470622wic.6.2015.08.10.04.59.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 04:59:35 -0700 (PDT) From: Srinivas Kandagatla To: dri-devel@lists.freedesktop.org, robdclark@gmail.com Cc: David Airlie , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH RFC 2/5] drm/msm/hdmi: make use of standard gpio properties. Date: Mon, 10 Aug 2015 12:59:34 +0100 Message-Id: <1439207974-30902-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439207923-30812-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1439207923-30812-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch modifies the driver to support standard gpio properties along with deprecated properties. This will help us upstream and cleanup the non-standard properties over the time. Signed-off-by: Srinivas Kandagatla --- drivers/gpu/drm/msm/hdmi/hdmi.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 8145362..e918889 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -339,19 +339,34 @@ static const struct of_device_id dt_match[] = { }; #ifdef CONFIG_OF +/* This code will be removed once we move to gpiod based calls */ static int get_gpio(struct device *dev, struct device_node *of_node, const char *name) { + char name2[32]; int gpio = of_get_named_gpio(of_node, name, 0); - if (gpio < 0) { - char name2[32]; - snprintf(name2, sizeof(name2), "%s-gpio", name); - gpio = of_get_named_gpio(of_node, name2, 0); - if (gpio < 0) { - dev_err(dev, "failed to get gpio: %s (%d)\n", - name, gpio); - gpio = -1; - } - } + + if (gpio_is_valid(gpio)) + goto deprecated; + + snprintf(name2, sizeof(name2), "%s-gpio", name); + gpio = of_get_named_gpio(of_node, name2, 0); + + if (gpio_is_valid(gpio)) + goto deprecated; + + + snprintf(name2, sizeof(name2), "%s-gpios", name); + gpio = of_get_named_gpio(of_node, name2, 0); + + if (gpio_is_valid(gpio)) + return gpio; + + dev_err(dev, "failed to get gpio: %s (%d)\n", name, gpio); + + return -1; + +deprecated: + dev_warn(dev, "binding deprecated for %s\n", name); return gpio; } #endif