From patchwork Mon Jan 25 11:12:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12045859 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 85BF1C433E9 for ; Tue, 26 Jan 2021 08:37:57 +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 196D922DFB for ; Tue, 26 Jan 2021 08:37:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 196D922DFB 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 71EF96E422; Tue, 26 Jan 2021 08:37:38 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2136.outbound.protection.outlook.com [40.107.243.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0922A89CDB for ; Mon, 25 Jan 2021 11:12:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7lZQ2Kf5Nupm7wFPbZImN2sglRFvYuhDEkh1iP8o5loch2V8VuAxPYsPCphjDT0k4sO/hT2mYEuUUZ5Nlq2T6lRpjv5KxsFrs8uGow+Mp73jZfMeqCKVIbwA4I/ofnFqhv9fzyH+s0dGKANanNYDMKr4Tn62+V3GQFz5FV0ug3Y2njs1U/XOyzILDon37JHkDYbXeT2qa3gZSkHtG7g/fG5rF0MwNTnuDFQr3icZ+ekEyxlHJwoN5H8ufhnwLcrx+mtkpxQHQ0YgZOeP/Zsn8eF20aTxEJwEledw7/xbHWnSJdQLetZ8sMg3Z+jZQKHfvpDvFEO2Jl+qo+9f7DmQw== 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=lxg3+JEk2NgPu096kffKI0yZ8DWEXezdVXlEc/xTh/I=; b=gjVaWjXK9GDRA6hmhikgQ9qbMabeRos8mJYXQj9s95kWGYdIJMu7Zfn1DB834TGwdewj15i2tR1FXJ9fIyRoZt+Jy1KiPLqqeuG5DYRflUhsgBWIkiNNvxAQy440QbHYXpgUKLi9S/ooQTSu/tZWM3Tk+dRRy6KZL/8sC86mbsLot6JgJ5SKS/WjSeEIVQSLWCrs6tepaMZQ1CwGILyCo2kS+qBV10Lvn03A0BLzvoltVfp9gZP9tqQOGcfONlFwKmu96lJOnF7WSDwory5H33cafNGn5BZgsqOiMQK2g0Aq87ViZTMI/elJCYqtNzrAgm1nbdB5aGauiG8iMYmbig== 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=lxg3+JEk2NgPu096kffKI0yZ8DWEXezdVXlEc/xTh/I=; b=pKDgeIHVZy6E4U4JdTGTkEz6wh5B4MZVfa9xNCXUHFy2c6bJE4fVZYq+E+4MTjM4TWTc0ctTP2qjhAfV+kCJoNf4iHWgZnxNhPnmY9J+yTwngA0X0u2Cf4PypAbdkOj/dEcZXg11ZfzxjsnaI4kUACCAQQwY5GkilEsv9x6xxY4= 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 BYAPR04MB6262.namprd04.prod.outlook.com (2603:10b6:a03:e3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Mon, 25 Jan 2021 11:12:50 +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.015; Mon, 25 Jan 2021 11:12:50 +0000 Date: Mon, 25 Jan 2021 19:12:21 +0800 From: Xin Ji To: Rob Herring , David Airlie , Nicolas Boichat , Hsin-Yi Wang Subject: [PATCH v3 1/3] dt-bindings:drm/bridge:anx7625:add HDCP support flag and swing reg Message-ID: <75e29d7386df2ebca4a8e3f0b91c8370a4a8f74f.1611572143.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: HK0PR03CA0114.apcprd03.prod.outlook.com (2603:1096:203:b0::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 HK0PR03CA0114.apcprd03.prod.outlook.com (2603:1096:203:b0::30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 11:12:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f332bf7-b1c0-4867-3720-08d8c1222715 X-MS-TrafficTypeDiagnostic: BYAPR04MB6262: 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: N99Di+zqQLAG4OHDj4qsVPB27BxX7EUQbisob9KAU1vScOH8JCHAwFLGNsZ4RnSOCjmUiBsKr+CZrdMrjy+HVTiHObJg1JN64sNAuIp/tvs7YkNczO+5kLMDMrq8Gpnjtdd1nuc5IjV4sv0vH3otX2d5SgINEYGjeGz6coHVaYWQ8Lu1FP3LOUbqAGD+iW3ICex8iYzGHP0i/Rleu14+MJi7Cd8Jf7XzqbX0+ybFgBbNaYG8VcAcOtPKC70bA+hR0lKHkOg8VBmj92C/1NrAmMN85bbiDNdEwPaku3SXvKx2Yy/GGHOuoVDz8z5aevJicCUGwolX8TNcvIyaIWpCrrpZGcJoI6Qsoroo6qrKxhYt2JH9ej9YeRq4Rh+2jFQ5gJaVmH+ZgiCk8MExTmoQWtbAyySlvweKztp/W0iWOTBR6MF40H13b26QK+p/hz8BLMuEKNHYADJ6xVPtaHUhhEEs9l/ikzs1fXq1BowT5XVQ0H0bLtlkSDvbrP3JIpBJqs7u8Tbmuy2xfhcHlGBVzP8Ln++UZhzlzKtTdjxxRmt4Hkjr9sY2nnDHfZ/2Fi4JnYwmU5Y8GuzmWw4RY986QQ== 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:(396003)(366004)(39840400004)(136003)(376002)(346002)(26005)(186003)(6486002)(16526019)(83380400001)(2616005)(956004)(478600001)(66946007)(316002)(110136005)(54906003)(8676002)(8936002)(6496006)(66476007)(52116002)(4326008)(66556008)(86362001)(36756003)(7416002)(5660300002)(2906002)(6666004)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Rbt/tmeuh986rSU2+gYYJa+xPQIQ+Pck+davhooul3VWLYsxqFYczGmkOAqfGLaa2k+HqjjRiwcmr+DKMIwnd6DT0VFHXspP6UWhWDcQy1torvq3O+79Rq70+Xl7YNWtplXbuKxXTBDc1qH2dmVU7epr2lg2TyToiJVvmCFLq8qIusjqAIHwpwck8gyLOrEzTrMwCmJyMMmlZDFas1X0ISDLGXtCyRzNHVR4Ks3aCpuDuCQgh+ftbEpHw2/FeYTQd+pw4+8l35LEOO8dbPtp3kcZejFIfeenLzGWwsCEoiYmSudcqIL3M1wD4JvYOQLUVcxM37Wmo25Oc7gvnYnOxKgOkcrdzAgADcRFdrzB2WEZ0nOcnTVCV6w3jRD13cBtQna4E78VmW75gm9JSh72hDMVIGIOpcuVk0gCdx3SAaBpsFa+4KKaMHHNom5+8h3LLt0hZZVXpe71mC4zLs+xEp3TMdGKVcl7jpWK73HH3HW0cEtYLRzOPwZ8pjFW7QS26q03W6lmJCOJA6f+FE/OZsf2IaTR6pimMTq+W9uH4s7ep+s9IUrm9zHC5GQUEJrpqGzxTiramWY/xi+YqKsOXpR7ThOILYUESZP6b76czIu7jKAU43FJombVRbOgDu2sUddmzE+w2U+ZzKVvgJcm0MuSuWvG8azrJVS314wJqoduZ54QcbkyjYSsOc0MqP2vvRcRbA1lLnbnwIjYETtBpInJ37iEgWlN+fEcM77YcFTN/78uTc9BSpktrUlSmD5v6o+JBgqP4/q6SRMqR1Ar5WQeH1j/ikW/UPR4WVLlu21+NDpdZvurDyC1STHIiXcUxmHAqX/sp6jD8WfgMwWG0PqdWSpjcT2/gZvOCDo+3sQJ8dTqB7MLB7WchQdHrJUWxpGrZ+SqNBrWARMIkC/E3NY25SiTygK1LVJtXheFh5DGiFlW+Zv2hQq2/5VuOMABxCfSUs9Hu0ge5kmuwsu7xpbIOC7E+m0hpQVX/8gKSwgPEDgsH8GsmiCgQ+9hYqm0jm79exp3cOHhmjfkPtZy0ZTL2T3LxApjG+7jBuDjkdgIJM79X6g7KZejbU2a0e4W X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f332bf7-b1c0-4867-3720-08d8c1222715 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 11:12:50.4802 (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: bnzdPO5zEaieu1iUcRHszYqbg0mGev9Nl1l+TVL17LRHvdRuu0fUWvMpJiRFAgcf9yZvcYc73EnsojLKWsk9xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB6262 X-Mailman-Approved-At: Tue, 26 Jan 2021 08:37:37 +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 | 57 ++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml index 60585a4..3b1cbe0 100644 --- a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml +++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml @@ -34,23 +34,69 @@ properties: description: used for reset chip control, RESET_N pin B7. maxItems: 1 + analogix,lane0-swing: + $ref: /schemas/types.yaml#/definitions/uint32-array + 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 + description: + an array of swing register setting for DP tx lane1 PHY, please don't + add this property, or contact vendor. + + analogix,hdcp-support: + $ref: /schemas/types.yaml#/definitions/uint32 + description: indicate the DP tx HDCP support or not. + ports: type: object + additionalProperties: false properties: port@0: type: object 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: type: object description: Video port for panel or connector. + properties: + endpoint: + type: object + additionalProperties: false + + required: + - remote-endpoint + + required: + - endpoint + required: - - port@0 - - port@1 + - port@0 + - port@1 required: - compatible @@ -73,6 +119,10 @@ examples: enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; + analogix,lane0-swing = <0x14 0x54 0x64 0x74 0x29 0x7b 0x77 0x5b>; + analogix,lane1-swing = <0x14 0x54 0x64 0x74 0x29 0x7b 0x77 0x5b>; + analogix,hdcp-support = <0>; + ports { #address-cells = <1>; #size-cells = <0>; @@ -81,6 +131,7 @@ examples: reg = <0>; anx7625_in: endpoint { remote-endpoint = <&mipi_dsi>; + bus-type = <5>; }; }; From patchwork Mon Jan 25 11:13:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12045853 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 4A8A9C433E0 for ; Tue, 26 Jan 2021 08:37:50 +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 F403C223E4 for ; Tue, 26 Jan 2021 08:37:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F403C223E4 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 EF3656E426; Tue, 26 Jan 2021 08:37:38 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2128.outbound.protection.outlook.com [40.107.243.128]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DA1389CDB for ; Mon, 25 Jan 2021 11:14:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lI6SK4E3xRljlAFfWTyVhX7ESBmlgFpjBLJNGWh1KiMypPMwjO905t2jVnRv0IEY8ASo0KM+kwhOC0SUNvijmu4899No4Rl2Xa0SNl0gMstFAbXfiHoNwf9YLOUQmNSJ5uUOngkzUTrRtpEPEFeTAXrAGpuby+2mEiadD4kCoHHXOeaLoLs+e2xe31uLXQE8WevuTvVx51iDJxMGj1Ly2xKh3a2iXJ5FSKWJXCHT5UqfWkPGy8Kw3EOKDiGKVU/bsJCf4jz3n5fOROmiRFI9CdPuU5fZIfs84onYgpvJ0ooAt0uHKkQpEzQdFtemV3AdY8VAfKY3T5eEbd2law+X7A== 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=bX0y1lG4b8FE9VN1aJGGCoXNm6bXJ+kyfs8Nyf0R2HyTUurwVS6iuxUAfd81nNefBHrEm2Ts8NDm4vRD1DbRWFWnCxh8qfnWC0f9u7cekBrZyctJE+gpI0tUidSaWmWmervfuMsWZQYxpFScABoPo+0ma+DYTwbwcv+n4M4WQbW4A20eFKFQkykXKbAjcCGHkmpRxpbl8yjAOQ6zyC5Y2LvRabOim2tkRiE4zCWSudoc3w46XlgcmvNUarUTQ2ukkZ/yNsFXPvyn27X8NZsSdYv0mHDhLoH2zeTJHjSt1XMayjnCq/8jJCcS52w96m/FXjbt1QZaD5KVmwKdp9vjIA== 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=t9J+MmmjbqU3hd5Qr3KGI9Zm4gzGIQGO9vhBVY6/C8gRgJ+OjiG9kL4DVj4vBBcggA52V+fEFHcE5jnO9lOLDwIB76d7h1lCQY0VbISpqkHHaE30q6V7o4p4bRfY7tNnY3OicN8Yf3O2TPzyRlFTA9wVFtfa4lrbg9xmi5i6kIU= 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 BYAPR04MB6262.namprd04.prod.outlook.com (2603:10b6:a03:e3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Mon, 25 Jan 2021 11:14:09 +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.015; Mon, 25 Jan 2021 11:14:09 +0000 Date: Mon, 25 Jan 2021 19:13:40 +0800 From: Xin Ji To: Nicolas Boichat , Andrzej Hajda , Neil Armstrong , Laurent Pinchart Subject: [PATCH v3 2/3] drm/bridge: anx7625: fix not correct return value Message-ID: 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: HKAPR04CA0005.apcprd04.prod.outlook.com (2603:1096:203:d0::15) 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 HKAPR04CA0005.apcprd04.prod.outlook.com (2603:1096:203:d0::15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 11:14:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea6472dc-de02-4ad1-38ac-08d8c1225625 X-MS-TrafficTypeDiagnostic: BYAPR04MB6262: 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: Wu1NqyjrAS/vuvHwieTCtuFiy1w4qRfc3YXDWDczgOIWAB3yxLtHgeKSV8T+8BbjEIlGNEPyuY0PIIyI1yAFvIERzhvRRWJm+KIobbyx+iEyTAqxvWfyg3wgXcvUPyaYsefGYkikeCxwaagnbGcPhFp3Zoxrb1XkvKTEqDYgCefKm3WblcZDaIhxTdYQlG6WZBBzSyOUi45ipoDBNd0QgWmmQ3YQR33+O1EgvCAGNlw2BXzpNEp8LSKIKlE/Z/KvFFgvSI4e4o4AVmloaiR5hgNPxF/yeMVIoTUs2HXRmJmAE2eE8B2JbhX6WjFl6/8lX0/js2Lvwxyztvy7iif52eNioQvn0GtGp1a+P7GfALYs2JF7/MI4kdCWPAtGzGIrLNp1HROi8As5L+dqh0hg7fOs4B6/jiHpERx7ul+JpluRk0ZfzdGbfc+gsrcpUoTruE8mg1KjL4eJcexJR2GXpbVN4As3C6hsytMfCO3AvO2uhNUb2OXSQh352fL4FPZKZfinq2HQEpnXNOXsLfDhiphfGi4czdJm9Cihz0hMdW6Tmn8jYYXgp4eepk7M96oMwHKjzbPearqIZRA/rsnbyQ== 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:(396003)(366004)(136003)(39850400004)(376002)(346002)(26005)(186003)(6486002)(16526019)(83380400001)(2616005)(956004)(478600001)(66946007)(4744005)(316002)(110136005)(54906003)(8676002)(8936002)(6496006)(66476007)(52116002)(4326008)(66556008)(86362001)(36756003)(7416002)(5660300002)(2906002)(6666004)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ODh3Bt1n/+sqMReuQsywQIgR6W5nnxwklUNQp5uO5jQX4mnYS1yWI5KtzjAdL3oEkJJT3z5vVB2qSbQkBEalSi6X/GDVZTSGg5TRewiVgRlcY+oZV+zOvDBNOhMmpBmSMdI04i1DnUnlcb564k4elGSCfDW9ZMpsPgUVpt9+VkiBUbmuHAUz00WtE7YZRWvyoX6Z79Sg6AeoNsQQ+es5BIWTOnDIZeNtPVp+r3F9dniumXn3+Dx3OriBw63jI7ySAL2mZF/EfEV6FU35VwgO7JMhjza64DZ+GOz3YZnUjlH8N4FAbUb6W4eST31mwMeIGcD1RcLZzV7A9/o0IydxSXtZuXQWBGlEz46iB0ixXRn0XDek4+7jWrv3+QyxNDtxlfrRZa5/dn4UTRVhfejkLaZXQlRmDm1PnVtjCJuf6KH2JYesdNGF7VaRvdW5q+jyoDf6um+p25oFTFkFj0euRdNA2mQHNp4Pb7etygpAR+2SBl70wFqgWyeNPwXRGFACED7w8PIebCagKb/9FamT1/fNf2+nfMZW19KI8ebg+JGvdXR3MzZdUukvgwMqgbfMc4vqNrZXvlHtfxb1jDPUTiyjdYLnrxdYNUyACxizc/FIVZC2jnDL4Je61zFNOcVEd5xGiMMAY7JeyzEInmhFuEd9jArDCra1Ooi/JUeUS5NGnNM+CPmlRRDr4cNMps11H4njZ2a+0l+SlZWzcRyDFHjiDhn/GHwlKNlgXVXzjhz0EHI4R3lYlHGLcjDk12oyDQrRhB0G8MsKll3/5EXTmThtGPNIuaxTCpxtUoZxwmUUEg5MBnZIAJgSU68Tv62vtr3RMfbF8pSPx/oL8nduqpMKRxsMoLua2ePVX3iDeoqMyywFA4puXUaXeIlviyjV2W2YDjaSsfmNM/ogBCu2S2TDvegQlxHvJP3LqhAk9TrL+ts2WE1RhPNqg6KsdYlFEvOGuMFmyghnHkICiZKTHI+SK6edgv8LDnCGfk3PZTK9UsVmT6kwsbT1gwL43GjyauTmUWOkKEN7h1myN7MW7giJGVkrrJ5/IoU3tX8uHZZvYVZ8GgT1Wma7JzpokN97 X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea6472dc-de02-4ad1-38ac-08d8c1225625 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 11:14:09.5555 (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: JxewNBCuJfcAzxbhJKvZEsCamLhV2ei7FdwJnfW9Y6x2welQ2OqXNYhrXkrocDPkCqYvgJmZq7q16Mlbpux24Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB6262 X-Mailman-Approved-At: Tue, 26 Jan 2021 08:37:37 +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 , Jonas Karlman , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Vasily Khoruzhick , Boris Brezillon , Torsten Duwe , Sheng Pan , 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 --- 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 Mon Jan 25 11:14:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12045875 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 0D46DC433E9 for ; Tue, 26 Jan 2021 08:38: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 BF33F22573 for ; Tue, 26 Jan 2021 08:38:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF33F22573 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 3E16A6E441; Tue, 26 Jan 2021 08:38:27 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2102.outbound.protection.outlook.com [40.107.237.102]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B2A989718 for ; Mon, 25 Jan 2021 11:15:31 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+elz3LhBzzDTsQLMrkK2KxGnUfwbJFHaCVPg+UDj1DyaABWbvDYB5ATgU8NBC/fyrTsJx/XCeHCIksPMCiF8jUB08L7vwVGsufUfCM1iAh1pkplyUHlvQTcx5ocCqnTgl1Mc5LkQ1T7WUMCRNclFhWOrseUWG10zP85iSiKb/OJg11Z+I3KH7TTzbZ750cySqXXsBAVTpJu+OVUx/2hY/He0qLsSOKGWRgmvfX5F4hXECs/r70qIXeq+qx9EFQvIOGN5WOOFoX3FBP07w28XfCOJd0PQrF0SMgrQCW1uqoOa0rofQeEELh84YBK0Y0WzzLgGpUZLTOwFM1csuuRDw== 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=TeiSrpzi+gjvNJWL2PNnWHrpFIUqBOkA2weoGun7h4M=; b=BYBjvGHSEPUjUl66y3okDjkCC4HYq+pJzbxg6VWsm8fDI2DhSMaGRp1Phiki+c2HDGVUY4nsN1gD5YGQ6LxXx0cfSFETHBHPJr9Ja57djKU+koLB8laCVzhz44DZNhrAJLPEo+bl1i76gOWpu/Z106s2oAQKeLh0pnwWrJWy+FtAPlcf5cO/9vHFvVKLtwPsXGdIqyxtfQY+KcBZB7nKZVb5d1E7HEKU5ZUiBW3D0DZ35BEsQzXIACyumO6Eyyj8zBbj5cqQyDzQZQrxuCuZJRhPfrtXwgcmmUtj43IdKwKabslnshlig0HzbSS9skplDTUV+CvJHAToPem02vqBcg== 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=TeiSrpzi+gjvNJWL2PNnWHrpFIUqBOkA2weoGun7h4M=; b=znKLeCjWxJxOH8uNp+pCDCXjFxkH7GFFBzOjZtjaUXbYrOS3+VK/AuRZWbCMyBPf3McetvMJdQHoqcEIGHpn1T/8ZFV67yeNJv8Jek8kPQ+vyKjozUqVDB70cK6Xi/s+K2JJK+VMgAydZEvogTHldHUOxnVpI/pFL5/KAXOlKDA= 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 BYAPR04MB6262.namprd04.prod.outlook.com (2603:10b6:a03:e3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Mon, 25 Jan 2021 11:15:29 +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.015; Mon, 25 Jan 2021 11:15:29 +0000 Date: Mon, 25 Jan 2021 19:14:59 +0800 From: Xin Ji To: Nicolas Boichat , Andrzej Hajda , Neil Armstrong Subject: [PATCH v3 3/3] drm/bridge: anx7625: add MIPI DPI input feature support Message-ID: <453fe8160685b641010906876b0340aba3366e25.1611572143.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: HK2PR02CA0132.apcprd02.prod.outlook.com (2603:1096:202:16::16) 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 HK2PR02CA0132.apcprd02.prod.outlook.com (2603:1096:202:16::16) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 11:15:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a465c645-9f05-438b-ca07-08d8c12285a0 X-MS-TrafficTypeDiagnostic: BYAPR04MB6262: 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: 1X/FEM9jLa+YAWik5WUQtQvdLz5xcJob0gwZfUb23mU3DGh+KGZNoU2yQRWfeAQfe3KWIlmUVlAz/m0agrJ1YfVPIqimtbTj4yFNnAIomGOssGdOmngrVLl/xrqDiv/mzZvIT9y7RyXDuJJoWK4Y7fMB45d1vRO4FwYSGS4VYWYBlkOnmeEw076aKUre6Wr4auXvvCeuqGrLNAJ/7I4HwCnrd9H2+6WIXjoLhJ+Te/RxmLQM5N2m5i9pR3yaYBYbrgfc4KVetdsQEjfSbq9z5my6vqMDin5TGB9OUivXvuiTx7F2YY2NeZwdv5LHUQz/wE31cNACTcQU8lXWlo4fPf4P7GTUVo4rElpbyXFvo7HPOlrR7F6ONT2MKmvDFL27EbGG8tmA/8myr2xcGhWzKUiWUlHnbxBdbgfttN/tVhc5n5dVwiQeW/kIUKMqxBCGTkuzExbgrTcd2zl+f1D2SHOiyroPNxfbl2wlEkan6/uYb9azTcOFPvMLoCu7ujJ4x8S9H5s7OrSdXCxsS20lX97nTt9T8P2VLciHWCP7MbS+FIHQRTJtqN4n1YeNO7IWD2tMI/ahCSK6Q7x4DTnepg== 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:(396003)(366004)(136003)(39850400004)(376002)(346002)(26005)(186003)(6486002)(16526019)(83380400001)(30864003)(2616005)(956004)(478600001)(66946007)(316002)(110136005)(54906003)(8676002)(8936002)(6496006)(66476007)(52116002)(4326008)(66556008)(86362001)(36756003)(7416002)(5660300002)(2906002)(6666004)(16060500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: S6cZOGUPFGJSBiF0G0niW8aq/DnzOL3cKqPTlUBK7t01tZ5Za2d3CELR3Ge9Xa/qZW7Zna6zIG+DS6+wgKJMkwBPh4i/IjyquP3qN1O4CeAOCIV9hCUEP9eukQHMDjlYjGc1sU8k5uOVWXOy9ZrZEjVsktR9MAIDvyN+6QlkldVPryu/sZpa1wEQfcyISBpno+RsfHjmg3V+UhHQcWgEtO0CN9gt9EbYz4tISbYyBHtiKvK8oR7aBNJhLeKcOJUE3/Mk1WOYFCEi1UEAiLTQnX9Y4Ggd6Gsmm0j63+d211nPOsmfdhor1hqHlfm01L9tYlFys3ZSXFVWPEFqgMi1S/xHXkxzyy1Ipl/n2ekTOgeu1SS+304yCohtayDSrpRwEI6JJpqrkSskqocGvH/geHnDPdocvGU2dkYTXJOpOHpykKpbusLQCHtKj31NbEA933pP0wuOg2aKtTjCVZfDYFDMHfiUyHvjIQVIiT1f2d2ncrA24tAGyL052OstEYXIK+YWjR6w5rx1XbKvTCiuf24Tu2sjFlZHD66ySvZ09WpM+DBkDUflx/YSB1192MkzaaGZnHXsdRnkDNSQd6jYiPerqNsbBuOJyJ15KcvQ2eRCm0fgvg1WpQ/Qjf56jRaU/Bf1aOu4G7uNSS14X+YyDQldSGKj8DOJwa/IPZLe8CKDn03QrzfUTaNdiXbdSGVXbVU3aGOBzfj1Fmb9IJ5n4SX1Ch1d26F01rBywJUUIuIJ6K7Dq0iDdKPKu/AHq6mC+kPI5qpN5k7d/7gptsoOjNBWLphS0+4UwR7SIXT2dyeLw+17Wg3YNYPVBHbauyYLMM28ht3FOWjB1yvvxtfNghlkLdTif+bb2EmwB3zxVV1zmr8gVFJIucqxa2bQbS7j9rSg/P+nA/YDPKz6p/7wAPdAFB5qMf4xNkRwq5UNsl3LOSqIdQTAeQEqAxuYPHbI+8FK6FF+i11AP9ZBE766KB0em9vGEkTJrGrTRBuSaC/uv2SuLUk7OCd9PVjKCzar1uMSFzFiiNzZ1+Fk6qOyT9QG2LLUItcBai0lN4ONwYsw7yl01HYV4CLJmDYDmsr/ X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: a465c645-9f05-438b-ca07-08d8c12285a0 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 11:15:28.9922 (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: 4p3BblutlTK8SgY3eNGejXzWN9KekNxKSv9kflbVjn+u29kiCy0EpaDtQLX068u+csVVo2+J/mXCPXl6gTVNJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB6262 X-Mailman-Approved-At: Tue, 26 Jan 2021 08:37:37 +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..c7fc92b 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"); + of_property_read_u32(pdata->mipi_host_node, "bus-type", &bus_type); + 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"); + + ret = of_property_read_u32(np, "analogix,hdcp-support", + &pdata->hdcp_support); + if (ret) + pdata->hdcp_support = 0; 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;