Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2904810ybl; Mon, 19 Aug 2019 09:08:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvSLPeRV+XpiM1AZV/QxNLXLyHmg0QCSPJcfLimEYHuwpTL5Mi9YK1jeewkIFqRaPW69Ct X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr23663926plb.3.1566230887611; Mon, 19 Aug 2019 09:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566230887; cv=none; d=google.com; s=arc-20160816; b=WB+3p1rdo9TmHisUiV/7h63oR/HLY5EICwFWJW+IOP0erdXkWG8WUW5EqHYTxi+z4i qJzoXF/uSC92iC9mzkeHiWfsdcaX6CokWwy+NdYedw5yuh+Cut9synyBIJDAm1hQkUKv 357Ia9WUWA07s+nnuSX0x5hFvGx5vHjap6G28kIhRKHjOZmHpDSRZN01M3D3CM2AgTtd cEIpJ1AnUKw3IV+sEMWpfB3VHv1y97znv4reN+Ll/kasRUX2NQ2rfm/xNUNaAn3wp/Ph uRDyPGjDwgkBRelh/DUbwbkQ7eBQtP3cZ46r1IuJ5E3tQNNc+RnuBFU5UmQ3EX+SzFLc VTLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fEdCjZDFZJNoFoFFYOpOXQTjJ9PnjRYiYxW34fntFB4=; b=RQo0qrqwsfmoM4WWXEujJQrgKrz7hGxdPRPfaTADDdAnvhnYU17yPImtUa41018vu6 YIAuNZ7ElA3VXy8GcrqIXhkydBN+JDNEb68QmwgmEVQO18fnMNRDYbpc9/xXeFcKjMz9 vrJcROxE4l/cfJS3HZEvJifMOEqTRuC/LTydvZY70mKGdKboOqJQBgZ/zvbEmiqnLPLI 7oIRKt+YwHHZs0+pbTckuNLnULPNR1tlNCEBitwbjkSmismRaige87iqILL2B1/uopEC edu06yKvJYqM4Np21SDfyQAT9gitvqlV+kFEc+0dZ2L7/pGAjW3j1XRAwAQWvR2tu0AJ SkmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11si10013218pll.343.2019.08.19.09.07.51; Mon, 19 Aug 2019 09:08:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727424AbfHSQGr (ORCPT + 99 others); Mon, 19 Aug 2019 12:06:47 -0400 Received: from mga17.intel.com ([192.55.52.151]:21544 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfHSQGr (ORCPT ); Mon, 19 Aug 2019 12:06:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 09:06:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,405,1559545200"; d="scan'208";a="195566523" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by fmsmga001.fm.intel.com with ESMTP; 19 Aug 2019 09:06:44 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1hzkB8-0000AT-TM; Mon, 19 Aug 2019 19:06:42 +0300 Date: Mon, 19 Aug 2019 19:06:42 +0300 From: Andy Shevchenko To: "Ramuthevar,Vadivel MuruganX" Cc: kishon@ti.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, peter.harliman.liem@intel.com Subject: Re: [PATCH v1 2/2] phy: intel-lgm-emmc: Add support for eMMC PHY Message-ID: <20190819160642.GC30120@smile.fi.intel.com> References: <20190819034416.45192-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20190819034416.45192-2-vadivel.muruganx.ramuthevar@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190819034416.45192-2-vadivel.muruganx.ramuthevar@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 11:44:16AM +0800, Ramuthevar,Vadivel MuruganX wrote: > From: Ramuthevar Vadivel Murugan > > Adds support for eMMC PHY on Intel's Lightning Mountain SoC. Adds -> Add. > +/* eMMC phy register definitions */ > +#define EMMC_PHYCTRL0_REG 0xa8 > +#define DR_TY_MASK GENMASK(30, 28) > +#define DR_TY_50OHM(x) ((~(x) << 28) & DR_TY_MASK) > +#define OTAPDLYENA BIT(14) > +#define OTAPDLYSEL_MASK GENMASK(13, 10) > +#define OTAPDLYSEL_SHIFT(x) (((x) << 10) & OTAPDLYSEL_MASK) > + > +#define EMMC_PHYCTRL1_REG 0xac > +#define PDB_MASK 1 BIT(0) > +#define ENDLL_MASK BIT(7) > +#define ENDLL_VAL BIT(7) > + > +#define EMMC_PHYCTRL2_REG 0xb0 > +#define FRQSEL_25M 0 > +#define FRQSEL_150M 3 > +#define FRQSEL_MASK GENMASK(24, 22) > +#define FRQSEL_SHIFT(x) ((x) << 22) > + > +#define EMMC_PHYSTAT_REG 0xbc > +#define CALDONE_MASK 1 > +#define DLLRDY_MASK 1 > +#define IS_CALDONE(x) ((((x) >> 9) & CALDONE_MASK) == 1) > +#define IS_DLLRDY(x) ((((x) >> 8) & DLLRDY_MASK) == 1) These are inconsistent with above: #define CALDONE_MASK BIT(9) ... #define IS_CALDONE ((x) & CALDONE_MASK) Note redundant == part. > +static int intel_emmc_phy_power(struct phy *phy, bool on_off) > +{ > + * - PHY driver to probe > + * - SDHCI driver to start probe > + * - SDHCI driver to register it's clock > + * - SDHCI driver to get the PHY > + * - SDHCI driver to init the PHY > + * > + * The clock is optional, so upon any error we just set to NULL. No, the clock framework will do it for you. > + * > + * NOTE: we don't do anything special for EPROBE_DEFER here. Given the > + * above expected use case, EPROBE_DEFER isn't sensible to expect, so > + * it's just like any other error. This comment is not correct... > + */ > + priv->emmcclk = clk_get_optional(&phy->dev, "emmcclk"); > + if (IS_ERR(priv->emmcclk)) { > + dev_warn(&phy->dev, "ERROR: getting emmcclk\n"); ...because here you have to return an error... > + priv->emmcclk = NULL; ...and here is redundant assignment. > + } > + > + return 0; > +} When you send out patches, check that you do this for latest version you got reviewed internally. -- With Best Regards, Andy Shevchenko