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 4D11BC9EC90 for ; Mon, 12 Jan 2026 13:49:33 +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=Rme+WYKL/QAjzZ/wF0rd2oJO6dKyxJhVktwLHHT5maM=; b=m8FybrsynIHRw5 wQ6ShIw0qq9E3+Wc8zrdjx+iOr95EsZyNaiBHdRXfGzZhUp1PQog1kbP8ag5WhUCwXmgl/YmZFhdz KmoSXDEl/DHd1+KMMCKBQql7Fr1O/YTXii9Mmu/VhEYbNieZ0lIntGqyrUW2fFjYtcA8dCz8AG/qS 0nHGJLM3oH8YsmANCklNJxzHcM9wtfGRfErPlMaAvDp/nybmgY7F3fGa40O/HgrjM2NoZ78PWe6Kb eQK5g+Ayl7nkIL8MWof+nJzxiHFv3fg6Tb1RDeDcMdRGEArpD3g6R4M1xlAeEBEfkfFGP7kt27lu+ RysdnGJrQpMljv4JYTDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vfIIR-00000005Rm5-3BQm; Mon, 12 Jan 2026 13:49:27 +0000 Received: from mgamail.intel.com ([192.198.163.16]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vfIIG-00000005RVV-1dhS; Mon, 12 Jan 2026 13:49:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768225756; x=1799761756; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JHnL0FZuz2kBPQyoqrsR5hXiCOc45yoxM7G5SyPLrLw=; b=k0Mi+whWT61BdNbzCYMnIrPCz9FtWbyWz5tGH5mMU4EH29lXbWJCuf+s DmdM87GJpRc4e496+Q13TUvQwOXbybUFen7GavFRKfwpFghygbK2bwszl N3pXQC5Kg4q7+oxw53Purt2qPgz8EGgaKMc/Mzd2aHfU9hWJWtD67qBK0 uTqU945hKm+ZE3dFFBByLQkz328+XkmdN0OiV6KHEi7tty6oPOyKqVIWP 889bmIu5UihF1Bwo7jvl/zcEBoivCXx43Ckex0ABJqVpCJa4psi7UxVCa +dbswfFXIyrPKCrq95t59uEujrE+QGgbWNgD5DaFzykg7n726q9wLLD+h Q==; X-CSE-ConnectionGUID: DlCWcSVQSDWJ+V76fL3DEA== X-CSE-MsgGUID: +DNUD4sBR2SuIA57O+9IIg== X-IronPort-AV: E=McAfee;i="6800,10657,11669"; a="57048316" X-IronPort-AV: E=Sophos;i="6.21,221,1763452800"; d="scan'208";a="57048316" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2026 05:49:16 -0800 X-CSE-ConnectionGUID: Ygp7+wInRp6lKcZ+jrQnnA== X-CSE-MsgGUID: LmQZLVZ+QeStZkDFrDfqGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,221,1763452800"; d="scan'208";a="208618615" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa004.jf.intel.com with ESMTP; 12 Jan 2026 05:49:12 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id C6143A1; Mon, 12 Jan 2026 14:49:06 +0100 (CET) From: Andy Shevchenko To: Andi Shyti , Andy Shevchenko , Wolfram Sang , Qianfeng Rong , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: Khalil Blaiech , Asmaa Mnebhi , Andi Shyti , Qii Wang , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , Heiko Stuebner , Patrice Chotard , Ard Biesheuvel Subject: [PATCH v1 5/7] i2c: rk3x: Use HZ_PER_GHZ constant instead of plain number Date: Mon, 12 Jan 2026 14:46:13 +0100 Message-ID: <20260112134900.4142954-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260112134900.4142954-1-andriy.shevchenko@linux.intel.com> References: <20260112134900.4142954-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260112_054916_457540_6538CC8F X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Use defined constant to avoid the possible mistakes and to provide an additional information on the units. Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-rk3x.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index d4e9196445c0..fcede9f6ed54 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -896,13 +897,12 @@ static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) clk_disable(i2c->pclk); - t_low_ns = div_u64(((u64)calc.div_low + 1) * 8 * 1000000000, clk_rate); - t_high_ns = div_u64(((u64)calc.div_high + 1) * 8 * 1000000000, - clk_rate); + t_low_ns = div_u64(8ULL * HZ_PER_GHZ * (calc.div_low + 1), clk_rate); + t_high_ns = div_u64(8ULL * HZ_PER_GHZ * (calc.div_high + 1), clk_rate); dev_dbg(i2c->dev, - "CLK %lukhz, Req %uns, Act low %lluns high %lluns\n", - clk_rate / 1000, - 1000000000 / t->bus_freq_hz, + "CLK %lukHz, Req %luns, Act low %lluns high %lluns\n", + clk_rate / HZ_PER_KHZ, + HZ_PER_GHZ / t->bus_freq_hz, t_low_ns, t_high_ns); } -- 2.50.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip