From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6470EC47084 for ; Tue, 25 May 2021 00:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46B8961400 for ; Tue, 25 May 2021 00:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbhEYAEb (ORCPT ); Mon, 24 May 2021 20:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbhEYAES (ORCPT ); Mon, 24 May 2021 20:04:18 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05755C061756 for ; Mon, 24 May 2021 17:02:49 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id s4so13886678plg.12 for ; Mon, 24 May 2021 17:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cqAqRwR7SBxsh+J9doi3iCRwS47/W3pRYFT204VDP/E=; b=aky6HgwCtGIDItfr6KuzoZ0upAjHVKrEh+JvfnvsApKOugQWciumDUofZfKG1VsRXq hcqM/cTRtEc4o/W1Hzg+xWqziOn9l6ZI/rxCYqWNblFGhJAVxFSSkuoKp+rcNf7bRrrk 6pon/cL1JVkTyLF4oFbq3yflzkshG8WmCaJgE= 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=cqAqRwR7SBxsh+J9doi3iCRwS47/W3pRYFT204VDP/E=; b=knb8KHx0KxegQ568cmmQ//OhmfPHlR7V4DPIMg9a19MVLu9dZx/4PaddkzaJdE+TIk vnpR1dLf17kKuSkOiyEU7a0hcXxJak5cWU7MeaNsvhE2MtysBWUPvWcWoQG7XROJJ1OY +t7IjnCfc8YL+0J46rOes7Vke0KZ0Kp7QAVbW29DFQ6GWugmFoslEcldj4unT7J9Ndv4 Dftj0nZFr7ATcTDHB7pIPd6QOfP9l61b6x7rxhSnoqMecHi6t8/MNbMr7Cqh8sLjcfX3 nVYHBkftb3Wr0EvUPEXqMeGr4cq3IHfeUC9anYgyPCIjrychlMelYcyi7nYfVfZpSzX7 LvVw== X-Gm-Message-State: AOAM532Yn2+GclOtSVTVLk6lzn/PkB8VnJ9iAIUmruRp80H7+Pe9OTjD 87jEczxCz6dY3tklydVHI0yT6g== X-Google-Smtp-Source: ABdhPJwQurHGtBCZA9D6tZv5jfTQYbLsPFJeovBlZ7boNrmn1dHU7MRixgj/HpmlaV+hMrViAbGKDg== X-Received: by 2002:a17:90b:1e43:: with SMTP id pi3mr27838723pjb.51.1621900968554; Mon, 24 May 2021 17:02:48 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:26d1:4df0:7cdf:ce13]) by smtp.gmail.com with ESMTPSA id f18sm10696741pjh.55.2021.05.24.17.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 17:02:48 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Sam Ravnborg Cc: linux-arm-msm@vger.kernel.org, Linus W , Lyude Paul , Bjorn Andersson , Steev Klimaszewski , robdclark@chromium.org, Maarten Lankhorst , Thierry Reding , dri-devel@lists.freedesktop.org, Stanislav Lisovskiy , Stephen Boyd , Douglas Anderson , Daniel Vetter , David Airlie , Thierry Reding , linux-kernel@vger.kernel.org Subject: [PATCH v8 07/11] drm/panel: panel-simple: Stash DP AUX bus; allow using it for DDC Date: Mon, 24 May 2021 17:01:55 -0700 Message-Id: <20210524165920.v8.7.I18e60221f6d048d14d6c50a770b15f356fa75092@changeid> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog In-Reply-To: <20210525000159.3384921-1-dianders@chromium.org> References: <20210525000159.3384921-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If panel-simple is instantiated as a DP AUX bus endpoint then we have access to the DP AUX bus. Let's stash it in the panel-simple structure, leaving it NULL for the cases where the panel is instantiated in other ways. If we happen to have access to the DP AUX bus and we weren't provided the ddc-i2c-bus in some other manner, let's use the DP AUX bus for it. Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul --- (no changes since v7) Changes in v7: - Patch using the DP AUX for DDC new for v7. drivers/gpu/drm/panel/panel-simple.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index d3b5ae22d939..b09be6e5e147 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -186,6 +187,7 @@ struct panel_simple { struct regulator *supply; struct i2c_adapter *ddc; + struct drm_dp_aux *aux; struct gpio_desc *enable_gpio; struct gpio_desc *hpd_gpio; @@ -658,7 +660,8 @@ static void panel_simple_parse_panel_timing_node(struct device *dev, dev_err(dev, "Reject override mode: No display_timing found\n"); } -static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) +static int panel_simple_probe(struct device *dev, const struct panel_desc *desc, + struct drm_dp_aux *aux) { struct panel_simple *panel; struct display_timing dt; @@ -674,6 +677,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel->enabled = false; panel->prepared_time = 0; panel->desc = desc; + panel->aux = aux; panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd"); if (!panel->no_hpd) { @@ -708,6 +712,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) if (!panel->ddc) return -EPROBE_DEFER; + } else if (aux) { + panel->ddc = &aux->ddc; } if (desc == &panel_dpi) { @@ -4633,7 +4639,7 @@ static int panel_simple_platform_probe(struct platform_device *pdev) if (!id) return -ENODEV; - return panel_simple_probe(&pdev->dev, id->data); + return panel_simple_probe(&pdev->dev, id->data, NULL); } static int panel_simple_platform_remove(struct platform_device *pdev) @@ -4913,7 +4919,7 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) desc = id->data; - err = panel_simple_probe(&dsi->dev, &desc->desc); + err = panel_simple_probe(&dsi->dev, &desc->desc, NULL); if (err < 0) return err; @@ -4966,7 +4972,7 @@ static int panel_simple_dp_aux_ep_probe(struct dp_aux_ep_device *aux_ep) if (!id) return -ENODEV; - return panel_simple_probe(&aux_ep->dev, id->data); + return panel_simple_probe(&aux_ep->dev, id->data, aux_ep->aux); } static void panel_simple_dp_aux_ep_remove(struct dp_aux_ep_device *aux_ep) -- 2.31.1.818.g46aad6cb9e-goog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BFDDC2B9F7 for ; Tue, 25 May 2021 00:03: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 1878F6141B for ; Tue, 25 May 2021 00:03:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1878F6141B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 278AE6E99C; Tue, 25 May 2021 00:03:02 +0000 (UTC) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2F9C6E452 for ; Tue, 25 May 2021 00:02:48 +0000 (UTC) Received: by mail-pj1-x102a.google.com with SMTP id g24so15777319pji.4 for ; Mon, 24 May 2021 17:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cqAqRwR7SBxsh+J9doi3iCRwS47/W3pRYFT204VDP/E=; b=aky6HgwCtGIDItfr6KuzoZ0upAjHVKrEh+JvfnvsApKOugQWciumDUofZfKG1VsRXq hcqM/cTRtEc4o/W1Hzg+xWqziOn9l6ZI/rxCYqWNblFGhJAVxFSSkuoKp+rcNf7bRrrk 6pon/cL1JVkTyLF4oFbq3yflzkshG8WmCaJgE= 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=cqAqRwR7SBxsh+J9doi3iCRwS47/W3pRYFT204VDP/E=; b=ICTPitJfF2cnqStMlR4qEyCmfUBREvKs3a1MgII2iJUydbfmZ0azQWdQHy6MIqHShx 90UsGRtE/BMujAeIsM8Vqu3Bf4AzdjzqW88oh0g8d08/gFrxnRTRpZ8SSomod4ui5Kk7 SIM9f2q13v+9eMeoFtFFCZMCwwXXq2Rcn/vtsp/5D8QDzuQuPWGysYG39ENKTUXkk2ug O2HB5k9RhL68OFDQuGuFpoBLpNcK/rjR6iDA3w7IEdAo+hGxREfM4Jx254cli40CYx2u bxfnn5Wt9AEaTuXewWd05NGZSfNgh99ITJ6lxncfNP+GmyV/0xsQQ+HwIH0OaYWxaYXv l9Lw== X-Gm-Message-State: AOAM533/iuaWU0dG6REzu1FG7YIimqwGA8Z3grPFPKeceX/ejuR8QkIg bM0eBS/h+ROnRY3zInhQ6MsWEg== X-Google-Smtp-Source: ABdhPJwQurHGtBCZA9D6tZv5jfTQYbLsPFJeovBlZ7boNrmn1dHU7MRixgj/HpmlaV+hMrViAbGKDg== X-Received: by 2002:a17:90b:1e43:: with SMTP id pi3mr27838723pjb.51.1621900968554; Mon, 24 May 2021 17:02:48 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:26d1:4df0:7cdf:ce13]) by smtp.gmail.com with ESMTPSA id f18sm10696741pjh.55.2021.05.24.17.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 17:02:48 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Sam Ravnborg Subject: [PATCH v8 07/11] drm/panel: panel-simple: Stash DP AUX bus; allow using it for DDC Date: Mon, 24 May 2021 17:01:55 -0700 Message-Id: <20210524165920.v8.7.I18e60221f6d048d14d6c50a770b15f356fa75092@changeid> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog In-Reply-To: <20210525000159.3384921-1-dianders@chromium.org> References: <20210525000159.3384921-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robdclark@chromium.org, David Airlie , linux-arm-msm@vger.kernel.org, Douglas Anderson , Steev Klimaszewski , Bjorn Andersson , Stanislav Lisovskiy , Thierry Reding , dri-devel@lists.freedesktop.org, Stephen Boyd , Thierry Reding , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If panel-simple is instantiated as a DP AUX bus endpoint then we have access to the DP AUX bus. Let's stash it in the panel-simple structure, leaving it NULL for the cases where the panel is instantiated in other ways. If we happen to have access to the DP AUX bus and we weren't provided the ddc-i2c-bus in some other manner, let's use the DP AUX bus for it. Signed-off-by: Douglas Anderson Reviewed-by: Lyude Paul --- (no changes since v7) Changes in v7: - Patch using the DP AUX for DDC new for v7. drivers/gpu/drm/panel/panel-simple.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index d3b5ae22d939..b09be6e5e147 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -186,6 +187,7 @@ struct panel_simple { struct regulator *supply; struct i2c_adapter *ddc; + struct drm_dp_aux *aux; struct gpio_desc *enable_gpio; struct gpio_desc *hpd_gpio; @@ -658,7 +660,8 @@ static void panel_simple_parse_panel_timing_node(struct device *dev, dev_err(dev, "Reject override mode: No display_timing found\n"); } -static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) +static int panel_simple_probe(struct device *dev, const struct panel_desc *desc, + struct drm_dp_aux *aux) { struct panel_simple *panel; struct display_timing dt; @@ -674,6 +677,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel->enabled = false; panel->prepared_time = 0; panel->desc = desc; + panel->aux = aux; panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd"); if (!panel->no_hpd) { @@ -708,6 +712,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) if (!panel->ddc) return -EPROBE_DEFER; + } else if (aux) { + panel->ddc = &aux->ddc; } if (desc == &panel_dpi) { @@ -4633,7 +4639,7 @@ static int panel_simple_platform_probe(struct platform_device *pdev) if (!id) return -ENODEV; - return panel_simple_probe(&pdev->dev, id->data); + return panel_simple_probe(&pdev->dev, id->data, NULL); } static int panel_simple_platform_remove(struct platform_device *pdev) @@ -4913,7 +4919,7 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) desc = id->data; - err = panel_simple_probe(&dsi->dev, &desc->desc); + err = panel_simple_probe(&dsi->dev, &desc->desc, NULL); if (err < 0) return err; @@ -4966,7 +4972,7 @@ static int panel_simple_dp_aux_ep_probe(struct dp_aux_ep_device *aux_ep) if (!id) return -ENODEV; - return panel_simple_probe(&aux_ep->dev, id->data); + return panel_simple_probe(&aux_ep->dev, id->data, aux_ep->aux); } static void panel_simple_dp_aux_ep_remove(struct dp_aux_ep_device *aux_ep) -- 2.31.1.818.g46aad6cb9e-goog