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: 6985411 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 235249F373 for ; Mon, 10 Aug 2015 15:15:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C5BF2076F for ; Mon, 10 Aug 2015 15:15:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 534D62074B for ; Mon, 10 Aug 2015 15:15:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BDED6E59A; Mon, 10 Aug 2015 08:15:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id 992CA6E4B8 for ; Mon, 10 Aug 2015 04:59:37 -0700 (PDT) Received: by wicja10 with SMTP id ja10so22257015wic.1 for ; Mon, 10 Aug 2015 04:59:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6VUY/sRpzjPT6peyAJo+Vl1bpzjhnMkzt3v28Nqn3Sc=; b=FcSslmtKXbr8BsCbanbhkadzBET4KN6p+A+Q26FGvnX+7evus63Wwx96aDlzM/JAIG jMhbFAGXdEby8EKZQJyYU0MD0CTl+nw0SGiyrxvVLF0ajTb5LH+KKxbU+U5Lm5+S8pRG ChhBs068SAXemd/K3LF4zczZiA31+1sXYUKiQIfEUU/y7q5+0zCi/UEsGkRyInPAi+r+ HKPiKNK3x8gCo5I0L6SnwF/XemreB80J3Om9Y28CBZy9paQ4Y6Ayzt7yDYaIRyq/R1jH F+H9zYSCLbYkzKLmy60d+mXw/1fLkals7X3co3yqKOX0vnLUN0nUfXST/gCXBqeQfhK8 mqSw== X-Gm-Message-State: ALoCoQndkj3y1aPlerzW23cpO7+WndymHGq7Q3scndTGtfMbMNlEE0gs4NzuC2zdQAiHpjnmcnyV 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 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> X-Mailman-Approved-At: Mon, 10 Aug 2015 08:15:26 -0700 Cc: linux-arm-msm@vger.kernel.org, Rob Herring , Srinivas Kandagatla , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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