From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B974C433F5 for ; Mon, 11 Oct 2021 11:39:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07ECF60EE2 for ; Mon, 11 Oct 2021 11:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 07ECF60EE2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ReIGozMo9rlQx4dYN0NoBoPH+QvZ5gOyoNHXbxOgwj0=; b=XLsXs1tsj/Luj6 8XIoe/kkxShslykyQd747aKonrKVPdHut8ztqBoIOEgPHFBpY/Oz1E6Z27OzSMCt1E5EJKEb2HUZv tm2vpyBuRyhOWZxpJafYLOvoqOFWttribkwytSYlRjxq5GdJ2w7gOQ6xEFbnybGfthIk7bH0A2J62 sLtfC7mWSHco6iamVZvvak5Il00Q7Zf8GWHM+8eRwEjlq64gmKzTHquyZa/4JMZdF1Bs8zXG53cp6 tVUbrAAUMb5dFV92PLMpp6qNsaqbUPq4q7ESYQq6m78isQTBTC/D75lSLtR0KFDmO+uGUh2GjZ2eu 0zo48ayDB5M4sRQ/m/rg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZtbf-009790-FF; Mon, 11 Oct 2021 11:36:36 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZtTI-0093rl-1U for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 11:27:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1633951675; x=1665487675; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tJKSBuOTBiBd8Y63je4r0LFxJcPueVYGL0ehIQ+Ul8U=; b=YkxTRhLdBq81Ox4F4VdQUOavctNKzaAnZCIQCCCf3TWsHdAZQKtQ4NJt Mvqp4jyghWtpcE40X1rjGZ8ujPPnsq0LV2Qctex0ZxN6tTa+vz/nSFwwG t7ekbljw0vBhhBeA0GLH9l4w8RacEJYfZWZZV4N8XXtbD/3Zjz7xVpX4v PNIC+2NgP8Skc8F6HroUrDJV9+oxx72E7DHRmfoADlZLTy2ofmLoyISHI KouWjMAwRn78bnLGrkpFPK+K0M5VVyVO71SwUxLt5AKTsACi+Q/Eux9ix cmM0WD2IIzycStqU4B8IvCgchCeGsGTqOMZuoN/9QTVq4taOmXMI8kZJ+ g==; IronPort-SDR: VCoDX2ERDPkTIB5pgT35k71Q/tE7n2PVecXTvpSHn3uOeljstA19W3IlwvkhFYU5kOs+eRkhLi F+g/L3kwgPhTz21G59sapAONsw7b3BPpsUI2BNLQUJ76ENNZvC/usB0QXyoMVn8LcDtH1Ugr4G 2XN+acxGt3mDzu6ZAT2lTmIVkuLKmYV0I4g9imefWUyOnZaGHhEm2SKDr0sYi9sAzezBoInAh2 +jx2rMBalVhjPbLILow/krBxluvBtVeGBRVB/S0i09ADpTiz96sl7ppHLP7aKgOqvHZRgVdOBg V3gxqq7p4t20ETcMM5cqiRNn X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="147591050" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Oct 2021 04:27:55 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 11 Oct 2021 04:27:55 -0700 Received: from rob-dk-mpu01.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 11 Oct 2021 04:27:52 -0700 From: Claudiu Beznea To: , , , , CC: , , , Claudiu Beznea Subject: [PATCH v5 10/15] clk: at91: clk-master: fix prescaler logic Date: Mon, 11 Oct 2021 14:27:14 +0300 Message-ID: <20211011112719.3951784-11-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011112719.3951784-1-claudiu.beznea@microchip.com> References: <20211011112719.3951784-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_042756_132170_0424967F X-CRM114-Status: GOOD ( 10.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When prescaler value read from register is MASTER_PRES_MAX it means that the input clock will be divided by 3. Fix the code to reflect this. Fixes: 7a110b9107ed8 ("clk: at91: clk-master: re-factor master clock") Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index 6da9ae34313a..e67bcd03a827 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -386,7 +386,7 @@ static unsigned long clk_master_pres_recalc_rate(struct clk_hw *hw, val &= master->layout->mask; pres = (val >> master->layout->pres_shift) & MASTER_PRES_MASK; - if (pres == 3 && characteristics->have_div3_pres) + if (pres == MASTER_PRES_MAX && characteristics->have_div3_pres) pres = 3; else pres = (1 << pres); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel