Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp23207pxr; Sun, 10 Apr 2022 05:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEM5AfKSPnmdKnp7abTbFPmtkXuZze2kG9SofD3WvIgvDRno+akOyohqWWtIx+MA9G7BuH X-Received: by 2002:a63:f10c:0:b0:382:623b:3bb9 with SMTP id f12-20020a63f10c000000b00382623b3bb9mr22623051pgi.97.1649594995007; Sun, 10 Apr 2022 05:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649594995; cv=none; d=google.com; s=arc-20160816; b=cYxkE7NzvbujNLo0CVneM2YQvBoNqduaWtKXkVvlAkbct4cMcRD9n0l6/mAWYE4uig 5vMsbuOiSwasJeSxiY0c84uP2hna9LB7QGvuuEXWmqpY/1wZ94p9IVhOFGoD5fxZbRgu NmSYAhNTsWE6QGindX36HkZMhmerbx3vhblotNBCoE8GMn/zCVHNRbdTuv7hBSRKAu7Q uVNHCTkPfHDrnXhiuyk8pZuJis7hGF8qnk4eINdje9wU3gfM+AY+HawwUMAU9rijxVmD HZIy51t3WEpG4/e/kXd5vD5omLbgNpN52Siy2oT/Sz2MmWZk4/CcgeVjUPGCpLLjDgtb xFcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fymhEmFv/O8Tuh2GeqHqqsiXL5aZG/ohxN9zZ7IUhcE=; b=H/EP9sMNZcRCly7HjwpRYTjAzNR468WLvgmoofDcl8jQ4oxqoz0YuuqXZf01wTdlze CVUc57YcJo+eH4w5bkL/ksLjxEYyzprP2qxBeRXJQP7hl85d0+VaCvj09REwDRbTR37M O1NrG+fJJ9VAII823SC72kBUFWGa6z5oG3AX+q4sOZalbJq2vRToa3VHUPQYdgNdv1lo HaszTAm0x0kZMGAwGLPbVHWGF8rbm/Ay228cwGy2MtoKGAJYsofK5kgP1Vg3bZjmJAP6 +wfba5Wy3EorzKUTWhidUW1U3vOYLgLkRUSlXnq+BjTys560/ZDICuSHvMLCDG9G/u9O af2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i+Scf6wX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a63d94c000000b0039ad8a5b075si6343329pgj.214.2022.04.10.05.49.42; Sun, 10 Apr 2022 05:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i+Scf6wX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240656AbiDICj0 (ORCPT + 99 others); Fri, 8 Apr 2022 22:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240633AbiDICjP (ORCPT ); Fri, 8 Apr 2022 22:39:15 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A89E7C31F9 for ; Fri, 8 Apr 2022 19:37:10 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id s14-20020a17090a880e00b001caaf6d3dd1so13461447pjn.3 for ; Fri, 08 Apr 2022 19:37:10 -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=fymhEmFv/O8Tuh2GeqHqqsiXL5aZG/ohxN9zZ7IUhcE=; b=i+Scf6wXGKJdppgcWPtk6/VxfqcDhX6IxbHqkMo9S9/gnqJfZJZ/jFMAnhpL7M2Qx0 eVfB4+aLpgVl0JDgirYwZ4r2JL2A6MM6//5/GgcKMkp63LMC3g2r6AxLsfiILIhWsl4P HA7k1MrDAfJlFt/ATY9UBfp4U4kxIIca89fAI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fymhEmFv/O8Tuh2GeqHqqsiXL5aZG/ohxN9zZ7IUhcE=; b=QxbNzOJvUlDPY+CAtjFHsifChantDT6MhzuQl6G9YLrTveuNifmpqOriwzkINAPoGg ifIVhyVbSjQN2IvYdSKGdY5WnWxOycWKXrNr1HBSeVF57qyeN2ExLHwuCCGZzNNQ9MyK RqpfkIww/a9ludSDNY//pK1b5/IOXAmYf9EgsgymXT2hJBamGC2uYzOv4H7RKxnbqrUX +OqO1SCoWOfvvcAt0/aYzq5bTK7ASNlvinY68QT0RvKkgqO11Jrjr0mUMrUKUeELTa4d 4OSEgdWnCBox30QW9o9Il1R+F6W/USTNVx7puuDveN3IhAXRaTN2Kc9dlaoTmG6prxT5 btgA== X-Gm-Message-State: AOAM532mtDsUdVHuXy7aJuDa1VAlp5X/B+KDC+BTLBC/y3WUnJfVH7eB tp30MgLzd0YQFw12NwiTtxKSLg== X-Received: by 2002:a17:902:f652:b0:156:701b:9a2a with SMTP id m18-20020a170902f65200b00156701b9a2amr22122893plg.14.1649471830116; Fri, 08 Apr 2022 19:37:10 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:17db:64e:48d4:a4e]) by smtp.gmail.com with ESMTPSA id 188-20020a6215c5000000b0050597294893sm759999pfv.124.2022.04.08.19.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 19:37:09 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org Cc: Robert Foss , Hsin-Yi Wang , Dmitry Baryshkov , Abhinav Kumar , Sankeerth Billakanti , Philip Chen , Stephen Boyd , Douglas Anderson , Daniel Vetter , David Airlie , Jani Nikula , Kees Cook , Lyude Paul , Maxime Ripard , linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/6] drm/dp: Add is_hpd_asserted() callback to struct drm_dp_aux Date: Fri, 8 Apr 2022 19:36:25 -0700 Message-Id: <20220408193536.RFC.3.Icf57bb12233a47727013c6ab69eebf803e22ebc1@changeid> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog In-Reply-To: <20220409023628.2104952-1-dianders@chromium.org> References: <20220409023628.2104952-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes it's useful for users of the DP AUX bus (like panels) to be able to poll HPD. Let's add a callback that allows DP AUX busses drivers to provide this. Suggested-by: Dmitry Baryshkov Signed-off-by: Douglas Anderson --- include/drm/dp/drm_dp_helper.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/drm/dp/drm_dp_helper.h b/include/drm/dp/drm_dp_helper.h index dad1442c91df..a12951319573 100644 --- a/include/drm/dp/drm_dp_helper.h +++ b/include/drm/dp/drm_dp_helper.h @@ -2021,6 +2021,20 @@ struct drm_dp_aux { ssize_t (*transfer)(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg); + /** + * @is_hpd_asserted: returns true if HPD is asserted + * + * This is mainly useful for eDP panels drivers to query whether + * an eDP panel has finished powering on. This is an optional function. + * + * NOTE: this function specifically reports the state of the HPD pin + * that's associated with the DP AUX channel. This is different from + * the HPD concept in much of the rest of DRM which is more about + * physical presence of a display. For eDP, for instance, a display is + * assumed always present even if the HPD pin is deasserted. + */ + bool (*is_hpd_asserted)(struct drm_dp_aux *aux); + /** * @i2c_nack_count: Counts I2C NACKs, used for DP validation. */ -- 2.35.1.1178.g4f1659d476-goog