From patchwork Thu Jan 28 03:08:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12052927 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=-15.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 7B461C433DB for ; Thu, 28 Jan 2021 08:16:33 +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 2881664D9D for ; Thu, 28 Jan 2021 08:16:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2881664D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=analogixsemi.com 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 82BD76E90F; Thu, 28 Jan 2021 08:16:24 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2098.outbound.protection.outlook.com [40.107.236.98]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6B7789B9F for ; Thu, 28 Jan 2021 03:09:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AMiTqY/u5Nn9/qXG1NLQX36ILgU3m5qWTXeKsomaee/PH6bHau5B9OpCKwIQNASnVI2tPjA5HBtdeOPqyLRJ+Iad+4536kkQyJGEyC6AwZdk564o6TB4sjv2gUw4mYj5Yj+seHIOwM7L8HG/i8mjurSITlWELUMknFtaETs70nQF3BNmx4YOZjuoXe4EvX9WOD674zLBKn+Q7eLomAOxxCqDaiPeqgIFDfDBoo5boxBaVvfq0FiXnxT6c9sva/lyFWUdVPEeW4jwnoBU1NQYXBzYheN98JdtpnHHPDLe0ByO9uAKo3xwpHA6lx6NNhBMZ2wNcdOq9Ra0ukfCGweQIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zMzjw8mGhLiz/yr/QZuSzHoccfMOaO9JAwQ4G+ezjxc=; b=FzXZc/qjr7Gbj5CD8FnpCMD2rF7ngsaP89YP58jTvzDFnF7fuXHgML5o1yRXjYJHyiBJaR/S9mNAG3rS3rH6semNVVF3gnpP1N2fx5daSrpASohS5d0PmBuYOxXd0PWSYm/Wov/qjjrLECNfqIsodPBz4XnDgVAkypj9F/9uDGp9LMJdkqo8STFssLq3tWw/LpZ77WhqxrNiOGJ4V7bVy0AkX+YA8KaWpC0hiWocmjAYX2beZf5W6LJ4Hfc/wrgoI4HncLGt2Bcyhxz1tbp/Ej5HQhUMM5+sURbwqn+s0GKRiL1R0es8PylLAs4k1kcM3HSSF/h/ngLkIjTnQCwD4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zMzjw8mGhLiz/yr/QZuSzHoccfMOaO9JAwQ4G+ezjxc=; b=0WzqwGCQ1wPqsH3/PuI03H72XqOhnbAdDAFyHGArPsW7cuem+haYIg0bWWd4LgmOVrEJm2/4xYr13DLd0mQMQD87SQMiLjc+kTyxYqEGz6QYmn2AoJffNUYjezRu8IwATj30Z4xHREJbObtuoeUzBAKkm4CxiUY/uH3Je632kZg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by SJ0PR04MB7504.namprd04.prod.outlook.com (2603:10b6:a03:32e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.19; Thu, 28 Jan 2021 03:09:03 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132%6]) with mapi id 15.20.3763.019; Thu, 28 Jan 2021 03:09:03 +0000 Date: Thu, 28 Jan 2021 11:08:26 +0800 From: Xin Ji To: Rob Herring , David Airlie , Nicolas Boichat , Hsin-Yi Wang Subject: [PATCH v4 1/3] dt-bindings:drm/bridge:anx7625:add vendor define flags Message-ID: <246b8bd6e51ed5c8cb3618f4259adf8aba319511.1611802321.git.xji@analogixsemi.com> References: Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [61.148.116.10] X-ClientProxiedBy: HK2PR04CA0052.apcprd04.prod.outlook.com (2603:1096:202:14::20) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from zhaomy-pc (61.148.116.10) by HK2PR04CA0052.apcprd04.prod.outlook.com (2603:1096:202:14::20) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3805.16 via Frontend Transport; Thu, 28 Jan 2021 03:09:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7c6806f-0ed5-4873-cf25-08d8c33a10c0 X-MS-TrafficTypeDiagnostic: SJ0PR04MB7504: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T/l4LIOybi802UkOAfDjmdHDQiivsLgE6lsPDu8rJapPHoaoMxHpQshu1cWjEDgmklxEN4jtcUdbJLjgPywr5TGsw2ZG5SRqaG+lekkjj3sCJSp3mf30PCCZTDhuomCLeoVMhmbXBh8hNjw0hJ97nw3MjD8NIJb4bBO6v94ceyDckrozHwUkiWecGLNxPKSdPtcRMYUjJ/OQ2H6roZYel0F+Yjdp/VBO+2cRs/sXqiI4jvK/sCbUdL6c1rZ0sUZXV7lFr5s09fLKgIMOEbcuvk11UKGYDzdxBXW390pOxTbHOdfMX+9RscA+eSmXsEZ8x3KDlnBBtHQxEipfvy3bM5t+cmlRqRyP8dUUVtIU1EGIiyzmqfSr3Sm/D3n9eXjEhXKngXPaRLAP+c/oJC1+XkPCdlLHQIqs+aC/BleS/uv7G5CjiR+94WOyOjs9IQw5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR04MB6739.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(39840400004)(396003)(136003)(366004)(478600001)(7416002)(956004)(8936002)(6666004)(6486002)(5660300002)(186003)(36756003)(8676002)(6496006)(110136005)(316002)(52116002)(4326008)(83380400001)(66476007)(16526019)(86362001)(66946007)(26005)(2906002)(54906003)(66556008)(2616005)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: R/KqUZacRslJOwa9Z/qv1f+9ZPLDf1ZQslhHAmy3gIBmnp0E6cFb6l+MqLOe7OTk/ONSZ5QypX5OZWcc4NbxKty9wV9AaYmnWdrqoEMuNoApfrX2xP+Y/WcnnIAqFQmoJbK8OzhyNXbGG+oPhjePB/vh2ZItH1Wd4yr/PueyU+xNPO3hbrW5hlV500eSC5Xik4vYlpMNwZmxVZAKiMDDdRrEV+Uy7Y7R+MDFUjcN6gj1d/vFDFaXVHQeyQYmBO5Fhx8R9pwB80hNes0Sdl7FSu4ZokeHLz+1AMbkUiQBA5AdSYZcX8BM4hs4l0FCIchydKSddMlXRThK/nxRH5YWnZAElu1VftllBVhv9sDRj09+CMLFQ94cK11bTSt8Mvg3VeeV3mJN0ALoo1IrsWIeaw4IaNt58J5M+LMdiNUV35u0EbIAD+Ps+6fldulwig33QO2xVAeuGTMs6f/lUFYhgb8AGSlLRsS/VDbWhFXUELqV/IHo1ZjxNxwAgtNqy6iQnW08aQsrHZH7vVumUOomWIoiypiXq57IsfPnYWAi65WoCCOfNhxTK9cacu4z3dV4zrOLATXkoZDC8knG/kOgt80KmCo6S5TLW4ZiA4dFaHvDSOW7xEkSZzZJZt+jJJak4wCAbfejEwC4WiWXXIAPW7Uge5K1nwry5lm1x61a3vkyBf3mFTiqsm66x3YwO+EcXy2qltPjhuA7w5fjduchHCW1LvoQLFDZnE2i5tlcm1z0+PAUwGl1iJQwvHuK3TAlgL23C5wvbIC5xMu3eMMqzUvzLdlM2+RkS74WZay0+kUbEtH4H88+CEHF2sOcQmRTeabBWEExriNcLv+KK/LcCYDTi2fKlpH1IVFdO/8hXkKwNboHeqtEnd7g6xBpGis34sAdnBy6LJFq7rG7KAwnYOBFr/VHfPjweijJIel3FbZQTESt5ED96oND5vcpwvGYYy6k12vM0/diuDf9CepPi9u2DsaTB5sk3zbr+cGg9HrhZfwfZqgFP6mADvxxhAJSH3u0N0OJd8alNm30l5W7GJkDod6HbJLe7pyMdAoaDiK1Txz6uIcmi5Qh8MUgwWXm X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7c6806f-0ed5-4873-cf25-08d8c33a10c0 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2021 03:09:03.3309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iaAf0rYM0fiWcjwkuP72l5SHvq/Oxln8I7z8IFF9epRgCnP0IcUL8d052p4qfu49aWLhekYRDo0+DTAy9uPyrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7504 X-Mailman-Approved-At: Thu, 28 Jan 2021 08:15:36 +0000 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: devicetree@vger.kernel.org, Laurent Pinchart , Sam Ravnborg , linux-kernel@vger.kernel.org, Mark Brown , dri-devel@lists.freedesktop.org, Ricardo =?iso-8859-1?q?Ca=F1uelo?= , Sheng Pan Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add 'bus-type' and 'data-lanes' define for port0, add HDCP support flag and DP tx lane0 and lane1 swing register array define. Signed-off-by: Xin Ji --- .../bindings/display/bridge/analogix,anx7625.yaml | 54 +++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml index c789784..048deec 100644 --- a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml +++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml @@ -34,6 +34,24 @@ properties: description: used for reset chip control, RESET_N pin B7. maxItems: 1 + analogix,lane0-swing: + $ref: /schemas/types.yaml#/definitions/uint32-array + maxItems: 20 + description: + an array of swing register setting for DP tx lane0 PHY, please don't + add this property, or contact vendor. + + analogix,lane1-swing: + $ref: /schemas/types.yaml#/definitions/uint32-array + maxItems: 20 + description: + an array of swing register setting for DP tx lane1 PHY, please don't + add this property, or contact vendor. + + analogix,hdcp-support: + type: boolean + description: indicate the DP tx HDCP support or not. + ports: $ref: /schemas/graph.yaml#/properties/ports @@ -41,13 +59,45 @@ properties: port@0: $ref: /schemas/graph.yaml#/properties/port description: - Video port for MIPI DSI input. + Video port for MIPI input. + + properties: + endpoint: + type: object + additionalProperties: false + + # Properties described in + # Documentation/devicetree/bindings/media/video-interfaces.txt + properties: + remote-endpoint: true + bus-type: true + data-lanes: true + + required: + - remote-endpoint + + required: + - endpoint + port@1: $ref: /schemas/graph.yaml#/properties/port description: Video port for panel or connector. + properties: + endpoint: + type: object + additionalProperties: false + + # Properties described in + # Documentation/devicetree/bindings/media/video-interfaces.txt + properties: + remote-endpoint: true + + required: + - remote-endpoint + required: - port@0 - port@1 @@ -81,6 +131,8 @@ examples: reg = <0>; anx7625_in: endpoint { remote-endpoint = <&mipi_dsi>; + bus-type = <5>; + data-lanes = <0 1 2 3>; }; }; From patchwork Thu Jan 28 03:09:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12052971 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=-15.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 D5977C433E0 for ; Thu, 28 Jan 2021 08:16:44 +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 9666664DA1 for ; Thu, 28 Jan 2021 08:16:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9666664DA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=analogixsemi.com 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 C3EA86E90D; Thu, 28 Jan 2021 08:16:42 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770105.outbound.protection.outlook.com [40.107.77.105]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43B2789B9F for ; Thu, 28 Jan 2021 03:10:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lin9xUDv6PBeV3waMMKQPF1h0IzPUaZ/3AOlfTx1pkZdeZKEwBwb7bg60v1ESuYccFgrpN+On3lmORuaOaiQ/XBqNJSYK9yN4dbnkziMo9/LxfMItKSTn07Z494gvtQl9QX0axbt0nAD2g2KsgKnjqRW5IXFGG3rOJmFTp52ynwa67lCfLh+gHIl2/RxOPACclQPCjmUQMYgJXWuVYBL8NqWISAQf62aAjCKPu/VHlr8nB3YyVA4zThbPDMBffksXwcXHdwDjYZ5tynjWUClz006OuqE3NMnNQekvDfHj1Nshf7ae2zztFUhKnvY6pdR7yEDNc19+sYMI5QuUlFodQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxJSPytLTGbJfuVaYKZUvuN+jvubAhBytBbcyAoj2zg=; b=HW7tAZtf7DsFTxwJ8fGgKRxTwbgByquIsdUDsXXI9P42roOqVm7Vd/qwdhUPUOApe0NHx0oA54Wlm1p3L4zQ/aKlVfYO4MCxvzDBLKaI7skgjnPgsv4vj5Y+rW1N1EqxB32eorhUnlKAKfyOiA4spnKKr5fXOeSb8l9zciPHKTrh4s8KxgQZfiAxUeYHlBxiCWLpsWgnwpp+WH8pU4q5ARzDLwWoSPClKhhQ/ioXRVD908XfG0Ad/gkFHSL38evy8QYJGXbtorZM6hsDLqjfjjMP+h9pr/O6FCB3ucmsuBglyHKTnIkE1La6IMnmQUj6Lj8yInByVNwmh8jePdPvfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxJSPytLTGbJfuVaYKZUvuN+jvubAhBytBbcyAoj2zg=; b=QDxV3nXD1VBW6wBjWJFDrN5hqg9r6Gk5NvO/bjonmtHcVdUt67L7P5oHTgW1ggfbWF1D6gJ9BZGAASclzb/VtkAjKJXuKcbGawCxNddD47ehSv46+4lbOBwOS0TwYbtJDOpNL0x3AZlgc11JrbBfHx2kalXK24tmWhsTgAgaL7g= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none;driverdev.osuosl.org; dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by SJ0PR04MB7504.namprd04.prod.outlook.com (2603:10b6:a03:32e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.19; Thu, 28 Jan 2021 03:09:59 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132%6]) with mapi id 15.20.3763.019; Thu, 28 Jan 2021 03:09:59 +0000 Date: Thu, 28 Jan 2021 11:09:23 +0800 From: Xin Ji To: Nicolas Boichat , Andrzej Hajda , Neil Armstrong Subject: [PATCH v4 2/3] drm/bridge: anx7625: fix not correct return value Message-ID: <23b62a447364a9047f0b1b144557e8d95f6ad7f7.1611802321.git.xji@analogixsemi.com> References: Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [61.148.116.10] X-ClientProxiedBy: HK2PR04CA0086.apcprd04.prod.outlook.com (2603:1096:202:15::30) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from zhaomy-pc (61.148.116.10) by HK2PR04CA0086.apcprd04.prod.outlook.com (2603:1096:202:15::30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3805.16 via Frontend Transport; Thu, 28 Jan 2021 03:09:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 877921f2-2cd9-40a2-d339-08d8c33a321f X-MS-TrafficTypeDiagnostic: SJ0PR04MB7504: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eO5w1EZMD7IpFSaKwcVDLFzePV+wVGEafrc7POz2l8GLj6Bg2eWt2MGpghPVumeoCqgn4n6w5xkl6qzmkO903u3FmAFtpVmxIqL9jgXyzPBWq7OZtNbR/HPuaJU71jxgTguppUzl3bm0ZyDinwikUxaCOEST9cx1fsz6qISCbvy21aAbAjU8/X32QUSFRJNWLRW612vd9VpzOmmGAvPsoBBiAJAVhOjuQL7lafziil+jX4G3qflH0eKJj3lq5wsTFSg7B7Vjg40JhAxkYTs/PVWZ23h0k0hg3D7yQpf8DdALijb2auKQocX4FqtbkkFzpUb83n9Gmjap1P8Pj42XLl0s44w5mhTIyr4Fs4WVJ3HdbJpBvja81LonrwGgZUsGRJvdIit1+yNVTUMLscuP029d1ZxkN4gulGcsmZR8IGhg0Vc5Y/sLpY1bn8hTkCyx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR04MB6739.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(39840400004)(396003)(136003)(366004)(478600001)(7416002)(956004)(8936002)(6666004)(6486002)(5660300002)(186003)(36756003)(4744005)(8676002)(6496006)(110136005)(316002)(52116002)(4326008)(83380400001)(66476007)(16526019)(86362001)(66946007)(26005)(2906002)(54906003)(66556008)(2616005)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: H1mC1wWol54gQ+Nu/1v1sjBMaP6Kg2drmcpva2AyZxopEmdqey/CE5/0nU4IogErnc8JHgN50n0LLbIG4kutzB81pZi150o0+vpRNBzjH32fLDmun1Ksc2c86pD3rHYhCFm8mphitx5RFqznTdXEz0EcJacBVXErujh1B0kKoDEKiUtIu1nHQEevrbtls9hzWlvZWxNGxdjm4CMG6/76SpI5Wyv2TEoKbt005ognMTfYakY6AZIXYdYU6kz6TNCHoVKmIm/wYINTEDT+hOWd65ujSCGmayt97LLestRiOPb0HkwClIY07q39N3EX28xBn4AEgPw5+g+3X7KESRdQ72jwKc8JlgDDIBlI88aCYeyIbqzHozPZo3vsXhvCK1FtETVTeeZEdwDj5V91XFhzUTK0ZkKSIkzX/Nv2OlbUdsJADmUOg9DdMOV6n9Sbb4797lkjlbQ8eBCUX5vjIVIJ55dIsK9YGQW7YHNy4ErzTjCuMkmVyZgnMYpaknWwK5rHWzaM4KL8mgXeof55CUBfvZ62XqTb1Lhsgppj93nQyiloGCWEarxwqtnPlrf9hgjCuflLcSvUQBMKK8zp+cJWU1Age9MecgYtSfqiLHnnCNV1r511aA/Frlnm5UsVHFt1Ojsb1KI6T3eBa/Q6wtBEivS8XdIfBDSYlW0UrHqRTqvyjZEl7MLQ8z6sXiERtqVaY1dyjjPJF1Lcln+1YKPodZJwnATmF8R3yt/fyAOvAqUFyD6S6p1uQNkCFzArN+wtNcwrauKvaRcp4IpngItq5CsIpGWOkiz2mYgB8KuvOX3fnzBQtktx9jdDWlKh5YIj0FgIquJMBA/CqSpjE2gWrsAJmpPNnU2cMeeOlty/qeQs6yX4WtNbBfkHHqzjNxXq3N/7OuQ1EO/OPhg45mZpgxNxJ/5BASYuj+NIucLPeRteeOtH6cpPoS/vz+C1idt1Qvrcbm1lXevzfkwjHFYgjw3rZxYPjlBt4mYqlSvDoiXYRKxjZnFYXSnmkQ9dUeaXqbZMweG5piqyoSqa+ELrgYMu7fhDz+AnaWHIuIwH0JF1Ylg+7pDXrT0Ib4g9deBA X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 877921f2-2cd9-40a2-d339-08d8c33a321f X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2021 03:09:59.2149 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lxAqlWQIr1eWcjV4tRYH6xqnK9XqeI/Cvhb+9iJSegwFAeCF1SVb2nw+u+uIIBrvq+4QD3bPSfk+v6KvxhkHKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7504 X-Mailman-Approved-At: Thu, 28 Jan 2021 08:15:36 +0000 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: devel@driverdev.osuosl.org, Jernej Skrabec , Sheng Pan , Jonas Karlman , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Vasily Khoruzhick , Boris Brezillon , Torsten Duwe , Laurent Pinchart , Hsin-Yi Wang , Sam Ravnborg , Dan Carpenter , Marek Szyprowski Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" At some time, the original code may return non zero value, force return 0 if operation finished Signed-off-by: Xin Ji Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 65cc059..04536cc 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -189,10 +189,10 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) AP_AUX_CTRL_STATUS); if (val < 0 || (val & 0x0F)) { DRM_DEV_ERROR(dev, "aux status %02x\n", val); - val = -EIO; + return -EIO; } - return val; + return 0; } static int anx7625_video_mute_control(struct anx7625_data *ctx, From patchwork Thu Jan 28 03:10:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12052993 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=-12.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_SANE_1 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 8E2D2C433E9 for ; Thu, 28 Jan 2021 08:17:12 +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 3FA4B64DA1 for ; Thu, 28 Jan 2021 08:17:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FA4B64DA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=analogixsemi.com 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 4C33B89617; Thu, 28 Jan 2021 08:16:46 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770102.outbound.protection.outlook.com [40.107.77.102]) by gabe.freedesktop.org (Postfix) with ESMTPS id 034C089B9F for ; Thu, 28 Jan 2021 03:10:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oebbvE6IpN9K4AaE+YbYBHw85CcQvngDenp8ZdtqxoPuub9Iw2op5+qQkwdSNK9uhQJ0iHpzcpGsw2w78JEmPYuDERQnETbD5spFAyn6PRmOoyH+9818lOvRZ7UMkCOyL+YMMzcmBjwoW2wyWRv7VfVxJ5gJlp8vQJS9I8hJq9W5IYKPCAdZDb208ElYk66uWvyotze6QMf9VwCuRsMiRUDBp+zAIrjo1dzR0mxOuSvfGMy/jgQ2moRWVGnL8bv+jQ90AFbH8wfE+D1Dc8oVbLF3WkqHGhEw5tEFqpREO2L3YvSkwRUjNDIin67Jc50CvlrQGCT7rz5uBzIJ6CyTPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AV+262+YR6QU/p4YxROc5zG3u9njfkHi/gMVKBTVKX8=; b=hYIIhPYnIfLmzJMZNchcj54Dh8fBvP1YQLg1eeV7KuLoKOBwuXwaggUh3fXhTCAj3OqfY5IXbrJq0qj8pudBhZc5kpninLi1DDQmRKzChrO532j0euLSRx6hVwkiWOUFCqk0Y4eG2tDe0OtTJPCO3kDQd00GS/GXwUebImJkxiYyf14tdABzEH8djsIA/uZpCRlLGdhTsdCcX28D33XKmboLG5LJPjUu2lz2Stj4wvwQOG5G5/Be6wf+LvfLvuoA3C9fSRLk9z6OYIkqmoEvx7LB1Agjki3GkjQafCp1Ap2JJHXwbILyzyCMPGh42b5NNaoev+gS0AUj0BPWOIg84A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AV+262+YR6QU/p4YxROc5zG3u9njfkHi/gMVKBTVKX8=; b=I7wd/s2mKSLyB3esOGkgMc7Z+NpAx39vOjCpFzPSMjrgIX2jcZbgtuPZNP+kiPeig4Ldmq2Dud5Za35BOmb5Ht1w5vQ5MFFbsvUpulBdj4X9Kms/Z7OseLrLs/DWeAlsHxJVIxbTcYcHIDfxzD30VOIafen/d89mSMd0KDcRQkI= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none;driverdev.osuosl.org; dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by SJ0PR04MB7504.namprd04.prod.outlook.com (2603:10b6:a03:32e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.19; Thu, 28 Jan 2021 03:10:49 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5813:96a7:b2d6:132%6]) with mapi id 15.20.3763.019; Thu, 28 Jan 2021 03:10:49 +0000 Date: Thu, 28 Jan 2021 11:10:12 +0800 From: Xin Ji To: Nicolas Boichat , Andrzej Hajda , Neil Armstrong Subject: [PATCH v4 3/3] drm/bridge: anx7625: add MIPI DPI input feature support Message-ID: <49fc9c62026988d7adc2eb7e4d1f6a3bffe0b66c.1611802321.git.xji@analogixsemi.com> References: Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [61.148.116.10] X-ClientProxiedBy: HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from zhaomy-pc (61.148.116.10) by HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3805.16 via Frontend Transport; Thu, 28 Jan 2021 03:10:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a07e6c6b-fc74-4009-a756-08d8c33a4ff2 X-MS-TrafficTypeDiagnostic: SJ0PR04MB7504: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:61; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xBoKYwaaB0Vk+ktcx+p8HHfKx9B86xkaNNZRDIqNz3upPe0ZitRJME2j0+t/BR0J11a384oEWgPKt/q5yr5ktHXMD+3z50PdJbx+QZRtCddGPb1qXj2Oe+BhybotQ60FBBiIShDLYypPVFKYvM/Dea8Ftz687TTaOF56/q0/JI/lpsTvE8NDwpS2hGju+ZARRHo2g2M98vIJ4daDjJaVJpFDInm260MXKeD+Y/5jewikbYxCJMx3cqXwBxcwnRs+/8VbNOv97RSBQ2ZiWG1TwqfQ7w5Efp7xf3RVHivC5XQJjvFYbmRM2VZ2b7z+b5RH7otoXlGWkcVUxxkZzambSVX/b7/LK/8hlKuoldKvuJcFo1g3CmcgDSg3mJk3t0TnQCoWUShmS00AQ2O36Dl4E3SFFQa9ltoNlZQWUAR+QUGVEg3DoYT6nqpWIVrcW0mD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR04MB6739.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(39840400004)(396003)(136003)(366004)(478600001)(7416002)(956004)(8936002)(6666004)(6486002)(5660300002)(186003)(36756003)(30864003)(8676002)(6496006)(110136005)(316002)(52116002)(4326008)(83380400001)(66476007)(16526019)(86362001)(66946007)(26005)(2906002)(54906003)(66556008)(2616005)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: byUZYDnpfBMIDiFP34WzcnLAMiJrB4NVe+XXbt+ZYbhM6RnRiSBJSesIZhz+XtAdBkVHcU6PTyf1YzVgQNEew3x8BuzZFyelyL0QC6H+T2I4LMQf9TsPdezT6jBZiUnIQdKA5M1ewblhfMY4ZfNxgITSjQTH2EdfTJtOuTCadaT3D9BoVPoHVbdOuM8FqZ60GF4VAhh4wA6J33SjlfvDPRZbLHWgRbX3hnDYClrbxEMN/+qfrBnvziIjOi/cbghAYbafXHBmAoQeYtJvKwRvQafHbZp9jxm7gySY1vFYfw4tYIXuhWrsY1ak3YERxCOJoHXvC/FPN3aD+WyqwBNMbHYXX0A3DgcR2TS+S8HncvbJRCZBbBlE9Srjm/ArIYtnyKf90HY3DbpCiUcE0KXsK66SLn35KFi7BMPcFofzGw6FYoKH4el3D4R+pwR6Hq7frV6r0su/Av55HnW5oW8G2gOVTY9P8VmhyF/erQdhmbNF50cFU1jlcN2uDmC4tVM5RWVxR6iWCcDiApubAC6rZZGKca4wYa1h8wj4JCWyQtdxPWzdVz22o7VQ7vJ2xg4xI8b0kZdeAn/rRdtWcjuOgXgDAFdHjsvPB7bHL7Cdf/JmOsqda7y5mPpi2Nnr+oiHpmvVuuqQtL5kUgP2Oj3owUGBWjmu0R3qnQD8ze1G4pQ1hNowP/6z8ZsIemCi9mItlrJPjbpLYfuYHDtrseHShUT6yQspZ85M6Uw6tHEtSCNbaSkpr2u2CbekpCgALVX9GEci8EaFehtRCEg3NEIe2ra70EG7FEJGK/xJ5o6iWMCkOfrnbmmu8lOAU0bXPBZeIf0Cj0+FHBmnTTItXymo4mQURK1fnFusBTGd8HrWJfP9OKLRIZb/t7IhZW3SZGUaQYWV+kWH2xjPLYOA9IxF2iUc/yO4cjE5GcEMzoNqDmVfloFjHq3G0xpUqZZlh1/Jv/rkrhKGuLOsGKk06aejWZ97ULfGR6g7jxicG0tj9bYi1Z/CJmwIRAwGiMX6jH6/gAUxQ3U63F114V9A9BGuZtrUXb8tUckIxdInUqL9oFLmq8H1X+nzGLVPgIFv34id X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: a07e6c6b-fc74-4009-a756-08d8c33a4ff2 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2021 03:10:49.2734 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ny7OPi6gJzc8WMAdkpnILQHCcoFhplmqNmCC/zV5hKcqEVhWQMggMGifIaCpm26uIVv71kx8dDpesV2VMq+t2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7504 X-Mailman-Approved-At: Thu, 28 Jan 2021 08:15:36 +0000 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: devel@driverdev.osuosl.org, Jernej Skrabec , Sheng Pan , Jonas Karlman , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Vasily Khoruzhick , Boris Brezillon , Torsten Duwe , Laurent Pinchart , Hsin-Yi Wang , Sam Ravnborg , Dan Carpenter , Marek Szyprowski Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add MIPI rx DPI input support Reported-by: kernel test robot Signed-off-by: Xin Ji --- drivers/gpu/drm/bridge/analogix/anx7625.c | 326 ++++++++++++++++++++++++------ drivers/gpu/drm/bridge/analogix/anx7625.h | 20 +- 2 files changed, 285 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 04536cc..628ae43 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -150,18 +150,18 @@ static int anx7625_write_and(struct anx7625_data *ctx, return anx7625_reg_write(ctx, client, offset, (val & (mask))); } -static int anx7625_write_and_or(struct anx7625_data *ctx, - struct i2c_client *client, - u8 offset, u8 and_mask, u8 or_mask) +static int anx7625_config_bit_matrix(struct anx7625_data *ctx) { - int val; + int i, ret; - val = anx7625_reg_read(ctx, client, offset); - if (val < 0) - return val; + ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, + AUDIO_CONTROL_REGISTER, 0x80); + for (i = 0; i < 13; i++) + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, + VIDEO_BIT_MATRIX_12 + i, + 0x18 + i); - return anx7625_reg_write(ctx, client, - offset, (val & and_mask) | (or_mask)); + return ret; } static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) @@ -195,6 +195,60 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) return 0; } +static int anx7625_aux_dpcd_read(struct anx7625_data *ctx, + u8 addrh, u8 addrm, u8 addrl, + u8 len, u8 *buf) +{ + struct device *dev = &ctx->client->dev; + int ret; + u8 cmd; + + if (len > MAX_DPCD_BUFFER_SIZE) { + DRM_DEV_ERROR(dev, "exceed aux buffer len.\n"); + return -EINVAL; + } + + cmd = ((len - 1) << 4) | 0x09; + + /* Set command and length */ + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, + AP_AUX_COMMAND, cmd); + + /* Set aux access address */ + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, + AP_AUX_ADDR_7_0, addrl); + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, + AP_AUX_ADDR_15_8, addrm); + ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, + AP_AUX_ADDR_19_16, addrh); + + /* Enable aux access */ + ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, + AP_AUX_CTRL_STATUS, AP_AUX_CTRL_OP_EN); + + if (ret < 0) { + DRM_DEV_ERROR(dev, "cannot access aux related register.\n"); + return -EIO; + } + + usleep_range(2000, 2100); + + ret = wait_aux_op_finish(ctx); + if (ret) { + DRM_DEV_ERROR(dev, "aux IO error: wait aux op finish.\n"); + return ret; + } + + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, + AP_AUX_BUFF_START, len, buf); + if (ret < 0) { + DRM_DEV_ERROR(dev, "read dpcd register failed\n"); + return -EIO; + } + + return 0; +} + static int anx7625_video_mute_control(struct anx7625_data *ctx, u8 status) { @@ -219,38 +273,6 @@ static int anx7625_video_mute_control(struct anx7625_data *ctx, return ret; } -static int anx7625_config_audio_input(struct anx7625_data *ctx) -{ - struct device *dev = &ctx->client->dev; - int ret; - - /* Channel num */ - ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, - AUDIO_CHANNEL_STATUS_6, I2S_CH_2 << 5); - - /* FS */ - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, - AUDIO_CHANNEL_STATUS_4, - 0xf0, AUDIO_FS_48K); - /* Word length */ - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, - AUDIO_CHANNEL_STATUS_5, - 0xf0, AUDIO_W_LEN_24_24MAX); - /* I2S */ - ret |= anx7625_write_or(ctx, ctx->i2c.tx_p2_client, - AUDIO_CHANNEL_STATUS_6, I2S_SLAVE_MODE); - ret |= anx7625_write_and(ctx, ctx->i2c.tx_p2_client, - AUDIO_CONTROL_REGISTER, ~TDM_TIMING_MODE); - /* Audio change flag */ - ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, - AP_AV_STATUS, AP_AUDIO_CHG); - - if (ret < 0) - DRM_DEV_ERROR(dev, "fail to config audio.\n"); - - return ret; -} - /* Reduction of fraction a/b */ static void anx7625_reduction_of_a_fraction(unsigned long *a, unsigned long *b) { @@ -410,7 +432,7 @@ static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) ret |= anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_LANE_CTRL_0, 0xfc); ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, - MIPI_LANE_CTRL_0, 3); + MIPI_LANE_CTRL_0, ctx->pdata.mipi_lanes - 1); /* Htotal */ htotal = ctx->dt.hactive.min + ctx->dt.hfront_porch.min + @@ -595,6 +617,101 @@ static int anx7625_dsi_config(struct anx7625_data *ctx) return ret; } +static int anx7625_api_dpi_config(struct anx7625_data *ctx) +{ + struct device *dev = &ctx->client->dev; + u16 freq = ctx->dt.pixelclock.min / 1000; + int ret; + + /* configure pixel clock */ + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, + PIXEL_CLOCK_L, freq & 0xFF); + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, + PIXEL_CLOCK_H, (freq >> 8)); + + /* set DPI mode */ + /* set to DPI PLL module sel */ + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, + MIPI_DIGITAL_PLL_9, 0x20); + /* power down MIPI */ + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, + MIPI_LANE_CTRL_10, 0x08); + /* enable DPI mode */ + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, + MIPI_DIGITAL_PLL_18, 0x1C); + /* set first edge */ + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, + VIDEO_CONTROL_0, 0x06); + if (ret < 0) + DRM_DEV_ERROR(dev, "IO error : dpi phy set failed.\n"); + + return ret; +} + +static int anx7625_dpi_config(struct anx7625_data *ctx) +{ + struct device *dev = &ctx->client->dev; + int ret; + + DRM_DEV_DEBUG_DRIVER(dev, "config dpi\n"); + + /* DSC disable */ + ret = anx7625_write_and(ctx, ctx->i2c.rx_p0_client, + R_DSC_CTRL_0, ~DSC_EN); + if (ret < 0) { + DRM_DEV_ERROR(dev, "IO error : disable dsc failed.\n"); + return ret; + } + + ret = anx7625_config_bit_matrix(ctx); + if (ret < 0) { + DRM_DEV_ERROR(dev, "config bit matrix failed.\n"); + return ret; + } + + ret = anx7625_api_dpi_config(ctx); + if (ret < 0) { + DRM_DEV_ERROR(dev, "mipi phy(dpi) setup failed.\n"); + return ret; + } + + /* set MIPI RX EN */ + ret = anx7625_write_or(ctx, ctx->i2c.rx_p0_client, + AP_AV_STATUS, AP_MIPI_RX_EN); + /* clear mute flag */ + ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, + AP_AV_STATUS, (u8)~AP_MIPI_MUTE); + if (ret < 0) + DRM_DEV_ERROR(dev, "IO error : enable mipi rx failed.\n"); + + return ret; +} + +static int anx7625_hdcp_setting(struct anx7625_data *ctx) +{ + u8 bcap; + struct device *dev = &ctx->client->dev; + + if (!ctx->pdata.hdcp_support || !ctx->hdcp_en) { + DRM_DEV_DEBUG_DRIVER(dev, "hdcp_support(%d), hdcp_en(%d)\n", + ctx->pdata.hdcp_support, ctx->hdcp_en); + DRM_DEV_DEBUG_DRIVER(dev, "disable HDCP by config\n"); + return anx7625_write_and(ctx, ctx->i2c.rx_p1_client, + 0xee, 0x9f); + } + + anx7625_aux_dpcd_read(ctx, 0x06, 0x80, 0x28, 1, &bcap); + if (!(bcap & 0x01)) { + DRM_WARN("downstream not support HDCP 1.4, cap(%x).\n", bcap); + return anx7625_write_and(ctx, ctx->i2c.rx_p1_client, + 0xee, 0x9f); + } + + DRM_DEV_DEBUG_DRIVER(dev, "enable HDCP 1.4\n"); + + return anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xee, 0x20); +} + static void anx7625_dp_start(struct anx7625_data *ctx) { int ret; @@ -605,9 +722,13 @@ static void anx7625_dp_start(struct anx7625_data *ctx) return; } - anx7625_config_audio_input(ctx); + /* HDCP config */ + anx7625_hdcp_setting(ctx); - ret = anx7625_dsi_config(ctx); + if (ctx->pdata.is_dpi) + ret = anx7625_dpi_config(ctx); + else + ret = anx7625_dsi_config(ctx); if (ret < 0) DRM_DEV_ERROR(dev, "MIPI phy setup error.\n"); @@ -688,8 +809,7 @@ static int sp_tx_get_edid_block(struct anx7625_data *ctx) return c; } -static int edid_read(struct anx7625_data *ctx, - u8 offset, u8 *pblock_buf) +static int edid_read(struct anx7625_data *ctx, u8 offset, u8 *pblock_buf) { int ret, cnt; struct device *dev = &ctx->client->dev; @@ -992,8 +1112,9 @@ static void anx7625_chip_control(struct anx7625_data *ctx, int state) if (state) { atomic_inc(&ctx->power_status); - if (atomic_read(&ctx->power_status) == 1) + if (atomic_read(&ctx->power_status) == 1) { anx7625_power_on_init(ctx); + } } else { if (atomic_read(&ctx->power_status)) { atomic_dec(&ctx->power_status); @@ -1051,6 +1172,7 @@ static void anx7625_start_dp_work(struct anx7625_data *ctx) return; } + ctx->hpd_status = 1; ctx->hpd_high_cnt++; /* Not support HDCP */ @@ -1060,8 +1182,10 @@ static void anx7625_start_dp_work(struct anx7625_data *ctx) ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xec, 0x10); /* Interrupt for DRM */ ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xff, 0x01); - if (ret < 0) + if (ret < 0) { + DRM_DEV_ERROR(dev, "fail to setting HDCP/auth\n"); return; + } ret = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, 0x86); if (ret < 0) @@ -1080,6 +1204,10 @@ static void anx7625_hpd_polling(struct anx7625_data *ctx) int ret, val; struct device *dev = &ctx->client->dev; + /* Interrupt mode, no need poll HPD status, just return */ + if (ctx->pdata.intp_irq) + return; + if (atomic_read(&ctx->power_status) != 1) { DRM_DEV_DEBUG_DRIVER(dev, "No need to poling HPD status.\n"); return; @@ -1130,6 +1258,21 @@ static void anx7625_remove_edid(struct anx7625_data *ctx) ctx->slimport_edid_p.edid_block_num = -1; } +static void anx7625_dp_adjust_swing(struct anx7625_data *ctx) +{ + int i; + + for (i = 0; i < ctx->pdata.dp_lane0_swing_reg_cnt; i++) + anx7625_reg_write(ctx, ctx->i2c.tx_p1_client, + DP_TX_LANE0_SWING_REG0 + i, + ctx->pdata.lane0_reg_data[i] & 0xFF); + + for (i = 0; i < ctx->pdata.dp_lane1_swing_reg_cnt; i++) + anx7625_reg_write(ctx, ctx->i2c.tx_p1_client, + DP_TX_LANE1_SWING_REG0 + i, + ctx->pdata.lane1_reg_data[i] & 0xFF); +} + static void dp_hpd_change_handler(struct anx7625_data *ctx, bool on) { struct device *dev = &ctx->client->dev; @@ -1145,9 +1288,8 @@ static void dp_hpd_change_handler(struct anx7625_data *ctx, bool on) } else { DRM_DEV_DEBUG_DRIVER(dev, " HPD high\n"); anx7625_start_dp_work(ctx); + anx7625_dp_adjust_swing(ctx); } - - ctx->hpd_status = 1; } static int anx7625_hpd_change_detect(struct anx7625_data *ctx) @@ -1224,20 +1366,69 @@ static irqreturn_t anx7625_intr_hpd_isr(int irq, void *data) return IRQ_HANDLED; } +static int anx7625_get_swing_setting(struct device *dev, + struct anx7625_platform_data *pdata) +{ + int num_regs; + + if (of_get_property(dev->of_node, + "analogix,lane0-swing", &num_regs)) { + if (num_regs > DP_TX_SWING_REG_CNT) + num_regs = DP_TX_SWING_REG_CNT; + + pdata->dp_lane0_swing_reg_cnt = num_regs; + of_property_read_u32_array(dev->of_node, "analogix,lane0-swing", + pdata->lane0_reg_data, num_regs); + } + + if (of_get_property(dev->of_node, + "analogix,lane1-swing", &num_regs)) { + if (num_regs > DP_TX_SWING_REG_CNT) + num_regs = DP_TX_SWING_REG_CNT; + + pdata->dp_lane1_swing_reg_cnt = num_regs; + of_property_read_u32_array(dev->of_node, "analogix,lane1-swing", + pdata->lane1_reg_data, num_regs); + } + + return 0; +} + static int anx7625_parse_dt(struct device *dev, struct anx7625_platform_data *pdata) { struct device_node *np = dev->of_node; struct drm_panel *panel; int ret; + int bus_type; + + anx7625_get_swing_setting(dev, pdata); + pdata->is_dpi = 1; /* default dpi mode */ pdata->mipi_host_node = of_graph_get_remote_node(np, 0, 0); if (!pdata->mipi_host_node) { DRM_DEV_ERROR(dev, "fail to get internal panel.\n"); return -ENODEV; } - DRM_DEV_DEBUG_DRIVER(dev, "found dsi host node.\n"); + if (of_property_read_u32(pdata->mipi_host_node, "bus-type", &bus_type)) + bus_type = 0; + + if (bus_type == 5) /* bus type is Parallel(DSI) */ + pdata->is_dpi = 0; + + pdata->mipi_lanes = of_property_count_u32_elems(pdata->mipi_host_node, + "data-lanes"); + if (pdata->mipi_lanes > MAX_LANES_SUPPORT || pdata->mipi_lanes <= 0) + pdata->mipi_lanes = MAX_LANES_SUPPORT; + + if (pdata->is_dpi) + DRM_DEV_DEBUG_DRIVER(dev, "found MIPI DPI host node.\n"); + else + DRM_DEV_DEBUG_DRIVER(dev, "found MIPI DSI host node.\n"); + + if (of_property_read_bool(np, "analogix,hdcp-support")) + pdata->hdcp_support = 1; ret = drm_of_find_panel_or_bridge(np, 1, 0, &panel, NULL); if (ret < 0) { @@ -1300,9 +1491,13 @@ static enum drm_connector_status anx7625_sink_detect(struct anx7625_data *ctx) { struct device *dev = &ctx->client->dev; - DRM_DEV_DEBUG_DRIVER(dev, "sink detect, return connected\n"); + DRM_DEV_DEBUG_DRIVER(dev, "sink detect\n"); + + if (ctx->pdata.panel_bridge) + return connector_status_connected; - return connector_status_connected; + return ctx->hpd_status ? connector_status_connected : + connector_status_disconnected; } static int anx7625_attach_dsi(struct anx7625_data *ctx) @@ -1330,7 +1525,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx) return -EINVAL; } - dsi->lanes = 4; + dsi->lanes = ctx->pdata.mipi_lanes; dsi->format = MIPI_DSI_FMT_RGB888; dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | @@ -1376,10 +1571,12 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge, return -ENODEV; } - err = anx7625_attach_dsi(ctx); - if (err) { - DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", err); - return err; + if (!ctx->pdata.is_dpi) { + err = anx7625_attach_dsi(ctx); + if (err) { + DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", err); + return err; + } } if (ctx->pdata.panel_bridge) { @@ -1478,6 +1675,10 @@ static bool anx7625_bridge_mode_fixup(struct drm_bridge *bridge, DRM_DEV_DEBUG_DRIVER(dev, "drm mode fixup set\n"); + /* No need fixup for external monitor */ + if (!ctx->pdata.panel_bridge) + return true; + hsync = mode->hsync_end - mode->hsync_start; hfp = mode->hsync_start - mode->hdisplay; hbp = mode->htotal - mode->hsync_end; @@ -1786,8 +1987,13 @@ static int anx7625_i2c_probe(struct i2c_client *client, platform->bridge.funcs = &anx7625_bridge_funcs; platform->bridge.of_node = client->dev.of_node; - platform->bridge.ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD; - platform->bridge.type = DRM_MODE_CONNECTOR_eDP; + platform->bridge.ops = DRM_BRIDGE_OP_EDID; + if (!platform->pdata.panel_bridge) + platform->bridge.ops |= DRM_BRIDGE_OP_HPD | + DRM_BRIDGE_OP_DETECT; + platform->bridge.type = platform->pdata.panel_bridge ? + DRM_MODE_CONNECTOR_eDP : + DRM_MODE_CONNECTOR_DisplayPort; drm_bridge_add(&platform->bridge); DRM_DEV_DEBUG_DRIVER(dev, "probe done\n"); diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h index 193ad86..127081e 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.h +++ b/drivers/gpu/drm/bridge/analogix/anx7625.h @@ -141,12 +141,20 @@ #define HORIZONTAL_BACK_PORCH_H 0x22 /* Bit[7:4] are reserved */ /******** END of I2C Address 0x72 *********/ + +/***************************************************************/ +/* Register definition of device address 0x7a */ +#define DP_TX_SWING_REG_CNT 0x14 +#define DP_TX_LANE0_SWING_REG0 0x00 +#define DP_TX_LANE1_SWING_REG0 0x14 +/******** END of I2C Address 0x7a *********/ + /***************************************************************/ /* Register definition of device address 0x7e */ #define I2C_ADDR_7E_FLASH_CONTROLLER 0x7E -#define FLASH_LOAD_STA 0x05 +#define FLASH_LOAD_STA 0x05 #define FLASH_LOAD_STA_CHK BIT(7) #define XTAL_FRQ_SEL 0x3F @@ -347,11 +355,20 @@ struct s_edid_data { /***************** Display End *****************/ +#define MAX_LANES_SUPPORT 4 + struct anx7625_platform_data { struct gpio_desc *gpio_p_on; struct gpio_desc *gpio_reset; struct drm_bridge *panel_bridge; int intp_irq; + int is_dpi; + int mipi_lanes; + int hdcp_support; + int dp_lane0_swing_reg_cnt; + int lane0_reg_data[DP_TX_SWING_REG_CNT]; + int dp_lane1_swing_reg_cnt; + int lane1_reg_data[DP_TX_SWING_REG_CNT]; u32 low_power_mode; struct device_node *mipi_host_node; }; @@ -371,6 +388,7 @@ struct anx7625_data { atomic_t power_status; int hpd_status; int hpd_high_cnt; + int hdcp_en; /* Lock for work queue */ struct mutex lock; struct i2c_client *client;