Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2646313ybt; Mon, 22 Jun 2020 03:39:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr5j5AkvwxwjnLkSY0e//yTaNFpuS+p4n3L0TLbWeAnUXwwgk5ut35i6k4RlghszqLzjVu X-Received: by 2002:a17:906:abc9:: with SMTP id kq9mr5343441ejb.493.1592822357858; Mon, 22 Jun 2020 03:39:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1592822357; cv=pass; d=google.com; s=arc-20160816; b=v8VAHpM+VjxhMMDdKELEzDGpxbcyCbo2cQfxeLHn21p2UtwaJS6Lu2Qhh03W8BOM+Q CsW0UZqFDjhpgXLRmow3F73EoqdxxE28ySY/2Ez+hd95CbDe6o+SR0JI+7XFLbBy1DuL BT5XVTWo0IF4H9Ohj3afz+Meeq1NFeaZoIO9w+i0ACOUMJ8AkSK0BPhanTntPp5vqZnm 4v5ukq907B7/juLtaIk3Lql+j5tm5RVQWNSNdraaNE7AQpv23Kiz7GSLYHvBbuv4fovR 7bJuKSIkuxXEoRvdWSzphAf9KNtf+nE3Xx0ovNd3BmiinNQiRRJRXQ9BVCRTwOTZ0Ng2 Ny5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QGiOjgdCtkURKw8Ml3FEzCSyvSIfzYnbxtLVR71Et38=; b=xBQVVc/XGZvBdjKfMYWsNfjQmnhVAQI5o152OuNbPBCUcUbNjDTnu5cZ3R0FeD6xMw NAE67wHQkpegdHT+2cwjvl3of4xyd053xtW6eivvxmfeAAKTdqPUbSIV/tk2EicNQ86/ ZOmqBL1qCFFtFIrfdYwH/MMPHU8IpYhrVXq+zO7nAUtDt9tofYLKYlPYEMFv37j3PMji 2vgkEcS8Qa6/PWTfjEbT3Soywx7mmLWFmQLtc1afaWGSerfDIRQmdbg+/cWZZnyjRNC/ amm5uATGu6OSiNFesd1EI5TeUlJvnoHAw3uDUofp/ziTe8FcvVen8iP1KeN+STuL+urD YcOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b="dzXY/1rr"; 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 dj5si2323891edb.367.2020.06.22.03.38.53; Mon, 22 Jun 2020 03:39:17 -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="dzXY/1rr"; 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 S1727108AbgFVKfG (ORCPT + 99 others); Mon, 22 Jun 2020 06:35:06 -0400 Received: from mail-bn7nam10on2131.outbound.protection.outlook.com ([40.107.92.131]:28129 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727020AbgFVKfF (ORCPT ); Mon, 22 Jun 2020 06:35:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9b6JsGPXGLMA8EeJxIxtG7VRFtS67yPd/rKPaGhMaPoFdEF8cflHd74ZHXHTIMz67Fy8HuXbC74l/5LEFW8aHl2zHbTM+0wj0SgxUlIXNgJyJ/UsffOo93jq+xngQZqtkqCyYkQaGbWYw9Tf2bAEWA1e5vDC+wY0O0OeWDpOjmSgFthb4qy7lR9VG90IDvZSD26Eyce2SxARHxD/RHckf9635KxxICcmgH+S3K4uLQBhgYXmGIU7iIrhWie8XGgV6iCmhQkY7qg85b2MGpP+RbOjNqLA51I5ljfKMPEgx+pj/cruKNHNp36u8yuA6UR2kJq0yY8PQ0i4N8/XQOfYQ== 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=QGiOjgdCtkURKw8Ml3FEzCSyvSIfzYnbxtLVR71Et38=; b=NKfhDri8H8iJNEiSKLc86U1IDo8IprHuENQ+VLs+DR1P6XuQIk+yyBtUx2K6VIn/+reabyhSeDPYWZZNlBgcVWx24bKkmBWO1M3LDK6F1u5CP3NEbF+0rCG+CCCayaw435SWC+lg3fdzD1qpBY/UKoyyZwj0vqtCx9C9Aav56XnjXLhr6co1H2plbn57hvgW9XhMK7LpFjiUV5B00JG6Cj5Zx9pyQy23ktDgS5jNREJizCzdR2ldvhoOhT/06u07rPSLqLP/ytx1iY/ejAoEZ1nKsw4TKQQiAV4CD+AxJrPqBhlN5vbu/tCQfEk1f9h9NazoNZELXT20I5TzB/5P2g== 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=QGiOjgdCtkURKw8Ml3FEzCSyvSIfzYnbxtLVR71Et38=; b=dzXY/1rrjJWjFfjdhKFcznUNkGhIqz72WpoMnTcaFcUJm0e+uNw39TRuxSDlfKJhRRp/4YQKkmJud6vyyiR8N9n8QfrmsRUSukT0GDvzkA2qvzBVw91/4hrOEEbAaiJwr8umJo6G87bFn+VgSSdwfthIVPlI4fwL7B7mO9c2wkI= Authentication-Results: analogixsemi.com; dkim=none (message not signed) header.d=none;analogixsemi.com; dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by BY5PR04MB6980.namprd04.prod.outlook.com (2603:10b6:a03:228::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 10:32:31 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::844e:398b:2165:631b]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::844e:398b:2165:631b%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 10:32:31 +0000 Date: Mon, 22 Jun 2020 18:32:23 +0800 From: Xin Ji To: Sam Ravnborg Cc: devel@driverdev.osuosl.org, Laurent Pinchart , Hsin-Yi Wang , Nicolas Boichat , Dan Carpenter , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Pi-Hsun Shih , Sheng Pan Subject: Re: [PATCH v13 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP Message-ID: <20200622103223.GA3734@xin-VirtualBox> References: <20200621080925.GH74146@ravnborg.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200621080925.GH74146@ravnborg.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-ClientProxiedBy: HK2PR02CA0199.apcprd02.prod.outlook.com (2603:1096:201:20::11) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xin-VirtualBox (114.247.245.254) by HK2PR02CA0199.apcprd02.prod.outlook.com (2603:1096:201:20::11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.3109.21 via Frontend Transport; Mon, 22 Jun 2020 10:32:29 +0000 X-Originating-IP: [114.247.245.254] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe0697e3-aa6e-4136-409a-08d816979118 X-MS-TrafficTypeDiagnostic: BY5PR04MB6980: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mrsp/3AG2z1a26dVWTj/jUxcrSLO7iOUAOzihplSP+j5SK5nkpr5/xQvD56A5FYt9QCyfvdocZ7TC2vI+Vw5pHFTCMeptya81gSCD83o8pdk+zXVlbEcN9rEc+LdIK2kD5Cxj25UahrzgE52q1pI2Wj7yVpDoE/YczRAdklYHwNCCZkTHiCef6t5cHOs9A29fbhaIhh9iZPDT6xSsn6pNIcop6zot6ZyUMcplnwN9+rD/lru6W1GIoDCmFa2x3cmmTGf7oAibXrzahLRw8QM8nxNOx3SICbIxNWaU0G4wPhIO1+u3sxu9AwKnp+gw+M0nFlhQwWvT0rJvFQ+Jqck4n0ZhRcaRJ+T/f5aRJci1Jo= 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;SFTY:;SFS:(136003)(376002)(346002)(366004)(54906003)(83380400001)(33716001)(5660300002)(1076003)(6666004)(30864003)(956004)(86362001)(2906002)(26005)(4326008)(6496006)(107886003)(66946007)(9686003)(66476007)(66556008)(186003)(16526019)(33656002)(8676002)(52116002)(7416002)(508600001)(55016002)(8936002)(966005)(6916009)(559001)(579004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: +uG1mrxVM+8/hdAwSj7SJqe1vi0/h0aBcGxEdaUXDDy4dayalL8NPi6Z0wQoDr7iSvNpKByMAwq1foI9M5OFQyS3I+g8Fd4Xu3rS9QmHKuSuhFFI9JSnoPhHyWMmfQkou/k3vEHz8j7gmRLyjxKGCcrRhMLCk49u16+63qpGBPfeiEpR5p6Zi9gv7P9p6lo4UwZdknOZJVcy4CRe3/VimwmHhcJyVchnUFHslAnE3QLRE4MyDs5r7QasmApDwrMRNRcr/cDJzy+GvdjsWcnablnL2AGeEjMoeBWSq4zkdU13P3wADkl9p1765ZnbxS35/4f+Kbf0pBOEZ3pJlEwqBTzN66mi0iHHw4VDOhqezTSq9/E79KG1Ghy3k0nu+4fWRTh+rgYpTLMt4TzJpZe7yy6TPFjaen7EWDqf0XjipaaL0kcnHBzlVGdrpkroE0rmzDcFDnuCLwnbg0kJaslccroqBrPMEdQF56rB3GsRtZuUU7udPItLUygeUNFpe37p X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe0697e3-aa6e-4136-409a-08d816979118 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 10:32:30.9047 (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: K5opbeZ5uWXxGdGCwODLK16+hbfUzD39iJyy/xsqPHyvPKiRoiYVUlu6hp53BcA6XvjJRrJ2zN3OCBrz34LNMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR04MB6980 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 21, 2020 at 10:09:25AM +0200, Sam Ravnborg wrote: > Hi Xin. > > > On Tue, Jun 09, 2020 at 03:19:50PM +0800, Xin Ji wrote: > > The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed > > for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K. > > > > Signed-off-by: Xin Ji > > The bridge driver now implements the bridge functions for get_edid + > detect which is good. > But the bridge driver also needs to check the flags argument > of anx7625_bridge_attach() so the connector creation is optional. > This is required to prepare the bridge driver to fully support a > chain of bridges and is mandatory for new bridge drivers. > > Futhermore the bridge driver needs to be converted to use the bridge > panel. See what other bridge drivers do. > In short - the drm_panel shall be replaced by a bridge in your > platform data structure. > Usual this end up in less code after the conversion. > > Sam > Hi Sam, thanks for your comments. 1. I'll add flags argument check in anx7625_bridge_attach(). 2. Do you mean panel bridge, related interface is "devm_drm_panel_bridge_add(...)"? If it is, do I still need call drm_panel_prepare()/drm_panel_unprepare() to enable/disable panel power? Thanks, Xin > > --- > > drivers/gpu/drm/bridge/analogix/Kconfig | 9 + > > drivers/gpu/drm/bridge/analogix/Makefile | 1 + > > drivers/gpu/drm/bridge/analogix/anx7625.c | 1999 +++++++++++++++++++++++++++++ > > drivers/gpu/drm/bridge/analogix/anx7625.h | 397 ++++++ > > 4 files changed, 2406 insertions(+) > > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c > > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h > > > > diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig > > index e1fa7d8..024ea2a 100644 > > --- a/drivers/gpu/drm/bridge/analogix/Kconfig > > +++ b/drivers/gpu/drm/bridge/analogix/Kconfig > > @@ -25,3 +25,12 @@ config DRM_ANALOGIX_ANX78XX > > config DRM_ANALOGIX_DP > > tristate > > depends on DRM > > + > > +config DRM_ANALOGIX_ANX7625 > > + tristate "Analogix Anx7625 MIPI to DP interface support" > > + depends on DRM > > + depends on OF > > + help > > + ANX7625 is an ultra-low power 4K mobile HD transmitter > > + designed for portable devices. It converts MIPI/DPI to > > + DisplayPort1.3 4K. > > diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm/bridge/analogix/Makefile > > index 97669b3..44da392 100644 > > --- a/drivers/gpu/drm/bridge/analogix/Makefile > > +++ b/drivers/gpu/drm/bridge/analogix/Makefile > > @@ -1,5 +1,6 @@ > > # SPDX-License-Identifier: GPL-2.0-only > > analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o analogix-i2c-dptx.o > > obj-$(CONFIG_DRM_ANALOGIX_ANX6345) += analogix-anx6345.o > > +obj-$(CONFIG_DRM_ANALOGIX_ANX7625) += anx7625.o > > obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o > > obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > > new file mode 100644 > > index 0000000..db37f68 > > --- /dev/null > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -0,0 +1,1999 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* > > + * Copyright(c) 2020, Analogix Semiconductor. All rights reserved. > > + * > > + */ > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include