From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EDE8C433F5 for ; Sun, 26 Sep 2021 16:33:28 +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 83D32600AA for ; Sun, 26 Sep 2021 16:33:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 83D32600AA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CF7889812; Sun, 26 Sep 2021 16:33:26 +0000 (UTC) Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id E596689812 for ; Sun, 26 Sep 2021 16:33:24 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 719e8be7-1ee7-11ec-a02a-0050568c148b; Sun, 26 Sep 2021 16:33:13 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 2BF19194BAF; Sun, 26 Sep 2021 18:33:14 +0200 (CEST) Date: Sun, 26 Sep 2021 18:33:18 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Kevin Tang Cc: Maxime Ripard , Maarten Lankhorst , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , pony1.wu@gmail.com, Orson Zhai , Chunyan Zhang , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , devicetree@vger.kernel.org Subject: Re: [PATCH v6 6/6] drm/sprd: add Unisoc's drm mipi dsi&dphy driver Message-ID: References: <20210813145302.3933-1-kevin3.tang@gmail.com> <20210813145302.3933-7-kevin3.tang@gmail.com> <20210917154047.leojvqjqjj2sg34l@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Kevin, > > > + reg->_0b.bits.out_sel = pll->out_sel; > > > + reg->_0b.bits.kint_l = pll->kint & 0xf; > > > + reg->_0e.bits.pll_pu_byp = 0; > > > + reg->_0e.bits.pll_pu = 0; > > > + reg->_0e.bits.stopstate_sel = 1; > > > + reg->_0f.bits.det_delay = pll->det_delay; > > > + > > > + val = (u8 *)® > > > + > > > + for (i = 0; i < sizeof(reg_addr); ++i) { > > > + regmap_write(regmap, reg_addr[i], val[i]); > > > + DRM_DEBUG("%02x: %02x\n", reg_addr[i], val[i]); > > > + } > > > +} > > > > It would be great to also convert this part to a pattern without > > structures. > I will try it, but our pll registers, all not have official name from > aisc design owner. > If need to convert it, our pll regiters macro define, it can only be > named as reg_01, reg_02... IT is better to use the stupid names provided by you asic design owner, than just numbers. Add a comment explaining this is due to the asic design owner the names are stupid and not your fault. > > > + > > > + if (dsi->panel) { > > > + drm_panel_prepare(dsi->panel); > > > + drm_panel_enable(dsi->panel); > > > + } > > > > Please use the new devm_drm_of_get_bridge helper here, and use the > > bridge API instead. > We use drm_panel_init and drm_panel_add API to add panel, so here is a > panel device, not a bridge. The new way to do this is to always wrap the panel in a bridge. We will start to slowly migrate away from direct use of the panel API, and let display drivers always wrap the panles in a bridge. So please do as Maxime suggests. Sam