From patchwork Fri Aug 23 07:34:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B719F1709 for ; Fri, 23 Aug 2019 07:34:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FA0D2341F for ; Fri, 23 Aug 2019 07:34:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FA0D2341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96CFB6EBC7; Fri, 23 Aug 2019 07:34:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 384436E040 for ; Fri, 23 Aug 2019 07:34:56 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id x3so6455910lfc.0 for ; Fri, 23 Aug 2019 00:34:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aLw4CRSPJ3WKrmTX2TV02F/5DZkmqEb7ZJ94kU2yaI8=; b=VnZ9cdbBSM9ygriMGqJFM2lfeixxUbRRxBmSIoccdP3GYzOUkXpfmVUFklEGcLgYvn KcdqCnsn7bM+3u1KMKfrrjINWhHZzFzCohe/8N7lEzuePAJAAPYf7txN3MINGuEs4PUq hkJs0OR3N16U67TCd0qMTq3SR5YNGONRbHZASL5iCmySK5/uk4kmdmCuim5A22zWrJ/J bAGsefovwiUgijbfx50t3PKCUhpsk+JqIb8xtQ1DZZO7YiVhmOTypBuKa8jHioa6VZvq 7vDygW4kaXO6//EJLvjNMqRZfKwR/d6NTQbmzgbP95klB/86BlWmd6tChw95v+DEoh5X Zlaw== X-Gm-Message-State: APjAAAWCbExcVt492F/lUxT/HsgZ8cEYS2kWSkEZJo+7UcxXZouAkBC/ S8kx9k9nagpTnbm7AKnhjKwNZA== X-Google-Smtp-Source: APXvYqxxsyuYmqHanoZNUMD5o5aUUSlZcJr9+cGYQ4QpjraO5WVJnV9YZinq5/Pk3jeJh6ojZT+g4w== X-Received: by 2002:a19:5217:: with SMTP id m23mr1846635lfb.124.1566545694604; Fri, 23 Aug 2019 00:34:54 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:34:53 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/6 v2] drm/msm/mdp4: Drop unused GPIO include Date: Fri, 23 Aug 2019 09:34:43 +0200 Message-Id: <20190823073448.8385-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aLw4CRSPJ3WKrmTX2TV02F/5DZkmqEb7ZJ94kU2yaI8=; b=mphS1O4ssdOoGeOzJ5pPlICCD+JVCVu7mO1MYI2hIn4o48+vvTMUX6lt5XrggcYA32 3In3CIS0bcTGBJwH+b1sZUdhF/nQD37bGMatfAZpEdoazdQHOLooCOCJ1pWPa3JpUSFp s/s1cqjf5sVKoYN7NiOpW2LyVU6l4EtZ5sdFNNiKvnc0dy8TNTNdKsG/aH+lB5k1Jsi1 sdntV9G3GRZAv74A3j7jm4q0qvTQN+sTzDNn8VmGxd9kJmr5KxouK+7IDh1pQSWaobo8 vYI0wikqg9vW9Iv6zET6CYfA6LUFuA3q6HYz41laNEhEJRUKglRPTb7n9qTylzzu8y4k 11bg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This file is not using any symbols from so just drop this include. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c index ecef4f5b9f26..9262ed2dc8c3 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c @@ -5,8 +5,6 @@ * Author: Vinay Simha */ -#include - #include "mdp4_kms.h" struct mdp4_lvds_connector { From patchwork Fri Aug 23 07:34:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1D491709 for ; Fri, 23 Aug 2019 07:35:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA7452341F for ; Fri, 23 Aug 2019 07:35:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA7452341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA0076EBD3; Fri, 23 Aug 2019 07:35:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B3196EBCD for ; Fri, 23 Aug 2019 07:34:58 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id x3so7954894lji.5 for ; Fri, 23 Aug 2019 00:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tWhyqZI+RyxZp+FLk4Dgae8z/RXq1pkybZ7Bwrb+ZCM=; b=KmZ4wTj0kp03zNEVbwOEmaJVq24C9pdJ6ucE+7aKBugkzKEvjOLTh/okEGOSH+Aond jbgHaQQ+BRtTPe98GiMtmmOK9uL/ISeSja90jHwVb0+r3Wp0IwjABnVQGcCU3AySroPw gVdiQYlcDAD480Y4dM3X8tuxSaBTT0Ldvh7m1lHxuinz9AStMXo/Zb9MvWaHBUJSAxIv pT/q+hrrtziLEovuwTVgRgIG+mHKwIJzE+e3mSb6of4aI1SNZ2IbGmO9YnojuWzfYwEN ssuCy49jWmEsN8G634s3c3O4yqh8XA/a2fwrbX0/nxt8jJdzJkYcszC7sf/lrAsoi1GR VJxQ== X-Gm-Message-State: APjAAAWc2tNojtu1gm9FuuyF/kPkFaqNgU2ZUhdCFs2OjZnnTIqU6PjP mw7hdRywOCafqoMitiZUG06Gog== X-Google-Smtp-Source: APXvYqwE7u2Cs/tTCozVbGiGnJ7iMpM+OrgYgkUfeZIdWWR0fNMzgWHa/Qd+FYH1ykVSS4a9eQpqHA== X-Received: by 2002:a2e:914c:: with SMTP id q12mr2052131ljg.34.1566545696789; Fri, 23 Aug 2019 00:34:56 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:34:55 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 2/6 v2] drm/msm/dsi: Drop unused GPIO includes Date: Fri, 23 Aug 2019 09:34:44 +0200 Message-Id: <20190823073448.8385-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823073448.8385-1-linus.walleij@linaro.org> References: <20190823073448.8385-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tWhyqZI+RyxZp+FLk4Dgae8z/RXq1pkybZ7Bwrb+ZCM=; b=iZWqkN2xUIjsY5VbuNfnpVbnLrR2fvQe/6iNNcrdauqIWg8r7Lk9WFj1khRph5byLA 6RwOND0kiZNLX9/QXicq6PnTD0NyE7i2/icCnxLNy9dEW/MBWvqtrsMUWqYAXDaau8Ee McR3meUDHDe+NB+ZypD2E0zMsvAH2BYeZRjT86W6EtOyasq0OyPz1Hzj0u8s/2flH8gb TYakAXyFno2/OQgZMgVPPaNaDw+db76oJBcTJC9J+Q5lF88aKm6W0dktNQ4AtSgeeaZH IdMwt0tQzKHa7611JHWfdn40qS8MRaCeVqMtrDxRolM1hawqxFWbc6MT7SiIp+a9Srnx 7Rzw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This DSI driver uses the new descriptor API so these old GPIO API includes are surplus. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index aa35d18ab43c..4b6f62138390 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -6,11 +6,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include From patchwork Fri Aug 23 07:34:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91E2414DE for ; Fri, 23 Aug 2019 07:35:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7AA402341F for ; Fri, 23 Aug 2019 07:35:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AA402341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A34D16EBCD; Fri, 23 Aug 2019 07:35:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id A5F7F6EBD3 for ; Fri, 23 Aug 2019 07:35:00 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id t14so7975071lji.4 for ; Fri, 23 Aug 2019 00:35:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+rL/k87007QFrN6e8/rQoCbxlA21xVkhbLU9RX3RGko=; b=B7kDATkK2wZ8WWxEWCdmbf9w0aF1FMGZk5lCmrLzmyfPCyaS1bC/d53QE3g9nZt4L6 LyJKcsyoRoI4w9KjabmBOQ7hDlE9jgJ2IFVaxZfgU04vj7R4NhfwaTAtPVA+rlcepwgq Ma2hIv3tiDeh65f/6ZFgG5YEBI4p6WOIOs1255bbjQQ1d8SS9yhbZFhP6pzXy/nnglVF NenVC7Q2TQaa3M/xef/vOxqgqGZgykPVLX0WivNidoQrBNNCdhcjE8fM3bWGQZDvueMw 0u6aQGHllzjy+FKtyMNofxHeRBh1fi7MLKyxOt62niyK6NNOoTqc2ND1Ggw2nKieoevm DZiw== X-Gm-Message-State: APjAAAWMtrfHY9jN5/T9KrmeEL5kglSCLTUFpgrHnOPTlNs4BbuG9L20 vQduXxiedobTn84Elfpdc0lluQ== X-Google-Smtp-Source: APXvYqxjnXzHD039zi6yAqeD5P5LSVZFVpvOrtuYsr7ppbLYLI9K3Q8lh/YIW2xm1hJjGxpWyos0yg== X-Received: by 2002:a2e:93cc:: with SMTP id p12mr2056927ljh.11.1566545698976; Fri, 23 Aug 2019 00:34:58 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:34:57 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/6 v2] drm/msm/dpu: Drop unused GPIO code Date: Fri, 23 Aug 2019 09:34:45 +0200 Message-Id: <20190823073448.8385-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823073448.8385-1-linus.walleij@linaro.org> References: <20190823073448.8385-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+rL/k87007QFrN6e8/rQoCbxlA21xVkhbLU9RX3RGko=; b=kWDp/eQtFpkwvLB6mBWwZMB+kZWqs4saJHbExwKbSt/Iqnpg7B5CI5goPDzEnqhX17 kdOslO6f4BYjB4EkEK5l+Jl1Tk1wpgHzojh5Fxdxjrqa66AJHSVlYN/M23vcQfr3ByyY ya6SAhLe0ZU8zwqxfJW3sN/dfcgxXnFA3InNoY2r7TOKXz6u01JY/RzR5tRo9QonYwUZ 0dP/Eaij55d+j9YKiF6cZxLuyYcDpDTXHtbYUp+4iX/JDNqkrfpx5PvG/e2IQQkhVN+z BfzVleLdfYSycw7GVmo2G3XAcSEhY6AO46nKZD5ND/ITl6v9bFSA8nbS5fDDnSUoGwfM qW1Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DPU has some kind of idea that it wants to be able to bring up power using GPIO lines. The struct dss_gpio is however completely unused and should this be done, it should be done using the GPIO descriptor framework rather than this API which relies on the global GPIO numberspace. Delete this code before anyone hurt themselves. The inclusion of was abused to get some OF and IRQ headers implicitly included into the DPU utilities, make these includes explicit and push them down into the actual implementation. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h | 9 --------- drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 4 ++++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c index 71b6987bff1e..27fbeb504362 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c @@ -7,6 +7,7 @@ #include #include #include +#include #include diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h index 09083e9f06bb..e6b5c772fa3b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h @@ -5,7 +5,6 @@ #ifndef __DPU_IO_UTIL_H__ #define __DPU_IO_UTIL_H__ -#include #include #include @@ -14,12 +13,6 @@ #define DEV_WARN(fmt, args...) pr_warn(fmt, ##args) #define DEV_ERR(fmt, args...) pr_err(fmt, ##args) -struct dss_gpio { - unsigned int gpio; - unsigned int value; - char gpio_name[32]; -}; - enum dss_clk_type { DSS_CLK_AHB, /* no set rate. rate controlled through rpm */ DSS_CLK_PCLK, @@ -34,8 +27,6 @@ struct dss_clk { }; struct dss_module_power { - unsigned int num_gpio; - struct dss_gpio *gpio_config; unsigned int num_clk; struct dss_clk *clk_config; }; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c index 986915bbbc02..c977baddfffd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c @@ -3,6 +3,10 @@ * Copyright (c) 2018, The Linux Foundation */ +#include +#include +#include +#include #include "dpu_kms.h" #include From patchwork Fri Aug 23 07:34:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FA7714DE for ; Fri, 23 Aug 2019 07:35:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0857E2341F for ; Fri, 23 Aug 2019 07:35:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0857E2341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D04146EBD7; Fri, 23 Aug 2019 07:35:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FDFF6EBD8 for ; Fri, 23 Aug 2019 07:35:02 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id x18so7982008ljh.1 for ; Fri, 23 Aug 2019 00:35:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U4JjuaJiqXMB2o4Ei0Z8NiWiXfcICpnx2WAq5seW+dw=; b=UZihlrsYnkzI+QJOyXJ0B9atuCmXUAFqGFyFUsNAY9ky9eRB6c8rA+n6e0ZbL/UW9O LONd8XNzAhYRDAZdKdM1XM3XzdbOD9S7b7Ks4yn5p/ZJlm1vfqUGyWxYr6XeuHBzuUGW N5ROEMwcctyh0G4VvrxtiHETUjubyzwoQLEBXx+U4ljn0fj7kG8ak/TAuDbQH/zNwjRe tICWK9aK/5FHtHloybFvHtXKToSBMB6HfnCglKtcyUFVo//VzwvF2ZGFIA/x2CDgxkoq ikZJ1wvzE0m4XeTaZ8B6sHxuWH4yGpcctmO/afJx5soFh3aLDBbCY1fodhEo25CcFaIk FH3A== X-Gm-Message-State: APjAAAXCpMcuWte1AgsO8SwPQGw7bJ2I9Sus3fiolrnUeJqZJNaISLnc BF2G3i/Ga71em0f3sLfLmyrEKg== X-Google-Smtp-Source: APXvYqx61Q5ijD7n7Msa4Yk7wnjy3PO7NaRoLanNXNHaTVeOVPLkcRICF53epznQywZG1c9aDGtNpQ== X-Received: by 2002:a2e:8651:: with SMTP id i17mr2102549ljj.136.1566545700968; Fri, 23 Aug 2019 00:35:00 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:34:59 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 4/6 v2] drm/msm/hdmi: Convert to use GPIO descriptors Date: Fri, 23 Aug 2019 09:34:46 +0200 Message-Id: <20190823073448.8385-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823073448.8385-1-linus.walleij@linaro.org> References: <20190823073448.8385-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U4JjuaJiqXMB2o4Ei0Z8NiWiXfcICpnx2WAq5seW+dw=; b=beKwdrHHjuxuM0+kjruLKtl6q5NuVehPNcKCcVIjm80K0ZHnbd4x/gqtWXZv7zRPPe Ih2kNUo2fRTf+xw1lCPan3iXcUNi0TPr6bkXJHWyKxYfep4Yw5uw6HitrSBtNL/4voHp LFG3HGCk1lDI7uU605QCiQIpAxS1kRUSkQo5RICVVSfPKa3bgJBp3DqRbxLYOK6xQ3yS WvnPnt+pZgJKHa7t+KSFPJ6FOBCCDrRIIFLmdgZPxZu2kinYsyqBxbm+omEVcgGtogHt H1QzPhjyPeDFksPwhZUu0fpAhy+OkPhcW8Ztl7OaW99MgPfFCHADyoIdDQneceDcqwCW 7a3Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This switches the MSM HDMI code to use GPIO descriptors. Normally we would fetch the GPIOs from the device with the flags GPIOD_IN or GPIOD_OUT_[LOW|HIGH] to set up the lines immediately, but since the code seems eager to actively drive the lines high/low when turning HDMI on and off, we just fetch the GPIOs as-is and keep the code explicitly driving them. The old code would try legacy bindings (GPIOs without any "-gpios" suffix) but this has been moved to the gpiolib as a quirk by the previous patch. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/hdmi/hdmi.c | 66 +++++++++++------------ drivers/gpu/drm/msm/hdmi/hdmi.h | 4 +- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 42 +++++---------- 3 files changed, 45 insertions(+), 67 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 0e4217be3f00..355afb936401 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -425,38 +425,6 @@ static const struct { { "qcom,hdmi-tx-mux-lpm", true, 1, "HDMI_MUX_LPM" }, }; -static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) -{ - int gpio; - - /* try with the gpio names as in the table (downstream bindings) */ - gpio = of_get_named_gpio(of_node, name, 0); - if (gpio < 0) { - char name2[32]; - - /* try with the gpio names as in the upstream bindings */ - snprintf(name2, sizeof(name2), "%s-gpios", name); - gpio = of_get_named_gpio(of_node, name2, 0); - if (gpio < 0) { - char name3[32]; - - /* - * try again after stripping out the "qcom,hdmi-tx" - * prefix. This is mainly to match "hpd-gpios" used - * in the upstream bindings - */ - if (sscanf(name2, "qcom,hdmi-tx-%s", name3)) - gpio = of_get_named_gpio(of_node, name3, 0); - } - - if (gpio < 0) { - DBG("failed to get gpio: %s (%d)", name, gpio); - gpio = -1; - } - } - return gpio; -} - /* * HDMI audio codec callbacks */ @@ -582,11 +550,39 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) hdmi_cfg->qfprom_mmio_name = "qfprom_physical"; for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { - hdmi_cfg->gpios[i].num = msm_hdmi_get_gpio(of_node, - msm_hdmi_gpio_pdata[i].name); + const char *name = msm_hdmi_gpio_pdata[i].name; + struct gpio_desc *gpiod; + + /* + * We are fetching the GPIO lines "as is" since the connector + * code is enabling and disabling the lines. Until that point + * the power-on default value will be kept. + */ + gpiod = devm_gpiod_get_optional(dev, name, GPIOD_ASIS); + /* This will catch e.g. -PROBE_DEFER */ + if (IS_ERR(gpiod)) + return PTR_ERR(gpiod); + if (!gpiod) { + /* Try a second time, stripping down the name */ + char name3[32]; + + /* + * Try again after stripping out the "qcom,hdmi-tx" + * prefix. This is mainly to match "hpd-gpios" used + * in the upstream bindings. + */ + if (sscanf(name, "qcom,hdmi-tx-%s", name3)) + gpiod = devm_gpiod_get_optional(dev, name3, GPIOD_ASIS); + if (IS_ERR(gpiod)) + return PTR_ERR(gpiod); + if (!gpiod) + DBG("failed to get gpio: %s", name); + } + hdmi_cfg->gpios[i].gpiod = gpiod; + if (gpiod) + gpiod_set_consumer_name(gpiod, msm_hdmi_gpio_pdata[i].label); hdmi_cfg->gpios[i].output = msm_hdmi_gpio_pdata[i].output; hdmi_cfg->gpios[i].value = msm_hdmi_gpio_pdata[i].value; - hdmi_cfg->gpios[i].label = msm_hdmi_gpio_pdata[i].label; } dev->platform_data = hdmi_cfg; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index 982865866a29..bdac452b00fb 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "msm_drv.h" @@ -22,10 +23,9 @@ struct hdmi_phy; struct hdmi_platform_config; struct hdmi_gpio_data { - int num; + struct gpio_desc *gpiod; bool output; int value; - const char *label; }; struct hdmi_audio { diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index 07b4cb877d82..d0575d4f747d 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -4,7 +4,7 @@ * Author: Rob Clark */ -#include +#include #include #include "msm_kms.h" @@ -68,30 +68,21 @@ static void msm_hdmi_phy_reset(struct hdmi *hdmi) static int gpio_config(struct hdmi *hdmi, bool on) { - struct device *dev = &hdmi->pdev->dev; const struct hdmi_platform_config *config = hdmi->config; - int ret, i; + int i; if (on) { for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { struct hdmi_gpio_data gpio = config->gpios[i]; - if (gpio.num != -1) { - ret = gpio_request(gpio.num, gpio.label); - if (ret) { - DRM_DEV_ERROR(dev, - "'%s'(%d) gpio_request failed: %d\n", - gpio.label, gpio.num, ret); - goto err; - } - + if (gpio.gpiod) { if (gpio.output) { - gpio_direction_output(gpio.num, - gpio.value); + gpiod_direction_output(gpio.gpiod, + gpio.value); } else { - gpio_direction_input(gpio.num); - gpio_set_value_cansleep(gpio.num, - gpio.value); + gpiod_direction_input(gpio.gpiod); + gpiod_set_value_cansleep(gpio.gpiod, + gpio.value); } } } @@ -101,29 +92,20 @@ static int gpio_config(struct hdmi *hdmi, bool on) for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { struct hdmi_gpio_data gpio = config->gpios[i]; - if (gpio.num == -1) + if (!gpio.gpiod) continue; if (gpio.output) { int value = gpio.value ? 0 : 1; - gpio_set_value_cansleep(gpio.num, value); + gpiod_set_value_cansleep(gpio.gpiod, value); } - - gpio_free(gpio.num); }; DBG("gpio off"); } return 0; -err: - while (i--) { - if (config->gpios[i].num != -1) - gpio_free(config->gpios[i].num); - } - - return ret; } static void enable_hpd_clocks(struct hdmi *hdmi, bool enable) @@ -311,7 +293,7 @@ static enum drm_connector_status detect_gpio(struct hdmi *hdmi) const struct hdmi_platform_config *config = hdmi->config; struct hdmi_gpio_data hpd_gpio = config->gpios[HPD_GPIO_INDEX]; - return gpio_get_value(hpd_gpio.num) ? + return gpiod_get_value(hpd_gpio.gpiod) ? connector_status_connected : connector_status_disconnected; } @@ -330,7 +312,7 @@ static enum drm_connector_status hdmi_connector_detect( * some platforms may not have hpd gpio. Rely only on the status * provided by REG_HDMI_HPD_INT_STATUS in this case. */ - if (hpd_gpio.num == -1) + if (!hpd_gpio.gpiod) return detect_reg(hdmi); do { From patchwork Fri Aug 23 07:34:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67FB61709 for ; Fri, 23 Aug 2019 07:35:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 50A502341F for ; Fri, 23 Aug 2019 07:35:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50A502341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 379726EBDA; Fri, 23 Aug 2019 07:35:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 999746EBD7 for ; Fri, 23 Aug 2019 07:35:05 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id x3so7955185lji.5 for ; Fri, 23 Aug 2019 00:35:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZiXvXuEAB80JH4Izjr6bAOct54iEzBQ2GtzAaQY3rk=; b=OUj56niQWyvkJaG8UOn/zkH4ISJF0y0jwp4np3AIXp92yTEotG44ylfY6cIsZyC4yi 3qppZxD8pt0B/mKztILOwty+tV2o+MPrQ5PsjcVrBjP+dzpjU/iyiEtmb1oIW2ECObmy /z50IkC2syz/i5Nx/SKY0DjDQU8jbLG8oVEPeWalwHHKoXIPdUBdzoRTGu2/jC+IkezL nEzXs502XI4Y0KILcIDbtfmDXFBZfm1bR2WNwFFQgzpDIPpXJiBInK/wZ4nlNH3Euhoh FXOjyR6CqTJEcboM2a11A/1HRtrZ+cmkY9zf5MxFBMm8WqoKXMIu/ZUCN/kDR30iJONZ 2LSg== X-Gm-Message-State: APjAAAX7uORIuokPUzlL3a6mVNyx/GLfZOTMN/HOiwEfDgXshRSgnZPB RFCT/jFtslnmin+gbeLZaNavYQ== X-Google-Smtp-Source: APXvYqwggeDlxFAPMMtQH3mwrmyGH02VY7NAKe26ctEF5h2N8nl5sVriLG9JqvdvB1+w9Xo94SbAjg== X-Received: by 2002:a2e:8559:: with SMTP id u25mr1987921ljj.224.1566545703187; Fri, 23 Aug 2019 00:35:03 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:35:02 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 5/6 v2] drm/msm/hdmi: Bring up HDMI connector OFF Date: Fri, 23 Aug 2019 09:34:47 +0200 Message-Id: <20190823073448.8385-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823073448.8385-1-linus.walleij@linaro.org> References: <20190823073448.8385-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZiXvXuEAB80JH4Izjr6bAOct54iEzBQ2GtzAaQY3rk=; b=fhuZt4UcPw1bSfjxRqNz+x/5kXt33QMeN67+VvZhvbEOmTSj1Faeyii4zpBlIx/md9 4L90S3OBpsHUIUNG9LSJBM3fblGBV7uBek3dfGMIliNHM/XhtxwY4AqBYwHPTpt9usvm SncGQV2uykuVT03rhAhf8/B1k2Cs6Nge2fe1y1nQleSrxGYuC15a1cx33H7egG2Q1jfh e7hjwSwNZCJvcHJurOOQ92cC+WdTdDS0sx74wzf0KLsmkMBe4Qg3+n0R311jRcdj62ft aD6+jr6mc2uvK87tmDE5tJ+/GScdSTn4cAgL+S3PPol/ThWHRH5IWlzWkDC+IRXTUPrL H6jA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is elaborate code in the HDMI connector handling to leave the connector in the state it was at power-on and only touch the GPIOs when the connector .enable() and .disable() callbacks are called. I don't think this is what we normally want, initialize the connector as OFF (possibly saving power?) using the appropriate GPIO descriptor flags. It will still be switched on/off in the enable()/disable() connector callback as before, but we can drop some strange surplus code. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/hdmi/hdmi.c | 19 ++++++++++++----- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 25 ++++++----------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 355afb936401..5739eec65659 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -552,13 +552,22 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { const char *name = msm_hdmi_gpio_pdata[i].name; struct gpio_desc *gpiod; + enum gpiod_flags flags; /* - * We are fetching the GPIO lines "as is" since the connector - * code is enabling and disabling the lines. Until that point - * the power-on default value will be kept. + * Notice the inverse set up here: we initialize the connector + * to OFF state. */ - gpiod = devm_gpiod_get_optional(dev, name, GPIOD_ASIS); + if (msm_hdmi_gpio_pdata[i].output) { + if (msm_hdmi_gpio_pdata[i].value) + flags = GPIOD_OUT_LOW; + else + flags = GPIOD_OUT_HIGH; + } else { + flags = GPIOD_IN; + } + + gpiod = devm_gpiod_get_optional(dev, name, flags); /* This will catch e.g. -PROBE_DEFER */ if (IS_ERR(gpiod)) return PTR_ERR(gpiod); @@ -572,7 +581,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) * in the upstream bindings. */ if (sscanf(name, "qcom,hdmi-tx-%s", name3)) - gpiod = devm_gpiod_get_optional(dev, name3, GPIOD_ASIS); + gpiod = devm_gpiod_get_optional(dev, name3, flags); if (IS_ERR(gpiod)) return PTR_ERR(gpiod); if (!gpiod) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index d0575d4f747d..f006682935e9 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -75,16 +75,9 @@ static int gpio_config(struct hdmi *hdmi, bool on) for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { struct hdmi_gpio_data gpio = config->gpios[i]; - if (gpio.gpiod) { - if (gpio.output) { - gpiod_direction_output(gpio.gpiod, - gpio.value); - } else { - gpiod_direction_input(gpio.gpiod); - gpiod_set_value_cansleep(gpio.gpiod, - gpio.value); - } - } + /* The value indicates the value for turning things on */ + if (gpio.gpiod) + gpiod_set_value_cansleep(gpio.gpiod, gpio.value); } DBG("gpio on"); @@ -92,16 +85,10 @@ static int gpio_config(struct hdmi *hdmi, bool on) for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { struct hdmi_gpio_data gpio = config->gpios[i]; - if (!gpio.gpiod) - continue; - - if (gpio.output) { - int value = gpio.value ? 0 : 1; - - gpiod_set_value_cansleep(gpio.gpiod, value); - } + /* The inverse value turns stuff off */ + if (gpio.gpiod && gpio.output) + gpiod_set_value_cansleep(gpio.gpiod, !gpio.value); }; - DBG("gpio off"); } From patchwork Fri Aug 23 07:34:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11110837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2338E1709 for ; Fri, 23 Aug 2019 07:35:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B3EE2341F for ; Fri, 23 Aug 2019 07:35:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B3EE2341F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54A0B6EBDB; Fri, 23 Aug 2019 07:35:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 071D16EBD8 for ; Fri, 23 Aug 2019 07:35:08 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id l14so7937776ljj.9 for ; Fri, 23 Aug 2019 00:35:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uviA742n/WPhqJ2p0ywgQN7PPZdj9n55wlPOzt1ahOA=; b=O0i6qgizpN49HMw441IqXG/g6ZMy+ojBcWc/PW1CTxdmsECxYeC8u7w2VazUNv48kl 5nir4Bqa0RvfoO4mt9I0PAQH9JgpZh8p3kiASKIT5D1ZMEHmjdtCqYlp6NlSXAd57SVt UDn13VWpFdjI+XgKoSLOpKY082XEvvLO4CED0+Y81qZAvuypOgLPa2YDzXsJzbK3lHGP o6TKxmNG4iMBtKlN7YjiMWYxK/9ZqCyvX0eN7XZjpS4cQfcOI1rGkNdFfOoSl6hiJ23D bCsSdpZsjEnDxlb6bgpmwkR8PZoBTDnuYTajOG9IebjrGzaLltrxqL8ywJVgkVZaJg69 yxLQ== X-Gm-Message-State: APjAAAXMEsJ6X4dABM3pk9dYp4MGoWxrTMrK6vwM5JPM2XmjcJ05WcJh qHbn3OSklXobPwza7x1aG5M6GQ== X-Google-Smtp-Source: APXvYqzB/63/X4i6oDk8h67bDnxCyqyaudqGHwVSFHmXzxq7F/U465KbaeCyGoSfIkUdG0xDiSlAww== X-Received: by 2002:a2e:9252:: with SMTP id v18mr1988085ljg.93.1566545705417; Fri, 23 Aug 2019 00:35:05 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n7sm483780ljh.2.2019.08.23.00.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:35:04 -0700 (PDT) From: Linus Walleij To: Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 6/6 v2] drm/msm/hdmi: Do not initialize HPD line value Date: Fri, 23 Aug 2019 09:34:48 +0200 Message-Id: <20190823073448.8385-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823073448.8385-1-linus.walleij@linaro.org> References: <20190823073448.8385-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uviA742n/WPhqJ2p0ywgQN7PPZdj9n55wlPOzt1ahOA=; b=vGNGwRJ14+9wFedjL20SfmCe4wJvbQoWtTcO0L60xQzXzjgz6N/j8BHqmm7yFoiQbA h7Hk6VMXUYx+uzZzlu2ZJcg/0GLqKJ2V/hX9O5aazLv4Z6GJjhnBWTXscRFAnQwYmWfH DWQ0+vRsCvg9h+5GZ/a7tHNR4k/U1cRuG9aAGSHcsqdVD6T2o5JGrkQKgMLPT+Va8bl2 /qEXDHuFBYDNizFUWJBo1tYImdjPurPttnpbGJGgSXUWMROn/mfZmYXhxRYE2Q2jg0rA OO1dsFj8upDGOig99MjUcfwhYvKn4DM26rRHM1tI7M5ZFUMaDNJb3bF3retesGRRtZGN fqsQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After untangling the MSM HDMI GPIO code we see that the code is deliberately setting the output value of the HPD (hot plug detect) line to high, even though it is being used as input which is of course the only viable use of a HPD pin. This seems dubious: GPIO lines set up as input will have high impedance (tristate) and the typical electronic construction involves this line being used with a pull-down resistor around 10KOhm to keep it low (this is sometimes part of a levelshifter component) and then an inserted connector will pull it up to VDD and this asserts the HPD signal, as can be seen from the code reading the HPD GPIO. Stop try driving a value to the HPD input GPIO. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Brian Masney Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on v5.3-rc1 - Collected review tag --- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index f006682935e9..bb1c49e3c9dd 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -76,7 +76,7 @@ static int gpio_config(struct hdmi *hdmi, bool on) struct hdmi_gpio_data gpio = config->gpios[i]; /* The value indicates the value for turning things on */ - if (gpio.gpiod) + if (gpio.gpiod && gpio.output) gpiod_set_value_cansleep(gpio.gpiod, gpio.value); }