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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1712FC4828A for ; Sat, 27 Jan 2024 19:53:00 +0000 (UTC) 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=6k2HQuJESUI7jVbKN7xWdujKMMB82ED6dyxMjh/Qv5Y=; b=l+dKdGQ/GTlb4E yFU1446OOgxajsY6hdKFI9gyRTjLLpaW3YYi33BEe1T8m6VP8loSC5lFB7L9+WUuxrA35KckLVqk8 2bV2wDLFMbd5clUATogViOc9T3BIJoXnChuYz17+LY0CmovFM9JKsXpYT3kOgBg/UTcpwc9GLnGwf Nl2oo7aXc4m+WmsqQoT0M/ee6xJah8wfUUu7eMqCsIflbfLst66yIrGuFp6VJM92t+9uV/+wIJyEo Ke4OaIGf6LM/hD+UOt8Mj0zKIfKgZEIVgpSdZsh58pHMyZ5DFR0JQ80xK2FgwZikt+f1e1ju7mz1J SWxJ0mrrvHyKfjy431kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTojb-000000087u3-35A7; Sat, 27 Jan 2024 19:52:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSeH5-003gIw-2B for linux-i3c@lists.infradead.org; Wed, 24 Jan 2024 14:30:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3632261D78; Wed, 24 Jan 2024 14:30:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D2F4C433B2; Wed, 24 Jan 2024 14:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706106643; bh=t0RZzSt1jjBgxGY4o0ZkWqVOeUyWAuIDWOZJMVJzbJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tu4DTE8DmWsnv51jiEwStonyfqVFSonzTNMqkY20sUeuBShZ2V2Xp4ppnLY4RY5ko ST+HpRvJjHKBCxG0ekWmKUI/2Pk+97E694PPBOLa83ZExnuk+hmalN/jgxZcHO2UAi h0SrRabyab9eJw8TEGyxDtEhi7OZYSU04y2qMhmgLktShYxcTizH7lzFVfa5QxTuMk HyNKZzoYjpDGXRkoqDlm2GqbjFvusd7dw79fW+YD8ccKN4NKUzCNRMfeP4Gcewvn0c h3fQKRJGENcJQa85aNiiwpJVHUc/XaRnw0SZWwSwQDVcoCBTdSD6quBAmEyeVxInlf /h9SS2kuSPE/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Harshit Shah , Alexandre Belloni , Sasha Levin , pgaj@cadence.com, linux-i3c@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 6/9] i3c: master: cdns: Update maximum prescaler value for i2c clock Date: Wed, 24 Jan 2024 09:30:09 -0500 Message-ID: <20240124143024.1284046-6-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124143024.1284046-1-sashal@kernel.org> References: <20240124143024.1284046-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.147 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_063043_761046_D0F8938B X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-Mailman-Approved-At: Sat, 27 Jan 2024 11:52:56 -0800 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org From: Harshit Shah [ Upstream commit 374c13f9080a1b9835a5ed3e7bea93cf8e2dc262 ] As per the Cadence IP document fixed the I2C clock divider value limit from 16 bits instead of 10 bits. Without this change setting up the I2C clock to low frequencies will not work as the prescaler value might be greater than 10 bit number. I3C clock divider value is 10 bits only. Updating the macro names for both. Signed-off-by: Harshit Shah Link: https://lore.kernel.org/r/1703927483-28682-1-git-send-email-harshitshah.opendev@gmail.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/i3c/master/i3c-master-cdns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c index 4a49c75a9408..b9cfda6ae9ae 100644 --- a/drivers/i3c/master/i3c-master-cdns.c +++ b/drivers/i3c/master/i3c-master-cdns.c @@ -77,7 +77,8 @@ #define PRESCL_CTRL0 0x14 #define PRESCL_CTRL0_I2C(x) ((x) << 16) #define PRESCL_CTRL0_I3C(x) (x) -#define PRESCL_CTRL0_MAX GENMASK(9, 0) +#define PRESCL_CTRL0_I3C_MAX GENMASK(9, 0) +#define PRESCL_CTRL0_I2C_MAX GENMASK(15, 0) #define PRESCL_CTRL1 0x18 #define PRESCL_CTRL1_PP_LOW_MASK GENMASK(15, 8) @@ -1234,7 +1235,7 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m) return -EINVAL; pres = DIV_ROUND_UP(sysclk_rate, (bus->scl_rate.i3c * 4)) - 1; - if (pres > PRESCL_CTRL0_MAX) + if (pres > PRESCL_CTRL0_I3C_MAX) return -ERANGE; bus->scl_rate.i3c = sysclk_rate / ((pres + 1) * 4); @@ -1247,7 +1248,7 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m) max_i2cfreq = bus->scl_rate.i2c; pres = (sysclk_rate / (max_i2cfreq * 5)) - 1; - if (pres > PRESCL_CTRL0_MAX) + if (pres > PRESCL_CTRL0_I2C_MAX) return -ERANGE; bus->scl_rate.i2c = sysclk_rate / ((pres + 1) * 5); -- 2.43.0 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c