From patchwork Thu Jan 26 22:40:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cormier X-Patchwork-Id: 48944 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp528283wrn; Thu, 26 Jan 2023 14:55:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXvHj8jkC6XzknpCb/bUZbv7okTfgYiKT2Fp6GUsTtxIkeJkoFY4D5lzI0+v684+sQvHVBj3 X-Received: by 2002:a17:906:7e1a:b0:86d:30ca:ec27 with SMTP id e26-20020a1709067e1a00b0086d30caec27mr36477894ejr.13.1674773705432; Thu, 26 Jan 2023 14:55:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674773705; cv=none; d=google.com; s=arc-20160816; b=IXo4yWp/tl20OoyRkO/1iqshFo2ZmzE1KG1nctGqykYipRZlLXRZiahrC9605f5rN/ +AYiBssbm+41GHZJDk9chm+YoWeVxWnSD1k28g3gqNC1Yxp2OhOJ48LffJl1Pr2OWX/D lZuQbuNAUmL4jLh/TbTPdEKPoJi8I2eRVPh1e8a98s9B7NDfA5xvWVVNiKH2dCwbYlRY nmzw4GyUu3OtKmMR1B5uhwdFS42GlCgMzJXfYSmD1TkWCDc+XtyAlLG9EjYhzeksTmJz ACqw/2IN078+PI08WmE5riB2IjFBUBDToUFTDc+ch42BxeQU9Jwe64dMRW+nLnU/MOq6 YL5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=+Z26JUx2ATLd/dkCoCkg+wifXJDNOjObbIUvuO+srwM=; b=yBBuw8ITwWtW6Hk+BAxsPD3znZbdu4w0HT6aOl+YdP6An4RKu21Pim4WG3IdFSAPs9 Q1Y4V/R8DhgpmR+mMTMgJ/rXhV0ZCjO6DdrV+8WJ46cjdgJHrISkiwuffbCe3aFbIEAv gcSvtlXv6eA0JcDbr2nBTtUeFnCTkJ5trfqUgXjIk/mLH8hKOQ27MY5WWqRqomwulKpZ zc78TUrQNHzuyhyfc1kuhqelxavtHWT1CHzcJjwDDjaU4Fq57C5ZxZc9mag82ejqQ1vN OPWqmJhNGw5XIAIczUXRJqk2/E/Qub1PxxUF90byBEGgygjrQ4Tyx6xeJoWP3il42aOq PvQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@criticallink.com header.s=google header.b=K1hD81ey; 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=criticallink.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b0087059a716e1si2541916ejc.697.2023.01.26.14.54.41; Thu, 26 Jan 2023 14:55:05 -0800 (PST) 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=@criticallink.com header.s=google header.b=K1hD81ey; 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=criticallink.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbjAZWky (ORCPT + 99 others); Thu, 26 Jan 2023 17:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231480AbjAZWkv (ORCPT ); Thu, 26 Jan 2023 17:40:51 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D6035A1 for ; Thu, 26 Jan 2023 14:40:49 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id v19so2621872qtq.13 for ; Thu, 26 Jan 2023 14:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=criticallink.com; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+Z26JUx2ATLd/dkCoCkg+wifXJDNOjObbIUvuO+srwM=; b=K1hD81eySQ0tWy7XUcrWjImwQF9mnNjKUmmrAZjds3Aw4ZZ0JJx1WUEymQu1gI3EiD F9JiVInwc0C1Asm4Fo8dhs36pYCCYedqYQcPvmdv0rYCKou/AC7GGS3sDs5ivEbY2BiW TiR/RsSLlX4IPWE4/HRQNg/Qe0EuhlGdcRPSDIcF3sXXlr6xIH8rrdjdU7XJQlWa1pKp Vp3ooiqAZxpv3WXDD46BAXxJwrXRG0Tby/MWtPj82lRh11aOJArCDTjk0RLrKXHL7cEs rOeGv2NPwUeDNKFIsHGcqpD4D5MO/2bKCH/UXnb1sDOSKkYnFzAN74+XZ6v9VJaN9xVu EtGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Z26JUx2ATLd/dkCoCkg+wifXJDNOjObbIUvuO+srwM=; b=MGPC/mQNFJ802iCcRFOAJvuwwkl90QvoAkV9liK0CayoXpJfgSfl84TjdURjTEXNPt IaPvymNFzkf81f/PwcT2D4GuVKr3I0k+Z3RfQYfwVzigYY5xREAwkebuKoLwPaFek4b+ akNIi15dbztYIoWcT3R4SFHvPbxQjLMh/iV2rHizGKArB3/7FC7po7A1B2fYv39SlbAX l9ZwzWbXcK76CQJw040lSoaDQkhhMejtWVld22cpbVQJAng2V1s3mQaPOfTedtC1WhIc TiY+BLejP6PKsGSyeh/K1txqEZOOAV0TP06UkI68dxDb1KZ0B3Di9hRd3lsolKrzMkJ/ WVsQ== X-Gm-Message-State: AFqh2kpa2nGLaDuuKtqcE/exmIieyVO42hcU/sPWIPJFbgqqx7Jrxxf8 0RenP9sZ+tPTBnu2WIsJbWGA0w== X-Received: by 2002:ac8:6f09:0:b0:3b6:309e:dfde with SMTP id bs9-20020ac86f09000000b003b6309edfdemr64396988qtb.27.1674772848366; Thu, 26 Jan 2023 14:40:48 -0800 (PST) Received: from [127.0.1.1] (static-72-90-70-109.syrcny.fios.verizon.net. [72.90.70.109]) by smtp.gmail.com with ESMTPSA id ek3-20020a05622a4fc300b003b68ea3d5c8sm1505678qtb.41.2023.01.26.14.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 14:40:47 -0800 (PST) From: Jonathan Cormier Date: Thu, 26 Jan 2023 17:40:42 -0500 Subject: [PATCH v2 1/4] dt-bindings: display: bridge: tfp410: Add tfp410 i2c example MIME-Version: 1.0 Message-Id: <20230125-tfp410_i2c-v2-1-bf22f4dcbcea@criticallink.com> References: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> In-Reply-To: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Williamson , Bob Duke , Jonathan Cormier X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1395; i=jcormier@criticallink.com; h=from:subject:message-id; bh=ChyX0+O3QNta/wRqgPEb2AoAlselOk6fdkUsmDhZY9g=; b=owEBbQKS/ZANAwAKAdzX/S4LNuuqAcsmYgBj0wFuFMqR89pfGZmdPhF+pwtHpym61u5iPDoVFk0N dKFZPvmJAjMEAAEKAB0WIQT/MozqCeZtYxNnVN/c1/0uCzbrqgUCY9MBbgAKCRDc1/0uCzbrqpJhD/ 9lIdfkA8tiGvRTw7bZMK7o+oglBip9uQzPZ+wnANjsROcumDlucu9WujrWGavlRGW7ShilWBD9dgLx Wv4KYkIKDUSCzeBvTCt8sAmg7GKFjClTZUQTQzEmzAiHOFNYm7GZmvDFXQ1EPATRr4rmO+U2Xni88g pw/rGTlrgWc42vPYiuY8mfRdNNQjb6ritUdxPk1d8TeHSkihkVCwfcSW0zfNZ7+an+62dT+gBaHsD5 /9aSW62LPR88px6ekim0UWQa8z3RxE0jQGenXZMt4/NCtqUV82eowNG6ysDJrWNwKo61BOJf3smom1 bttnNHU3mYf6QwkHsExVC9JWJtlUr+Vch/VFUYJJJs73vxMRUOUjpk0CUK8njorLvAejGeZeBUJyyc IEHm/YpFC+Nttg/h5TELh1YF+QVOcCR4NA8nCz1m4bYQCnCs22AuaoBgjjvRri2TvnDXZ/cTxjBSyN cMd04FLx3gpLiBzHJ2E6czOJW+NQmWMFNuSqQes9+QLY7QmpCaRBaYobxsPNsJ0kWfuzY5cX4dLv0l ox9x4w4OgkAXH15aLhdCkK2f2jiNqAlOycDDlZtfCbbgSwihRhFGR1XxvShf+gx7gww9IRzIGB4ai4 Z3SMI56RB6TO9TuB3zIm3UULujGRZIcq5RmI4EY4ut9UCDzLcCRJZw5gpgxw== X-Developer-Key: i=jcormier@criticallink.com; a=openpgp; fpr=FF328CEA09E66D63136754DFDCD7FD2E0B36EBAA X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756127512742028019?= X-GMAIL-MSGID: =?utf-8?q?1756127512742028019?= Add a i2c example with HDMI connector Signed-off-by: Jonathan Cormier --- .../bindings/display/bridge/ti,tfp410.yaml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml b/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml index 4c5dd8ec2951..1f3d29259f22 100644 --- a/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml +++ b/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml @@ -116,4 +116,34 @@ examples: }; }; + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + tfp410_i2c: encoder@38 { + compatible = "ti,tfp410"; + reg = <0x38>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + tfp410_in_1: endpoint { + remote-endpoint = <&dpi1_out>; + }; + }; + + port@1 { + reg = <1>; + tfp410_out_1: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + }; + ... From patchwork Thu Jan 26 22:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cormier X-Patchwork-Id: 48945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp528300wrn; Thu, 26 Jan 2023 14:55:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsYnxX2e1sTZwVVfVx1xsc7gZfKJ4FcRwffgb5YzOVPyiuwT+Yys9CKIiCG3ppfP1wQC5oc X-Received: by 2002:a17:907:6746:b0:84d:1c67:97d7 with SMTP id qm6-20020a170907674600b0084d1c6797d7mr46292534ejc.30.1674773709312; Thu, 26 Jan 2023 14:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674773709; cv=none; d=google.com; s=arc-20160816; b=kKvRvKA5D7E2EotmYZO6+JYFCRBIV0mCA+8hjpFuW+LnoImuO5MHjV5P4F9AsZdelN ABUwH/8yUgh/4vvqyjmEc+yzNiO4244wuFxx8fSiVa3CFr3y7Nfhva5NmvV9wQyLYc5r Db9YAvl4MnG3mlD13Ea3NP3MwZw3tksau+7nRz7+aPGtx7uny6K0uRnEB54lFlgtHgPY 6DdVI3mxCiUdLVkkN4Q8QtZkWPBRwXOIFY1ZTx+dordsxTkszGI6rqwd7q9glyDyzVbb WcU42SlnhUn1ZvvzSu4+4dn60VqdpIX45xtgvsRUiTijY9HY7sn+b4wtBFqGWGsIf7s+ jKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=p2rA8r1vRndMpn7srMUnFhgGhzOj7xn+WluRQ5bsA4A=; b=hudRwwlE+WitwYm8D5K0Z+d7G3sV5v4eC4t5ZQ+Y4W7VkScaH0VlXg+Q3B6IXHiQRM VmqLEbtcmHffs+hBlWb/ClP73c5Hv+PRpHP+gY0fkLd5YUqypQgTipYe92LYKOHCIXgS U0KOWCYgE5qnjh8beub76gFxsNbmk++fMa7HmXFxdwyh+CydF9hGd3DrLlyJEuLBB7SP tFu8hrg0RSyIDXfcD/wWk+vw6u4iIr8YhlDCWGmbebNCpYsvyk7AnbnhmoXZkkO/Jc+G +mwJzDnhJ6HEiOhpffP5q4mrhq/uIpa6X6pvOrUWPNo1duB0eLgOA9Tib5XyIQ5WHRcQ X7tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@criticallink.com header.s=google header.b=hHESNKH7; 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=criticallink.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fp7-20020a1709069e0700b007c18ffbf16esi2462855ejc.433.2023.01.26.14.54.45; Thu, 26 Jan 2023 14:55:09 -0800 (PST) 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=@criticallink.com header.s=google header.b=hHESNKH7; 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=criticallink.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233245AbjAZWk5 (ORCPT + 99 others); Thu, 26 Jan 2023 17:40:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbjAZWkw (ORCPT ); Thu, 26 Jan 2023 17:40:52 -0500 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE1959EF for ; Thu, 26 Jan 2023 14:40:50 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id g16so2659847qtu.2 for ; Thu, 26 Jan 2023 14:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=criticallink.com; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=p2rA8r1vRndMpn7srMUnFhgGhzOj7xn+WluRQ5bsA4A=; b=hHESNKH7+BH8Nu6BjIYJ1gEOlbYflfEjHQTILo/jF9vJ24+b9od0zBE14J4xQFcLY3 570w3EbkvYhJ6W6QNzYBZiYfNEpRSk5ISk7VFtj2ZQ8y8bCu7pK5O0yZvyBKfByZ+ZQH 7TgTNM63gtWTvMVYQtszzKp6k2mTwdSoJITlW71be9pe5gshJLuQDUmzM0m5KwIHqZ7e hqdna5h4VYG9nze0xfCm9pS3L2N5Wf/60d8MQncN9Dc3TfY7bdJCiP9yzWTws1vQWWBl q0KnJVuQV28Nx7Warw6RzYL32H4ILV+HP6dVIc8L+f295HLtZDiGCD1Z9CQr6W1TnrRN eZiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p2rA8r1vRndMpn7srMUnFhgGhzOj7xn+WluRQ5bsA4A=; b=N7PfABJ6t06hZLz2RhnAWilIuWO4/sKkhkUoIOoBlr3RgI3ILxINXmtkKEfpxBRVjz 79Lu4+fiudcdBiP5LLrFM+guhvZQ6d2p9vS2jaQfhdCXBmd0uugnLbo/8X2zr/CNo+8x TBtF2gFmHnXls2kvhgc/J9Th1CcverahA0flHx5MWhprsCDH83eyrYhwo1Hu4cJTBOsa kH/yXWX2g9rmEdKgUp6NjgaO2bHMRnuXFsBcEfbGxKX0DGwwhiNYLgrf/OUnnFQzDumn 9KoAxzypvRQbfTKxx+W7RewDa2llbNu5TYpSJSfgx5SmsDF0SySuCNY1bbGadATPVpja av9A== X-Gm-Message-State: AO0yUKVyB76ZJfEl6oAwVZlmb5lJYKJM2VXYI6fonE39Zz1lIQI6lJEF 6CVk5Q6nB2/wggAhb1J8FpDiHg== X-Received: by 2002:a05:622a:1443:b0:3b6:3697:63fa with SMTP id v3-20020a05622a144300b003b6369763famr14779135qtx.28.1674772849326; Thu, 26 Jan 2023 14:40:49 -0800 (PST) Received: from [127.0.1.1] (static-72-90-70-109.syrcny.fios.verizon.net. [72.90.70.109]) by smtp.gmail.com with ESMTPSA id ek3-20020a05622a4fc300b003b68ea3d5c8sm1505678qtb.41.2023.01.26.14.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 14:40:49 -0800 (PST) From: Jonathan Cormier Date: Thu, 26 Jan 2023 17:40:43 -0500 Subject: [PATCH v2 2/4] drm/bridge: tfp410: Support basic I2C interface MIME-Version: 1.0 Message-Id: <20230125-tfp410_i2c-v2-2-bf22f4dcbcea@criticallink.com> References: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> In-Reply-To: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Williamson , Bob Duke , Jonathan Cormier X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6492; i=jcormier@criticallink.com; h=from:subject:message-id; bh=XWThcU4Z36mFj7a764RgSd+QtYAddWcIDsaMnqm/1io=; b=owEBbQKS/ZANAwAKAdzX/S4LNuuqAcsmYgBj0wFu0nfKBjU/FSlWT9m7wefZDzy53qLToZJ8CX3h sOGelZiJAjMEAAEKAB0WIQT/MozqCeZtYxNnVN/c1/0uCzbrqgUCY9MBbgAKCRDc1/0uCzbrqrUyEA Cwzc7d7tH3He5RfIoqtNRKHNlpzLiqb+DN3hWjuxmtdV6827n8KvFm0Lb+SF+sPatVzSBXeOU5mU1g O0cH4tc7c1qI2RLXUuRwE3Hex0C2uaAYbvZWJVs2qKlntORGaLSXsrskNYvWypvK5bY9jcoPbgPrsS oLkJmii6cVXvHd3ojIEabzlJWcWD80G4lpdEQRqlODSahDKY4v54juDzf2WlzBn71Y9K+sWZRevPAi zSOktGGRovRs3O/BR5dsv/zChqLpUvw9EnRep9gsFGyyQvNFnJ4rxNENiu6OQR4zmhOixDgCYl0St7 uBLZ4WOzLcMUSgq3NyYxux9Y2ZkmCNLjfKtWjKHhaYcPKw5TG9HkTvyYKy+m2bcsv82CMP2A/7svM2 k5o2IvUcOnp8fH5+7HUMrdLfimrKEAVSPqkbMSxrl7I0p2RDLF999YrOXXGe/itrP/kfI12/IL6rKq 4wJP6uP02GD70ybGh130Si9h7ej+AAT0xY9XEc850WyLW8jyyPFT1rm5sW6YY96HdmeFlARsFJ/Wd5 HNZNcqAuKMZFdvI4tMf1nbGjIV/cJ4f03Juny0Sb7aGlDND9vuP4iaJhBbCZr1yGDH9TggXYjXUiIk HKf0R214Jih07nEXPyuYZsZp+p2MjoMUT/mWcz8vV2XRF+bGMk2kP9tbyDdA== X-Developer-Key: i=jcormier@criticallink.com; a=openpgp; fpr=FF328CEA09E66D63136754DFDCD7FD2E0B36EBAA X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756127516921128923?= X-GMAIL-MSGID: =?utf-8?q?1756127516921128923?= From: Michael Williamson The TFP410 driver does not support I2C. As such, the device remains in Power Down if the I2C is enabled by the bootstrap pins. Add basic support for the I2C interface, and provide support to take the device out of power down when enabled. Also read the bootstrap mode pins via the CTL_1_MODE register when using the I2C bus. Signed-off-by: Michael Williamson Signed-off-by: Jonathan Cormier --- drivers/gpu/drm/bridge/ti-tfp410.c | 93 +++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index b9635abbad16..bb3f8d0ff207 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,20 @@ #define HOTPLUG_DEBOUNCE_MS 1100 +#define TFP410_REG_CTL_1_MODE 0x08 +#define TFP410_BIT_PD BIT(0) +#define TFP410_BIT_EDGE BIT(1) +#define TFP410_BIT_BSEL BIT(2) +#define TFP410_BIT_DSEL BIT(3) + +static const struct regmap_config tfp410_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + + .max_register = 0xff, + .cache_type = REGCACHE_NONE, +}; + struct tfp410 { struct drm_bridge bridge; struct drm_connector connector; @@ -33,6 +48,8 @@ struct tfp410 { struct drm_bridge *next_bridge; struct device *dev; + struct i2c_client *i2c; + struct regmap *regmap; }; static inline struct tfp410 * @@ -183,6 +200,9 @@ static void tfp410_enable(struct drm_bridge *bridge) { struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); + if (dvi->i2c) + regmap_set_bits(dvi->regmap, TFP410_REG_CTL_1_MODE, TFP410_BIT_PD); + gpiod_set_value_cansleep(dvi->powerdown, 0); } @@ -190,6 +210,9 @@ static void tfp410_disable(struct drm_bridge *bridge) { struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); + if (dvi->i2c) + regmap_clear_bits(dvi->regmap, TFP410_REG_CTL_1_MODE, TFP410_BIT_PD); + gpiod_set_value_cansleep(dvi->powerdown, 1); } @@ -221,38 +244,48 @@ static const struct drm_bridge_timings tfp410_default_timings = { .hold_time_ps = 1300, }; -static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) +static int tfp410_parse_timings(struct tfp410 *dvi) { struct drm_bridge_timings *timings = &dvi->timings; struct device_node *ep; u32 pclk_sample = 0; u32 bus_width = 24; u32 deskew = 0; + unsigned int val = 0; + int ret = 0; /* Start with defaults. */ *timings = tfp410_default_timings; - if (i2c) + if (dvi->i2c) { /* - * In I2C mode timings are configured through the I2C interface. - * As the driver doesn't support I2C configuration yet, we just - * go with the defaults (BSEL=1, DSEL=1, DKEN=0, EDGE=1). + * For now, assume settings are latched from pins on reset / power up. + * Should add options to optionally set them out of DT properties. */ - return 0; - - /* - * In non-I2C mode, timings are configured through the BSEL, DSEL, DKEN - * and EDGE pins. They are specified in DT through endpoint properties - * and vendor-specific properties. - */ - ep = of_graph_get_endpoint_by_regs(dvi->dev->of_node, 0, 0); - if (!ep) - return -EINVAL; - - /* Get the sampling edge from the endpoint. */ - of_property_read_u32(ep, "pclk-sample", &pclk_sample); - of_property_read_u32(ep, "bus-width", &bus_width); - of_node_put(ep); + ret = regmap_read(dvi->regmap, TFP410_REG_CTL_1_MODE, &val); + if (ret) { + dev_err(dvi->dev, "Read failed on CTL_1_MODE\n"); + return ret; + } + pclk_sample = (val & TFP410_BIT_EDGE) ? 1 : 0; + bus_width = (val & TFP410_BIT_BSEL) ? 24 : 12; + dev_dbg(dvi->dev, "(0x%02X) : detected %d bus width, %s edge sampling\n", + val, bus_width, pclk_sample ? "positive" : "negative"); + } else { + /* + * In non-I2C mode, timings are configured through the BSEL, DSEL, DKEN + * and EDGE pins. They are specified in DT through endpoint properties + * and vendor-specific properties. + */ + ep = of_graph_get_endpoint_by_regs(dvi->dev->of_node, 0, 0); + if (!ep) + return -EINVAL; + + /* Get the sampling edge from the endpoint. */ + of_property_read_u32(ep, "pclk-sample", &pclk_sample); + of_property_read_u32(ep, "bus-width", &bus_width); + of_node_put(ep); + } timings->input_bus_flags = DRM_BUS_FLAG_DE_HIGH; @@ -291,7 +324,7 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) return 0; } -static int tfp410_init(struct device *dev, bool i2c) +static int tfp410_init(struct device *dev, struct i2c_client *i2c) { struct device_node *node; struct tfp410 *dvi; @@ -313,15 +346,24 @@ static int tfp410_init(struct device *dev, bool i2c) dvi->bridge.of_node = dev->of_node; dvi->bridge.timings = &dvi->timings; dvi->bridge.type = DRM_MODE_CONNECTOR_DVID; + dvi->i2c = i2c; + + if (i2c) { + dvi->regmap = devm_regmap_init_i2c(i2c, &tfp410_regmap_config); + if (IS_ERR(dvi->regmap)) + return PTR_ERR(dvi->regmap); + } - ret = tfp410_parse_timings(dvi, i2c); + ret = tfp410_parse_timings(dvi); if (ret) return ret; /* Get the next bridge, connected to port@1. */ node = of_graph_get_remote_node(dev->of_node, 1, -1); - if (!node) + if (!node) { + dev_err(dev, "Could not find remote node\n"); return -ENODEV; + } dvi->next_bridge = of_drm_find_bridge(node); of_node_put(node); @@ -352,7 +394,7 @@ static void tfp410_fini(struct device *dev) static int tfp410_probe(struct platform_device *pdev) { - return tfp410_init(&pdev->dev, false); + return tfp410_init(&pdev->dev, NULL); } static int tfp410_remove(struct platform_device *pdev) @@ -378,7 +420,6 @@ static struct platform_driver tfp410_platform_driver = { }; #if IS_ENABLED(CONFIG_I2C) -/* There is currently no i2c functionality. */ static int tfp410_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -391,7 +432,7 @@ static int tfp410_i2c_probe(struct i2c_client *client, return -ENXIO; } - return tfp410_init(&client->dev, true); + return tfp410_init(&client->dev, client); } static void tfp410_i2c_remove(struct i2c_client *client) From patchwork Thu Jan 26 22:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cormier X-Patchwork-Id: 48946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp528302wrn; Thu, 26 Jan 2023 14:55:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtefbctn8QFIMm+Mksc7WvwiwTLctzUOOqoHCKZPkE62aVeoAZDHQfR5Zh17w3nHPrbQrl2 X-Received: by 2002:a17:907:6746:b0:871:2051:637a with SMTP id qm6-20020a170907674600b008712051637amr45327656ejc.60.1674773709734; Thu, 26 Jan 2023 14:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674773709; cv=none; d=google.com; s=arc-20160816; b=RNyl0hhFWVKRR5j4EPTtJ9K0s6gvYj+6Mw5Sbrg+DNmqVn3dgHBUWdBJw/2JEthXqY ttnf6+jvnoXStKCpGiuKiwcylWRiZc0zCpgT4QahNu1PmSjFuaMfXIsjmkFWd9dtIOyb AhbKtaWLnw52aYoimgMWwvn06LzTsHcOA0P1WhqZM3PzEAGSgngrp4oCYx+/OCkG5H+A 24txDeHWjTYRcQvYDBpzt3CS8s4K/ZGVyhSw7e9F2a5dGtR4kQ5QNe2LGjx5TKw+UiDz 7cFmv548WwtOyNs26ZfTKNJGlRGghNMdsPleElwavlgok5aLcY8hf4PLQvTOIwdzGl8E NHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=THHRayynm5AbgmOQpvB3lJW0friOEzmgv0B/wGzZtaA=; b=V5sulIkW0lalUDZp0AV/jvmASigtqS5hM355KKPC/5CW3GQh2NBJwlPN8VfT+sNh+V bcJcfpGbY6A/Sr2PEX2Xj6xHRPDbQ6Xc8kDXGwOT82s3svGzux1uVTSl6U59B5TEGe7N XXGbyOHdS6zIrBcCE3tA+0Gro2wl5XUbCqso0r2OcUDzIJjqzU8tiqrkNJcmzFZ9xl6u xC35gTtpLTj1o2KpJk67ilYUqGRn4Ga7h3+zNpU7xtao0iXqqIReK1sIX3b2/IkYLKLI tT6DCCNBy4BFBzNHqGW11cWIsq4uw+ywnukv9/dQsmTSZjw7xNkztDOEKly9N2QLqJex YVlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@criticallink.com header.s=google header.b="RF6Mnh/8"; 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=criticallink.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec12-20020a170906b6cc00b0084d354539d7si2774253ejb.195.2023.01.26.14.54.46; Thu, 26 Jan 2023 14:55:09 -0800 (PST) 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=@criticallink.com header.s=google header.b="RF6Mnh/8"; 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=criticallink.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233253AbjAZWk7 (ORCPT + 99 others); Thu, 26 Jan 2023 17:40:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233206AbjAZWkw (ORCPT ); Thu, 26 Jan 2023 17:40:52 -0500 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C74A2131 for ; Thu, 26 Jan 2023 14:40:51 -0800 (PST) Received: by mail-qt1-x82b.google.com with SMTP id j9so2652745qtv.4 for ; Thu, 26 Jan 2023 14:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=criticallink.com; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=THHRayynm5AbgmOQpvB3lJW0friOEzmgv0B/wGzZtaA=; b=RF6Mnh/85qLjgyMlDUJSkvImtH9djlYTgKg7XXoQrPUdiKC1uKZs/pj6vNLsC5g/NH HOSjTmW4fvlZ4cKKsAhGL6k9TgT8eKTueFUoDEUTSmu1du0FaUxlEzkqnTVU049591+3 e+Til8baR6eC8XUAHdglp5Q4n1pHk+3CtQ7Gv777sAXZYq38ZvBbQhI2uD/q/3FXv6lZ LbtyEw5k+KRc7hTD79sp9vsO6d0elqy6j6Fsxym09JKwRMDHFQaLZAP6aVq9LAOLABHG /GRZcbwUvCjZiZL/nU/53xU4dJsNSmnqzdZAQ9sVDlLwj7jVy0WctKldeq6JE5YPcIbj R2Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=THHRayynm5AbgmOQpvB3lJW0friOEzmgv0B/wGzZtaA=; b=PKDZK0+Tev5vJchqUZUQSMh5NNuxjXpj7hvkTRZzWHa/u5mMP08hsjz59mVeHFHbEi 8qHQv2NMNchkyp1sve0zXzyMNhMU6k5r+lDrtm+3q9gOvRpvX65vvCsZFbeTFVrOkAu1 0bM6hIDYavz0lv3wprOE3XPaPR2AJqle/X53IyrF06oV+wz2I1unHIB8rNL8Ysg9Zigk j5iphi0R+Zb+5InLgGTA2ZyEUHblebRcZ6I1sLjb9rPCeoaoLj7l5hN+raECJqfJVbxF Clcq5bJS9YDAfMhUw/ZhEqC9h1JlXa9Pf7tMo+uVMgQrwKXgROjaSUX5aDkNNFD6FWF9 KB9w== X-Gm-Message-State: AFqh2koRp0Euap33psNE6d0jonC0dqdMBZmCx+mJ2i7BuxcmCBVqbnd1 X20ySOu9KRQJsiRYC1GHQ2t/OzsMQaA4tGqbLBA= X-Received: by 2002:a05:622a:1f16:b0:3a6:a4ed:7c42 with SMTP id ca22-20020a05622a1f1600b003a6a4ed7c42mr56284841qtb.54.1674772850458; Thu, 26 Jan 2023 14:40:50 -0800 (PST) Received: from [127.0.1.1] (static-72-90-70-109.syrcny.fios.verizon.net. [72.90.70.109]) by smtp.gmail.com with ESMTPSA id ek3-20020a05622a4fc300b003b68ea3d5c8sm1505678qtb.41.2023.01.26.14.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 14:40:50 -0800 (PST) From: Jonathan Cormier Date: Thu, 26 Jan 2023 17:40:44 -0500 Subject: [PATCH v2 3/4] drm/bridge: tfp410: Fix logic to configured polled HPD MIME-Version: 1.0 Message-Id: <20230125-tfp410_i2c-v2-3-bf22f4dcbcea@criticallink.com> References: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> In-Reply-To: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Williamson , Bob Duke , Jonathan Cormier X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1011; i=jcormier@criticallink.com; h=from:subject:message-id; bh=mvqilqhA2ozv8fVrZmSQf6YxF7B70T7NT6GdEuGjaz8=; b=owEBbQKS/ZANAwAKAdzX/S4LNuuqAcsmYgBj0wFuYWPQsfYUyfpIcVOrIwiInhKS0eFH53Pn3Wja SLuLT/KJAjMEAAEKAB0WIQT/MozqCeZtYxNnVN/c1/0uCzbrqgUCY9MBbgAKCRDc1/0uCzbrqo6VEA ClyYJaNl41nKR3DS58OZYnTE5jYasRyURXyHJa0vtk0k0ECOzJeDTpAZaNloUrW46d0xnb4iUSwMoX pAGMe/omvBPn66/UHW01DDk3v+l/1eaudv74eRIWpOJ5AVIc7HX8RAFqxKhbE8rFJwBBBjR02tRbtC Argdfw6geohKw3j80C7HvhoRqA1rC6RbWuAHgtKreEShgXWjcI3W+KFdtR83pSVBH/RdAOBnY2FD0Q 4cbesCtPS4OMOnURLwHsmf5goawW903UWn3gV1LlZhcoB5qnqODMZiGxrtDABSoqZvxgzINLVDZo6o jwhilA81CUkpsa0eNO4XYHH4kQP7z3RBi5Q+Scyhz4XFnabzNtUODIciOtQKruDviEpGl+I5ny0f0h QWM+5WmnxEE59M3oh1HWi1xgIdg9fVik+prV8hejluk8rMMmaVR4hY4Bvv+hoQnQtQ4Ctte3WB2JBo GZlnKPpldX63R2lhh7YDcDOlyquUlnckXlduIeRSRRtx5AAUNLd9sSJVKyPWFbaFxthWbDu2i2d2eO Uri1N2J3CEzZ9Jj38+QYj0h1wakCXJ5DYscok+95I/DQJ04mJrqXDdkt1UBIIsS1PhbPwcRaqjY5eW JNmuunXjwB/L8f0cMqwOyRAS/t07K76HEffLwtAmKa742XzzFLGgi48R6FBg== X-Developer-Key: i=jcormier@criticallink.com; a=openpgp; fpr=FF328CEA09E66D63136754DFDCD7FD2E0B36EBAA X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756127517513796265?= X-GMAIL-MSGID: =?utf-8?q?1756127517513796265?= From: Michael Williamson The logic to configure polling (vs async/irq notification) of hot-plug events was not correct. If the connected bridge requires polling, then inform the upstream bridge we also require polling. Signed-off-by: Michael Williamson Signed-off-by: Jonathan Cormier --- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index bb3f8d0ff207..41007d05d584 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -155,7 +155,7 @@ static int tfp410_attach(struct drm_bridge *bridge, return -ENODEV; } - if (dvi->next_bridge->ops & DRM_BRIDGE_OP_DETECT) + if (dvi->next_bridge->ops & DRM_BRIDGE_OP_HPD) dvi->connector.polled = DRM_CONNECTOR_POLL_HPD; else dvi->connector.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; From patchwork Thu Jan 26 22:40:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cormier X-Patchwork-Id: 48947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp528317wrn; Thu, 26 Jan 2023 14:55:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAFZT+up+4Z8IlRS8lX9s7UEIciIiX9k7DHxa9arcNHV1x0YzqFu+JOiDsWZAJUaBh+2aJ X-Received: by 2002:a17:902:7889:b0:192:b5a8:3eb6 with SMTP id q9-20020a170902788900b00192b5a83eb6mr30939582pll.44.1674773710453; Thu, 26 Jan 2023 14:55:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674773710; cv=none; d=google.com; s=arc-20160816; b=jpI/4zfO9oh/cV2FHFjHd6pmmcnLGzHY2GSqW6Z2cxdmD6xB8CRQo3DRZIhN5hVW/p VvhZTkIIRiAFpwjkcbYDICIaIENwe3Oz6bxuFgpBYKCiw+i7LEc4OTqYiMmFiupuGBoO vPjxXMfytJrO9ho9zHY8DErWSDdKgSoX2ATmUFEM4zax8L2uXDxm4TgkF0u2NI1jBYjZ dWfQTxbVymHXZi6HCyAjyqZHe2LojNDrIhJhi+4EgQuIg4AsFPGi9Ve2lDQoOOr9WIFf qnOJUHWIW6RZeCDWdDohrZs2zAREoLl0Q8F8YLDoY007eD1zml1nDxA3bUW2VXS9qupW 7g+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=7++FPNmCT11inHBtqfYJtM4/xAJgiLCvorUz1cWzIv4=; b=yXzg9CK2Yf8TCjXa/8j5j5FK9SNiUYgcA9TOTXN0fegqNqD3mRrbAjt3VIM9ZGQFBu Y8gy4sc1yT8K5GGJFyEB7iPV+Rn3KlKYNKCwrG3Vmm3yoDkyKf1dbworCnxHrz0M46as N2zwslN36fm5sJK2grYJ0+AWuDLmIuUMAhBr9JIsISPBriihjWPPYg6jDpkxS5WvDWAT 7bZqhwmtt3kuUuniyP2qrslvT51fat+gLi/jmPlf7xbleI/hCrSyVK5nJXEy/1w5dnk2 79dU1OzYCy7VHu2qqrQ4v0STSCWii/XdbohA8W5j+mNyjWSPFP4gGX5nmyftUwK5N4wH lKRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@criticallink.com header.s=google header.b=FfWgMmXF; 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=criticallink.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a170902bb9100b001891957c097si2639575pls.91.2023.01.26.14.54.57; Thu, 26 Jan 2023 14:55:10 -0800 (PST) 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=@criticallink.com header.s=google header.b=FfWgMmXF; 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=criticallink.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232921AbjAZWlC (ORCPT + 99 others); Thu, 26 Jan 2023 17:41:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbjAZWkw (ORCPT ); Thu, 26 Jan 2023 17:40:52 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C09384EF7 for ; Thu, 26 Jan 2023 14:40:51 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id o5so2624205qtr.11 for ; Thu, 26 Jan 2023 14:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=criticallink.com; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7++FPNmCT11inHBtqfYJtM4/xAJgiLCvorUz1cWzIv4=; b=FfWgMmXFYEj9lPeH/Vdv0zqG9hIvMC3dzwgFaJPxJPBQ/Bl/fhkUfEOTaV64Fzy4TR QL4milXBTiVyIzRmgCFLJMQjMxFI1fXWYOI9uT/ooir+UY5FQDGo9KkaYI3vaz3v1iXc EyCoq6qPTHK1pNFQv/RSJj6ooLeQe1QU1BjuWnsmrXyltSIXYXbtK/AupdJMGD8ZP2X8 ZE/ibew4ToAU5EzVKFkfnmcLGPIr1d4Y8tAW+5vpghVyZAJ+uWORKCxp1HhhNT7LLeHR 4Kf4dv5h+c/akVW39GQ3PrMfnysFXSf04gax26PoX9/TEwPnXphQrgEPBYgWaoZbHx+6 JooA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7++FPNmCT11inHBtqfYJtM4/xAJgiLCvorUz1cWzIv4=; b=mvmjyjQHoQU8kjzV9uD5x619R5VNjZt3tmZpT0nPOJOT5b35uq3E7CWrvmatVEZmSz FNdpLhhbKDJu77zIOIiXSOhClOySVKJpryMFDrKgvpbbMJD/GY6vA7wja47j3HmZtyQV p2X0Yv2iZm0UOq2Qws0y3WacFqaIfMjGNnvW7M0bNxgSaDgn8ysqV9LiWGqOEWzvyo4B F1+AOcK32XrapXXNa4unf+4nR9cO8yqNYJJk8IrQkkNFiqiFjVKJy3VtYTmnxJkGoxrC bR9nMSnPAqv0vR1SfLp263Ut9klEvkacsilaOAbI/+q/OGNwz7jpE1ACKT6dMJ2oNj5+ +P0Q== X-Gm-Message-State: AFqh2kr7qfM0j047Bc51nAfPNh3Wm1sNgpYVIbFHZXcWd8pW+319DMsl GSiEaUQPmtHW+ruaSiy7Yi4mKQ== X-Received: by 2002:a05:622a:178d:b0:3b6:35cb:b946 with SMTP id s13-20020a05622a178d00b003b635cbb946mr71952397qtk.14.1674772851400; Thu, 26 Jan 2023 14:40:51 -0800 (PST) Received: from [127.0.1.1] (static-72-90-70-109.syrcny.fios.verizon.net. [72.90.70.109]) by smtp.gmail.com with ESMTPSA id ek3-20020a05622a4fc300b003b68ea3d5c8sm1505678qtb.41.2023.01.26.14.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 14:40:51 -0800 (PST) From: Jonathan Cormier Date: Thu, 26 Jan 2023 17:40:45 -0500 Subject: [PATCH v2 4/4] drm/bridge: tfp410: If connected, use I2C for polled HPD status. MIME-Version: 1.0 Message-Id: <20230125-tfp410_i2c-v2-4-bf22f4dcbcea@criticallink.com> References: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> In-Reply-To: <20230125-tfp410_i2c-v2-0-bf22f4dcbcea@criticallink.com> To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Williamson , Bob Duke , Jonathan Cormier X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1511; i=jcormier@criticallink.com; h=from:subject:message-id; bh=mnMRLzTQ5OvUKpoF4H4mdtxVS/UwcOVTBoA/DdsbVck=; b=owEBbQKS/ZANAwAKAdzX/S4LNuuqAcsmYgBj0wFuvXkSsXrMPuQIuaE7dqR3P3ABer3/DA77uFMa Kse6bIOJAjMEAAEKAB0WIQT/MozqCeZtYxNnVN/c1/0uCzbrqgUCY9MBbgAKCRDc1/0uCzbrqjH0EA CuMWARBsza9msRcHworH1ssy/nFvqzq4JbkaBvAIl0CJb4diN58Mnla1QqnkkqHuSAj/Wta4K9JmJB XPBdPdsr66l2JKinBGdLAJRJHN6r0BM66hlL5RuizDJHFhfU9WgWiQsz4KoidZh/rUcm2yvODPTR2y TS+c4JA5a8mNj6EELvH+dZG3MRdgAot6HEH9yDLjUXz7kMYb5Acz1YmpfKYHnyZUP9OsKopq+iAOs/ oEB8kr36y6xylEkJfTZyHcAwKpD/5T3Nlk5FcMGQh5BrXqF9X51He1ns5V5fujw/N7Ybrhn+sAdwcB iA/w6dhTfeuyRRlyGJo7liNOUEVeu9Qx1EVE11AriFjxFxEC9muC2aVQPZT8OmU7ho9okGhDRkmA6K PI9f71y0dUHpZHPzyEoYlwAz/kEVd2U7VnPtJmA//l9AS2z/zk9gLghAMllvkkPgr5ye6khJd+v4O0 V89ebxTpges+Kbd/oyShBYwRpSh4gYTM4w+RpKg1tB/3FlTempzoX//3/QMAthGRmygseCSDjWM6UD uUoHgcxV86Dzfnn2WEyQcRS89AXv4DIF45hiPtOpLd/X/ZSgTOhpkF/50WLKHDT7X1MTEKSYjDxii2 ivTCGpZLsW6Qv3lF7PR3bbLSzeHEOmUh2MfoYtbMteNMElwBVsJsqY+PIP3g== X-Developer-Key: i=jcormier@criticallink.com; a=openpgp; fpr=FF328CEA09E66D63136754DFDCD7FD2E0B36EBAA X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756127518432538964?= X-GMAIL-MSGID: =?utf-8?q?1756127518432538964?= From: Michael Williamson If the I2C bus is connected on the TFP410, then use the register status bit to determine connection state. This is needed, in particular, for polling the state when the Hot Plug detect is not connected to a controlling CPU via GPIO/IRQ lane. Signed-off-by: Michael Williamson Signed-off-by: Jonathan Cormier --- drivers/gpu/drm/bridge/ti-tfp410.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 41007d05d584..eeb7202452aa 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -28,6 +28,9 @@ #define TFP410_BIT_BSEL BIT(2) #define TFP410_BIT_DSEL BIT(3) +#define TFP410_REG_CTL_2_MODE 0x09 +#define TFP410_BIT_HTPLG BIT(1) + static const struct regmap_config tfp410_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -105,6 +108,15 @@ static enum drm_connector_status tfp410_connector_detect(struct drm_connector *connector, bool force) { struct tfp410 *dvi = drm_connector_to_tfp410(connector); + int ret; + + if (dvi->i2c) { + ret = regmap_test_bits(dvi->regmap, TFP410_REG_CTL_2_MODE, TFP410_BIT_HTPLG); + if (ret < 0) + dev_err(dvi->dev, "%s failed to read HTPLG bit : %d\n", __func__, ret); + else + return ret ? connector_status_connected : connector_status_disconnected; + } return drm_bridge_detect(dvi->next_bridge); }