From nobody Tue Feb 10 06:25:34 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 E2667314A61 for ; Fri, 14 Nov 2025 10:52:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763117534; cv=none; b=egSGNAtPdWBh6znHWgrK+Ai3gHakmI9mh4O3wNAqhTJQnW48TY0Ds1+OFTMHXKMnrhBuKxqjabRjlUPdiF4WHenaIuzwZWiDzh9WQPcWE7Db+czaLB4s5Kz2dCXgwdAcadcCN5hx6P2T6nYGRY3797Dj2OpYLqCMF+UDvS6Vh3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763117534; c=relaxed/simple; bh=Vtgi4lfvu1X+kThD5elQPk8tyijOhE+uKacGCvt2KsE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fcypbahmsd5uPMeooCqrIHwZivT2ON8Ej+w3LmmbAjwyDV15050ew31okDwEy9aeb6qwtGBvNvhdSIvaY4ySuFEh8Tcb9FViWnAkgFgdOIULbVY5g/7i/afQIVpq1vKldM3odx/BeX29uzUDDaYHMrPf5MgoaQsoSC8GIisdsEw= 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=BjCuflfK; arc=none smtp.client-ip=209.85.221.49 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="BjCuflfK" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-42b3108f41fso1013023f8f.3 for ; Fri, 14 Nov 2025 02:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763117530; x=1763722330; 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=T8DAzeNxgcKZ7yUD6bDH/FI8JtIxqypywOcVoLK9k0U=; b=BjCuflfKNftc0B+avuLIwj7QmZ+3WxprW7JxIVNZtUzG+1pZOcgb1XlY7k4XbiLLp3 yvk5c8ca8HFv4ar6s81CodEpmosfyP8RAnfHFaR2m60OVV8+MNtiwdP0+N+Q+W5HcUkC M/ufz+tq8j6fn36pCXakip0NrwLTsD8rEiwrhEJaN/iMFE+IzxmW4DsBnRQSrrRSAE8v 9RBMvnnQxn+r8E+0boE/M5JewPDfRnD0e68XVAT1Mvrke3ieGIltLxwvSV1bLhXFr5NI NpNC8Qm7xdhqbY3HUdjIBMpqLl1VMyk9qh+wIAtl5BzmAgrunNrpaOaCykW9CGtCzm6n SI9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763117530; x=1763722330; 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=T8DAzeNxgcKZ7yUD6bDH/FI8JtIxqypywOcVoLK9k0U=; b=bNDDYHOLZSLVnytwGsSEAQc+XF2SC51SwWXJbSYUaWUejhdDtc6Uzk2Kq3wCKo5Hc6 yEr1Js0cEwIPU/Ah8EucucVST+/Ia/Bfrp0H9mj3o77708psDe+B+lZXEWqz4aTZHOS5 Mr4BYIhutDgg4tIC0PHiCGhU9Xx5mcQ6w0DoUDg3MaHe/dsVP/7EpMRxpMCnE+p+wmjz 9qEWzDp5Lq40RzNfw8eonOlJ6jPm7RLf3lU3cDUbcIc0gZrLH6jTx8wYsXus5xIcrugp JKHp5NABabx9B5/4iAArwUq6LSli/gWmHHuVBXeGmnnuXOChrR1Wci5z8DRV5jIMphaC jEvQ== X-Forwarded-Encrypted: i=1; AJvYcCUoQDLMJgXQP/qMdvYRqjye91Bi1DhB5nP9ruvxKJU3qKc6817eenUSxOb7M/6BvQsS75FYPbpWlBbuw9Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5rVLyJQy1Nm6x7RL0pEaar5TXVhPDO2HYERkEZF0fJa+Q41Zy xlbGUtuXhCH4gxYjeuwsCbw9NyI9fl4QuWsjZ9ncXVg+7nam+4BKHbkk X-Gm-Gg: ASbGncsNRtzP/PS/tViSp/zRlu0dvWPDihhzZ9WVCmhY/IJYQU4it/DRfEUDdhGeGK5 G8iAjcgkcxekCc9aGK8lDQErPOJUqYaOw+g9YbvtNTmddXatDm/taTFQsBwcrj8zDUfM9YEJSNH IeaxO/m725v57eNZNuaaB2WWEhA+k5kvVzihSoN0Jv9OQ1OF13ShB5spEItoKvxyZgglTFi7VQv fCKutzFJqOV3wCIcV8HQgc3dbVb3/MnZDa5kImKkyB0y5nb4clqi6WPMLROrfCMm4pWuTGT/BFR jV2fL3765Fhd9eUfChjdAW3ZfPtHW9lOmJxoJknxStvLUQ061D/TVT3720TgFD6lCMmy3D52q/n eAMKr+6aef6mHqHoQREqWaZVHDEY2F9KyCzCOdj4hv9+orp+dnyTLlTg0LyzpPXRL4wLtG6MPce 3tNRIRSdA6enOgNTFTk2ClhM5CR3c/RHMeSjH45W/Ba88cWle6HCWSZFB2noCdP0BDUdseujcp8 yjTS6uM+44dGy8B X-Google-Smtp-Source: AGHT+IEsMmHNh0DO1X88HpKTuf6l4Do3Q+f4cMx/ubEtqRtlwPBkz5p20OD2aaXxaMLUIAcCVHyVuQ== X-Received: by 2002:a5d:5d03:0:b0:429:d391:642e with SMTP id ffacd0b85a97d-42b593742fdmr2342001f8f.30.1763117529498; Fri, 14 Nov 2025 02:52:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 02:52:09 -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 08/13] serial: sh-sci: Add sci_is_rsci_type() Date: Fri, 14 Nov 2025 10:51:17 +0000 Message-ID: <20251114105201.107406-9-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 Add sci_is_rsci_type() for RSCI port type. This will simplify the code when the support added for RSCI_PORT_{SCI,SCIF} private PORT type. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- v2->v3: * No change. v1->v2: * No change. --- drivers/tty/serial/sh-sci.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 66ab85571230..2da36e8ce555 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1182,6 +1182,11 @@ static int sci_handle_errors(struct uart_port *port) return copied; } =20 +static bool sci_is_rsci_type(u8 type) +{ + return (type =3D=3D SCI_PORT_RSCI || type =3D=3D RSCI_PORT_SCI || type = =3D=3D RSCI_PORT_SCIF); +} + static int sci_handle_fifo_overrun(struct uart_port *port) { struct tty_port *tport =3D &port->state->port; @@ -1190,7 +1195,7 @@ static int sci_handle_fifo_overrun(struct uart_port *= port) int copied =3D 0; u32 status; =20 - if (s->type !=3D SCI_PORT_RSCI) { + if (!sci_is_rsci_type(s->type)) { reg =3D sci_getreg(port, s->params->overrun_reg); if (!reg->size) return 0; @@ -1198,7 +1203,7 @@ static int sci_handle_fifo_overrun(struct uart_port *= port) =20 status =3D s->ops->read_reg(port, s->params->overrun_reg); if (status & s->params->overrun_mask) { - if (s->type =3D=3D SCI_PORT_RSCI) { + if (sci_is_rsci_type(s->type)) { /* * All of the CFCLR_*C clearing bits match the corresponding * CSR_*status bits. So, reuse the overrun mask for clearing. @@ -2015,7 +2020,7 @@ static irqreturn_t sci_tx_end_interrupt(int irq, void= *ptr) unsigned long flags; u32 ctrl; =20 - if (s->type !=3D PORT_SCI && s->type !=3D SCI_PORT_RSCI) + if (s->type !=3D PORT_SCI && !sci_is_rsci_type(s->type)) return sci_tx_interrupt(irq, ptr); =20 uart_port_lock_irqsave(port, &flags); @@ -3289,7 +3294,7 @@ static int sci_init_single(struct platform_device *de= v, * The fourth interrupt on SCI and RSCI port is transmit end interrupt, so * shuffle the interrupts. */ - if (p->type =3D=3D PORT_SCI || p->type =3D=3D SCI_PORT_RSCI) + if (p->type =3D=3D PORT_SCI || sci_is_rsci_type(p->type)) swap(sci_port->irqs[SCIx_BRI_IRQ], sci_port->irqs[SCIx_TEI_IRQ]); =20 /* The SCI generates several interrupts. They can be muxed together or --=20 2.43.0