mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugo Villeneuve <hugo@hugovil.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: [PATCH v3 01/14] serial: sc16is7xx: rename LCR macros to better reflect usage
Date: Mon, 27 Oct 2025 10:29:43 -0400	[thread overview]
Message-ID: <20251027142957.1032073-2-hugo@hugovil.com> (raw)
In-Reply-To: <20251027142957.1032073-1-hugo@hugovil.com>

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

There is no reference to CONF_MODE_A or CONF_MODE_B in the manufacturer's
datasheet.

Rename register set configuration macros for the LCR register, to better
show their intended usage to select either the Special register set, or the
Enhanced register set.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/sc16is7xx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index c7435595dce13..330d95446f1d7 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -149,10 +149,12 @@
 #define SC16IS7XX_LCR_WORD_LEN_6	(0x01)
 #define SC16IS7XX_LCR_WORD_LEN_7	(0x02)
 #define SC16IS7XX_LCR_WORD_LEN_8	(0x03)
-#define SC16IS7XX_LCR_CONF_MODE_A	SC16IS7XX_LCR_DLAB_BIT /* Special
-								* reg set */
-#define SC16IS7XX_LCR_CONF_MODE_B	0xBF                   /* Enhanced
-								* reg set */
+#define SC16IS7XX_LCR_REG_SET_SPECIAL	SC16IS7XX_LCR_DLAB_BIT /* Special
+								* reg set
+								*/
+#define SC16IS7XX_LCR_REG_SET_ENHANCED	0xBF                   /* Enhanced
+								* reg set
+								*/
 
 /* MCR register bits */
 #define SC16IS7XX_MCR_DTR_BIT		BIT(0)   /* DTR complement
@@ -442,7 +444,7 @@ static void sc16is7xx_efr_lock(struct uart_port *port)
 	one->old_lcr = sc16is7xx_port_read(port, SC16IS7XX_LCR_REG);
 
 	/* Enable access to Enhanced register set */
-	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, SC16IS7XX_LCR_CONF_MODE_B);
+	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, SC16IS7XX_LCR_REG_SET_ENHANCED);
 
 	/* Disable cache updates when writing to EFR registers */
 	regcache_cache_bypass(one->regmap, true);
@@ -598,7 +600,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
 	/* Backup LCR and access special register set (DLL/DLH) */
 	lcr = sc16is7xx_port_read(port, SC16IS7XX_LCR_REG);
 	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
-			     SC16IS7XX_LCR_CONF_MODE_A);
+			     SC16IS7XX_LCR_REG_SET_SPECIAL);
 
 	/* Write the new divisor */
 	regcache_cache_bypass(one->regmap, true);
@@ -1650,7 +1652,7 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype,
 
 		/* Enable EFR */
 		sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_LCR_REG,
-				     SC16IS7XX_LCR_CONF_MODE_B);
+				     SC16IS7XX_LCR_REG_SET_ENHANCED);
 
 		regcache_cache_bypass(regmaps[i], true);
 
-- 
2.39.5


  reply	other threads:[~2025-10-27 14:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 14:29 [PATCH v3 00/14] serial: sc16is7xx: register access fixes and improvements Hugo Villeneuve
2025-10-27 14:29 ` Hugo Villeneuve [this message]
2025-10-27 14:29 ` [PATCH v3 02/14] serial: sc16is7xx: rename EFR mutex with generic name Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 03/14] serial: sc16is7xx: define common register access function Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 04/14] serial: sc16is7xx: remove unnecessary pointer cast Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 05/14] serial: sc16is7xx: use guards for simple mutex locks Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 06/14] serial: sc16is7xx: drop -ENOMEM error message Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 07/14] serial: sc16is7xx: declare SPR/TLR/XOFF2 register as volatile Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 08/14] serial: sc16is7xx: move port/channel init to separate function Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 09/14] serial: sc16is7xx: simplify to_sc16is7xx_one() with a single parameter Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 10/14] serial: sc16is7xx: Kconfig: allow building with COMPILE_TEST Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 11/14] serial: sc16is7xx: use KBUILD_MODNAME Hugo Villeneuve
2025-10-30 10:35   ` Andy Shevchenko
2025-10-30 20:01     ` Hugo Villeneuve
2025-10-31  7:06       ` Greg KH
2025-10-27 14:29 ` [PATCH v3 12/14] serial: sc16is7xx: change conditional operator indentation Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 13/14] serial: sc16is7xx: reformat comments to improve readability Hugo Villeneuve
2025-10-27 14:29 ` [PATCH v3 14/14] serial: sc16is7xx: add comments for lock requirements Hugo Villeneuve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251027142957.1032073-2-hugo@hugovil.com \
    --to=hugo@hugovil.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®