Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp209970pxu; Thu, 10 Dec 2020 23:50:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2qMrLlGALT+2uDarVi6qPXlqGcyKbblQMMSlZJVildSa/fdbsxWjKtUCduK1TGEb2SpbS X-Received: by 2002:a17:907:4332:: with SMTP id ni2mr9895425ejb.422.1607673034456; Thu, 10 Dec 2020 23:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607673034; cv=none; d=google.com; s=arc-20160816; b=RKsNO+UI3QGj01gxE8zEJ5XWE9eoGbMoRw2MsfBERZN8PUatR7Vxoop5HSHPt0Rh3a p8z8tYxSGvTo8K4B/hYzLF259kx1+UALgCf3B0dj/Md6CDxZHCzUrV/Fo96DaT6fU4bE 9G6+GHx9GUDy82Y/7dhctEJLE1gIM6GoOBgFlWSbXPpIKCjiPgIjbgKWH3mV76WDAmnl YrUoRjLiUz+rQAcmgreOKq/O7snBg9ISgf/8uDSBpGPZ7SAa2W3s4HTTFhBFdQrhjYC9 29GP7rwbGDU8xWDhnFsxftQ5kEiNaTqzr6rxdzjk5A/KfOm43RuxAZFTPwJywhufdYwn qIpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=d4LZazcEk4MFX1qHLGHiKS1Th2EI2Tgbz/+dKarKOJU=; b=RRyzlTkExgSt34vBCY9pF+hURZuDIQoeJGL8992PouEmlqff2s8QvSqw2+pbX9ZjOj JnHl8HCZD/4N/uLmOmYxtpnfAEv/jZn/GIwZmN/Oa1KyBUKZkgEbDipuz7/wy6vQ+aTn I98hm4pNz7t0nsZDRUD6tsdshIu47FFFOwuVs2k9ZaXGG4OSU+urO3IWpcWtnnVOlXd/ 5X4VdTc76HpLKY1W4oqatzmwQThIFZbFlFLb2KTK9Tu3RRNEPX3KTRFZZWYNXAafJdDX Z22GWB6fY57vEhsqjl/KYGtYRVRHg6mR5cOITyPE439d1/Kj/xfAC1sZ/tVXZolpGLmV 7Okg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e6z/NFYe"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a27si4355858edb.498.2020.12.10.23.50.11; Thu, 10 Dec 2020 23:50:34 -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; dkim=pass header.i=@linaro.org header.s=google header.b="e6z/NFYe"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388352AbgLJPeF (ORCPT + 99 others); Thu, 10 Dec 2020 10:34:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391389AbgLJOla (ORCPT ); Thu, 10 Dec 2020 09:41:30 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D9E6C0613D6 for ; Thu, 10 Dec 2020 06:40:48 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id y5so5732963iow.5 for ; Thu, 10 Dec 2020 06:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=d4LZazcEk4MFX1qHLGHiKS1Th2EI2Tgbz/+dKarKOJU=; b=e6z/NFYeQUVhfdYZqe5DejzSFYW4cHjElw6aAgjnK8eSZ9+ruf8dLLyI5y7rRQAtsQ 1VEel+RGMX9uzSP4P7Pgf5oQkyQ3q2yr/LdAYXIOgjYk29efEnt2xd3efk+2xKH1VQkO tT6cwts1CW76AUBWhNXO11t/0I0fQrXtNzbR+rhlte3I+GXuSra0B00RljRzZHqD1MeY frGfNIHe1Y7FfO3zucoSAEfrtK71Mjce8ySwaLCLkjynjOv7FSgP/1lnsKTGuOPDUBb4 7l8OADqABeEZ1XTJqWBRzmWUFvvdGfgPPxfZdRIKr+9wj44HyWK19MUydpHxBu71nso4 QbCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=d4LZazcEk4MFX1qHLGHiKS1Th2EI2Tgbz/+dKarKOJU=; b=Rh3Ua2074fOUAlRSg1ubXU5tsqORKBKw5HQ50rbmM82HnQYkb+Uxbp+SYUt1vEMh2a T8ftQ8VsdTTy7FA+cwe7CIx2+g6X10zniUKTVkB0JZcjENcr3MWjFx61QHVqk7r6c0hS P9P/0i9ucDpe9fs+lmOOPSyhF3vjP5kpxjFbWQIVc7uubGn0G7saS729LzRmD39/xsEH 2XF93UgvFUWqgaLt8pgrLkB7ScJzu4yRQuLDg1mVsWVi+awmvi+V4CLgBcuPy6mOSpCJ EVgghdo+QuzjXCifLWuF3T/EHKM8CAikBiZmlX/Fy9J6i39JDzZTkg8AYA2bquNWcwpF Kxjw== X-Gm-Message-State: AOAM533wPBQ+cT1zaTmZ1wTXygUHqX4bblsKqEzBWifA+U+Sgoun+6ro 6BIE9+HBrr51tdIc4BX1gHOw/4lu5rVf1ewdnglYmA== X-Received: by 2002:a05:6638:1027:: with SMTP id n7mr8943390jan.35.1607611247949; Thu, 10 Dec 2020 06:40:47 -0800 (PST) MIME-Version: 1.0 References: <20201208044022.972872-1-bjorn.andersson@linaro.org> <20201210015136.GA18407@dragon> <20201210130453.regjkemfneqbelsi@pengutronix.de> In-Reply-To: <20201210130453.regjkemfneqbelsi@pengutronix.de> From: Shawn Guo Date: Thu, 10 Dec 2020 22:40:36 +0800 Message-ID: Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Implement the pwm_chip To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uwe, On Thu, Dec 10, 2020 at 9:05 PM Uwe Kleine-K=C3=B6nig 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 constants > > (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/7cde887ffb3b27a36e77a08bee366= 6d14968b586 > > 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. 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. Shawn > (Even if up to now there is no other code location using this name.)