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 C3286C4828C 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=qzrDjc7qohNZ9fbuSFHSTorI0ul6I3eXPpsLzfcQWK0=; b=kjsxGe7gBoPvLh vLsLHDwbR31O8Oa9eK3KVnLaOCo6aPX6LcFIctPe+IewuOrSrWToPYHOoGp5tdf+pE1WDpMEVdajY X/PoOtbc1/6M6mjdAL3kpX9Qovgm6xOoftuk2ewBTwCx4Y77W5QyvvGLxQl6IdGqPU27hqMCCjdhm sM/GxllNdpkXuTCcll0oREY6cpYKj7gzRAoCDjc4ej56I3mHe8fpgrpZL5D+NYuuMP694Su1H7uRN ZdBD+9RLhd4kP6vZ6hSCy0v3SwE11RgI3O6YrvJ/AeilL3kimDgRZ64rXjljDMC8WAVyAx2QC4rUW qf+Wrx55XfMgcdk0+fEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTojc-000000087ub-1vnV; Sat, 27 Jan 2024 19:53:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSeHz-003gkz-0n for linux-i3c@lists.infradead.org; Wed, 24 Jan 2024 14:31:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BFAF961D97; Wed, 24 Jan 2024 14:31:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C32DAC43399; Wed, 24 Jan 2024 14:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706106698; bh=ghddF2k3WHRpc3ghPsVmfoFfwi8mMPeqg4/NlpEp0SY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1vlB6odbn2JzowgbW0bl1iJRF4jSTaDoVWQRBq9wRrGK0GEISc9XaihQ24ZLDNPD NKqWk5LWcSAHThX0rFQtA6oPO83fqLScStQEZy5xmQlQXHGDQmLMwf9UnNHzec1jV6 AdvJK/O4m2RUXAJfcyd6plYLPqoEhG4b1Pjn+8fVnee46KlBRqX4BFx6EOXyS7Gnhj FwDTIqSXx4tQMtOYUzZxM2lUlZQwceyzviUe4MD0lnKneLq04MCNMVZ6RHstYcwc6/ 9Ng2A/RMlM9uq4gm2AvToieWk7SAzVxFhRikPlad/IUDgJc9LKFcOmkRHg63MSCYWa rfv3bYWE84uIw== 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.4 5/6] i3c: master: cdns: Update maximum prescaler value for i2c clock Date: Wed, 24 Jan 2024 09:31:14 -0500 Message-ID: <20240124143124.1284462-5-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124143124.1284462-1-sashal@kernel.org> References: <20240124143124.1284462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.267 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_063139_351569_D3B62EA5 X-CRM114-Status: UNSURE ( 9.75 ) 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 cc0944e2d330..6e0621e730fa 100644 --- a/drivers/i3c/master/i3c-master-cdns.c +++ b/drivers/i3c/master/i3c-master-cdns.c @@ -74,7 +74,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) @@ -1212,7 +1213,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); @@ -1225,7 +1226,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