Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2402750rdb; Tue, 12 Sep 2023 00:04:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVkX2a+GKVFHpRk66NhF+AyuCMQN7M5+zZ06XO3oonI+r4Guf64ttJXAHSRrcYl/Pte0Ln X-Received: by 2002:a17:90a:c246:b0:273:e26b:47a with SMTP id d6-20020a17090ac24600b00273e26b047amr2022452pjx.24.1694502269393; Tue, 12 Sep 2023 00:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694502269; cv=none; d=google.com; s=arc-20160816; b=t3mYhcMulr+AQCrDqueoFLQfz/wQYdi4vd3z1PjYz8PYm4P0bT17ju9stIbX0mytiq HeAsVahzCaEVd8SmgkXU6p+91qVAZKKkEFzqd4Yb3bGO8gwkPp6S6Oj95ntK94dzFtf2 EW+8cRxxfI2+UZfQxiDhzPhXmrOx979LqwpGgCvQ5EhXIy52iHne6QuOJWxkEVehxQAp qzplY7XC++IaSbZUUFXkzmQpk65UV6gQ9qhW1YSAzDnAo+X9zA6hnDO7UyEAZToe5VVU /rGl/5hW9yfD52rjhPR+Wr0FtwcF2F+TnN1h1ecyCO0/qpqeNG90M6Da5qj/xMioe5jw 3CVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=snUK6IGdcPPH31oyrmWJb6PGm1SWgHHvAW8FtA1dRGY=; fh=7xbNZwTym+CKkW9darKiAIrlxwrHvdD9/+5rIv88u2Q=; b=0pzbiwn5PkZvTUX9MGWsZx4AamEg5QSRd7PWVDjMeWJSr03WjNWB/DtmNwjsOsWzH7 UEzEQXnpB2wrNW8Jb1UFtozVeM5kunSn+3mdnTqNQmeZu65a+oABO1Yek91J2Apk3UPF 618pYnbuLrIWUtjr4JZjETsuEelJaPw8G1oIIA4r3xyBaLjxMCPyZRCFvaXl+NToOsEQ Rs5VSls0fYW/KoWaX8bSfJAke2gG2GkFd+wlk2+jE/ao9A2SHs4bswEx5JXu4/XgpOOg 7Mnq3DGEeifOyS0YNELIBkPWfI3ndzDjHvm9p48BpvRDY1bkn9p+vFtUSSluP3u3X3TO J6sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=fsW1QIIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id hi17-20020a17090b30d100b00261326aa56esi7485258pjb.5.2023.09.12.00.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:04:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=fsW1QIIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5DC30802209B; Mon, 11 Sep 2023 21:54:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbjILExf (ORCPT + 99 others); Tue, 12 Sep 2023 00:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjILEwp (ORCPT ); Tue, 12 Sep 2023 00:52:45 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3DBA10E0 for ; Mon, 11 Sep 2023 21:52:34 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-52683b68c2fso6763830a12.0 for ; Mon, 11 Sep 2023 21:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1694494353; x=1695099153; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=snUK6IGdcPPH31oyrmWJb6PGm1SWgHHvAW8FtA1dRGY=; b=fsW1QIISAkwqEOyPM4pIHtQSBHEsdVvarIyjLfevy+I2Y9vxrk28aWiUw+xLRreBs7 044622wXMwW7F0dIWDcx/z9x0r3QJEDCCFcHITMoLpHSQd1K4BqWLuLb7YNXRote2/4I YWH7YbZ0naRlCUZh9cBl241mMtqtSJ7JBTgLav9jMmDan0LVBd8c6/pw4e7EJTh/rTuZ 3+1pam1xeoePQNGiQtNU454gmeF+f+Y2YE284N22dYQuw5ofaxaR8nBrHpvvBTMCOhcJ 8dbNueD60OMaiylDGMPWZsYUVaQ8SrS6NzQzJoLCAes/h0YXwG+zjayEd8muL/0R/KEb 5hRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694494353; x=1695099153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=snUK6IGdcPPH31oyrmWJb6PGm1SWgHHvAW8FtA1dRGY=; b=r+mGh0KuO19q91zrKMiAoqxC4BXsenE7UYYgsMihU5h2XL841ebVns2qJSd/Pn3y6f T3hUPt4EF6/ybSq0lYbj1heq+MQIWUjf4RX2iIG8ybcNvs3h1e55cZt23VwhOivhHhVo eMyBkRzF24ipUuKcSOLS02dg6fpkYUORUdusdhurIA1q0LfPc9RqzUW31U3sBRQ3Tbx7 7vpGck4qwZD3ZAnMVG6GPdQFs/+xTeWzkAr9GxmdhClf/aON6x08mX5lFYHKSrjvce6c iKAZYkbrd6HHWabULDtBe7Ys7Kb6G63Nji6rixre9kTqcIiucHse8DrKQcMf8zFfzg29 950A== X-Gm-Message-State: AOJu0YypPEbt0XkQSNBiK56WWUtX0hFaLn7R8qMAYNKwOTbzXqPmUS8d go91A54wcYkVvJRySYETmTdD2g== X-Received: by 2002:aa7:df08:0:b0:52e:585a:e9c with SMTP id c8-20020aa7df08000000b0052e585a0e9cmr8579509edy.2.1694494353384; Mon, 11 Sep 2023 21:52:33 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.145]) by smtp.gmail.com with ESMTPSA id f21-20020a05640214d500b0051e22660835sm5422415edx.46.2023.09.11.21.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 21:52:33 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, magnus.damm@gmail.com, catalin.marinas@arm.com, will@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com, quic_bjorande@quicinc.com, arnd@arndb.de, konrad.dybcio@linaro.org, neil.armstrong@linaro.org, nfraprado@collabora.com, rafal@milecki.pl, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea Subject: [PATCH 08/37] clk: renesas: rzg2l: trust value returned by hardware Date: Tue, 12 Sep 2023 07:51:28 +0300 Message-Id: <20230912045157.177966-9-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> References: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (morse.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:54:02 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email From: Claudiu Beznea Initial value of CPG_PL2SDHI_DSEL bits 0..1 or 4..6 is 01b. Hardware user's manual (r01uh0914ej0130-rzg2l-rzg2lc.pdf) specifies that setting 0 is prohibited. The rzg2l_cpg_sd_clk_mux_get_parent() should just read CPG_PL2SDHI_DSEL, trust the value and return the proper clock parent index based on the read value. Do this. Fixes: eaff33646f4cb ("clk: renesas: rzg2l: Add SDHI clk mux support") Signed-off-by: Claudiu Beznea --- drivers/clk/renesas/rzg2l-cpg.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index 1195d4b1f545..d0d086d6dc51 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -239,14 +239,8 @@ static u8 rzg2l_cpg_sd_clk_mux_get_parent(struct clk_hw *hw) val >>= GET_SHIFT(hwdata->conf); val &= GENMASK(GET_WIDTH(hwdata->conf) - 1, 0); - if (val) { - val--; - } else { - /* Prohibited clk source, change it to 533 MHz(reset value) */ - rzg2l_cpg_sd_clk_mux_set_parent(hw, 0); - } - return val; + return val ? --val : val; } static const struct clk_ops rzg2l_cpg_sd_clk_mux_ops = { -- 2.39.2