Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp699799pxt; Fri, 6 Aug 2021 11:29:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWInIml0ox/pCZIqhbM5PA02matI1jGhTLYLn8Ek1pq7rhYR+ouc6cMGN7oo7G55lSWZ3/ X-Received: by 2002:a02:cc21:: with SMTP id o1mr11104422jap.114.1628274596295; Fri, 06 Aug 2021 11:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628274596; cv=none; d=google.com; s=arc-20160816; b=l0lk0dwa0wmNA38vofs6s4KQzCCsTixjlJRjkuygNepi3BphUV+P6R07aKWYJFDi+e TW0ag/3Cl5HJbBiTg+gv/ps3d8EFacvfrhM5h2WnNgynVLW864DqUNb6jclT8Ln1Jt2X ozkWzneHUsJU1Pjc3r4K9LznLhcdQXFTrChV7k9YQpmd8PX80WgurDMLwGW1atkaoMq8 qlQSzM2wxurc0TqC7vk3yJWkudzUmtb7Sf0EWB7UBiXluMkC3K4iYlg9mbdbaSk3DJIw OT+Y7WliA6qEpKB8Q33ow7FVonXpMvSkUVsNkcCffBzNLm8SqetQxFPGpzH/O042vYAK 2qGA== 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:dkim-signature; bh=suaF+okm/4bDKf6axUXwGjnFToP92EOtIJ8ZJ6nCqXY=; b=QyY1F0WiUJPuc88ri7TSopS0xt8bh4vYRG7heTq7sONoMhL/tcZF55nCm59awDpMH0 GKLjfscAB63gwO48mLMq7FEHQJPQPCkQpK+RiOAju6cP252lJhVs45BiNQT+x0LmZpnU 1CzufXL2y4bNL184li8wcmYvF44G4kvwQIIiO6UCoiu7KBXjlJp+vFEcMCdPCrKhV6qj 5Lxy2q0ThHQORYTu8aCDgE+awN6AoJ48cVX+XvMrmB3BtG8l3Ar6Obalr8AJdPtmdBJG /4EqedC3wOkbZ2M+WV6rDvJSfhCkrZ7aGvZxG82Cq8GqnI8Tbw0SuEvXHBzgLN5eKicz xUbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z6aOhBvV; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si9005683ilb.113.2021.08.06.11.29.44; Fri, 06 Aug 2021 11:29:56 -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=@kernel.org header.s=k20201202 header.b=Z6aOhBvV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243270AbhHFNR6 (ORCPT + 99 others); Fri, 6 Aug 2021 09:17:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:37510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241700AbhHFNR5 (ORCPT ); Fri, 6 Aug 2021 09:17:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97FDC610FB; Fri, 6 Aug 2021 13:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628255861; bh=1Z7LeDLFF5o7wMGR7j6uGiu9CbMJ/5b/kBdkKapBM2o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z6aOhBvVE95DQ5TDZZRAEVrvHVt+JWyLemQ+ii70p+RwZMPY5SNy2o85TR2vpeC7S RTKSlYqOpQJc81+WkXJwpdv6aeE3hF+hoe6UrgS/HsJL163Yk2XHRveLWxDYLcZL4A cA731tXahQBaZgnKAnb04eYdcv+28zGp7KrV5N2TvHuKi2JHB178bpVwpgv2XBAv4V EwAmMZH9bVfUOTxDPY00APqyZ6SZwKiVx1rHVo79yb2S4xh4OleOB6m8w5qXDRUpgO sP6cTyXXos1HHaQ5Mz5zdUYJm0wnm22kWShrQl7u7WvLBy9xi38IJ70jX7MdBznfgV fTmcHx+Zz5FPg== Date: Fri, 6 Aug 2021 18:47:37 +0530 From: Vinod Koul To: Mauro Carvalho Chehab Cc: Bjorn Helgaas , linuxarm@huawei.com, mauro.chehab@huawei.com, Rob Herring , Greg Kroah-Hartman , Kishon Vijay Abraham I , Manivannan Sadhasivam , linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Subject: Re: [PATCH v9 01/11] phy: HiSilicon: Add driver for Kirin 970 PCIe PHY Message-ID: References: <90aada2f51b58c162e199faf823ba887e50f1dc6.1628092716.git.mchehab+huawei@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90aada2f51b58c162e199faf823ba887e50f1dc6.1628092716.git.mchehab+huawei@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04-08-21, 18:02, Mauro Carvalho Chehab wrote: > +/* define ie,oe cfg */ > +#define IO_IE_EN_HARD_BYPASS (0x1 << 27) > +#define IO_OE_EN_HARD_BYPASS (0x1 << 11) > +#define IO_HARD_CTRL_DEBOUNCE_BYPASS (0x1 << 10) > +#define IO_OE_GT_MODE (0x2 << 7) > +#define DEBOUNCE_WAITCFG_IN (0xf << 20) > +#define DEBOUNCE_WAITCFG_OUT (0xf << 13) Why not use BIT() or GENMASK for these? > +/* Registers in PCIePHY */ > +static inline void hi3670_apb_phy_writel(struct hi3670_pcie_phy *phy, > + u32 val, u32 reg) > +{ > + writel(val, phy->base + 0x40000 + reg); magic 0x40000? > +} > + > +static inline u32 hi3670_apb_phy_readl(struct hi3670_pcie_phy *phy, u32 reg) > +{ > + return readl(phy->base + 0x40000 + reg); > +} > + > +static inline void kirin_apb_natural_phy_writel(struct hi3670_pcie_phy *phy, > + u32 val, u32 reg) > +{ > + writel(val, phy->base + reg * 4); why * 4 ..? > +static void hi3670_pcie_set_eyeparam(struct hi3670_pcie_phy *phy) > +{ > + u32 val; > + > + val = kirin_apb_natural_phy_readl(phy, RAWLANEN_DIG_PCS_XF_TX_OVRD_IN_1); > + > + if (phy->eye_param[1] != EYEPARAM_NOCFG) { > + val &= (~0xf00); > + val |= (phy->eye_param[1] << 8) | (0x1 << 12); > + } again too many magic numbers, Do check FIELD_GET/PREP macros for these? -- ~Vinod