Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4975811pxu; Thu, 10 Dec 2020 09:49:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsRsvcV/mkemwPeI0pkzHhEHHASfxrY3FrfqHTwVYjoHfiMCgzZR2/psLvO5HsFmkm1GR4 X-Received: by 2002:a50:e715:: with SMTP id a21mr7971832edn.285.1607622592480; Thu, 10 Dec 2020 09:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607622592; cv=none; d=google.com; s=arc-20160816; b=yEddQAXXHnSl12yg6mwYTHniF2VYzaOlWsu39AcL7DdqpqMiyqu9ukad7nRUnemdEo oEmPIqIHSHLvP5y+q9pOWmXiTy0/65MpMisYyctR7CZwgWgzfaUTlhWcs5WM9iPkLObH VJqQjp0sy88P1fB8Kr7B8Uxj/wY/lpbx4/oLg2AucKBGGuSVp5+xInqnw5xvYQZvfItr Rq1V06TiPnfGkVjYNk6Y1edu0eL39zsvmjxbI+FZ5xFDvGFBEvFFx/yhNl+VfKlnGEfx oNNdMZByfSo9LmXJ7HliqYrq4JAIOQ+7l03/2aEm6jlS+fU843ndFLSdfN1ZPSNC1vPG dfkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=F2s9mgpnAxTdtT/zPkpQPMC39IdsDc4fee9ERRw9XhM=; b=H2TZ7r6mDxvdN3B644uhjm1SZBAIWUKfFAU2PmcByZxeayFW+x1VLoNoOUss7f1v6Z Wqqwo9AJKIXoib+IwChIVcTTZXdR0Vnf5EogBepAZI+CF6DOi/PQYafS6TR8BGVced+c aR5s2HrVH5BRaYZ9vBSVc2jHOc66guLQdTT8IjXMaYowKPM71wPy/TNNg4HwRQugdrNh Xsc4kM44mzwM6vaITTCSwsKlDV6VxLEAwkSLGYaV3ufyGwmMVtpy2oaoqhbu5g1jtOg1 0KkiCKpuW3pBqnzBn/grQ/KWeYDp/Sz8Xr5LrY7mUbrrdnNupIA5RPnXqbCr6l3C9OUv +qHA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si2924620ejz.538.2020.12.10.09.49.29; Thu, 10 Dec 2020 09:49:52 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391237AbgLJRok (ORCPT + 99 others); Thu, 10 Dec 2020 12:44:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392468AbgLJRod (ORCPT ); Thu, 10 Dec 2020 12:44:33 -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 BAC3CC0613D6 for ; Thu, 10 Dec 2020 09:43:52 -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 1knPyh-0001XP-Vu; Thu, 10 Dec 2020 18:43:43 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1knPyg-0007GO-0n; Thu, 10 Dec 2020 18:43:42 +0100 Date: Thu, 10 Dec 2020 18:43:38 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Shawn Guo Cc: Bjorn Andersson , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Thierry Reding , Lee Jones , Doug Anderson , linux-arm-msm , dri-devel , Linux Kernel Mailing List , linux-pwm@vger.kernel.org Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Implement the pwm_chip Message-ID: <20201210174338.kecryijwptzc2mi7@pengutronix.de> References: <20201208044022.972872-1-bjorn.andersson@linaro.org> <20201210015136.GA18407@dragon> <20201210130453.regjkemfneqbelsi@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ps2gwrvyhmcv56vu" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ps2gwrvyhmcv56vu Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 10, 2020 at 10:40:36PM +0800, Shawn Guo wrote: > Hi Uwe, >=20 > On Thu, Dec 10, 2020 at 9:05 PM Uwe Kleine-K=F6nig > wrote: > > > > @@ -111,6 +118,8 @@ > > > > > > > > #define SN_LINK_TRAINING_TRIES 10 > > > > > > > > +#define SN_PWM_GPIO 3 > > > > > > So this maps to the GPIO4 described in sn65dsi86 datasheet. I'm > > > wondering if it's more readable to define the following SHIFT constan= ts > > > (your code), and use GPIO_MUX_GPIO4_SHIFT >> 2 where you need GPIO > > > offset? > > > > > > #define GPIO_MUX_GPIO1_SHIFT 0 > > > #define GPIO_MUX_GPIO2_SHIFT 2 > > > #define GPIO_MUX_GPIO3_SHIFT 4 > > > #define GPIO_MUX_GPIO4_SHIFT 6 > > > > > > If you agree, you may consider to integrate this patch beforehand: > > > > > > https://github.com/shawnguo2/linux/commit/7cde887ffb3b27a36e77a08bee3= 666d14968b586 > > > > My preferred way here would be to add a prefix for the other constants. > > It (IMHO) looks nicer and > > > > GPIO_INPUT_SHIFT > > > > looks like a quite generic name for a hardware specific definition. >=20 > While this looks like a reasonable argument, I also like the naming > choice for these constants in the beginning for that distinction > between registers and bits. And changing the names the other way > around means there will be a much bigger diffstat, which I would like > to avoid. I suggest let's just focus on what really matters here - > keep the naming consistent, so that people do not get confused when > they want to add more constants in there. In my eyes the bigger diffstat is justified. As I wrote, GPIO_INPUT_SHIFT isn't used in other files, but please look how many definitions there are for RESET. The usefulness of ctags/cscope is quite reduced if generic terms are used this way. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --ps2gwrvyhmcv56vu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl/SXkcACgkQwfwUeK3K 7AmI/Qf+O2t7kLzcKzhBBKQiEXpzva2VVJ1Sdqx+3IFglDVCks7FCR5ezU0dO09T 72uH2a7cWTHDIo1DcVVCtefbVVClwIeXYdGbDr4FKRzkGjf54Veao3Ow+bRIS5DM 6R+6d3oUuXHt+Ta51eGT/BoSL81iHQuyFhxUPGXlKBnPMdEy3/ZNa7jRj3LDgP0+ /InQbERlpSTU2x5OAgXbczDYsH/ZnzrTorCVdpmRSOYMci5HU/o8DU7Lu3YR8PJp 0QUai3CczxpUi0ZYF5dvPF9ED1Hctn0AeNuMM4hnErSg3EN6TrZsblLPnxSEh5bd ZgcHNcVUveLXFUdAcMmzB5YercKscg== =EgCO -----END PGP SIGNATURE----- --ps2gwrvyhmcv56vu--