From nobody Tue Feb 10 01:35:31 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 246BE314D2E for ; Fri, 14 Nov 2025 10:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763117536; cv=none; b=apU9bgtQ/Fc+bkZ+vzfhWaHsD/iTDN6S1cdOEd/+GfeeX5/WrjHyTuKG6akhsg80lJ8b59N/WJ1L4lTy5C3vbriyIgVvv+yJsnwCWKbEz9niBPKPd+Pau5JBoyOB38FSrjvSUq+yj4Z7VH0cqaNXsGIqW8n87qB4padwAebhx3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763117536; c=relaxed/simple; bh=mv2mYdOg7LrC0MfHxAiJ/nb0yhCqexkBIc6K7/VaeZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KRX5XRkO/hVNmAj4/EoNbSaAHBy6PsimmJ2KoM1n9yWZNo9Y8LzlLm3o42GQpnVcieQMs6wJF0b2V2GOyclE7zzULWg1U7JYoqAKdPxE8h9RjPe4zYLEmJMF4lwFQ4QqShxd3Gjj9ocrbBTUu2Y1RogPsZjkvXLdugWoZXqlojI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SLNQASvS; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SLNQASvS" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-47754e9cc7fso11173585e9.2 for ; Fri, 14 Nov 2025 02:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763117531; x=1763722331; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oure4CGk54ZT9fjfLN97GsFO/opoaJIaOfBNUUyjY9o=; b=SLNQASvSnDd2uDeeYA+Ny+FWmQVj5sAbRjHv/P+oLVz2KDlCHwFHQmYWTmcHHffTVz 8O3ssz45zIVLPZavfwFaetJUmYe4mX/V1wTTy/4I9Qx6RC+P0xil2neJ0j+1ciVsMebE 2edYkzDkqRb/FY7yG5F1A/9nfFi2gleYUhObqncGxpcWdzp9DfscVxWeXcIaj+mUq0J+ FINJGIkoMS9aIUj1OurPQYHmjN2HO0EAVZ5/ffMRjP0XqfhetFCKdI+DA2c0XuZzB77S xJu2AtKCLn/vHS1GpE0uBueGOPzNpybT5gjcuguieEai2UmzpmlOl2A5wALT1DvWDUIB TzoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763117531; x=1763722331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oure4CGk54ZT9fjfLN97GsFO/opoaJIaOfBNUUyjY9o=; b=uyBUL49MUI7itdGkkYWOvIYrG1uE5hFM+qKXS7mxri+YbYPWZVeTEA2MHmd1bfCi6v 5mHNKurinczbArjWkID1NC1725AnZ0gdMOx4vo3hyuSHjLUq0gIsVO7GdVo6UMyVXebA k2OPZwK5jkgVkivNPVKOKzbhvecpiWwL3E5CpvYBEZ7N0oza7/QUdBkpGmJ+dK5iQQhx u4iir7QQKolgRXGt/chdW2bmwyZQWy9ar/8E3cO+FCGr+f63Ys39yIo4zddPxYNRy0+3 JQ1r60m1zQmOvxJmeVQUav8v80Eugfs+xFc8LQxqxEwgUPZ2M0WUL4obxve5rKINMe3n +EFQ== X-Forwarded-Encrypted: i=1; AJvYcCUeWGgwmTEPpzmfPdI5lDpyQipjVhSADlaGqlGmD0VhUMqEmU2swsN9J7QGijKyiErrr18p3AthS3mCb3s=@vger.kernel.org X-Gm-Message-State: AOJu0Yz07GshOUALvIPZqGnKhCLX6T0FR0LdzemPCd7sem31swycCb51 F/oVd5gh+mfrhPPwowcZ4JaSlj+zvkgYHZedPF+F7PVqb+4LM1uoObCE X-Gm-Gg: ASbGncvmJQbjLlxbnSy575xXKgUCSLupAdDFdvCDAX8sNQu5IHtDxSlWeGCsVkDXB/8 30YfBUED+xSOYIiT0WsTuARSWoplAIuStyCndUNrhINa8r3OpSeDcMVaTLu9Fp4oji5jzFT989Q ukFYy6OW/kn9N0Hmxa2SwBcO/CZ9SyMPcLKZ3guwGG3hWZs8v9YUTM29yjFPINDQAxes6AuqFuB Ip1/0FW1KM4jwPnzEQX8/OvMTK7cNY34cKYForuiVm9+Hg7tv3RUkwaff/5Npn3fm9LaSDTyVPb YkF9h2DCQ3s1mNy7om0xvocW9760vSDwHfQescDYJoIp+l6r3d+c90KH4+yNvQX0UKpQnTtfx0E yEDCsSbr84gp5i29XCj1jvaCbVj1iD3pOChJtTdGZTT7pKUU+my4dwHYXbUiIzlgU2HB0SgjYjQ 8lZgmAR+xQv50Blmd/oU04o0OYieEcgmE+E0wlBmBR4AIdEm5gKashsRtRQpH0N9w5utOE0+yEI 3Bp25umlvcBU5qy X-Google-Smtp-Source: AGHT+IHyh9+bCTJgLOvK9EK/d8+FstS+PNLykYKfr5zqimCLJC1FA+ELYVlW0o49D5QHxK8wWp+yvA== X-Received: by 2002:a05:600c:1f86:b0:477:7c7d:d9b2 with SMTP id 5b1f17b1804b1-4778fea17bemr28907635e9.32.1763117530874; Fri, 14 Nov 2025 02:52:10 -0800 (PST) Received: from localhost.localdomain (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53f17cbfsm9031255f8f.35.2025.11.14.02.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 02:52:10 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , Wolfram Sang , Lad Prabhakar , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das Subject: [PATCH v3 10/13] serial: sh-sci: Make sci_scbrr_calc() public Date: Fri, 14 Nov 2025 10:51:19 +0000 Message-ID: <20251114105201.107406-11-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251114105201.107406-1-biju.das.jz@bp.renesas.com> References: <20251114105201.107406-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Make the function sci_scbrr_calc() public for code reuse to support RZ/G3E RSCI IP. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- v2->v3: * No change. v1->v2: * No change. --- drivers/tty/serial/sh-sci-common.h | 3 +++ drivers/tty/serial/sh-sci.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci= -common.h index 6c849757119b..41a437440dfa 100644 --- a/drivers/tty/serial/sh-sci-common.h +++ b/drivers/tty/serial/sh-sci-common.h @@ -170,6 +170,9 @@ void sci_port_enable(struct sci_port *sci_port); int sci_startup(struct uart_port *port); void sci_shutdown(struct uart_port *port); =20 +int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr, + unsigned int *srr, unsigned int *cks); + #define min_sr(_port) ffs((_port)->sampling_rate_mask) #define max_sr(_port) fls((_port)->sampling_rate_mask) =20 diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 3b03d3d3f2c7..c7f8a9b470fe 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2573,9 +2573,8 @@ static int sci_brg_calc(struct sci_port *s, unsigned = int bps, } =20 /* calculate sample rate, BRR, and clock select */ -static int sci_scbrr_calc(struct sci_port *s, unsigned int bps, - unsigned int *brr, unsigned int *srr, - unsigned int *cks) +int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr, + unsigned int *srr, unsigned int *cks) { unsigned long freq =3D s->clk_rates[SCI_FCK]; unsigned int sr, br, prediv, scrate, c; @@ -2639,6 +2638,7 @@ static int sci_scbrr_calc(struct sci_port *s, unsigne= d int bps, min_err, *brr, *srr + 1, *cks); return min_err; } +EXPORT_SYMBOL_NS_GPL(sci_scbrr_calc, "SH_SCI"); =20 static void sci_reset(struct uart_port *port) { --=20 2.43.0