Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2387685rwb; Fri, 20 Jan 2023 02:10:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsI2WSVHPlGu5E2tBpxqgz2lSIPkhlYMCq9SjTsUYdZP42FQ/qbUMc9+FbkspzrzoP+xKsC X-Received: by 2002:a17:902:d2d1:b0:194:c5d6:328 with SMTP id n17-20020a170902d2d100b00194c5d60328mr9679201plc.35.1674209450378; Fri, 20 Jan 2023 02:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674209450; cv=none; d=google.com; s=arc-20160816; b=UHrEtpJl3SDFRJS3pNiQbWxlf84IN0QBbRprlTujuqBmbEvd0kfd3uXnuJXU3t0g9F v6/TkM4EY/RE4yhGWnrVIiJ0TKdYJ9rB5AGGEcRE2QgQpk1CqU0Tz5B4ZjKeSbwP52Xx 5JCAls7wMrSdFz3OiATCmhzPvM0OrTnRiAIc+XcuZolXD/Il2m7UXbPGar8w8aC66SWD OmyoNuaP7/yFGIF5NY5iqgggD3rVdIDCP5o0VpT4QENc0qOQHq6wf1tPBg2TI9rOXkc6 N75vQlLsp6PbnYMCCVXZhhisqczQDnJqu4KKeEFSYDiD9gBnWB5U3sniCq9qD36RKPSl dLvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7nqtBxn6x9dmJzVZTEOUohVj6RibjR+zHZlAa3anopY=; b=fgEIrhSYytst9eylkBVlndlRXaPcwRoVgX0PFPJDtgJa0GxmwWgUfsJs3PAXj7h/dm SJxobQ8yuhj2gbzvD6SI2CzRaPDDKvECy2Pfo8of9NtIjpDd+6gUNkCdLOU1hy1clZuR 6P3hbp+Z4Wx50ezq0E7K/f+1mKv6nOx9IIjT8DzY6wANR+6qKHXTDnscGjgUl0OYRJ60 OPT1u7hjYdElEY+B5GgI6NgHl3zKfWct4Z7RkdJvfww3hojwOorurxv2r+JKDZ5ETBTl f1/3+7V6OEGj/PPDxDJwY7StYg1NzqBXqzltMDE+IHGqrLO9ZfF3UxqGH2KLWH3sVHiT ec+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a170902789800b00193373e40afsi30924894pll.172.2023.01.20.02.10.44; Fri, 20 Jan 2023 02:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjATJla (ORCPT + 48 others); Fri, 20 Jan 2023 04:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjATJl3 (ORCPT ); Fri, 20 Jan 2023 04:41:29 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0611445205 for ; Fri, 20 Jan 2023 01:41:28 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pInth-0006vW-Qz; Fri, 20 Jan 2023 10:41:21 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pIntd-00064S-Gh; Fri, 20 Jan 2023 10:41:17 +0100 Date: Fri, 20 Jan 2023 10:41:17 +0100 From: "s.hauer@pengutronix.de" To: "Sverdlin, Alexander" Cc: "a1ba.omarov@gmail.com" , "heiko@sntech.de" , "krzysztof.kozlowski+dt@linaro.org" , "hjc@rock-chips.com" , "michael.riesch@wolfvision.net" , "macromorgan@hotmail.com" , "daniel@ffwll.ch" , "frattaroli.nicolas@gmail.com" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "pgwipeout@gmail.com" , "devicetree@vger.kernel.org" , "frank-w@public-files.de" , "robh+dt@kernel.org" , "ezequiel@vanguardiasur.com.ar" , "linux-arm-kernel@lists.infradead.org" , "airlied@gmail.com" , "linux-rockchip@lists.infradead.org" Subject: Re: [PATCH 1/3] drm/rockchip: lvds: add rk3568 support Message-ID: <20230120094117.GM24755@pengutronix.de> References: <20230119184807.171132-1-a1ba.omarov@gmail.com> <20230119184807.171132-2-a1ba.omarov@gmail.com> <20230120091641.GL24755@pengutronix.de> <9fe2678da0ae10e6996889971a3137799a68c4b9.camel@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9fe2678da0ae10e6996889971a3137799a68c4b9.camel@siemens.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 09:31:43AM +0000, Sverdlin, Alexander wrote: > Hello Sascha, > > On Fri, 2023-01-20 at 10:16 +0100, Sascha Hauer wrote: > > > +???????/* Enable LVDS mode */ > > > +???????return regmap_update_bits(lvds->grf, RK3568_GRF_VO_CON2, > > > +???????????????????????????????? RK3568_LVDS0_MODE_EN(1), > > > +???????????????????????????????? RK3568_LVDS0_MODE_EN(1)); > > > > Isn't this the same as: > > > > ????????regmap_write(lvds->grf, RK3568_GRF_VO_CON2, > > RK3568_LVDS0_MODE_EN(1)); > > > > Unless I am missing something I find a plain regmap_write() easier to > > read. > > the former is setting a bit in a RMW operation, the latter is a plain > write, isn't it? That's right from the view what the function itself does. Note the registers that are accessed here are a bit special. They effectively are 16bit wide, the upper 16bit contain a mask. Only the bits set in the mask are actually modified in the lower bits. See the register bit definitions: #define HIWORD_UPDATE(v, h, l) ((GENMASK(h, l) << 16) | ((v) << (l))) #define RK3568_LVDS0_SELECT(val) HIWORD_UPDATE(val, 5, 4) Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |