Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1745098ybg; Sat, 19 Oct 2019 01:34:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxekdhdg4T4Tbf2aLijfBpuMkPP5XpeGsQfQZjjpAXKwEVCMULRfj7woUyyOfoE4wwxLrda X-Received: by 2002:a05:6402:698:: with SMTP id f24mr14105223edy.172.1571474096923; Sat, 19 Oct 2019 01:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474096; cv=none; d=google.com; s=arc-20160816; b=XB/m5gi7PRDGXSWGeB+42u1NDJW2BWx46hMo/aUOxVgsg+u16G2dU2INBQuZw8vue3 yK9k1M9VWu2a4Pif76sdYpJpLYzQ5mwgJQ5AKZ1nCq7gqVJmOWIeBZDVjMLoVfOG+kF0 aqZYp0NUquJFrvhZ0XF+fhsi1/x+xYJmNkBOB/uRwLZs4IdUtw62q0bPgm7POwAsCXgP cQtuVFi8JMhE1Z3FX1TTCOGXB0zcnb1ZYz9jc3KcQTfyco6XU9mKe0aG5hd13oH/b6Hk GNfRNKsLoZk57TJCm14hoX3IFfDA7XlIp75z9+dlPol8ODYlK7AgwakuuwxS8dajf03l XR0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=yvFr+nNghkKZwR4mawCKvHUmrMBJduw6erMI6YTlcHM=; b=gP1cqxXURyFGqcYtzaiZ8un2GXwNG9tRxV6rrz2JHdFDYYXliMG3A/SgALjzcO+5kU tb494xFEMJMcRhw5msbTh/HJKXSrj3PKVIZk+Q59GTTgy5oY52thA3o7MpFqdEUBMfIt SadXVhpmJ0jHXeA+4+2xAEG9mqkzHyWTz8Frcrz42s/iiTUZDHCvJGHZa+9s/7oUg+Mt +HBCBO3hGBkto+l8+NX6EHvF74ujTlFciO8QXBEJFeDNV6jVHIyRvnTOFO4oaw+1ZyED hiG9Is6ng4NCe+666G3vthnj1B4DJaY6vZ5IEf1IGJkVwu28HocIBkvGoueiD5zEO5p2 zZDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b="v470AP/W"; 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=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e50si349781ede.59.2019.10.19.01.34.34; Sat, 19 Oct 2019 01:34:56 -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; dkim=fail header.i=@crapouillou.net header.s=mail header.b="v470AP/W"; 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392759AbfJRPh6 (ORCPT + 99 others); Fri, 18 Oct 2019 11:37:58 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:60928 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730468AbfJRPh6 (ORCPT ); Fri, 18 Oct 2019 11:37:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1571413074; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yvFr+nNghkKZwR4mawCKvHUmrMBJduw6erMI6YTlcHM=; b=v470AP/WoXYbHAA0MikRhd2C2Q47Jva7B2tAsqSQJh2nMYK2q/AuxV6ILjajalIe9ifrUq QQ5AMEkFZxjYo9B3QckbJkKJ22INg6mA+cpEFKl/QqzArCcPa/pKii/EQODfOjJpBl38Oc nlS76mnfHy2OQjR4ZofesDfcpS7rIQ0= Date: Fri, 18 Oct 2019 17:37:47 +0200 From: Paul Cercueil Subject: Re: [PATCH 6/6 v2] MMC: JZ4740: Add support for LPM. To: Ulf Hansson Cc: Zhou Yanjie , linux-mips@vger.kernel.org, Linux Kernel Mailing List , linux-mmc@vger.kernel.org, DTML , Rob Herring , Paul Burton , Mark Rutland , syq@debian.org, Linus Walleij , armijn@tjaldur.nl, Thomas Gleixner , YueHaibing , Mathieu Malaterre , Ezequiel Garcia Message-Id: <1571413067.3.0@crapouillou.net> In-Reply-To: References: <1567669089-88693-1-git-send-email-zhouyanjie@zoho.com> <1570857203-49192-1-git-send-email-zhouyanjie@zoho.com> <1570857203-49192-7-git-send-email-zhouyanjie@zoho.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uffe, Le ven., oct. 18, 2019 at 10:52, Ulf Hansson a=20 =E9crit : > On Sat, 12 Oct 2019 at 07:19, Zhou Yanjie wrote: >>=20 >> add support for low power mode of Ingenic's MMC/SD Controller. >>=20 >> Signed-off-by: Zhou Yanjie >=20 > I couldn't find a proper coverletter for the series, please provide > that next time as it really helps review. Additionally, it seems like > you forgot to change the prefix of the patches to "mmc: jz4740" (or at > least you chosed upper case letters), but I will take care of that > this time. So, I have applied the series for next, thanks! >=20 > I also have a general question. Should we perhaps rename the driver > from jz4740_mmc.c to ingenic.c (and the file for the DT bindings, the > Kconfig, etc), as that seems like a more appropriate name? No? Is there a kernel policy regarding renaming drivers? Since it trashes=20 the git history. Anyway you're the subsystem maintainer so I guess=20 that's up to you. I can send a patch to rename it if you want. Cheers, -Paul >=20 > Kind regards > Uffe >=20 >=20 >> --- >> drivers/mmc/host/jz4740_mmc.c | 23 +++++++++++++++++++++++ >> 1 file changed, 23 insertions(+) >>=20 >> diff --git a/drivers/mmc/host/jz4740_mmc.c=20 >> b/drivers/mmc/host/jz4740_mmc.c >> index 44a04fe..4cbe7fb 100644 >> --- a/drivers/mmc/host/jz4740_mmc.c >> +++ b/drivers/mmc/host/jz4740_mmc.c >> @@ -43,6 +43,7 @@ >> #define JZ_REG_MMC_RESP_FIFO 0x34 >> #define JZ_REG_MMC_RXFIFO 0x38 >> #define JZ_REG_MMC_TXFIFO 0x3C >> +#define JZ_REG_MMC_LPM 0x40 >> #define JZ_REG_MMC_DMAC 0x44 >>=20 >> #define JZ_MMC_STRPCL_EXIT_MULTIPLE BIT(7) >> @@ -102,6 +103,12 @@ >> #define JZ_MMC_DMAC_DMA_SEL BIT(1) >> #define JZ_MMC_DMAC_DMA_EN BIT(0) >>=20 >> +#define JZ_MMC_LPM_DRV_RISING BIT(31) >> +#define JZ_MMC_LPM_DRV_RISING_QTR_PHASE_DLY BIT(31) >> +#define JZ_MMC_LPM_DRV_RISING_1NS_DLY BIT(30) >> +#define JZ_MMC_LPM_SMP_RISING_QTR_OR_HALF_PHASE_DLY BIT(29) >> +#define JZ_MMC_LPM_LOW_POWER_MODE_EN BIT(0) >> + >> #define JZ_MMC_CLK_RATE 24000000 >>=20 >> enum jz4740_mmc_version { >> @@ -860,6 +867,22 @@ static int jz4740_mmc_set_clock_rate(struct=20 >> jz4740_mmc_host *host, int rate) >> } >>=20 >> writew(div, host->base + JZ_REG_MMC_CLKRT); >> + >> + if (real_rate > 25000000) { >> + if (host->version >=3D JZ_MMC_X1000) { >> + writel(JZ_MMC_LPM_DRV_RISING_QTR_PHASE_DLY | >> + =20 >> JZ_MMC_LPM_SMP_RISING_QTR_OR_HALF_PHASE_DLY | >> + JZ_MMC_LPM_LOW_POWER_MODE_EN, >> + host->base + JZ_REG_MMC_LPM); >> + } else if (host->version >=3D JZ_MMC_JZ4760) { >> + writel(JZ_MMC_LPM_DRV_RISING | >> + JZ_MMC_LPM_LOW_POWER_MODE_EN, >> + host->base + JZ_REG_MMC_LPM); >> + } else if (host->version >=3D JZ_MMC_JZ4725B) >> + writel(JZ_MMC_LPM_LOW_POWER_MODE_EN, >> + host->base + JZ_REG_MMC_LPM); >> + } >> + >> return real_rate; >> } >>=20 >> -- >> 2.7.4 >>=20 >>=20 =