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 A70F1CCD184 for ; Sun, 19 Oct 2025 23:23:20 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tvUAznWpP4YGmaDrt4WAKUn27r+gHq4yXqE8RmElSWc=; b=N1tX6zZJo7xKN1 qz/8OmdNq0b7WlnM46gDuZ/7QeA2jNjN2etxQxrF/8s7RKTzCiot9iwfrk2tlnEB3WuEAUv7bieYJ SjzghjRX6e+KMfn0vjWxXKzJYizlbJ8cV2exGNWHrHjyBlY+YnNEDyH2Y+ApQME0RjKMNBvzYI9cd GmRsiMXUEsYyG3ixGt9j5y8hjMKgwONoPo9C6tuKpsfhO2XdMO1OsUrqRcOvJgdg74jKmLufwqeVC wJ3kvAXnvAEBF+pMxYWzxtYreNdHAAqxFHhQ6433LNNGwuGLrc5FincjcluMwIikJIQlcMEW5aD3e 8Ehj+khgB6KoM0lTCeVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vAcjr-0000000BX6Y-3cfd; Sun, 19 Oct 2025 23:23:00 +0000 Received: from woodpecker.gentoo.org ([140.211.166.183] helo=smtp.gentoo.org) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vAcjp-0000000BX6B-2BB5 for linux-riscv@lists.infradead.org; Sun, 19 Oct 2025 23:22:58 +0000 Received: from localhost (unknown [116.232.147.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dlan) by smtp.gentoo.org (Postfix) with ESMTPSA id B96F13415C7; Sun, 19 Oct 2025 23:22:53 +0000 (UTC) Date: Mon, 20 Oct 2025 07:22:43 +0800 From: Yixun Lan To: Troy Mitchell Cc: Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev Subject: Re: [PATCH v4] i2c: spacemit: configure ILCR for accurate SCL frequency Message-ID: <20251019232243-GYA1506524@gentoo.org> References: <20251017-k1-i2c-ilcr-v4-1-eed4903ecdb9@linux.spacemit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20251017-k1-i2c-ilcr-v4-1-eed4903ecdb9@linux.spacemit.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251019_162257_599596_1B0B4337 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 15:27 Fri 17 Oct , Troy Mitchell wrote: > The SpacemiT I2C controller's SCL (Serial Clock Line) frequency for > master mode operations is determined by the ILCR (I2C Load Count Register). > Previously, the driver relied on the hardware's reset default > values for this register. > > The hardware's default ILCR values (SLV=0x156, FLV=0x5d) yield SCL > frequencies lower than intended. For example, with the default > 31.5 MHz input clock, these default settings result in an SCL > frequency of approximately 93 kHz (standard mode) when targeting 100 kHz, > and approximately 338 kHz (fast mode) when targeting 400 kHz. > These frequencies are below the 100 kHz/400 kHz nominal speeds. > > This patch integrates the SCL frequency management into > the Common Clock Framework (CCF). Specifically, the ILCR register, > which acts as a frequency divider for the SCL clock, is now registered > as a managed clock (scl_clk) within the CCF. > > This patch also cleans up unnecessary whitespace > in the included header files. > > Signed-off-by: Troy Mitchell Reviewed-by: Yixun Lan > --- > Changelog in v4: > - initialize clk_init_data with {} so that init.flags is implicitly set to 0 > - minor cleanup and style fixes for better readability > - remove unused spacemit_i2c_scl_clk_exclusive_put() cleanup callback > - replace clk_set_rate_exclusive()/clk_rate_exclusive_put() pair with clk_set_rate() > - simplify LCR LV field macros by using FIELD_GET/FIELD_MAX helpers > - Link to v3: https://lore.kernel.org/all/20250814-k1-i2c-ilcr-v3-1-317723e74bcd@linux.spacemit.com/ .. -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv