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 D9F14C47DA9 for ; Sat, 27 Jan 2024 19:52:59 +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=xoz1WiAczcCGCe AOMAq1Q18mL+ZUmhQo3K9KbdFpyuTvEyHJeZFiUQHrWsErMQ+aaIir/vCKm4jTpL7JGp3ds1fTkX5 MZIscX2GunnJI+/m4hZ2twJ8/3GrmKXXg7jdrdYubdSsDVUvWz6Cau8V4NGcnyJre19E41bAdFhsp +SLyE4KIuZbn+T7JCT7UK3yNOW1KO9HRCeMEHiKsy+JKeopGpmOA1tmwj3tiqwd+p2QmWi/yOu9jt X16A/1bkL4fDd1c2J4w7XX8+8wzy2N0Y0JKX6OrEbeZyDI6XaSD5lVy90S64kMj9b44K7MuAnWrAL mACWGSPAAIyEk0FBaKAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTojb-000000087tj-1aFe; 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 1rSeGW-003g3U-1i for linux-i3c@lists.infradead.org; Wed, 24 Jan 2024 14:30:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 08B5161D71; Wed, 24 Jan 2024 14:30:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01096C433C7; Wed, 24 Jan 2024 14:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706106607; bh=t0RZzSt1jjBgxGY4o0ZkWqVOeUyWAuIDWOZJMVJzbJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MF3sMOWC/o7kL65lcLIvl3X8KVM1RRu6X1HMm2jIhYNHGDFkzpJolcjK29FNi3cfN U2iQtQXHQjvfOIj+LDAc+eqRe1EeDP2KTR2T8pdFuaZcpUYJJJWNEPPcrYPOWpfotn DQrXNZgzjJtDIMKa9TjU0WZpYs36tj5l+z3lZQDf3oNvl7YR1cBXp4CKKQV02Si540 HG3imkrbO2vDoDV8/UvWd+ZGuuA7jEZ6OBXbolQ13TcMYOo0KcTNF9tWZ3hFav9r/4 ymAdZzAdqxgGzjvfWp6ShnU4EtYSXKGmorz+5cK1xMPTYtr4gDWoh1IMJlMxSU75eZ mtDXmfo/oiyJw== 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 6.1 6/9] i3c: master: cdns: Update maximum prescaler value for i2c clock Date: Wed, 24 Jan 2024 09:29:36 -0500 Message-ID: <20240124142949.1283818-6-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124142949.1283818-1-sashal@kernel.org> References: <20240124142949.1283818-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.74 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_063008_672442_71CC6966 X-CRM114-Status: UNSURE ( 9.67 ) 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