From patchwork Sat Jun 29 12:59:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9123713BD for ; Sat, 29 Jun 2019 13:01:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DB3E2838F for ; Sat, 29 Jun 2019 13:01:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A97D287CE; Sat, 29 Jun 2019 13:01:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2B772838F for ; Sat, 29 Jun 2019 13:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbfF2NBz (ORCPT ); Sat, 29 Jun 2019 09:01:55 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36656 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NBz (ORCPT ); Sat, 29 Jun 2019 09:01:55 -0400 Received: by mail-lf1-f67.google.com with SMTP id q26so5787556lfc.3 for ; Sat, 29 Jun 2019 06:01:53 -0700 (PDT) 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=DbpuIcCBG2OY5e1NmpBE7wz6kAerHOIPdrXSJOYlBOk=; b=efVnvG6gsnh3l0XcsGPL7A1HnlxKgumwKIBMGtiqOMwHhdusEpWZaOWf+MqEF7BL5W WqbtG12LDpX6unXqMqDWTdVfM4zRrQmh4gqLzTx89lJEYR79woEb8W89uVlvW7MlFHEL Zp08PLKv6Na6vEgUdeNTUl5SJw8p7T4ZPUq94KcIME4V87xJpVQbKIHwoCK6jGRKWDu3 Ngbb1bNlSk8+QAUVLVkhjTR0J8X3cz7gs99b/MC0wyJ4D28Wm9EDPnT2vEzHjH3XqEc/ mhWNLYEUuhbeHtzFK/maFVDyz7mEP4hs1UZ+jfHb6VE7oiGbwu1a/LhUoF08NL8U/zFo qWJA== 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=DbpuIcCBG2OY5e1NmpBE7wz6kAerHOIPdrXSJOYlBOk=; b=V5utg/8rqKXKQxLeQ9NCKLYXIq/AsWzsh90MFyXLktCgEWCOGymIIvS44Zbpovydmf Xvx3A79Q3Pb1QMRB7Fj0iuFZ79gqswxMB3T8Q7rPTFOV/VfG7C+nw1duNTlNLVo2FHlG WMK36ePTXsrPAdWuX+1UBLdmDnoUyAJeL8pW7oHtHSKW3H6HxKltoxqHSp6EvOy3e7rB kWgsZldTOJQPdrmZx0yWIjITE/66Wr4onbGVsxXFkZMPGqKCe2HxFs+S1yAbHEJ7XjoE HVAYtuI4REcQBOHy+bkjGQ0QouYzis65qpUEKV3+TrCevwGV4lFzE3RjKXgs4Hgm5bDP gh5w== X-Gm-Message-State: APjAAAU1aUWtMURsKyk27wmeX9OtU37ysuR05baSTMHXZXZGR4jUnopR BrKaACox0Pmwdk/LZel5lFM5eA== X-Google-Smtp-Source: APXvYqwOS0pDKXe1RTOO0fPQa8iQngPginDmqxsbSy4gahwb7Y9qnEGHUp2+11mR/5U04XqewQh3gw== X-Received: by 2002:ac2:5636:: with SMTP id b22mr4172787lff.2.1561813313145; Sat, 29 Jun 2019 06:01:53 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.01.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:01:51 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/7] drm/msm/mdp4: Drop unused GPIO include Date: Sat, 29 Jun 2019 14:59:27 +0200 Message-Id: <20190629125933.679-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij Reviewed-by: Brian Masney --- 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 5368e621999c..753579914d0c 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c @@ -16,8 +16,6 @@ * this program. If not, see . */ -#include - #include "mdp4_kms.h" struct mdp4_lvds_connector { From patchwork Sat Jun 29 12:59:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A7B174A for ; Sat, 29 Jun 2019 13:01:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DFF2838F for ; Sat, 29 Jun 2019 13:01:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA4BC287CD; Sat, 29 Jun 2019 13:01:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7478A287CE for ; Sat, 29 Jun 2019 13:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbfF2NB6 (ORCPT ); Sat, 29 Jun 2019 09:01:58 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43742 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NB5 (ORCPT ); Sat, 29 Jun 2019 09:01:57 -0400 Received: by mail-lf1-f65.google.com with SMTP id j29so5732554lfk.10 for ; Sat, 29 Jun 2019 06:01:56 -0700 (PDT) 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=AJIo1pqQ+aFujHuHdql1oLAKsZ6dcOAKCD+S+KrStQg=; b=zQR54iAbGadX7yH6kb/W+A9Ev+FFwoc/g484x0VCE13ChTt4OVnLxuK03gAMFIhnUl a2s9RA8N93ziUXqxC4ZQbtiqRFq5+YrhUohrwTtL4UjNSSpUwjpJVTsnP5ztF+7mGcoD MaLZSwY/+wrc+Mrx1HIJcScmiCGvWqe6rIh6byJLfnq4HXzuuJHQwbH2tIrOgDiQcz99 WHgvK5QzlgPMcFkkbQyB3iRjkDA2stc0/LSp4lugHsNtNHuQ4txm7SxP3GBg7pAGpzfw p4YL7ENLxHbwJB3rq3EQNAMUYHxs7zQQYNqFGvNcxySTPkzYoXSaECdplNiqhLg377rK dzeg== 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=AJIo1pqQ+aFujHuHdql1oLAKsZ6dcOAKCD+S+KrStQg=; b=aFRn795NZ6rDzAcmM1tWQ/BXllw1diAHBwypJanLMuEfQy7p0CnyE7JmnjC5LXSO0k aLn8k5rS3SHJIG8uVY29dKqDbgJbWwmcU50icM9TEHJO6GQq883iHVTuJWWQojMGZrXc KTfIVBK9AXF5MDaabBVANbtlfxryIrdfeugHdJRL3+3bKzUUrLS8S9VBZGKNG0zLW0AH VA+iAqhgSE+wlxxq656SfM8eS0kQYuJIVR7NcACMijiopuhylwM+IY9NtD7RdVfSlEW0 G5/KdwjSVyAnoLtNqkNx4BIUj905G71qHZ/02qngPumHMA/airF1RKtkxL0NBwo+mvR2 ji3A== X-Gm-Message-State: APjAAAVucdZuVNnBmRBW3BbTJ6LXmnoFBoqLUIFV5t4wsz1FPgEiVPhz uxOvLLRA5qYIEzYacbDA+57RLDiIiM7wiA== X-Google-Smtp-Source: APXvYqxvXt6L2Ml1QCW1/zH7Sv4F1tQcoxTHgqupuETmPxNbTlWyt0OHygO+Xy9Hh1ch7/orM4lZPw== X-Received: by 2002:ac2:4c29:: with SMTP id u9mr7457510lfq.100.1561813316205; Sat, 29 Jun 2019 06:01:56 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.01.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:01:55 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 2/7] drm/msm/dsi: Drop unused GPIO includes Date: Sat, 29 Jun 2019 14:59:28 +0200 Message-Id: <20190629125933.679-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij --- 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 610183db1daf..d44bad13cbaf 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -14,11 +14,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include From patchwork Sat Jun 29 12:59:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86A401398 for ; Sat, 29 Jun 2019 13:02:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A2A2838F for ; Sat, 29 Jun 2019 13:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C7B0287CE; Sat, 29 Jun 2019 13:02:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004722838F for ; Sat, 29 Jun 2019 13:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbfF2NCB (ORCPT ); Sat, 29 Jun 2019 09:02:01 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46556 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NCB (ORCPT ); Sat, 29 Jun 2019 09:02:01 -0400 Received: by mail-lf1-f68.google.com with SMTP id z15so5729277lfh.13 for ; Sat, 29 Jun 2019 06:01:59 -0700 (PDT) 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=Ji8jAojLPl8vD+gcsy1dZ2LAcjvPmFSVJ5glNsjtSak=; b=nAjmGaNaoXOfVZnFCs0LUWx0cgkIpWqrZKexDYARBy6576kyG3UYP+U3tLv6Z7mbun 3mza7Rr4HNinHrz/Z+ZS8QeQeD2ig1Wuy5eIgVPImRlRcCxR6UE3d6lvjrMrektszXS+ 0CG3ahmSPlVFxu3mFx0uVQqdq4jNPLcFg8BC+yVu43Um7D3UMfNOpakEUcEVn6MuC8Ry X4Gx9ihORnId7aLMGMVG+MYoXUZ7qMgU1CSiYsMEXSOfdUiBe/5UWIg8MwtVDMvToc9k 2kG/2Li5Bv+dVCPKpJYsQ5s5V65k/L9JNU0oyZMgdR84ds/6gyw5txkGZP6EpXJbSn72 8DlA== 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=Ji8jAojLPl8vD+gcsy1dZ2LAcjvPmFSVJ5glNsjtSak=; b=l9jc3XcKpbNvBcbuuHxQG2PHW1Jq3YoW/lDL+awbBATZ4c5dkGjcvAAkh5eaDcxqGi KPM1jL/+mXNNzR9/PGxkJLOWgzi07UM+ANuMimoEtqyrq1fy4LBbAxEA8oMvUG5EEOnH RfpN2qnAPYky1TfKXPI1QLWburCqRNEEzkMw2jAXPHJtqAODudA+59aI0gIvZKqQ9WxB p2i+dnUwDBqkf6kAB8wzkgi1LizHLOHfWnPbfhZO80r/P53D7DBbQBBGf2VyS0vwMzlr CAAHhs9F9mUeSodxah9V8/vH7ANelLwQUMhtxpFKcuLBtY7kwswrD+3ifbQGV9ftU6gz 01Eg== X-Gm-Message-State: APjAAAULfB14GRFQSmfPfBjPpvsrV9mCVYO6eOQ5gMh2UUJnRlfbVqVc deZszVdpckXDysczRBOjk6LlYw== X-Google-Smtp-Source: APXvYqw4JVg2KbWLoxvVW9U6jPqYrcYh2H4AXq4ph9NDkiYzD2Bg7mSbg0zvS+exFIzcUH3D8CLeKg== X-Received: by 2002:a19:f601:: with SMTP id x1mr7523920lfe.182.1561813318996; Sat, 29 Jun 2019 06:01:58 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.01.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:01:57 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/7] drm/msm/dpu: Drop unused GPIO code Date: Sat, 29 Jun 2019 14:59:29 +0200 Message-Id: <20190629125933.679-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij --- 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 78833c2c27f8..78f04147839f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c @@ -15,6 +15,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 bc07381d7429..a0498c7bd677 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h @@ -13,7 +13,6 @@ #ifndef __DPU_IO_UTIL_H__ #define __DPU_IO_UTIL_H__ -#include #include #include @@ -22,12 +21,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, @@ -42,8 +35,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 7316b4ab1b85..9baabadc62bb 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" #define to_dpu_mdss(x) container_of(x, struct dpu_mdss, base) From patchwork Sat Jun 29 12:59:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99B39174A for ; Sat, 29 Jun 2019 13:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2CA2838F for ; Sat, 29 Jun 2019 13:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F50A287CD; Sat, 29 Jun 2019 13:02:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 199E5287CE for ; Sat, 29 Jun 2019 13:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfF2NCD (ORCPT ); Sat, 29 Jun 2019 09:02:03 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35514 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NCD (ORCPT ); Sat, 29 Jun 2019 09:02:03 -0400 Received: by mail-lj1-f194.google.com with SMTP id x25so8639985ljh.2 for ; Sat, 29 Jun 2019 06:02:02 -0700 (PDT) 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=lniFIm91gCkBVo8OT7Qc6rB8XEZiKvYZhCGqRwQxgRg=; b=R/OUJdhNfZGHaJoOsvmC50TZU4KNiySqOFuqTZkhUMlRuF2aiKO7gw52YdVXItSgcn yULpt7pmN8Q0FFQWwWXuiz9aPOeB3pvaPkb6xxb4hn467Tb4aGWSL9SCavDLu8IkKmmy qrTeh6vZQGGT0xcFf5zz72dp/fegF92Xn8K1lsaMp74Y52ZV+yXlor4P8xA3LvmbAVRg tyhC8dkj7Wq74VCB6f5GSAxCnIBTYFRJrgHvcNYjkbMf39LLwokl+2KRAWR7rROFUhJW 510SqwEGSIvRO7vwvVY/+PCm/RmKugHh6Jbbn1ODQskyPdvHfCTEPIlI0+NbNPr/JqAa NqSA== 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=lniFIm91gCkBVo8OT7Qc6rB8XEZiKvYZhCGqRwQxgRg=; b=nPztyCtpIs3x7LU6dfs3NnlcTetSiGTINrnb0Q+VZPyUAmH/EB8sxZ99z0czHROeaq vr6l6P3YHyJEXt/KESYQCeRNM/e7YkAgV2b++cZ4ma88BCwvUhh+t48FC1ITUEZbVT// IIv5NuffXLKN+pRRMckMfmUwb+7yBaat79tXI9+ZsnZOGAYmfsV1kQ18Ra0J8uYQnZIb Tc2SCLXAC2Aj6vZ/PZQHlzml5q15GBtNFpBCIjaNZuC2OZgC7H/dj1Kwvat44uoW5s90 Ns/hFYaV0JbyMYRLLNZ646F1Jtq0PmnNIntBgo1JnZtvt4nN9qu7bXGDhdnheOJft5Cx mwXg== X-Gm-Message-State: APjAAAURC8dVNJrn/AWnhs/mbLe6WN2EXKxtjEdAatBunZZHb5USTFvZ 49PDmUJn+OQEXfZoiWmpruNEeg== X-Google-Smtp-Source: APXvYqwVGU+xg50XiekYht3IIxEqFHM099dgUifn3T0K/F2g1KQaP1T9fAtfYeTQ4lNEuy0h1An6cA== X-Received: by 2002:a2e:8744:: with SMTP id q4mr8768966ljj.77.1561813321447; Sat, 29 Jun 2019 06:02:01 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.02.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:02:00 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 4/7] gpio: of: Support some legacy Qualcomm HDMI bindings Date: Sat, 29 Jun 2019 14:59:30 +0200 Message-Id: <20190629125933.679-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Insteaf of the MSM DRM code going around and inspecting the device tree nodes by itself to find "qcom,misc" GPIO phandles, we add a quirk to the core so that if "qcom,misc-gpios" and "qcom,misc-gpio" isn't found, we try to find just "qcom,misc" as a last resort. Provide an explicit whitelist for those GPIOs. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Linus Walleij --- Rob/Sean: if the approach is overall OK I will merge this one patch already for v5.3 so the rest can be queued for v5.4 later. --- drivers/gpio/gpiolib-of.c | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index aec7bd86ae7e..c927eaf6c88f 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -286,6 +286,45 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char * return desc; } +/* + * Some non-standard Qualcomm HDMI GPIOs need to be supported as they exist + * in random old device trees out there. + */ +static struct gpio_desc *of_find_hdmi_gpio(struct device *dev, + const char *con_id, + enum of_gpio_flags *of_flags) +{ + /* + * These are the connection IDs we accept as legacy GPIO phandles. + * If we get here, the same prefix ending with "-gpio" and "-gpios" + * has already been tried so now we finally try with no suffix. + */ + const char *whitelist[] = { + "qcom,hdmi-tx-ddc-clk", + "qcom,hdmi-tx-ddc-data", + "qcom,hdmi-tx-hpd", + "qcom,hdmi-tx-mux-en", + "qcom,hdmi-tx-mux-sel", + "qcom,hdmi-tx-mux-lpm", + }; + struct device_node *np = dev->of_node; + struct gpio_desc *desc; + int i; + + if (!IS_ENABLED(CONFIG_DRM_MSM)) + return ERR_PTR(-ENOENT); + + if (!con_id) + return ERR_PTR(-ENOENT); + + i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id); + if (i < 0) + return ERR_PTR(-ENOENT); + + desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags); + return desc; +} + struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, unsigned int idx, unsigned long *flags) { @@ -330,6 +369,10 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) desc = of_find_regulator_gpio(dev, con_id, &of_flags); + /* Special handling for HDMI GPIOs if used */ + if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) + desc = of_find_hdmi_gpio(dev, con_id, &of_flags); + if (IS_ERR(desc)) return desc; From patchwork Sat Jun 29 12:59:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B87B1398 for ; Sat, 29 Jun 2019 13:02:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CF8B2838F for ; Sat, 29 Jun 2019 13:02:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00E37287CE; Sat, 29 Jun 2019 13:02:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52407287CD for ; Sat, 29 Jun 2019 13:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbfF2NCH (ORCPT ); Sat, 29 Jun 2019 09:02:07 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46560 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NCG (ORCPT ); Sat, 29 Jun 2019 09:02:06 -0400 Received: by mail-lf1-f68.google.com with SMTP id z15so5729369lfh.13 for ; Sat, 29 Jun 2019 06:02:04 -0700 (PDT) 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=2KRTAU6ehPX/xpH0HKMaZdgcL0pE06VvF+Cz0lSkdGM=; b=oIll79elm1tF0VCcLp+Ng7l/OtHRjW3+0tBcilR4GYUeAnu3R6/Tedhi0bc9XsRg6T +qRPVUxXAmDbf3sj21K2PQ3L7OjFaGPFZIMphP/X/UfJfX+2WL59aqU6pJOg2OssIe8x 3piXFJldqvugqPHWGtZv/T1hV7YJQUruoE+3Pj5dJeN4Ae1/hZP6n0ZesOEa/5MS9Mzi qzOKI21XULgKL/ldq3TNUGorYUQ34j0w6zB94iDk/jKaqce80x2goGU/wAlbsamJwz+R 28p9Mw/Ie9Bd2PrC0yCh1J/VeWnbNfZtT22ymuou/9SV2PvPo1k7TGBExHXNTzbRRVml txtg== 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=2KRTAU6ehPX/xpH0HKMaZdgcL0pE06VvF+Cz0lSkdGM=; b=SfVVkxMDske7MsLH1aKHBphLotSHQDBbASOGvUS8mfAjp76Z+kE3JWWckO41qFD0Y0 pkKWC08DXYyFuUgR/hfKXc3d8nknrGA3U7Nazbh2UW+XmMPVNY3nLYp9MTe2GlIbJGxD hTuGoY0U1W3VPGFvv47ar6D737io5TCuTgJ4lQkJFmHkAUVVIAIWJnmZ9t4RQlTImU2o 7XSXstscjoq5Oj2huUbYEweY9R/SLxd51o0GiL6GlvQXY+/vVrUwQa4qvkSdUeUpXjj8 0b0x5JsloIrJ/PFL3uK92ifpEjTQstdw2a+zqKrfLNOKQnBleLMZ2x1kh5aLmkqHm4MR Z4Qg== X-Gm-Message-State: APjAAAUhKXrDVPY9Z+Cy8Uh+uk6hYN6D/qEZDWjXkPRgqIcMyCpWu5F8 HpIR683suuvGaeLntpAnMryS6A== X-Google-Smtp-Source: APXvYqyisZIfrxWe3N5Szh1GWTfKSxX3a3LffxrfYVO394S3qG3CuHcrkb/6yrrtWRGEB7o6fAik4A== X-Received: by 2002:a05:6512:30a:: with SMTP id t10mr7348435lfp.22.1561813323803; Sat, 29 Jun 2019 06:02:03 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.02.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:02:02 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 5/7] drm/msm/hdmi: Convert to use GPIO descriptors Date: Sat, 29 Jun 2019 14:59:31 +0200 Message-Id: <20190629125933.679-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij --- 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 e247d6942a49..c8e8268c76e2 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -436,38 +436,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 */ @@ -593,11 +561,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 5c5df6ab2a57..3ef956e8de71 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "msm_drv.h" @@ -33,10 +34,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 a6eeab2c4dc3..c4e9f6d7960f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -15,7 +15,7 @@ * this program. If not, see . */ -#include +#include #include #include "msm_kms.h" @@ -79,30 +79,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); } } } @@ -112,29 +103,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) @@ -322,7 +304,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; } @@ -341,7 +323,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 Sat Jun 29 12:59:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAC2A13BD for ; Sat, 29 Jun 2019 13:02:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBE182838F for ; Sat, 29 Jun 2019 13:02:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFBCA287CE; Sat, 29 Jun 2019 13:02:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E40E2838F for ; Sat, 29 Jun 2019 13:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbfF2NCJ (ORCPT ); Sat, 29 Jun 2019 09:02:09 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:36672 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NCI (ORCPT ); Sat, 29 Jun 2019 09:02:08 -0400 Received: by mail-lf1-f68.google.com with SMTP id q26so5787841lfc.3 for ; Sat, 29 Jun 2019 06:02:07 -0700 (PDT) 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=Bx02aBFfPRkMhKf40AS7qTzkWiU4y0/D0eEn128oWGQ=; b=HMJwmwK/OCpaYq/6HMbWpbRyQvbyRKO/I7HCpmQY60NBAA5MO22b/vxuEsNGmfSrQj fcBHaXH3QcaXBjlvZSLYDun/FB+rgDgBWoWalJEfqrFx7clYu5kbrkkBKrjVtZmMKlq8 WC2B7LrGWBnyBnj7Drd4FPlumQkqf0Z7A5isRfAnVg65WJG+CsFsYRjJAAhuTNd2aVA7 66LsDK1Qqc8JeCr6xmMPRc8LdBJYZN0YWR33m6YI2cjRuLFu5zKVU7UmtADnzzy1MTh6 dKR1eH+dSyDQqLMlaA0pDm4XeS752CpzhfPClsdCtntV/lFNVKMEnL93gCLgI+lOthEm bLVg== 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=Bx02aBFfPRkMhKf40AS7qTzkWiU4y0/D0eEn128oWGQ=; b=aSnKAjAugyZHQmm+A82PlMqVxPMQIWVV/LQko1oUjZcfs3KfpKJP1owuxoAN1HEta6 s+Tbh9wiaezsvBMMOe0mGqS94/ECeV85eLqNhGEWvJKCZTHPiXY5ziyU7jfhS5T6JWvz V7p2ZTYHNzCGu+AHQML2qKtyPoYHG0BtWATezVUe7NNkb4rU4JaDV5rWlr2WQMz8jCfE uk5hpi7zolZ9XSMXp1HKKv2iAI7EPDgJu4WeIaHpAHLV9uIoKQwJKauYvpDPV/gLtdlm MresdP5/YvlVuwVkIKVJ5cMQrnZmhfYbQuAfHCobSCg8vJ8DhNtfCpHQha6OqhAAv+uJ djNQ== X-Gm-Message-State: APjAAAWMivU0w0ly8kfnnyKuAzz2+u1BN7IZeVJOvbWSVeA8g+t43V5K 2SeQ1WAZDidpAL+AOK7XKtGtlw== X-Google-Smtp-Source: APXvYqxTzIJVpddQHAmhA5Fk+i0uPHGclgtAxJMzxPUjiAnCGI/TQWmRQfr+sLmOyHXNV5a5lmrefQ== X-Received: by 2002:a19:cc45:: with SMTP id c66mr7446160lfg.171.1561813326303; Sat, 29 Jun 2019 06:02:06 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.02.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:02:05 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 6/7] RFT: drm/msm/hdmi: Bring up HDMI connector OFF Date: Sat, 29 Jun 2019 14:59:32 +0200 Message-Id: <20190629125933.679-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij --- 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 c8e8268c76e2..7d87f8821d2f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -563,13 +563,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); @@ -583,7 +592,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 c4e9f6d7960f..89c64cc85027 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -86,16 +86,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"); @@ -103,16 +96,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 Sat Jun 29 12:59:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11023987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B38313BD for ; Sat, 29 Jun 2019 13:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DC15287CD for ; Sat, 29 Jun 2019 13:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71BB3287ED; Sat, 29 Jun 2019 13:02:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3250287CD for ; Sat, 29 Jun 2019 13:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbfF2NCK (ORCPT ); Sat, 29 Jun 2019 09:02:10 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44820 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfF2NCK (ORCPT ); Sat, 29 Jun 2019 09:02:10 -0400 Received: by mail-lf1-f67.google.com with SMTP id r15so5731068lfm.11 for ; Sat, 29 Jun 2019 06:02:08 -0700 (PDT) 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=gUhHBzqpeqf9laCyRDqe0YTreYPsBAWIdDU1MBCLr1k=; b=BYavBGMBtik6r+A9tFdwUyOfHqHK+Yl4c7/OJSbz75XF2NUDjc4Jw7+6wvc3ssAnDF 9sq25tD60Ch3GCG0hM/5PRkqSgHcW/LYOm35ZiNdaPczwua7xlkaQTtJrqZOM9Tpv2HK ZvXChwFa1/VVDUg/f4Nyh3tUquPVnrg2zNpac70vRhAUi7CZ8hpGVSeRuy+q36Hhso+h Ks17fIaZ1Z+66/HbPp9dwbic5x4vw3gyVfV98DTntLs57UNkVYUKwuust+xKTjaLKoct 7zQUCFkufCWR85bg3HzsRWlJ42Nostw2IEcGdvH3kk5vn0kj3ZdmlMrn0Ij8qrwefETN THcA== 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=gUhHBzqpeqf9laCyRDqe0YTreYPsBAWIdDU1MBCLr1k=; b=VV0oUPx/AZC26+xD4NYEu9FL2n2WmaWzXQF1LgeofbxRNYALPhHINNHoF4r7Lz4VWq FJ202iCN7cyUsQB6KiLtJY2vy4+1wQL42I3A4xeploC22fRSrAzRP4+Fwpum1vJAXuP5 9rHC+RCqWxPo6aj98Pw6M1i/PIc1KYl/W336MnL+8X15uNheElQAo+OIi2PlCUyFRnYN brssdz3a7Hw7PwojJ16FG23aMQ9QX5sZ1fTQG0lwjWB7xAD5w+ZGnpjX2lddmH7Cyx1f RwXEt4eTNgt596ZWgCqpeMXXWA3HUQLIP5ayhK/qbZMNXrEyp451sT6ogZTR1KOSetku Xecg== X-Gm-Message-State: APjAAAX4AGRLe7/xi6eU6Soxnixr2/niO5reTn6OhLAB3bojsDMsMuzb tGSgPcOUd/fV5aLBJOJTGsz7Yw== X-Google-Smtp-Source: APXvYqwiKTo2KmlXB88B2iDxqXfGg+cPGIjxT3oac4t0Fb8IeqR1+G3z9dw+lnnW3Vr5Kl66Lss03g== X-Received: by 2002:ac2:4891:: with SMTP id x17mr7657045lfc.60.1561813328311; Sat, 29 Jun 2019 06:02:08 -0700 (PDT) Received: from localhost.localdomain (c-22cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.34]) by smtp.gmail.com with ESMTPSA id v2sm1354500lfi.52.2019.06.29.06.02.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 06:02:07 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 7/7] RFT: drm/msm/hdmi: Do not initialize HPD line value Date: Sat, 29 Jun 2019 14:59:33 +0200 Message-Id: <20190629125933.679-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629125933.679-1-linus.walleij@linaro.org> References: <20190629125933.679-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Linus Walleij --- 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 89c64cc85027..ecbcd8638b66 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -87,7 +87,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); }