Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp331137pxt; Fri, 6 Aug 2021 03:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM/od0rDmlgzsEFGYw9vw6eOH1LnD6fhzDd8zDUOq6GLK9d2etsJcJ8RcNYZMUbum75sv8 X-Received: by 2002:a6b:6d02:: with SMTP id a2mr107773iod.93.1628244663735; Fri, 06 Aug 2021 03:11:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628244663; cv=pass; d=google.com; s=arc-20160816; b=c0Gaw2/Cc8b8GIBKK23y/5CymvtHGhIoAcCcVHvfRskgcBOCGbx1wlvTETnb0MuES5 WCbMnSd3/qtvcFvQFCcKXn3VNI1063nMrbocwzIWkBa5BM1I2mznfwCL4cFZYsAguO38 KpztjHI7hEMUiNHc2X4/amGzZspnhP9LrrK0+jXipp9YuSSLsyT9abrYfPbsdArtEk/f VjAWMEB6F22QqEqs/F+v/07XQ4Ye4KUJnYWiOagceOYOCzGGjfaeGJdjnxsizCyWmj/4 VXWcDXv0lMNQ5Ek+mu/Cye8wRF53INUvjXhwonhhFtTQRNbJgDJhI6O26Or7sCcWk4+a MPJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-disposition:message-id :subject:cc:to:from:date:dkim-signature; bh=WheNvOQb7m5Nb2xbnVsY1/4nzMe7gWxmw7EIWbYnNb0=; b=rUwDIy7OY32AHfat86kwxWpg0fVLcVF0xW/XV0qakkKP3/w01Lm/sLOUyhKBi8sOOe 1innrEKwBDFJTCpPhT7DtSQPkigurv3/NlYvjvbukO8Kxlki7Ajy8U5vbtftB0E7EfRn b0eLMJHkm0luZfICROlP/vH2POEgLBf+K7eHF9S8ffBzu2TBjvNMdSK9ejX6Br9uj+1D xd3w3CqZN13won0kn96OxTLzMQdwNDRQn5L/g2ICju0p238XenBONVHx3OSZ97yJGWCQ mp0YB8UO+lgaHJJHu6lTFPUIIHqzXA4XEbqzBC0WuzyVgTQjMf9dfYBLdT1AHANGnK4i tW3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=tOsvzUhv; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si7895876ilu.161.2021.08.06.03.10.52; Fri, 06 Aug 2021 03:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=tOsvzUhv; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244788AbhHFKJw (ORCPT + 99 others); Fri, 6 Aug 2021 06:09:52 -0400 Received: from mail-bn8nam08on2110.outbound.protection.outlook.com ([40.107.100.110]:9173 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244864AbhHFKJn (ORCPT ); Fri, 6 Aug 2021 06:09:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lER0LmMSGPYAYL72QefmubvJJNP2e55iULiFU+JrbehEpf7huaiO/xdh8cdrjtfC8Iu0n4djqlZKi2/xV+UsYLQvfc1Zw2jqaj6kcLrL0aDRdZlaXOjrjojXRvg9SEg24Y/OHHwWQcnZoUOcYFFhOasEG4vtrKbIL71OvCuFFmgNt/2Ml0cIIgUKrbZgJ7C7vTDMUs2ruptxkceCRkpSpoWzzEnTeaXZJMxaSlfqO5fGcU9DlteNijxtHrrYdOXX0X/h6g1lY4kMWXZeX0L1hDcrz8TFel4QxBLkCY7I1eNGHu21ySfqKDJGc6656v9A6hGmX5abiQqAS8J+Ei+/tw== 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=WheNvOQb7m5Nb2xbnVsY1/4nzMe7gWxmw7EIWbYnNb0=; b=A3Gst13/mip3MvvBpthpyVSDGtgnrrZXbA/tMOBqRAqlc7USwfCgICtta5xM8XLwANi271j8c7b5KuZXTOZu1EW6pkjlUAqXw4dyB+Bu7zdDEZBnRPofeVonjXNvbcRSfHLawAFco9PsVcqadogZqz7OtM14OEtpFP2l237n1EYufSUOLjzhg5kOe2BjEciGIUfMAFdeVskh9h7nN4X5BHyHG/VS7UrAUAr8lJaQw50dKo5JnlSGcohVr7Gt3QCYLbXE3aAHPAMNYtEbV7l16PiY+fzepS1L8v08ovMrnWymqkYctV3hp0ENl9ftnSU+hbbM5PgMO2JnJaXBIVQCeQ== 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=WheNvOQb7m5Nb2xbnVsY1/4nzMe7gWxmw7EIWbYnNb0=; b=tOsvzUhvUYgog5Atar3ttHdFbq5vYpsQN9MBOUuO/HyeXprtB/A6DJG7zpXvP+odyY78Ql6Br9qY4wTFbDelUIGCvzqDQdflUVh6tsyuzCj/tQEIQw+zq6T+ujrvzwHPwoPMAPcdPcasF/4gcl8UyKg8LUN9UAHjfhOXw0TJbcE= 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 BYAPR04MB5974.namprd04.prod.outlook.com (2603:10b6:a03:ef::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15; Fri, 6 Aug 2021 10:09:25 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5c0e:fbe5:2bd6:ec6]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5c0e:fbe5:2bd6:ec6%3]) with mapi id 15.20.4394.019; Fri, 6 Aug 2021 10:09:25 +0000 Date: Fri, 6 Aug 2021 18:09:18 +0800 From: Xin Ji To: Robert Foss , Nicolas Boichat , Andrzej Hajda Cc: Neil Armstrong , Laurent Pinchart , Jonas Karlman , Dan Carpenter , David Airlie , Daniel Vetter , Boris Brezillon , Sam Ravnborg , Hsin-Yi Wang , Torsten Duwe , Vasily Khoruzhick , Marek Szyprowski , Bernie Liang , Qilin Wen , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH v2] drm/bridge: anx7625: Tune K value for IVO panel Message-ID: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-ClientProxiedBy: HK2PR02CA0184.apcprd02.prod.outlook.com (2603:1096:201:21::20) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from anxtwsw-Precision-3640-Tower (60.251.58.79) by HK2PR02CA0184.apcprd02.prod.outlook.com (2603:1096:201:21::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Fri, 6 Aug 2021 10:09:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24ba8188-daa6-4b92-5ec6-08d958c24483 X-MS-TrafficTypeDiagnostic: BYAPR04MB5974: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CNXH3r7cpBnIzndo7TB2ORKqDRhMAjd4XRRn2A/D3tdssdjiYDdeS2e+pptECDYIxR8nW/iiU1DIyYbslyGfpI+R9kyWt32jl4HgcROwsIYrZNTrdLK8FyD9WVSFpT3m8EaPNiiVG3hsPcorXn+WiDLJD/KoMziOe8U9rNeXmyklADAVGR46ha77ox92f+rn3R0rxi7Z0MPOjVMzyCaJK59aZxVVS4wxR5aLdmmU8jKDV9atEp89swW5f/APSECQQPQF0hJBXr9Dn2jIsiDbhsq4KHAiW+6JePBuRuzSUxavgt8/53tsjLmoDxrKVzKJl1nBkLZgmxAPbX/nV8G3u9nhMIlySbcvDcxWhgzmIiowoAY0s7mbF+EL2qon8YWUayHbwdRQnA8XPBgiyCwSSBReenFzo0/YvEnIsks7irr6IxdIMqdG4noYLhf/TlGnUWA2LjfHQLij8pGuyDquW6zFjhSIYe4AsXakdjVmzOD4iQFDxFkoSRmPPLBkoW84hMC8lTsh1f+V+FG5QSEw0hbJbPMCo7la9S09lJ0yYYDFH1Eq6pJLfrY5WkALECvJ2RTDI1JRaNega7e7S/ZKxPCbbXLco7wNSQIDoO6VqmJccjxhTq5eIdMgM8Nlx2gRGb5N7+TTZRctxPIVxZ91Dhkunvd58aBa6Oa4RorwPVQ9Fu/kv7QL1eZNSrh1iYQALtLr8xyjQ4d8u5PZ4uAFCw== 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)(366004)(376002)(39840400004)(396003)(136003)(5660300002)(7416002)(6666004)(4326008)(478600001)(6486002)(66476007)(66946007)(66556008)(52116002)(110136005)(2906002)(36756003)(54906003)(8676002)(38350700002)(2616005)(26005)(86362001)(6496006)(83380400001)(316002)(8936002)(38100700002)(55236004)(186003)(956004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pnjweh9Q3/W06oqIAY4G1kl/bi1IGSxDlRyOUDYlugiWZL7MBKUFFy3jvFEl?= =?us-ascii?Q?GQr7oYzx4Toube6nUH9+Af6ZCTZynni3XZBXsrR8xj3TQPacEFeg7ZRdu21y?= =?us-ascii?Q?Be79hlNM9t1Ef5Q8/PdlfWFnYXOUNvbGkflBBD4BwDQ0DmDS7K3mc3edtQCs?= =?us-ascii?Q?k6nRvfxnWy/Yp75ABhXWv+JlXZ1zF5Ba+kwNCwiOgQZnfUEPS1ZZj9FkRIKC?= =?us-ascii?Q?76l71K54b+Ynp3ayQCKxwBiIFZSwDg1l2m7P+pJYMIIZGHBPdB5TT/sj7dTC?= =?us-ascii?Q?ukiE5P7A8J2c82uoAAVQpxdc+lO9ZOPcmX4UD/UOMxI4eUILxirukhEORqjF?= =?us-ascii?Q?cOn+SlzlSmgmI83rwxidSve6Q9MiX744pb+Kyr91wl5x3IcfqtLxR2NLC6tp?= =?us-ascii?Q?A7+oimaNJcs2bNxD2q5TKC1rqSajUhp4lz4BpT+Lva/CyuoliEbS91SqP++K?= =?us-ascii?Q?zfB9J7iY+x8+lXSSNZ0u2uD295fkrVykLxratoTNjQLjjHg69RkaaNknJmWl?= =?us-ascii?Q?TKLofO7ZRdSXa5E0ygapiOAcZKFP8rNt+K7oPDixEV7iXZRh1f4tIO27w295?= =?us-ascii?Q?56GLDjxriE6At3pkU1Ou81kQxS6i0FhPr9qSqdKZ69BArKU/6t1AgtjI3uWu?= =?us-ascii?Q?VJto0W1bU/tolHc5irPbhrw1utGDptKdUIkXh3iFVszxFKV71brC2NAtjh8h?= =?us-ascii?Q?kpoZATNwimyZL0C76o9k9xL0KinGEPaz1z7sjQiThvyBd8gh6a673/k8c2GN?= =?us-ascii?Q?C48kqvSRFdUmcUHbo57RC58qob6XQwBdUTRiW3AC83SpnSOuVKbpS0HXfShL?= =?us-ascii?Q?qmiL53oQly+20Mq4/yIWndCexHTu38ksaD6LC0vBDYXSjV3zwZtNX4bNTY0f?= =?us-ascii?Q?cZasmaLgv1ttLNyPBEiemgkCmRWfuazlNcyR3pKLY+956zc9AQNwK8ANbUEI?= =?us-ascii?Q?5sev3OsD/2Uz5wBh/HkWA+digUcYORYR+7i/0oG202N0uP/oAxN9saAjYee5?= =?us-ascii?Q?zokLwf9YIwujfosqN1z7GB6Paa4iHXsebf7lAtTnupmmDpDHj9GAbJjDwz62?= =?us-ascii?Q?4iKSSy1ySFGQSwwbQsFer/4xHnioXgVQ7bxTDr6v2z8mzIsIqEDT4I704MCA?= =?us-ascii?Q?SfQdB8HDNX20ARfTisMUyoAmDQZtieJsTPMsbSTsYyPQqHpjuixbP+0Z+8U1?= =?us-ascii?Q?ALCzTaWBkvDmiZmmD9AFyTgsngwcBKJ9q4HYRPMgV2gh/qVpA2kNyuKBsh97?= =?us-ascii?Q?oJDNHxWs9goKLRsHE+t7tKsAoEqKZ3tfZkDAoqnWQkTMGlFvoWYjr5A3W+Z3?= =?us-ascii?Q?T2Ljrr+/0bYU6rkr+r/louQf?= X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24ba8188-daa6-4b92-5ec6-08d958c24483 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2021 10:09:24.8644 (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: iy9+yriqZ7dM2dz6UFM/m0UAmgrdWhJJnFv9+MnSG+H1h31U50hJ055Y2MB32XWlUW/TQmg9KTF20/VJxJHA/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5974 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IVO panel require less input video clock variation than video clock variation in DP CTS spec. This patch decreases the K value of ANX7625 which will shrink eDP Tx video clock variation to meet IVO panel's requirement. Acked-by: Sam Ravnborg Signed-off-by: Xin Ji --- drivers/gpu/drm/bridge/analogix/anx7625.c | 24 ++++++++++++++++++++--- drivers/gpu/drm/bridge/analogix/anx7625.h | 4 +++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index a3d82377066b..9b9e3984dd38 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -384,6 +384,25 @@ static int anx7625_odfc_config(struct anx7625_data *ctx, return ret; } +/* + * The MIPI source video data exist large variation (e.g. 59Hz ~ 61Hz), + * anx7625 defined K ratio for matching MIPI input video clock and + * DP output video clock. Increase K value can match bigger video data + * variation. IVO panel has small variation than DP CTS spec, need + * decrease the K value. + */ +static int anx7625_set_k_value(struct anx7625_data *ctx) +{ + struct edid *edid = (struct edid *)ctx->slimport_edid_p.edid_raw_data; + + if (edid->mfg_id[0] == IVO_MID0 && edid->mfg_id[1] == IVO_MID1) + return anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, + MIPI_DIGITAL_ADJ_1, 0x3B); + + return anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, + MIPI_DIGITAL_ADJ_1, 0x3D); +} + static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) { struct device *dev = &ctx->client->dev; @@ -470,9 +489,8 @@ static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) MIPI_PLL_N_NUM_15_8, (n >> 8) & 0xff); ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, MIPI_PLL_N_NUM_7_0, (n & 0xff)); - /* Diff */ - ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, - MIPI_DIGITAL_ADJ_1, 0x3D); + + anx7625_set_k_value(ctx); ret |= anx7625_odfc_config(ctx, post_divider - 1); diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h index 034c3840028f..6dcf64c703f9 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.h +++ b/drivers/gpu/drm/bridge/analogix/anx7625.h @@ -210,7 +210,9 @@ #define MIPI_VIDEO_STABLE_CNT 0x0A #define MIPI_LANE_CTRL_10 0x0F -#define MIPI_DIGITAL_ADJ_1 0x1B +#define MIPI_DIGITAL_ADJ_1 0x1B +#define IVO_MID0 0x26 +#define IVO_MID1 0xCF #define MIPI_PLL_M_NUM_23_16 0x1E #define MIPI_PLL_M_NUM_15_8 0x1F -- 2.25.1