From patchwork Fri Jul 3 19:24:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11642749 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 41F6A60D for ; Fri, 3 Jul 2020 19:24:45 +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 1FF8E20884 for ; Fri, 3 Jul 2020 19:24:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TeaSiOj9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FF8E20884 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.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 EA35E6EBB5; Fri, 3 Jul 2020 19:24:36 +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 715F76EBB1 for ; Fri, 3 Jul 2020 19:24:34 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id f5so22319699ljj.10 for ; Fri, 03 Jul 2020 12:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ilng7Kli1eWnVw7MJjFUyca35KB0/YCP9yYYScKjbC0=; b=TeaSiOj9gn1A0rNDXlPuQ4OTzPmhaF8BAZD7FjCGWy2+wzMKiWEuYZ02f8Ub7A9la/ 41lyDILt+r94E08GP1QeEfCczgVdSBfs9/i806mKQ790Sz3fDca+ALTjkB2CwvyvP+yv /B9i9LsXDt6eT5v/64k5/UKhB8LHcyJ683aTZ/7rR54ANwe5tipav27EKHvhsZaObozZ DYH8F1I+mOLTMLuM9B+7OPF0FWtQMzdz782s44znIqcfKuV1LH96x4Ts59ZamAV8bWcO gBgk9AcGBYyio1casBP8Zk2jMUnFbuxax5f73RX9JTQ19Pk6P4qNlHIHQs7KP3E3HMhv Wmsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ilng7Kli1eWnVw7MJjFUyca35KB0/YCP9yYYScKjbC0=; b=D0cyhT6BtcBUS+impr6JmyVyQMk2tN09Laa1+ZUwLXfJzYv8rMv9PC5PT2Ip08bspB w5TtusJrHeAbS10Pe4MzXDfaIfBQkI9/W3CLtNnO0sCKM5TjMzQwEHYWFaJjE0LdiBm6 fc+zRRFyqweDTuYm2rW5TvIA0UABZa5mhT3sqXDBfDRWCsMRzB7yvgppjuBmuprtrC2f lLSxrPyn4BDiXRyogA/MIirPDXE5rE/lxv13GqKh91VCHma9tsbygqwkIn7tv0eEbxnD m80CEDYr9RVjoc1QpnRp9kKl0Ox+0I7OPf7htYg+rvDvwFLzFfjC1rTJz+kkJwz9M5EZ vz/g== X-Gm-Message-State: AOAM533QsscIC7vScnNa34lS+G5uKpPQCOb3/c9KtlLsGeABx/vOctWs ejlks6v9HAGpgnuxXNEtqLCYxQD9AZI= X-Google-Smtp-Source: ABdhPJzaQy5t3p238WDml+i7GzrZK/eS/gTfJJwX+dipxppk8hHtY5iPAIb8sH8TN9MlnVNmTRzmOw== X-Received: by 2002:a2e:9957:: with SMTP id r23mr21417154ljj.127.1593804272668; Fri, 03 Jul 2020 12:24:32 -0700 (PDT) Received: from saturn.lan ([2a00:fd00:805f:db00:4025:a614:1d5c:b7bc]) by smtp.gmail.com with ESMTPSA id y26sm4411791ljm.46.2020.07.03.12.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 12:24:32 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Laurent Pinchart , Neil Armstrong Subject: [PATCH v3 07/21] drm/bridge: tc358767: add detect bridge operation Date: Fri, 3 Jul 2020 21:24:03 +0200 Message-Id: <20200703192417.372164-8-sam@ravnborg.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200703192417.372164-1-sam@ravnborg.org> References: <20200703192417.372164-1-sam@ravnborg.org> MIME-Version: 1.0 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: Jernej Skrabec , Martyn Welch , Jonas Karlman , Peter Senna Tschudin , Andrzej Hajda , Thierry Reding , Sam Ravnborg , kbuild test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Prepare the bridge driver for chained operation by adding support for the detect operation. Signed-off-by: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec --- drivers/gpu/drm/bridge/tc358767.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 08d483664258..85973ae728db 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1353,10 +1353,9 @@ static const struct drm_connector_helper_funcs tc_connector_helper_funcs = { .get_modes = tc_connector_get_modes, }; -static enum drm_connector_status tc_connector_detect(struct drm_connector *connector, - bool force) +static enum drm_connector_status tc_bridge_detect(struct drm_bridge *bridge) { - struct tc_data *tc = connector_to_tc(connector); + struct tc_data *tc = bridge_to_tc(bridge); bool conn; u32 val; int ret; @@ -1380,6 +1379,14 @@ static enum drm_connector_status tc_connector_detect(struct drm_connector *conne return connector_status_disconnected; } +static enum drm_connector_status +tc_connector_detect(struct drm_connector *connector, bool force) +{ + struct tc_data *tc = connector_to_tc(connector); + + return tc_bridge_detect(&tc->bridge); +} + static const struct drm_connector_funcs tc_connector_funcs = { .detect = tc_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, @@ -1444,6 +1451,7 @@ static const struct drm_bridge_funcs tc_bridge_funcs = { .enable = tc_bridge_enable, .disable = tc_bridge_disable, .mode_fixup = tc_bridge_mode_fixup, + .detect = tc_bridge_detect, }; static bool tc_readable_reg(struct device *dev, unsigned int reg) @@ -1677,6 +1685,8 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) return ret; tc->bridge.funcs = &tc_bridge_funcs; + tc->bridge.ops = DRM_BRIDGE_OP_DETECT; + tc->bridge.of_node = dev->of_node; drm_bridge_add(&tc->bridge);