Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4649143yba; Wed, 10 Apr 2019 01:50:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNZ7I0kQZXi2DjmlTq34GjwvhHUuByWwv9BDmSIJsAmtXysskHo79XFSn39SMpu2IghYt/ X-Received: by 2002:aa7:9296:: with SMTP id j22mr42807838pfa.140.1554886210192; Wed, 10 Apr 2019 01:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554886210; cv=none; d=google.com; s=arc-20160816; b=vEtITjhbwhHexZGrMgj7DSqK84iRa9LFbOQXhQcjKk9S8/VMxoGwPSDBrJIjEJTOhP tPe525gd6IVcnLD/6CbmUix+k/nloSP1iERxO2+J6q93pJiKf3baNXQuOda+G8wjoPUU iNOu68rzBgPrCx8x0mPbKVAFEYW9nR3OuSwvr0PB+W7DVyVGxUvUMIjpm/w2o5d/dB1j z7IAMDROZgl9cC9D0KoaPevUK8mlp/ytAhUMZ4WUkfty8xI21VBS2wGkTv9o88nskPen pX4WoUfVRrMdr743Rzp5EZPOVzSqxhD14WlUNI3JHHNssgQjzm3Stqzhj9G0qpUv+2TF njBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=ViMjY7PFbqRtxvpgQpNuM4u1Ocd6CPy/4jR+WCCjcQQ=; b=hTBkNu3ILlWrIhw/IqBKg+hmA+TvXbquHyAKu0Rc24aac/VRvoP8MLtJXxheSlt+x7 xB1YXwYPw6Znw+xRb7RPQu9jrRfE+I+v5VECFZLn9/VjVbnpGNBcpK8ogLVLSQGhGwk9 nIExyDNcTgm1WjSdQ0H18PzZ9mxPIzPQR0e/c1rFPJl7P7iDr8poVghenFDjdDl2KzFd aQ6mAJG/zoo8JXNU7pyJJb9pZ8964LQPnU4pUg0iUB1eXrjd9vMWkQKaOmFMosIjFUpk Htj6M+8lb63WDxepwpocb6P5PMzD9q7EjvQQTaJecunkosQaBUe3hD9ekhoXPOwk9109 BtYw== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si22489637plt.68.2019.04.10.01.49.54; Wed, 10 Apr 2019 01:50:10 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729068AbfDJHsh (ORCPT + 99 others); Wed, 10 Apr 2019 03:48:37 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48443 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbfDJHsf (ORCPT ); Wed, 10 Apr 2019 03:48:35 -0400 Received: from mail-pf1-f199.google.com ([209.85.210.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hE7x2-0003af-4Q for linux-kernel@vger.kernel.org; Wed, 10 Apr 2019 07:47:20 +0000 Received: by mail-pf1-f199.google.com with SMTP id s26so1131179pfm.18 for ; Wed, 10 Apr 2019 00:47:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ViMjY7PFbqRtxvpgQpNuM4u1Ocd6CPy/4jR+WCCjcQQ=; b=UI16bfxT0ZGaH1v82mC5ifOwpH3T5CzfhxligJocx6GpiXgoTP8oRZklgasI0w3tLC juqCYFV1f5WpD818JL6Dvnt2TRHEoPTTkH+br2NTfv77fCyhpyqsG1f/mv13lramxYMG GoU7Bb//lcKsLDd3rkjUl16ZatrLv1WBiZ5u7gABbnQeABNCbNNk0XmBVe83irIAm7YJ Tr6HCi3Pf5HTqGSvT0wBEK5gHOfYwaiUhMDbcOxPDscV70AAmbmYKQfB9KFK/I3zbaaF whISw3h3DI+v/onq8UKOzRzOYVEVgAHUFdyXwpuE4LgyrpPM8iOCt7sbgo16nWDHovxp bvRg== X-Gm-Message-State: APjAAAUmEwx54YIJpzSSmZKoeRkvDBUvCUPISNLePHYeiDB8BNx4DnKq hCuP1ShNkOb9BKymNUy+Hfd7jGBjIoUtjiv8FnQie9arc3UQ6Odu5tZtcWWY9tFN3sk25Ac3lPX XzwTFkxrQkFln0j7kVmOxXXFcRx17KbQwD05rCzY+vA== X-Received: by 2002:a17:902:9341:: with SMTP id g1mr4301962plp.81.1554882438549; Wed, 10 Apr 2019 00:47:18 -0700 (PDT) X-Received: by 2002:a17:902:9341:: with SMTP id g1mr4301928plp.81.1554882438035; Wed, 10 Apr 2019 00:47:18 -0700 (PDT) Received: from 2001-b011-380f-14b9-2457-7651-7496-9966.dynamic-ip6.hinet.net (2001-b011-380f-14b9-2457-7651-7496-9966.dynamic-ip6.hinet.net. [2001:b011:380f:14b9:2457:7651:7496:9966]) by smtp.gmail.com with ESMTPSA id a8sm59129305pfo.144.2019.04.10.00.47.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 00:47:17 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: [PATCH] misc: rtsx: Fixed rts5260 power saving parameter and sd glitch From: Kai-Heng Feng In-Reply-To: <20190402085607.32165-1-ricky_wu@realtek.com> Date: Wed, 10 Apr 2019 15:47:14 +0800 Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <9B165235-7B33-44C1-80C5-49E28E9873A8@canonical.com> References: <20190402085607.32165-1-ricky_wu@realtek.com> To: =?utf-8?B?5ZCz5piK5r6EIFJpY2t5?= X-Mailer: Apple Mail (2.3445.104.8) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 16:56, ricky_wu@realtek.com wrote: > From: RickyWu > > this patch fixes rts5260 power saving parameter > make power saving function work on L1.1, L1.2 > > Signed-off-by: RickyWu > --- > drivers/misc/cardreader/rts5260.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > > diff --git a/drivers/misc/cardreader/rts5260.c > b/drivers/misc/cardreader/rts5260.c > index da22bcb62b04..b510d3f46587 100644 > --- a/drivers/misc/cardreader/rts5260.c > +++ b/drivers/misc/cardreader/rts5260.c > @@ -195,7 +195,7 @@ static int sd_set_sample_push_timing_sd30(struct > rtsx_pcr *pcr) > | SD_ASYNC_FIFO_NOT_RST, SD_30_MODE | SD_ASYNC_FIFO_NOT_RST); > rtsx_pci_write_register(pcr, CLK_CTL, CLK_LOW_FREQ, CLK_LOW_FREQ); > rtsx_pci_write_register(pcr, CARD_CLK_SOURCE, 0xFF, > - CRC_VAR_CLK0 | SD30_FIX_CLK | SAMPLE_VAR_CLK1); > + CRC_VAR_CLK0 | SD30_FIX_CLK | SAMPLE_VAR_CLK1); Just a nit, seems to be an unnecessary change. > rtsx_pci_write_register(pcr, CLK_CTL, CLK_LOW_FREQ, 0); > > return 0; > @@ -238,8 +238,8 @@ static int rts5260_card_power_on(struct rtsx_pcr > *pcr, int card) > /* Reset SD_CFG3 register */ > rtsx_pci_write_register(pcr, SD_CFG3, SD30_CLK_END_EN, 0); > rtsx_pci_write_register(pcr, REG_SD_STOP_SDCLK_CFG, > - SD30_CLK_STOP_CFG_EN | SD30_CLK_STOP_CFG1 | > - SD30_CLK_STOP_CFG0, 0); > + SD30_CLK_STOP_CFG_EN | SD30_CLK_STOP_CFG1 | > + SD30_CLK_STOP_CFG0, 0); Ditto. > > rtsx_pci_write_register(pcr, REG_PRE_RW_MODE, EN_INFINITE_MODE, 0); > > @@ -315,12 +315,12 @@ static void rts5260_init_ocp(struct rtsx_pcr *pcr) > > > rtsx_pci_write_register(pcr, RTS5260_DVCC_CTRL, > - RTS5260_DVCC_OCP_THD_MASK, > - option->sd_800mA_ocp_thd); > + RTS5260_DVCC_OCP_THD_MASK, > + option->sd_800mA_ocp_thd); Ditto. > > rtsx_pci_write_register(pcr, RTS5260_DV331812_CFG, > - RTS5260_DV331812_OCP_THD_MASK, > - RTS5260_DV331812_OCP_THD_270); > + RTS5260_DV331812_OCP_THD_MASK, > + RTS5260_DV331812_OCP_THD_270); Ditto. That said, the patch works, Tested-by: Kai-Heng Feng > > mask = SD_OCP_GLITCH_MASK; > val = pcr->hw_param.ocp_glitch; > @@ -451,6 +451,7 @@ static void rts5260_pwr_saving_setting(struct > rtsx_pcr *pcr) > lss_l1_2 = rtsx_check_dev_flag(pcr, ASPM_L1_2_EN) > | rtsx_check_dev_flag(pcr, PM_L1_2_EN); > > + rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, 0xFF, 0); > if (lss_l1_2) { > pcr_dbg(pcr, "Set parameters for L1.2."); > rtsx_pci_write_register(pcr, PWR_GLOBAL_CTRL, > @@ -573,10 +574,10 @@ static int rts5260_extra_init_hw(struct rtsx_pcr > *pcr) > * to drive low, and we forcibly request clock. > */ > if (option->force_clkreq_0) > - rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, > + rtsx_pci_write_register(pcr, PETXCFG, > FORCE_CLKREQ_DELINK_MASK, FORCE_CLKREQ_LOW); > else > - rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, > + rtsx_pci_write_register(pcr, PETXCFG, > FORCE_CLKREQ_DELINK_MASK, FORCE_CLKREQ_HIGH); > > return 0; > @@ -704,7 +705,7 @@ void rts5260_init_params(struct rtsx_pcr *pcr) > option->ocp_en = 1; > if (option->ocp_en) > hw_param->interrupt_en |= SD_OC_INT_EN; > - hw_param->ocp_glitch = SDVIO_OCP_GLITCH_800U | SDVIO_OCP_GLITCH_800U; > + hw_param->ocp_glitch = SD_OCP_GLITCH_100U | SDVIO_OCP_GLITCH_800U; > option->sd_400mA_ocp_thd = RTS5260_DVCC_OCP_THD_550; > option->sd_800mA_ocp_thd = RTS5260_DVCC_OCP_THD_970; > } > -- > 2.17.1