Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3862434rdg; Wed, 18 Oct 2023 08:06:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwD20rQM6POozfKV4KWTN8lz4av/Udbsd/3sdf0xL6t6+8NbdZpTMfsEvRVLRQvHCZQ/M+ X-Received: by 2002:a17:902:d546:b0:1c7:8345:f377 with SMTP id z6-20020a170902d54600b001c78345f377mr6584588plf.29.1697641618496; Wed, 18 Oct 2023 08:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697641618; cv=none; d=google.com; s=arc-20160816; b=Uz78zdm3K/G926tHd0r3hUofttIkZMy0AavAqpe/0ceKofjix16spiBFFl+bHVirgx meytrJqHv/flSRFomy9S/y2w2ySBsMjrt13ViAJznEFfsRDruuAdF4e098RUXsb8VDY6 rT/Gow0PuIlCDF/VFIhjIQjNbxHyD8HdDu/P8ux1fq6bdEnQL14W2X2mj/EEW5ZJrIPi i07QoRNTqHynLuBNOwtZZeUBzgRw/8hyMPtTIC1kyPDSqrtK8wtO20q2Fq1ktFxadYkV TlWH4ApE4C/HAiHl6rs7qyGXc3TNPrD+pDgH4YsPC07uUig2Kv+7qH6JkG9rBqHjaPcv Q49w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VI+zA7EFh2CkMcaj/t1Gods+GsAIVSa4QUCPKpuznF0=; fh=7OhFJ3mCPzpdZBoDt5ObhzM8xzuVF7Vf6QqDCXgBytU=; b=Iicj8Krdg15dv7gCaUmkiMsR9aP011FfNArbfwFuwsd86ImrwwmjB+G9J67WtHCjYL EIj/a4TcxKlS7RR1aONJhCy0ovx7IdWy2fx+scW8sJ2zK3V1wFgV/gBgFm5kZF2Moeie 7DlKTvdggIVWmFOPXy+UlF4tK5AF160eDiURPj5am6KfZ/19jbbkiAXx0gJEqMxm88F0 0IZu4Wnr0AWXnamg99XsU38Mnc16xQGfSBtB38J/JENrMWl3gUrheojZ2gV+THoNHr/G 5myebqqk9QD15HLoftypJRmjaEnhvwpIbSpjIBknFoE6WEvyBVXQzZYIRhnf//SSv+P6 xz5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kK8ExdXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m4-20020a170902db0400b001c7755dccbcsi24625plx.619.2023.10.18.08.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kK8ExdXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9F648802956E; Wed, 18 Oct 2023 08:06:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344643AbjJRPGs (ORCPT + 99 others); Wed, 18 Oct 2023 11:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbjJRPGr (ORCPT ); Wed, 18 Oct 2023 11:06:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF1D94; Wed, 18 Oct 2023 08:06:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44B40C433C7; Wed, 18 Oct 2023 15:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697641605; bh=KnA7zFpFIl0gSz7qkNqGqWHblOvAj6N6q/W+BHe+eQw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kK8ExdXVtOOjl7Fx+mzoMS+qIkBWE4ob9vQGiBLMaV31jC8e6bFAbE2uYkJ0W+ukk ZQoFtiHg/yEggnDaQfTnDmEepFGEX69N/rxUVn/Cn2Pi1zQ5RNmbx3wP3ZMO+xArZ6 iHsfOq3qPZcpWXtpA/Eu48qDF/EtRDXgC50px0uIalWs6fPe/FXk1ld7CJPw7YPnTI ZvXwSnLrZOEApCBae7B8udYh9r2V6HdfKHutmn0QfleSFm5rT5iuapq1b95ZB+WKZO rXzGzf/v17y8MVM2FZB4qRT79pCUecrb/q8eTVZPSHzSPARbwyZMRy0S/KoRn3okjz zKfDWLo6Km3QQ== Message-ID: Date: Thu, 19 Oct 2023 00:06:43 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 11/26] PM / devfreq: rockchip-dfi: Handle LPDDR2 correctly Content-Language: en-US To: Sascha Hauer , linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Robin Murphy , Vincent Legoll , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Sebastian Reichel , Jonathan Cameron , Chanwoo Choi References: <20231018061714.3553817-1-s.hauer@pengutronix.de> <20231018061714.3553817-12-s.hauer@pengutronix.de> From: Chanwoo Choi In-Reply-To: <20231018061714.3553817-12-s.hauer@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 08:06:55 -0700 (PDT) On 23. 10. 18. 15:16, Sascha Hauer wrote: > According to the downstream driver the DDRMON_CTRL_LPDDR23 bit must be > set for both LPDDR2 and LPDDR3. Add the missing LPDDR2 case and while > at it turn the if/else if/else into switch/case which makes it easier > to read. > > Reviewed-by: Jonathan Cameron > Reviewed-by: Sebastian Reichel > Acked-by: Chanwoo Choi > Signed-off-by: Sascha Hauer > --- > drivers/devfreq/event/rockchip-dfi.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c > index 571d72d1abd1c..8ce0191552ef1 100644 > --- a/drivers/devfreq/event/rockchip-dfi.c > +++ b/drivers/devfreq/event/rockchip-dfi.c > @@ -83,12 +83,19 @@ static void rockchip_dfi_start_hardware_counter(struct devfreq_event_dev *edev) > DDRMON_CTRL_HARDWARE_EN), dfi_regs + DDRMON_CTRL); > > /* set ddr type to dfi */ > - if (dfi->ddr_type == ROCKCHIP_DDRTYPE_LPDDR3) > + switch (dfi->ddr_type) { > + case ROCKCHIP_DDRTYPE_LPDDR2: > + case ROCKCHIP_DDRTYPE_LPDDR3: > writel_relaxed(HIWORD_UPDATE(DDRMON_CTRL_LPDDR23, DDRMON_CTRL_DDR_TYPE_MASK), > dfi_regs + DDRMON_CTRL); > - else if (dfi->ddr_type == ROCKCHIP_DDRTYPE_LPDDR4) > + break; > + case ROCKCHIP_DDRTYPE_LPDDR4: > writel_relaxed(HIWORD_UPDATE(DDRMON_CTRL_LPDDR4, DDRMON_CTRL_DDR_TYPE_MASK), > dfi_regs + DDRMON_CTRL); > + break; > + default: > + break; > + } > > /* enable count, use software mode */ > writel_relaxed(HIWORD_UPDATE(DDRMON_CTRL_SOFTWARE_EN, DDRMON_CTRL_SOFTWARE_EN), Acked-by: Chanwoo Choi -- Best Regards, Samsung Electronics Chanwoo Choi