From patchwork Wed Jan 10 10:20:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762423 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 B74AB3FE2A for ; Wed, 10 Jan 2024 10:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EHa+QY2i" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40e43fb2659so34539805e9.1 for ; Wed, 10 Jan 2024 02:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882068; x=1705486868; 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=a/c7oDT8RKSeNrIFhGqJZw8sJoinUsXp+DaHWK6w1PA=; b=EHa+QY2iDGVWuOoQ/ys4OLVXFb/zbFRuQLlei825OF66EBStNyLjLXASYbhFPByzKw /5+o+cWIr5j9NULiMVgvlmdoIZxOOkBc1M+PXAQ4tOxOsRV/eTeBzLBa1bFI3bxUlp0s cR4aoavbQ6F/ol6DVoRc8ZtLW+gFGA1ArXl4tm90CmDU9q1WZuzOWbH9JD+Q4KXgk6pU pCgns/lCMXAji7MoRo45BAYTD4K8DDQdhnvb0fdeIpkwyx9xUz9HCT3g0BnoE+26hLMt Nw337rppyUK02tUyE5imJgAt/uFUj4+MV3XDQQxZqqpirBXogBbQQCRuyN8iOGYktrZY lj2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882068; x=1705486868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a/c7oDT8RKSeNrIFhGqJZw8sJoinUsXp+DaHWK6w1PA=; b=aa1yTilIDP+3531R1GuhLpfyFjnfd+fWOktLpsQYm2j7+qZmPKU5hcAAiBT5kYcsjd 6q/umepxtAX39efbmQI9Fhb+9Ayhb2tVhjXWmIEdzp+db/UmwjtkjyPw08n5jlGlYxvY 0Qz7n9qeuLxeXm8qbRXaodKI1YZJskUx7k9o9+VbmaqA/bS/HV4U08ZNRPl/DloYrIk5 gXApCnHZsxoS2868EhrBsRcLQ/Zp74ypM8Gn+LtOvC+Lcd9HkQ0WRLX6kh37ivN3boH8 BIUnXXCCFMnhWsO8Hi6T9AuWBAxUmP8bw+g1Q+a1ehh75cEX/4KWEt3aaO9mIJDSNRPj uEZg== X-Gm-Message-State: AOJu0YyaVBPBP/g1gnXRAGfwrTGBgJiR0wJLkbnezldYSSdAh++BSfqL ZvaPyK6kM0ip/nf0VXdxR84Vf5ClO6IBOA== X-Google-Smtp-Source: AGHT+IEQmAz/yRZ4JQb4KH0cdGwc6wBVKJX8n66A4HzKVJGrDTgM6umRzceJA14m6Bo9F2DGOz85Jw== X-Received: by 2002:a05:600c:b88:b0:40e:4cc6:9ff5 with SMTP id fl8-20020a05600c0b8800b0040e4cc69ff5mr406137wmb.100.1704882068122; Wed, 10 Jan 2024 02:21:08 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:07 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 01/18] tty: serial: samsung: prepare for different IO types Date: Wed, 10 Jan 2024 10:20:45 +0000 Message-ID: <20240110102102.61587-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 GS101's Connectivity Peripheral blocks (peric0/1 blocks) which include the I3C and USI (I2C, SPI, UART) only allow 32-bit register accesses. If using 8-bit register accesses, a SError Interrupt is raised causing the system unusable. Instead of specifying the reg-io-width = 4 everywhere, for each node, the requirement should be deduced from the compatible. Prepare the samsung tty driver to allow IO types different than UPIO_MEM. ``struct uart_port::iotype`` is an unsigned char where all its 8 bits are exposed to uapi. We can't make NULL checks on it to verify if it's set, thus always set it from the driver's data. Use u8 for the ``iotype`` member of ``struct s3c24xx_uart_info`` to emphasize that the iotype is an 8 bit mask. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 71d17d804fda..b8fe9df20202 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -84,6 +84,7 @@ struct s3c24xx_uart_info { unsigned long clksel_mask; unsigned long clksel_shift; unsigned long ucon_mask; + u8 iotype; /* uart port features */ @@ -1742,7 +1743,6 @@ static void s3c24xx_serial_init_port_default(int index) { spin_lock_init(&port->lock); - port->iotype = UPIO_MEM; port->uartclk = 0; port->fifosize = 16; port->flags = UPF_BOOT_AUTOCONF; @@ -1989,6 +1989,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) break; } + ourport->port.iotype = ourport->info->iotype; + if (np) { of_property_read_u32(np, "samsung,uart-fifosize", &ourport->port.fifosize); @@ -2399,6 +2401,7 @@ static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .fifosize = 64, .has_divslot = 1, .rx_fifomask = S3C2440_UFSTAT_RXMASK, @@ -2428,6 +2431,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .has_divslot = 1, .rx_fifomask = S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, @@ -2457,6 +2461,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .name = "Samsung Exynos UART", \ .type = TYPE_S3C6400, \ .port_type = PORT_S3C6400, \ + .iotype = UPIO_MEM, \ .has_divslot = 1, \ .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ @@ -2517,6 +2522,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, .port_type = PORT_8250, + .iotype = UPIO_MEM, .fifosize = 16, .rx_fifomask = S3C2410_UFSTAT_RXMASK, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, @@ -2546,6 +2552,7 @@ static const struct s3c24xx_serial_drv_data artpec8_serial_drv_data = { .name = "Axis ARTPEC-8 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .fifosize = 64, .has_divslot = 1, .rx_fifomask = S5PV210_UFSTAT_RXMASK, From patchwork Wed Jan 10 10:20:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761686 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 0A2103FB3B for ; Wed, 10 Jan 2024 10:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xK8vMPH0" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-50e67e37661so4962696e87.0 for ; Wed, 10 Jan 2024 02:21:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882069; x=1705486869; 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=WA1wqdkIBgQshp7OOT7q6kHMVXJcjDA2G18H91tm8Z8=; b=xK8vMPH0tTdvjzREA+kXmSbeaSuoL9xKI3Vxcpz/UhDqZ0No8PCJPktXZo6YPmg7Qb EvboM8yFnzZ7QZziP1tMkoshVE6zxj4eAtO7nsMiOeVaGt6jkj2WrQeMdY8eD6/ukLtA Y6KC2T/X8HWOICt9fAMLVyf4l5j0x13/XKK4adfs+CP21gfEFAUj0ZGgSFWMOOw053N1 JfMBEZ3OLaLQYtjHZPOoSJp8d24nwuS+fj2xab+znJKC3k5ZekmH3xaCz1sbhzxg0tbz EgDMMjWvpbxFEKApKU9+W1tm3j6nXngCb4hixslpdGiuiTuCVmfXOItdIlHprHbetLVp PHOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882069; x=1705486869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WA1wqdkIBgQshp7OOT7q6kHMVXJcjDA2G18H91tm8Z8=; b=Z0Tj33ZblANBO+WqDmH45utQtvSQ+GV+D1W0tBJhcnIT8WN/KgvGVecsZEgpxhQRFb oPuKEqYrpuZnotbwQC/DIUa9rJKfthRRKTGAfsEWPrE5NHTLEszq2rpLwJaNbvBniaSP ECWF14MsRT9a+TpkV1q9dpgsAH3cfiIgMKRItC1h+0ZlpnZGIwJ3wqylSm2Cpts+sXnJ S3vVZs4i5+d1r3OehZMlViO0G4zxAzhdlUKsD/Uerx7CoZlI8KnJZv8I1lYuxWaDkm1/ /9XhdEYvUIGuStFLM+E9HJ4r9k0gcRYcLGxZILB7jLrL1SgNHk1jObAmnFf1UvgGODmg fzLg== X-Gm-Message-State: AOJu0YwgxsWpcjIPCVIxo3B7D1Nkbn3RokfA1GC7pPRk49/kKzR4Vha+ Hf2fQttvMfVuq8Mg0byFKg0j23RhHDADjg== X-Google-Smtp-Source: AGHT+IELjvrXw11hASDuqeoOjnXHBb/wHFRSBI3T8k5uASK1m5nJmKIYBXNYKwon+CNtfclv5aKAuA== X-Received: by 2002:a05:6512:131f:b0:50e:d347:b83 with SMTP id x31-20020a056512131f00b0050ed3470b83mr344642lfu.115.1704882068958; Wed, 10 Jan 2024 02:21:08 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:08 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 02/18] tty: serial: samsung: set UPIO_MEM32 iotype for gs101 Date: Wed, 10 Jan 2024 10:20:46 +0000 Message-ID: <20240110102102.61587-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 GS101's Connectivity Peripheral blocks (peric0/1 blocks) which include the I3C and USI (I2C, SPI, UART) only allow 32-bit register accesses. Instead of specifying the reg-io-width = 4 everywhere, for each node, the requirement should be deduced from the compatible. Infer UPIO_MEM32 iotype from the "google,gs101-uart" compatible. Update the uart info name to be GS101 specific in order to differentiate from the other exynos platforms. All the other settings are not changed. exynos_fifoszdt_serial_drv_data was replaced by gs101_serial_drv_data because the iotype restriction is gs101 specific and there was no other user of exynos_fifoszdt_serial_drv_data. Reviewed-by: Peter Griffin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 38 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b8fe9df20202..20ec6ef1a52f 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2495,25 +2495,43 @@ static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { .fifosize = { 256, 64, 64, 64 }, }; -/* - * Common drv_data struct for platforms that specify samsung,uart-fifosize in - * device tree. - */ -static const struct s3c24xx_serial_drv_data exynos_fifoszdt_serial_drv_data = { - EXYNOS_COMMON_SERIAL_DRV_DATA(), +static const struct s3c24xx_serial_drv_data gs101_serial_drv_data = { + .info = { + .name = "Google GS101 UART", + .type = TYPE_S3C6400, + .port_type = PORT_S3C6400, + .iotype = UPIO_MEM32, + .has_divslot = 1, + .rx_fifomask = S5PV210_UFSTAT_RXMASK, + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, + .rx_fifofull = S5PV210_UFSTAT_RXFULL, + .tx_fifofull = S5PV210_UFSTAT_TXFULL, + .tx_fifomask = S5PV210_UFSTAT_TXMASK, + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, + .def_clk_sel = S3C2410_UCON_CLKSEL0, + .num_clks = 1, + .clksel_mask = 0, + .clksel_shift = 0, + }, + .def_cfg = { + .ucon = S5PV210_UCON_DEFAULT, + .ufcon = S5PV210_UFCON_DEFAULT, + .has_fracval = 1, + }, + /* samsung,uart-fifosize must be specified in the device tree. */ .fifosize = { 0 }, }; #define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data) #define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data) #define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data) -#define EXYNOS_FIFOSZDT_DRV_DATA (&exynos_fifoszdt_serial_drv_data) +#define GS101_SERIAL_DRV_DATA (&gs101_serial_drv_data) #else #define EXYNOS4210_SERIAL_DRV_DATA NULL #define EXYNOS5433_SERIAL_DRV_DATA NULL #define EXYNOS850_SERIAL_DRV_DATA NULL -#define EXYNOS_FIFOSZDT_DRV_DATA NULL +#define GS101_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_ARCH_APPLE @@ -2601,7 +2619,7 @@ static const struct platform_device_id s3c24xx_serial_driver_ids[] = { .driver_data = (kernel_ulong_t)ARTPEC8_SERIAL_DRV_DATA, }, { .name = "gs101-uart", - .driver_data = (kernel_ulong_t)EXYNOS_FIFOSZDT_DRV_DATA, + .driver_data = (kernel_ulong_t)GS101_SERIAL_DRV_DATA, }, { }, }; @@ -2624,7 +2642,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = { { .compatible = "axis,artpec8-uart", .data = ARTPEC8_SERIAL_DRV_DATA }, { .compatible = "google,gs101-uart", - .data = EXYNOS_FIFOSZDT_DRV_DATA }, + .data = GS101_SERIAL_DRV_DATA }, {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); From patchwork Wed Jan 10 10:20:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761685 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 62BCA3FE2B for ; Wed, 10 Jan 2024 10:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HtIJ7gBc" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e461c1f5cso35229905e9.3 for ; Wed, 10 Jan 2024 02:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882069; x=1705486869; 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=fsnoBIJqRKL8fx5Abgy7bxSlqGNMKE0Lqg/re65WEDg=; b=HtIJ7gBc23zKjcHLhsbCZg17sUrDa44EqsX0I/awb6sLxYcg6lndV0wMehxwk3oZNB iXTb8fT3lWmwOE0ZyU7bq8gy6xd2UicGnwRKgaKdAOmpkyniPY+9fmjScptcBF4lsZK4 TSbtS7IYNAVfQNpP9g0TWGzsDmLhp2JUYNFiZ6iMVYcJkwr0Ji89sxZwXQqwd2ijmOuX lOwPWo6o5KmWsiA7lZXd/h5MNBKRSXpgxBBWxj4+oFWIonhRV/k0mf9XVf7/vr5gG+Ay pFO4DPWJCtvw1YZiLFW0AS4Uge14PUNcfYuDyYaX2S30+gK2FrqRbHspQkUqjOSFGPuD 1cKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882069; x=1705486869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fsnoBIJqRKL8fx5Abgy7bxSlqGNMKE0Lqg/re65WEDg=; b=Yl6yhGw8GRxbgtxj9eh4Lsuhl7ek5sHgARYSUhozmDKT9LskFemwxwezt5CeXB2JmL qK7TWguq3Mih8TCqlO725lG3sE0KGkqqnaKXB+uwHli9owXiWhar/AoTHv8oz0BIzCPb bLlqOjU0x+Bvii5pBnPs854UO/Qfs6qaUo7k6zuP+gGAkgneMub5D81Vhng/eft8cGqq Ox15drqpSt8Tc3m0F4CgEpP0IWT7CbQjNHIPFxRJSy0g1O+h97WtREIprfHHA0rj84M0 3wqth4h51VKhSAYw1jO8gC3jaUTGZiF0wJLeAGSWxRKIKYJH6sJOTONWQv2vG0LB+MjM JiPQ== X-Gm-Message-State: AOJu0YzCCz8fIOtf1m2lv9OXdVUxSuIFwgABYn3USKr2Qzn3c/4Mp8XB /uBnF3h5xGe48apQBNNKVHHXMd/D/uUsBQ== X-Google-Smtp-Source: AGHT+IFyetyaA6/1wjXTRap8gF7AQlclivTZB7k1d1dyppWTKQU0nJEVHPWzIx2rYQXgLUJlRHX0RA== X-Received: by 2002:a05:600c:32a7:b0:40e:44eb:c40 with SMTP id t39-20020a05600c32a700b0040e44eb0c40mr312383wmp.30.1704882069641; Wed, 10 Jan 2024 02:21:09 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:09 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 03/18] tty: serial: samsung: add gs101 earlycon support Date: Wed, 10 Jan 2024 10:20:47 +0000 Message-ID: <20240110102102.61587-4-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The entire bus (PERIC) on which the GS101 serial resides only allows 32-bit register accesses. The reg-io-width dt property is disallowed for the "google,gs101-uart" compatible and instead the iotype is inferred from the compatible. Always set UPIO_MEM32 iotype for the gs101 earlycon. Reviewed-by: Peter Griffin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 20ec6ef1a52f..74bc5151dad4 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2810,6 +2810,17 @@ OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart", OF_EARLYCON_DECLARE(artpec8, "axis,artpec8-uart", s5pv210_early_console_setup); +static int __init gs101_early_console_setup(struct earlycon_device *device, + const char *opt) +{ + /* gs101 always expects MMIO32 register accesses. */ + device->port.iotype = UPIO_MEM32; + + return s5pv210_early_console_setup(device, opt); +} + +OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup); + /* Apple S5L */ static int __init apple_s5l_early_console_setup(struct earlycon_device *device, const char *opt) From patchwork Wed Jan 10 10:20:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762422 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 1A7DB3FE30 for ; Wed, 10 Jan 2024 10:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pSSjqrVB" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40e43e48a16so36607435e9.2 for ; Wed, 10 Jan 2024 02:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882070; x=1705486870; 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=rCIwgQ4YttU9lzxXqEJuv2Mwb9Cj5TAyRM4oPuL0tc0=; b=pSSjqrVBqeKGCgJvkWJH9XuOMGfkW68S2D7bZohMhksRmmiNkSlE2HOud44/b958JL Htt3Ej7Kq1yBERhGXlLeWpyXFMuVliZVQMs9K+RyiB1jSyj4iF3dCKifwFu3rav+BYIJ reYHyhySUq39WJcCOSXV7+wrhtmB8wVAyO7nqYPkO2V4IvHBPALPe/CJ1jIM1VffjvQf QlJqvY9OYF/hROFY7AAc8Rwo1siz29HAY+KQ2erGH/yf1qjqvzwLjHqW7MQ8r4VZpy5t OFnopphX8ZaRAmxwnh44xL/6ZE2FALZ4ReLQpmU+t0nyVbYjSH9eKJtlU99nDnu2cjyT MKFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882070; x=1705486870; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rCIwgQ4YttU9lzxXqEJuv2Mwb9Cj5TAyRM4oPuL0tc0=; b=LpiHPE3XP3howAcu5KmvS5X53SPc0DrCxicIvGW52fd2nkDYZIp8L9djp6+j/gVxIQ ODpRFDD790QQ8jJoRFA40fycFXt4/zN038sBrd/XRxMX8A8OrqYsKV1xghBUbdWeIql+ mrCttduhpH4f4zDbVGQ7mj0bPfzIaLm/iR81BEqm+17teSsAUvahiodh70woeGn4Iju9 0kE01BuXejaX6ibGkt48Lc0mk0k05tj00irS8hQv7jhqr6qEv4o1AXyxs40edoe4joaP 8DavaQG+iHBO/ff6LS/LzsHlAK6840Jx7VzwgUJIfZkZtYPUvzbrV6Bt3uy/15FXAYnT /mHA== X-Gm-Message-State: AOJu0YxZtgSXXU+BzJQLku9ofM5ao+R1y20DxOHFhgpLR9tZ4Py4tTKM wHGFZd4S/YLrv13G00V6LGqLOajqxzxzig== X-Google-Smtp-Source: AGHT+IHt/P5/L5xH5AAfveckh63ganb8NEGmYwtf9RT0JC1yoNO6aAavNRUXC/fTYmqSHMRcJOKt7w== X-Received: by 2002:a05:600c:2143:b0:40e:4156:9059 with SMTP id v3-20020a05600c214300b0040e41569059mr371775wml.177.1704882070457; Wed, 10 Jan 2024 02:21:10 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:09 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 04/18] tty: serial: samsung: sort headers alphabetically Date: Wed, 10 Jan 2024 10:20:48 +0000 Message-ID: <20240110102102.61587-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sorting headers alphabetically helps locating duplicates, and makes it easier to figure out where to insert new headers. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 74bc5151dad4..f37d6724bfe5 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -21,26 +21,27 @@ * BJD, 04-Nov-2004 */ -#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include #include -#include -#include +#include #include -#include +#include +#include +#include +#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include + #include /* UART name and device definitions */ From patchwork Wed Jan 10 10:20:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762421 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 026DA3FE38 for ; Wed, 10 Jan 2024 10:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YvFtRv/A" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40e4d515c9aso25724855e9.0 for ; Wed, 10 Jan 2024 02:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882071; x=1705486871; 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=O4iYdXj/TSCgsEZp2b2vJFAs1qXmGMx2hLD5PPyxfe4=; b=YvFtRv/Aj0WzE6T6JVyC9vI3o48kV5b3VhioXCfQUA2NNmQ0eRbh7NY9m952Rji0LP K8TyYyQJO29Vp9TCsipUwvA6CY0Yjsss/ItgOLMkKUCn5CG0Xn/4sjres+RpUTBirHJe EaKm+dkNp4bTLheTStRSsaE7i71c14F3zs5swX4N8lCbGsyvwNH11/KgS6eBTaIS0Cfb q16+ahe/532c1crhJldrJYAJZLpikeYUDxypnyI7NCL5QeVVlwLrnMPBz46WMAqSwBTn +yvJLsElFf3BZCldefewu3XRWszfTwB8tE7xJwwZjTgHQzG3E1cF/2Wb2JA467hbKpsi lWAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882071; x=1705486871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4iYdXj/TSCgsEZp2b2vJFAs1qXmGMx2hLD5PPyxfe4=; b=XhQWFiWVeV+WayWi3CuElojaB1OFqlm89LuOyMF5A5UatLzUTZV/15qD/FRhrsiUoE 2ytbrOOxWbGbTyWJ+mUpKX8ED7yKgE0bdUmTDdKC1XzXg9tcfUHKIduXhk3JdVmlK1pL 5X9SVEEkWMJ8LqJrw944OXGDn7mRXIpdINuziuPhFYk15R5CN/ioCxDPolKZWWAx2r+W nmw5dfNKusQvz0P8kpkrbTksvm72rrHlyMssih1eJKWlnSSsMZgUAdSvgfeZ/aa/eeNJ CHyKqCdv0KbGGF1ECaEn/OO3uSGOaMnO4Ooji9RUzOh6bR18fv3/G4Im23xYgwZki5Ea k82w== X-Gm-Message-State: AOJu0Yw8s6zkL99XVubbv4bfLLV8VNbvSpCVwQnm1F+vnn5sLzfrG3hQ 6emevo0ChbgOlyP5vaCp/TYqtmyiNxFZFA== X-Google-Smtp-Source: AGHT+IEJaLJEuywZyJ4sRLPFSPZQHxuethScWjz9nRPWcCw2dTCMG2kd8LT+vUP10sFOjNedK0JasQ== X-Received: by 2002:a05:600c:3d1a:b0:40e:461e:26a6 with SMTP id bh26-20020a05600c3d1a00b0040e461e26a6mr471328wmb.36.1704882071439; Wed, 10 Jan 2024 02:21:11 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:10 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 05/18] tty: serial: samsung: explicitly include Date: Wed, 10 Jan 2024 10:20:49 +0000 Message-ID: <20240110102102.61587-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 samsung_tty.c uses u32 and relies on to include . Explicitly include . We shall aim to have the driver self contained. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index f37d6724bfe5..b8b71a0109ea 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -41,6 +41,7 @@ #include #include #include +#include #include From patchwork Wed Jan 10 10:20:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761684 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 0881C405E8 for ; Wed, 10 Jan 2024 10:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bKhdoES9" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40b5155e154so51689695e9.3 for ; Wed, 10 Jan 2024 02:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882072; x=1705486872; 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=LfuH3wSlm6aDB+5MQe7gxyw0I5hRCPtFyKG+AY6rcK0=; b=bKhdoES9+F2y3TxMRg2fmdjlR7vKrmFmAItlg/a5/LR9I/kNGMpXkkV2YL/qiNW2V1 XfgWab3hof4XzpG+ujafoNtB7pOnxcwl4Z+xqjkFerEH891zhOugxKfLjdpovol4As6F 7w2TrTNkTnE4ls35kdgm1XRekzRQpdds08nIPXH3aX9TMkLh4pC2FIK2PTqKbzHjnWFt CrDGykSrRl/Pqgf1lXcBdZh+3QxOu7iOSDLSFqAsVtIbiHbIdfuk4pOLoQ7r2G4nC6Q9 t+Resins4erU5SW3ewqG9/o6NEPi0mkjANZKlc4xfhXnMEQsr2Yb9RrzHYVEWk1ZO/+e E+gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882072; x=1705486872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LfuH3wSlm6aDB+5MQe7gxyw0I5hRCPtFyKG+AY6rcK0=; b=aD1cLrEjuBMqoAEv7q9fCeING3q8VdzLHNT+eZjLUUh7UPVUvsh+8pIVw8KpVrHm+j b68JK1yXW/Av1HUE7cXtvlfw1KyxpBdyPVEeVEHq3HmSUKklH6NuVRVbxNa5DiHOQ40P PstAg0Bk072HEE+ueONbouW+segt1CYVkVn5LQ/3ymcUFJ2uAEucDDsErY9mcKmimN0e ZnDkOkJfR5l6DZnju1nzuFxDQTeD2NjUD4Fcn71RnNaUfHXDhFPLSbc0roYvjqE8aId9 pwvHG3d8d5Fpnv5kURzbOsjzX6J0g6MlfCQjEAJ8Kp/8aflLx4n3Z1Kr+q5bEGyUdssg bJ5g== X-Gm-Message-State: AOJu0YzDkMDtm/fPfLaf+qyuLK55pdqYAPePlYrN8InfZI1fgzMMUNLI JX8Z48+zHWJrHu7nyATX0SdEJEerNOh6zw== X-Google-Smtp-Source: AGHT+IHxCH+x8Bd49h96aENkSSiu3NcMtRR69yY6qu1FUYAozJ3aiG1NexaAB58eotSyJt97Xv++1Q== X-Received: by 2002:a05:600c:5390:b0:40e:3f37:d893 with SMTP id hg16-20020a05600c539000b0040e3f37d893mr457342wmb.17.1704882072241; Wed, 10 Jan 2024 02:21:12 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:11 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 06/18] tty: serial: samsung: use u32 for register interactions Date: Wed, 10 Jan 2024 10:20:50 +0000 Message-ID: <20240110102102.61587-7-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 All registers of the IP have 32 bits. Use u32 variables when reading or writing from/to the registers. The purpose of those variables becomes clearer. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 79 ++++++++++++++++---------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b8b71a0109ea..d5f9bec24b8e 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -199,7 +199,7 @@ static void wr_reg(const struct uart_port *port, u32 reg, u32 val) /* Byte-order aware bit setting/clearing functions. */ static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, - unsigned int reg) + u32 reg) { unsigned long flags; u32 val; @@ -212,7 +212,7 @@ static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, } static inline void s3c24xx_clear_bit(const struct uart_port *port, int idx, - unsigned int reg) + u32 reg) { unsigned long flags; u32 val; @@ -245,8 +245,8 @@ static void s3c24xx_serial_rx_enable(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon, ufcon; int count = 10000; + u32 ucon, ufcon; uart_port_lock_irqsave(port, &flags); @@ -269,7 +269,7 @@ static void s3c24xx_serial_rx_disable(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -591,7 +591,7 @@ static inline const struct s3c2410_uartcfg } static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, - unsigned long ufstat) + u32 ufstat) { const struct s3c24xx_uart_info *info = ourport->info; @@ -663,7 +663,7 @@ static void s3c64xx_start_rx_dma(struct s3c24xx_uart_port *ourport) static void enable_rx_dma(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -686,7 +686,7 @@ static void enable_rx_dma(struct s3c24xx_uart_port *ourport) static void enable_rx_pio(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -711,13 +711,14 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport); static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) { - unsigned int utrstat, received; struct s3c24xx_uart_port *ourport = dev_id; struct uart_port *port = &ourport->port; struct s3c24xx_uart_dma *dma = ourport->dma; struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port); struct tty_port *t = &port->state->port; struct dma_tx_state state; + unsigned int received; + u32 utrstat; utrstat = rd_regl(port, S3C2410_UTRSTAT); rd_regl(port, S3C2410_UFSTAT); @@ -759,9 +760,9 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ufcon, ufstat, uerstat; unsigned int fifocnt = 0; int max_count = port->fifosize; + u32 ufcon, ufstat, uerstat; u8 ch, flag; while (max_count-- > 0) { @@ -945,7 +946,7 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) { const struct s3c24xx_uart_port *ourport = id; const struct uart_port *port = &ourport->port; - unsigned int pend = rd_regl(port, S3C64XX_UINTP); + u32 pend = rd_regl(port, S3C64XX_UINTP); irqreturn_t ret = IRQ_HANDLED; if (pend & S3C64XX_UINTM_RXD_MSK) { @@ -964,7 +965,7 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) { const struct s3c24xx_uart_port *ourport = id; const struct uart_port *port = &ourport->port; - unsigned int pend = rd_regl(port, S3C2410_UTRSTAT); + u32 pend = rd_regl(port, S3C2410_UTRSTAT); irqreturn_t ret = IRQ_NONE; if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) { @@ -983,8 +984,8 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ufstat = rd_regl(port, S3C2410_UFSTAT); - unsigned long ufcon = rd_regl(port, S3C2410_UFCON); + u32 ufstat = rd_regl(port, S3C2410_UFSTAT); + u32 ufcon = rd_regl(port, S3C2410_UFCON); if (ufcon & S3C2410_UFCON_FIFOMODE) { if ((ufstat & info->tx_fifomask) != 0 || @@ -1000,7 +1001,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) /* no modem control lines */ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) { - unsigned int umstat = rd_reg(port, S3C2410_UMSTAT); + u32 umstat = rd_reg(port, S3C2410_UMSTAT); if (umstat & S3C2410_UMSTAT_CTS) return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS; @@ -1010,8 +1011,8 @@ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) { - unsigned int umcon = rd_regl(port, S3C2410_UMCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); + u32 umcon = rd_regl(port, S3C2410_UMCON); + u32 ucon = rd_regl(port, S3C2410_UCON); if (mctrl & TIOCM_RTS) umcon |= S3C2410_UMCOM_RTS_LOW; @@ -1031,7 +1032,7 @@ static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) { unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -1189,7 +1190,7 @@ static void apple_s5l_serial_shutdown(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -1215,7 +1216,7 @@ static int s3c64xx_serial_startup(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C64XX_UINTM, 0xf); @@ -1260,7 +1261,7 @@ static int apple_s5l_serial_startup(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS); @@ -1345,7 +1346,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, static inline int s3c24xx_serial_getsource(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned int ucon; + u32 ucon; if (info->num_clks == 1) return 0; @@ -1359,7 +1360,7 @@ static void s3c24xx_serial_setsource(struct uart_port *port, unsigned int clk_sel) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned int ucon; + u32 ucon; if (info->num_clks == 1) return; @@ -1476,9 +1477,8 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; unsigned int baud, quot, clk_sel = 0; - unsigned int ulcon; - unsigned int umcon; unsigned int udivslot = 0; + u32 ulcon, umcon; /* * We don't support modem control lines. @@ -1760,7 +1760,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port, const struct s3c2410_uartcfg *cfg) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ucon = rd_regl(port, S3C2410_UCON); + u32 ucon = rd_regl(port, S3C2410_UCON); ucon &= (info->clksel_mask | info->ucon_mask); wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); @@ -1906,7 +1906,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, wr_regl(port, S3C64XX_UINTSP, 0xf); break; case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -2110,7 +2110,7 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) /* restore IRQ mask */ switch (ourport->info->type) { case TYPE_S3C6400: { - unsigned int uintm = 0xf; + u32 uintm = 0xf; if (ourport->tx_enabled) uintm &= ~S3C64XX_UINTM_TXD_MSK; @@ -2126,7 +2126,7 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) break; } case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; int ret; ret = clk_prepare_enable(ourport->clk); @@ -2188,10 +2188,10 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = { static struct uart_port *cons_uart; static int -s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) +s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ufstat, utrstat; + u32 ufstat, utrstat; if (ufcon & S3C2410_UFCON_FIFOMODE) { /* fifo mode - check amount of data in fifo registers... */ @@ -2207,7 +2207,7 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) } static bool -s3c24xx_port_configured(unsigned int ucon) +s3c24xx_port_configured(u32 ucon) { /* consider the serial port configured if the tx/rx mode set */ return (ucon & 0xf) != 0; @@ -2222,7 +2222,7 @@ s3c24xx_port_configured(unsigned int ucon) static int s3c24xx_serial_get_poll_char(struct uart_port *port) { const struct s3c24xx_uart_port *ourport = to_ourport(port); - unsigned int ufstat; + u32 ufstat; ufstat = rd_regl(port, S3C2410_UFSTAT); if (s3c24xx_serial_rx_fifocnt(ourport, ufstat) == 0) @@ -2234,8 +2234,8 @@ static int s3c24xx_serial_get_poll_char(struct uart_port *port) static void s3c24xx_serial_put_poll_char(struct uart_port *port, unsigned char c) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); + u32 ucon = rd_regl(port, S3C2410_UCON); /* not possible to xmit on unconfigured port */ if (!s3c24xx_port_configured(ucon)) @@ -2251,7 +2251,7 @@ static void s3c24xx_serial_put_poll_char(struct uart_port *port, static void s3c24xx_serial_console_putchar(struct uart_port *port, unsigned char ch) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); while (!s3c24xx_serial_console_txrdy(port, ufcon)) cpu_relax(); @@ -2262,7 +2262,7 @@ static void s3c24xx_serial_console_write(struct console *co, const char *s, unsigned int count) { - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); + u32 ucon = rd_regl(cons_uart, S3C2410_UCON); unsigned long flags; bool locked = true; @@ -2289,11 +2289,9 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud, int *parity, int *bits) { struct clk *clk; - unsigned int ulcon; - unsigned int ucon; - unsigned int ubrdiv; unsigned long rate; unsigned int clk_sel; + u32 ulcon, ucon, ubrdiv; char clk_name[MAX_CLK_NAME_LENGTH]; ulcon = rd_regl(port, S3C2410_ULCON); @@ -2743,7 +2741,8 @@ static int samsung_early_read(struct console *con, char *s, unsigned int n) { struct earlycon_device *dev = con->data; const struct samsung_early_console_data *data = dev->port.private_data; - int ch, ufstat, num_read = 0; + int num_read = 0; + u32 ch, ufstat; while (num_read < n) { ufstat = rd_regl(&dev->port, S3C2410_UFSTAT); From patchwork Wed Jan 10 10:20:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762420 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 D91A840BE2 for ; Wed, 10 Jan 2024 10:21:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FYBshhb/" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40e585ec8ebso2401915e9.3 for ; Wed, 10 Jan 2024 02:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882073; x=1705486873; 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=mwqnqS/wycxZAhr2uerf+qQVYpnKiVk2U9Lnh+3LXKA=; b=FYBshhb/YFgpGgyC0oFjH3SM7b/iaSx6vx50RqqOq6x0orsdHw54YLi1vwuMLWub6U oO3oP3A1hC7RPucRt7tTtFJxBPldQr8gAnUhy1RQYE/uouf/UpIK6w5o9VjzvOSecqSI gGA8cbBTZ/Il8dAE//cZSq7CDB/ws5/YZ7iQu5YQX9KVkd88Bo6Ul2puSJ7ZAWAKdpOx kbEnCGZp+7f0Y5uyQBOo1UoAjvW9XD/NvrATBim4X6zxd2EK/kcx1T0HNkYfco/FOtDX F1a9M8UX8a3/acHKtLgE/Dc2oxCKZ17OU3bSPyj8maRJHMZNT/TkzVTn28vDgiTKR0PO Rc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882073; x=1705486873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mwqnqS/wycxZAhr2uerf+qQVYpnKiVk2U9Lnh+3LXKA=; b=otSeFUPA1W0ny5hBggD7399X0bL/yEGZONeWmWihbBY7qhW0kdGQuP0mKUNriPlnN5 yYoFN6nPfyq4AxJQ8IVbE7qRFvKwVSNU7nhyPJICQSd5hhkCVmbbxIc7wOfLQKQTticc f0+ru/FjkwDr6fUOockG1OQgV9BKMlOrhZuO+NS0Y8WWqLX2VBw3o6g50L6EdSquJHII wzNhw7lp0HTD0GGs8MW6pUOI+43KzuDb46g3jgxdNNSXNPFGg7xrPnpg8KLz3hUmua3R /nYwf605N0IMYGRx5zuCaaFgO254NMTY40R1TV/kcF5KEdgLEnajI7ZPm4XVqH5OfaCw 9lzg== X-Gm-Message-State: AOJu0YwYxB6RqAp+gpiuw+SL7s2Y6iPwaQyDbOUVIvWtfs2euv0lLl4P ZBCdHxAp+RH+XnoijgQTOUUlt99KZgwZ/A== X-Google-Smtp-Source: AGHT+IGcQBbhMHK+EKOMon1hp4+KGJv3InwLXWLO1SrdmS31XEWMZkMTbvJjozVPLu3hLFnAqJN0FA== X-Received: by 2002:a05:600c:519b:b0:40e:49b2:2c9e with SMTP id fa27-20020a05600c519b00b0040e49b22c9emr439607wmb.34.1704882073274; Wed, 10 Jan 2024 02:21:13 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:12 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 07/18] tty: serial: samsung: remove braces on single statement block Date: Wed, 10 Jan 2024 10:20:51 +0000 Message-ID: <20240110102102.61587-8-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Braces {} are not necessary for single statement blocks. Remove braces on single statement block. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index d5f9bec24b8e..11ae3a1dcdc3 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2062,9 +2062,8 @@ static void s3c24xx_serial_remove(struct platform_device *dev) { struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); - if (port) { + if (port) uart_remove_one_port(&s3c24xx_uart_drv, port); - } uart_unregister_driver(&s3c24xx_uart_drv); } From patchwork Wed Jan 10 10:20:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761683 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 D2F8141239 for ; Wed, 10 Jan 2024 10:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L6VpBB9c" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40e490c2115so16885665e9.0 for ; Wed, 10 Jan 2024 02:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882074; x=1705486874; 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=uJiSbOx+y9kAD9nYaP7HZ6jgQVEvK0yZ8eFJjkZeaz4=; b=L6VpBB9cF0a6G4w3wFJSHiZmBJMqa/hdSG0umDIbKLKyjOIRDkvUG8qQDCDgXSURCj 6kUE1gvDRIxWsKtzmunBVrhJuTKrhEnTlyfLZRupIPYTKDcab0ZIgDSLf5+96y2ljsDs 5ylv14ztav+JB7Q0JEyQgfxRL/isV7rIJxp8Zen7UukbRAdmpXHoyKD0BDN+VaLR0N2K S8mJT8fx2JF6VC8Gn+Sq6dSPsafef2Fi7J89FTpZednqtlEkQGB60Ke0g6aSrk9EvObE 8r6ARQtx3ukckfVFhdw7vza83eiNWDtmiIfzmudak0SHkii9TfLTBsm0dsFjPekqhjk6 6fiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882074; x=1705486874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uJiSbOx+y9kAD9nYaP7HZ6jgQVEvK0yZ8eFJjkZeaz4=; b=fMmbnGqikaFx7RT5Q/9P9jxYn5X626twetZC2VoUV9TnsG/W15k+uQ6ICRG3AEm5Mp mFGhrY2J+O4YnUTx9pS38bDvVuJZ2V4ZrKTegf1PmJ8TbVJz3qxLNIic7g5LdjRYg0Jb F7ZtTJekYv08pZJeqMNGuMQpx4SMuhelj1ZIdNsskRJqMjZI3Bz7nZSXJ1o++u2E1+nu HUjF+Qw6Vl/MUZyPu+8QTYnDoLvdmWa6GzQUS7jzoiF4QXAhxTESB5PBCuYQQWXUDQMq YCYMmbCBCnt6BY6Yuj4GpABmlk8QQBcKJZKLi1WR5KNd3wyuTiCAHxb3BzbXTMPrEey0 o1sQ== X-Gm-Message-State: AOJu0YwoFISuxnP/1Ze/A/AfaNGXy8lWakI1ILf/ofvo2Iks4lIGJyux qp/X1NVopjYAsSO5e7cSBpQjm2Rx6RMFFg== X-Google-Smtp-Source: AGHT+IF1VVx7NZ4+jYpZe5nZJn+QtrY9rCxcI5pj277eW+yQK3URG35FfJHed1DogBS4MlQyh203yw== X-Received: by 2002:a05:600c:3b97:b0:40d:94ba:cb8c with SMTP id n23-20020a05600c3b9700b0040d94bacb8cmr489208wms.109.1704882074171; Wed, 10 Jan 2024 02:21:14 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:13 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 08/18] tty: serial: samsung: move open brace '{' on the next line Date: Wed, 10 Jan 2024 10:20:52 +0000 Message-ID: <20240110102102.61587-9-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Move open brace '{' following function definition on the next line. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 11ae3a1dcdc3..b9d1ef67468c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1740,7 +1740,8 @@ static struct uart_driver s3c24xx_uart_drv = { static struct s3c24xx_uart_port s3c24xx_serial_ports[UART_NR]; -static void s3c24xx_serial_init_port_default(int index) { +static void s3c24xx_serial_init_port_default(int index) +{ struct uart_port *port = &s3c24xx_serial_ports[index].port; spin_lock_init(&port->lock); From patchwork Wed Jan 10 10:20:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762419 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 5629244388 for ; Wed, 10 Jan 2024 10:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jQxehS3R" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40d88fff7faso41078505e9.3 for ; Wed, 10 Jan 2024 02:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882074; x=1705486874; 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=XpLNRFI7Q+nWhYT1sc52rnbfGdxVUedlk9wvDQAxZZo=; b=jQxehS3RRNio84dia/qvQRDy5JrvR4eRjQKt6wOkk4cTI6ggjkRMh4X6cz8rZMxYeO muTCD/V+/qb5DmRYW76XLhZVPsezKMzziD4OP8tCoWlXtROL2YVi90JY2AnxrIDsrde+ AGOWBYRfeo5jWmfDZ5nVespzCP08avUTgkixBXx8aS/vx4z1qvhpk/jVS/NTcSOkDffX aQJgRriBeMLo693a7UC9PzVrjKaw/bE4Cu9zh8V0xBSrssfeSKzmjXU2ZQrgJ2p/BF4H k+erZ9rBDwxXpWymcs2ug4E5nS3WQG/eOSl4fEdwTHEg7vKHxylpSSzY8o2m8GPPyAan nwOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882074; x=1705486874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XpLNRFI7Q+nWhYT1sc52rnbfGdxVUedlk9wvDQAxZZo=; b=bpZWTgj6LDNCzdNcYEGrmbki8waShjIGv2bgPrLFvOwXcR7OVxYVK7ZCmI+9G9HocG glIqfWsRofc4SPg9JfGr8UneDUyy0UdUUXBVmSVp6mM5MDYX6vY9EvIrSZ250Tug+TbC 7PtO9miRfN6L3BaoxeHiXgWfmx7xDt/OEdiNlyfiuRFTJk04XTgmAAfsHVxQhbC8Aa4O 6rClFK2X5GGvPI/j4ZOhRz0EHZHIV/36u8Y35l2tDMLj2qQU5YzdsB81E6LNvoot0H2o v0VqGkyZZN6Kp8WBKlJ5xQOQUdWiG00pn8uA5an+dvqtgtJxWdttg75TocwngBlnuTzg HZxQ== X-Gm-Message-State: AOJu0Yz4S8C7NthuyRIvWOhEcefj3EGNTGKRKjhIjNrJYwtidG/dcjtZ R/pcLrx+Xz5qTnOJEY8X+m/r+k9dd3Fn0Q== X-Google-Smtp-Source: AGHT+IGUYbHFbchWngawNO9+st/Bnrd1dMjCfFRd06ZBdJ7tUXEyUMFqYOKHkId3ObbsvmgEoSrIWQ== X-Received: by 2002:a05:600c:2195:b0:40e:42ce:1b67 with SMTP id e21-20020a05600c219500b0040e42ce1b67mr192335wme.246.1704882074792; Wed, 10 Jan 2024 02:21:14 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:14 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 09/18] tty: serial: samsung: drop superfluous comment Date: Wed, 10 Jan 2024 10:20:53 +0000 Message-ID: <20240110102102.61587-10-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The comment brings no benefit as we can already see from the method's name, ``s3c24xx_serial_pm``, that it deals with power management. Drop the superfluous comment. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b9d1ef67468c..90c49197efc7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1296,8 +1296,6 @@ static int apple_s5l_serial_startup(struct uart_port *port) return ret; } -/* power power management control */ - static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, unsigned int old) { From patchwork Wed Jan 10 10:20:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761682 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.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 1E84E45C1C for ; Wed, 10 Jan 2024 10:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DsGBHJmk" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40d4f5d902dso42003675e9.2 for ; Wed, 10 Jan 2024 02:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882075; x=1705486875; 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=2v2KRYXA+keXRfq45rf7VwhlRc8wCU8IH+wWuas1Yt0=; b=DsGBHJmkSTXlmYapX+3mNu5VB00VVSMxNr1PV05C6V1gK1AwSCNbqdpd5Tb9Hbouup +UkgeU+eGgoFgmjL2piF81SbxHtJ3gzQ0Klbbq5V1EVQcykukmnqAAN+XxI1zQ1FebUg LXxXY9n+WeCNccYuXcBSwZ81stm2RareyoppqGLi7EX0BMN4rxQCBYOQffe5AqGH5iOh lUZ64P6zM9lDrFXNROnZEog/zDlArIgBjUvFmhTILv2wKeTKMsqP4VnK+b+tpXG4MFIV wNZG2uW394vYclC232qMoEYfJzLn5+N1f4Cx1Tz6zTZJhqOMW4Zo1K36+RDdForSaz5f K2Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882075; x=1705486875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2v2KRYXA+keXRfq45rf7VwhlRc8wCU8IH+wWuas1Yt0=; b=mhoaCg5MERyi4l3f5hiubSWCWh+FZsMJQhyHvK4Lhu6lu5MTkWerPOheJvatU3PO1A 0kXIMneFb/MGkedmkiXxHFH+hqa/MmtyY0w4wtJj2HaxA/I3Hk8iRZapDF3IClyNlHXI Fmq/ERkLOgtwRt53HT5mMKZO78wkbi3z6klSHQtjIayh+s4bfkHpmAXLdWxvorw03Z3I FFo6fNlq8cN7oeItVSJIuYAMVIee7Hr43Ua3efgaVhcGDIvyyPdb78j4CRKGK/ONl81S b4Sm/fI+qSTzLZiFBlcvn4dCbDK136WXia9DaRUBQQI7vlauUd9BT6prngKG/I+9IqeG v4lA== X-Gm-Message-State: AOJu0Yz4DXt/khpoNYdN+b1ajraF+9P7aFkCvZ3CjMzMK3CD3rXg5NMh N+1uZAUb7yHstIXQdyMXV7HNrafUK5gIcQ== X-Google-Smtp-Source: AGHT+IGLeDeKQhsCLP5+R4lOabowbyfiHLzCDX82nYtvoNIupA5AR/1fHezyqisxDb7TJ9bwCXPMhA== X-Received: by 2002:a05:600c:1d95:b0:40e:4084:b948 with SMTP id p21-20020a05600c1d9500b0040e4084b948mr414155wms.94.1704882075513; Wed, 10 Jan 2024 02:21:15 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:15 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 10/18] tty: serial: samsung: make max_count unsigned int Date: Wed, 10 Jan 2024 10:20:54 +0000 Message-ID: <20240110102102.61587-11-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ``max_count`` negative values are not used. Since ``port->fifosize`` is an unsigned int, make ``max_count`` the same. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 90c49197efc7..dbbe6b8e3ceb 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -760,8 +760,8 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; + unsigned int max_count = port->fifosize; unsigned int fifocnt = 0; - int max_count = port->fifosize; u32 ufcon, ufstat, uerstat; u8 ch, flag; From patchwork Wed Jan 10 10:20:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762418 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 3E8A746556 for ; Wed, 10 Jan 2024 10:21:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k7Vb1n5F" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-50eabd1c701so4851034e87.3 for ; Wed, 10 Jan 2024 02:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882076; x=1705486876; 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=nZqqbWPwYwhLrpcSvI/iFs7tmVPH9J4dNpzf8ql04hU=; b=k7Vb1n5F2SEPXIQXisAakST2klRHzgVl6s9Cikn8ta66M4l/aiA/96Hc0Ae+BeCAlq DwvsfkTHeb4HbgQf8UWBTlxG/JikGHbDYYzBZzvFRKlTKYehzCrFKVPcyGpxWAMsWrVq 6zBbTyNY9jiXUwhWOOfua40wCqTuot1ba8q6OAnpZrG3cAxt8/Z1GJ8sizCXIBYcZD4w qopt13AtQQMbHjv438CRroXDbp/0uiJ4S/iB6VBVWygoAMk/DtngrasklYAcqkK5TMj4 xozVhdLF4jfXIQkp4TX3mXCxHFLEcQ3Wtg5VHMX+tdm6IOR7yPa1GV9n86n4IK+9z/4U 6f3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882076; x=1705486876; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nZqqbWPwYwhLrpcSvI/iFs7tmVPH9J4dNpzf8ql04hU=; b=hcgwWbBWem32MhIqTBC3GMtPGHcMT9knN3erxVhvXpnU4TW3aw4dAVirJpPV9BUu6F 7g/Empp/XZaAbWmtl+oMnPhSUvlvSaBLeCncMQ+X25J8zj5/wYTbkkU3H7WCq57hvf6F gS26TJClJK2Pb+1ifYCax8jrTC0AyhOUFj9JSgv9NR9wZ3qTzHcYA9vPTbJOa/KkUkyA jNtAekGr6L+53Vt3hHxtbR8OfxmSOwR3eCQi8lsWa3XXgaPOogb42Pi2BFczJdpwUrYB j/FHO9rVxcG7NYoqcD6cJnNkBn1D61lb/eluWMx82vcouAt7YctBr1mfBI5FbmnN7WjX 948w== X-Gm-Message-State: AOJu0Yw1hq1a5/jvwnW4/X9w5LKHQjEr85faFd9/qqp0D6V2EApUbYYD LpUU2lLj9cidyDf2yNSyJqE8KllTCPrrIw== X-Google-Smtp-Source: AGHT+IHUDinlorp0iKAoAamRhoFsnXh8pnrCQea2LbnsIeK75SvmBljlO0KL8/orqVUjuZxufpV6mQ== X-Received: by 2002:ac2:4554:0:b0:50e:8137:9a10 with SMTP id j20-20020ac24554000000b0050e81379a10mr307722lfm.129.1704882076456; Wed, 10 Jan 2024 02:21:16 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:15 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 11/18] tty: serial: samsung: don't compare with zero an if (bitwise expression) Date: Wed, 10 Jan 2024 10:20:55 +0000 Message-ID: <20240110102102.61587-12-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since an if tests the numeric value of an expression, certain coding shortcuts can be used. The most obvious one is writing if (expression) instead of if (expression != 0) Since our case is a bitwise expression, it's more natural and clear to use the ``if (expression)`` shortcut. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index dbbe6b8e3ceb..f2413da14b1d 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -988,8 +988,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) u32 ufcon = rd_regl(port, S3C2410_UFCON); if (ufcon & S3C2410_UFCON_FIFOMODE) { - if ((ufstat & info->tx_fifomask) != 0 || - (ufstat & info->tx_fifofull)) + if ((ufstat & info->tx_fifomask) || (ufstat & info->tx_fifofull)) return 0; return 1; From patchwork Wed Jan 10 10:20:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761681 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 C80E14778E for ; Wed, 10 Jan 2024 10:21:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XiaxeP1F" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40d8902da73so37762495e9.2 for ; Wed, 10 Jan 2024 02:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882077; x=1705486877; 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=X4OrxluJS1Dxt0QsygYV4JA7ss0pHdXLycYpqP8S/nY=; b=XiaxeP1F/NrMhXsnnLE7Hr2pHbh298NywDAybFLZmrWm632DevmscaQ+QMWERiOvby XGtbUetrkmiFlSiM9wLA+UqdgnLXsroAnsJ21jjBuU2Ko7CuZVb5Fgb2MK5+nVpy9ujQ e1tZzL41uyarHCe9d3kcphhPjfUS9jVf4xVwB8tkaLka2kquTlbixIzFt5IGfXJIFJ// 8Poofs3EJCBg5Adu4UQOJdqaO/rpp3YNlgqLIDQucmev/hWnrO8McsoB9jepyfvruQwh A9xacRXOOsDENxKLPzwwjBxhLLveuh4ALxrANCMAYSw1pbSmgyqsESohQmRWjJ3G7alR DfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882077; x=1705486877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X4OrxluJS1Dxt0QsygYV4JA7ss0pHdXLycYpqP8S/nY=; b=XeFVhEQLm30f+gHlvqQAKut/xBEQyxgKq6M9ylLkhU7TEYcjNzOe8sbC9PdgCrNrr+ QmwVv4Od1tIByd8BKdOT7dhawl5e9W3eJiAUATINBl2Cy6ueDzvrDQipphFraIXCVSLx JH/Tlv/2t3TQrR+3ozQhgucU5RWx7++uIQa7VTWmO+SkxK/vawRWScnv0WDeuSZ0WJjK WPC08JMGuuageiuPOU+lJeqlbhHUWEPn10SU979c1T9ferf7ltxbUb/jpAYdYsmg4lPt zHEj0px0MiO9g8EsDlnPpwNZWnGUitd/Jjk3K55lN6VWLtCHuAsT7UnfipyoIJjtdOSo 0V9Q== X-Gm-Message-State: AOJu0YxjxPxDF7f6PbLu3PfkfMgloBayhEKwlFesdUFFPgR+HlKrwsxl ED3pGkkiwS8tAlbJbOURF/4HFE4grS7kCA== X-Google-Smtp-Source: AGHT+IH2pHpqQ2IvcL8mLqW4mDIBGBWO/XFWarVigmK91FlJxQn+wyWXYGgkF4J4hdXMLY2WPdpvQQ== X-Received: by 2002:a05:600c:511e:b0:40e:42b4:23b6 with SMTP id o30-20020a05600c511e00b0040e42b423b6mr498393wms.55.1704882077261; Wed, 10 Jan 2024 02:21:17 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:16 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 12/18] tty: serial: samsung: use TIOCSER_TEMT for tx_empty() Date: Wed, 10 Jan 2024 10:20:56 +0000 Message-ID: <20240110102102.61587-13-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The core expects for tx_empty() either TIOCSER_TEMT when the tx is empty or 0 otherwise. Respect the core and use TIOCSER_TEMT. Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index f2413da14b1d..46fba70f3d77 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -990,11 +990,10 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) if (ufcon & S3C2410_UFCON_FIFOMODE) { if ((ufstat & info->tx_fifomask) || (ufstat & info->tx_fifofull)) return 0; - - return 1; + return TIOCSER_TEMT; } - return s3c24xx_serial_txempty_nofifo(port); + return s3c24xx_serial_txempty_nofifo(port) ? TIOCSER_TEMT : 0; } /* no modem control lines */ From patchwork Wed Jan 10 10:20:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762417 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 9164247A5B for ; Wed, 10 Jan 2024 10:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yYSveuyM" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40d87df95ddso41204185e9.0 for ; Wed, 10 Jan 2024 02:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882078; x=1705486878; 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=zUZkD3RxZyomRUtnLq1bNhUO9I/uygo4/DAHV/FeOS0=; b=yYSveuyMs5dIyP/53U1mj1nZF+w3Z5vq/5XOV2by6TdQiU6pvh/hhKxfWqAylgUOMm KF/NC+SVesNplooqw5r8RnYkIwQOwpvzmU+cI4vl83fGKi4YqgZ8GYaLUm382PqJT05Z G+FWWGFcl4Wg2qcNVYqFaF5UCAwQnbl579KGCTQpuuBVBGq52zqIHiudcZ71xW5atKqO 1xiZelrkBcF2JjUrjgRYHXcm/hOqWyzVT1afhB92FgZYuyL4IKuWI9w8+enrNqyfLG3C uziI49QNg7DgrKIsi7zNem1j6k8iEvYoMJTzFTvrjjSfMNJGum73aytwRGZtWE7ATzS6 S3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882078; x=1705486878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zUZkD3RxZyomRUtnLq1bNhUO9I/uygo4/DAHV/FeOS0=; b=N6YTuggmy0boaycFWAqIdbC7aNAartYBiyf0lwO0ZTcKE+RMmJPHrpBsaufDehcajy Dl8PKF4+O9cLq/AS6fHaXJPCrCCdCzuMj5up0FXhNqw3JPlXKPXYXL1qAMxBMQ1C08fu K3jGafQ1a3Nr0vG3qlnwuOLmhiZZRGEHHJ6OrI+bBZP+Cak3QbCsIN/No/bGbh2NpBTU mncOeFI3q3dgRsvHVcLOIZCSx+k80axnHJrX2nH9X6iH1f3kB4xV4rdf5un7oEeAp2kB YIV929FrBBoW70/B6lzJCBDxqupeLB4uxbZxbEKGGOq1jhKQ1Ne4SHziv+VnyhDzrfWe E+Vw== X-Gm-Message-State: AOJu0YyJvxcOY6YXwokbwZGS9o7Jw3bP3C+mKLpqkIwwmiCLkVF5yzP7 Qki8s+9IngmKjUOFeJRR7KYNh1lTvU4LiQ== X-Google-Smtp-Source: AGHT+IGYLsOFrNdKSYUGQJjzwSLK/RYL6+X1/WFxwE+OfMrXS+TWExfIax6TS45wnteKjsb5eI8ulg== X-Received: by 2002:a05:600c:45d2:b0:40d:7c1a:cce4 with SMTP id s18-20020a05600c45d200b0040d7c1acce4mr208326wmo.213.1704882078025; Wed, 10 Jan 2024 02:21:18 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:17 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 13/18] tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo() Date: Wed, 10 Jan 2024 10:20:57 +0000 Message-ID: <20240110102102.61587-14-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 s3c24xx_serial_txempty_nofifo() returned either 0 or BIT(2), which is counterintuitive. Make the method return bool, and return true when TX is empty and false otherwise. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 46fba70f3d77..63e993bed296 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -236,9 +236,9 @@ static inline const char *s3c24xx_serial_portname(const struct uart_port *port) return to_platform_device(port->dev)->name; } -static int s3c24xx_serial_txempty_nofifo(const struct uart_port *port) +static bool s3c24xx_serial_txempty_nofifo(const struct uart_port *port) { - return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE; + return !!(rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE); } static void s3c24xx_serial_rx_enable(struct uart_port *port) @@ -782,7 +782,7 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) ch = rd_reg(port, S3C2410_URXH); if (port->flags & UPF_CONS_FLOW) { - int txe = s3c24xx_serial_txempty_nofifo(port); + bool txe = s3c24xx_serial_txempty_nofifo(port); if (ourport->rx_enabled) { if (!txe) { From patchwork Wed Jan 10 10:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761680 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 C231F47796 for ; Wed, 10 Jan 2024 10:21:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VTr87Hmy" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e552dfa5dso7916825e9.1 for ; Wed, 10 Jan 2024 02:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882079; x=1705486879; 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=UmHRPW27RDnkA+g75aUBVezswJMsnzKsK+kYqojzJWA=; b=VTr87Hmyz3A7qj6wrmDWmYrJff/uJeZ/J5YX81UDGRjI5zT6a4gyMnmU3a8P9mQU9X pnnUEivqFzDZSII1qYkDhlY8h21kppcuPtnS3uoiJpcrz7Tn0c8SwujaOPb+a9ka4sIT miH5ivZEf2bdRhEpiq1tTn6wQMD+5s4Ypa9D2j2iF0q3Ki42Vd27cDgXIMnkpzZfYguG T15kK3h0VBXnzT9r4eGNYmeoBwwOvkYUi4GFyAmBWLGZ3WqTh002h2lt+wQTM7zHF1fP D0395XYBapx3k0/oK5nvdmUWzbOQmXsSvnR2d+mNUfb4Uy7FhKmOuOBn7fPy/dntIH4S ZitQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882079; x=1705486879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UmHRPW27RDnkA+g75aUBVezswJMsnzKsK+kYqojzJWA=; b=DiZ1pKwgWWCvofp0G4mshvSn3KJ8w8e87JQegFWJkk6L8m5vAb+Xtr6nFcp/9q4htW bsp4YmF0L78z2ufoNApj9BgQ0YlbWkmn1984tcAOrocso68kiexy0aJn8Cx6bOEVb1OT i2pM6Bt8DLUiHF/w8RTa97xZ8H7jbsy687YqxPTWoBwVDVRCPU3pvL7C1loZa2JklJzL AsIR/bAv3Al56V7xUgodP6mNVCkTkBfIWOYS/S21ZZt4i2A49LzGiu1San9eQBphheeB tEgAQxaOmIhrVxIguKLU/1SehffQR8xk0Ed3/JZ66aQM2g/KEEen6+fG2GTMVafJdZUW 6dQQ== X-Gm-Message-State: AOJu0Yy5Svrm27R9T3VVQTJu8fC2BE+MJ3T5QlsYWgJCdAiVLM2FO3l7 RdhP+TmDdJVwJ9LpOCsD3lwkJiuJYwBENQ== X-Google-Smtp-Source: AGHT+IF+Oagp4pVfoPn3Qez+PCLQ0H1IzVpFxNqvHn3qcWSqeS9VWnZ6GpgOzUfsQ+2xzQchsRL06w== X-Received: by 2002:a05:600c:45c6:b0:40d:932b:c4eb with SMTP id s6-20020a05600c45c600b0040d932bc4ebmr405924wmo.176.1704882078926; Wed, 10 Jan 2024 02:21:18 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:18 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 14/18] tty: serial: samsung: return bool for s3c24xx_serial_console_txrdy() Date: Wed, 10 Jan 2024 10:20:58 +0000 Message-ID: <20240110102102.61587-15-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 s3c24xx_serial_console_txrdy() returned just 0 or 1 to indicate whether the TX is empty or not. Change its return type to bool. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 63e993bed296..37c0ba2a122c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2183,7 +2183,7 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = { static struct uart_port *cons_uart; -static int +static bool s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); @@ -2193,13 +2193,13 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) /* fifo mode - check amount of data in fifo registers... */ ufstat = rd_regl(port, S3C2410_UFSTAT); - return (ufstat & info->tx_fifofull) ? 0 : 1; + return !(ufstat & info->tx_fifofull); } /* in non-fifo mode, we go and use the tx buffer empty */ utrstat = rd_regl(port, S3C2410_UTRSTAT); - return (utrstat & S3C2410_UTRSTAT_TXE) ? 1 : 0; + return !!(utrstat & S3C2410_UTRSTAT_TXE); } static bool From patchwork Wed Jan 10 10:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762416 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 1B97947F7C for ; Wed, 10 Jan 2024 10:21:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BXhg3hM0" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40e5701cbbaso2090985e9.0 for ; Wed, 10 Jan 2024 02:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882079; x=1705486879; 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=usOFTN8z9J8oP1ehPXietRPaPrvt1NPPISnLCzCNgPc=; b=BXhg3hM0pS7t3Tv35DtttZ38+AIVNojHF8gn+VBxCoAHG3KlCJo0TL0+m66GlsHTOW DdudZj8h9axgGgMVaZUD6RJUOeOrTucFDScxH4cKEB3qP7pIlIgaDzzgcmrLfT0suqgT pcl4lmGNDHx+K9t64mWzjLS2iWd405a5ggUY6fQ10oKstEMW+1dC8WiRs1HFjL+O24Rs r45KVsfyWX9FHmmHVzrDvQlxEuJ7tRk9C9BwnZcEelTLbXF82HUEJEHhuVZRee2ZB6OH yL2N0UNvwwQZjd657IuWULX2SrFHyVO/8LA1z2k8NqhjQlYYNFPTvZ3/Yq7CgE6fHjEt N0EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882079; x=1705486879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=usOFTN8z9J8oP1ehPXietRPaPrvt1NPPISnLCzCNgPc=; b=H1jkj0+QFKAEbXL2xcGx31D8zLuxm5tUzwnIZPHkVZm6PlARZRWGq7nhRy2+BgFEGr eN0LnfFlXK6kBWy7y10whijyD9VvZOTDtmXRS25av5nvLdKdujlFDPgDAeOf+J0aYcxl OAMjZzJm5O13fBa8txF4A4+KRlt1P10zUqh+++Ks++6dWOyi5umErYQTRfeGANMBKJRi XEj4Sp8uyFxaw/uKCjqdw5SxiEa+WfNAIHJq4UQry1Zh+LeXBpSVD9gZqpA5wml2INRU CWfN6BGEj99gSsJdVivSEWKpUZZ6wtbgFymL5LT3scGHZJitARQxj83hk+Inf4qBGB5B nzTw== X-Gm-Message-State: AOJu0YwHUYL0LMZ3ewdji6HZI8sz2HAEiTe8+X+q0QlIdOTDHKH6pj2e fv1/12LjsXeTeViVVwfVfymSUDXkd0J7Hw== X-Google-Smtp-Source: AGHT+IGDIg8QSdxKZ/9GjLkRR0mxgPFDnsnalInD3L7mu7gsQjaMvnyMWk8ZG1bGrUhDYCOjPQyiAg== X-Received: by 2002:a7b:c855:0:b0:40d:b191:10e with SMTP id c21-20020a7bc855000000b0040db191010emr577084wml.175.1704882079484; Wed, 10 Jan 2024 02:21:19 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:19 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 15/18] tty: serial: samsung: change return type for s3c24xx_serial_rx_fifocnt() Date: Wed, 10 Jan 2024 10:20:59 +0000 Message-ID: <20240110102102.61587-16-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Change the return type of the s3c24xx_serial_rx_fifocnt() method to ``unsigned int`` as the method only returns the fifo size and does not handle error codes. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 37c0ba2a122c..436739cf9225 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -590,8 +590,8 @@ static inline const struct s3c2410_uartcfg return ourport->cfg; } -static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, - u32 ufstat) +static unsigned int +s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, u32 ufstat) { const struct s3c24xx_uart_info *info = ourport->info; From patchwork Wed Jan 10 10:21:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 762415 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 163E2481C8 for ; Wed, 10 Jan 2024 10:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RX++FVM3" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33761e291c1so2303071f8f.0 for ; Wed, 10 Jan 2024 02:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882080; x=1705486880; 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=L7ZrSjFHYr2/iB6uZVD8VtG9hhedczp9x5lal7G3QGg=; b=RX++FVM3TPvSqfAFPcnH9anQ4ZygBa2SwrSA3Jc20pJwnCqGb5tyxCbCAScDaeBCMx ZgSfBsbLT7QUiXoB1O1tyRUfeEYypTLmbFjAGq7T+YP0WN+ihrKNBZ2gvi412AufnmAM 7mMC67yFTdwhm/Lea6YDsDDDwSI1+8gEOAyjFbpYUtMplS0ogLN7UAbuh+3dMObF3JRw 5ru34ufkeC/Yd2LrpfJ2h+quO6zP2PoBSy/9FJ8Dc0bSB/OM69rbBwtF1baZlee99Hof RTYv0IMMm+MM6X9Xci+IYxDdBF6subxKq89AFtpdo8GNorfPng2K+zI74kC9/KczqRMi z2+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882080; x=1705486880; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L7ZrSjFHYr2/iB6uZVD8VtG9hhedczp9x5lal7G3QGg=; b=IFQGzCHhOb8+Z3RcjEl4SYl7pnuaOmlIh0+pShY5Rf5vcLzVpQl/gPOF0u0HUpu/lT 2WJdt0J3xOyCoOGdiPAKswDHJMbgWtJhihniSoys9JnRJZGmyr6RuJgykI4UB1aKs99F KUcuuPHvQWSXpNGUIA4UY6oqqkMsJEr4rtQk9Mgs9y+CXFPTBL7GCCTBi7IcaGNB4CDx Vq4FI1GwDUvdTSYwxSkPpMqt5xQDC21ElSUqFVPQmOQHCpv8QO9fD8KL/RWSMLOTT8ho CxQ2qw8IGx9Wa+XpRUtJ9lFAzAnBqmMfjt0wTABbza+8fQ8IRvP6U9u3T/6269ensOvV 9c6A== X-Gm-Message-State: AOJu0YwrZ4nvGvPSolmCOeP3q6tarujRK1QjZTox+QpPkL85bMHGUm67 iUOfSEuLMpCsnfnESR155V5VIuHSKl4czdtcP68gJ4R0Pa/U5A== X-Google-Smtp-Source: AGHT+IHoYzn6WU3WEl02h7AGFS46UkkaeF7/tdZLhTAKWS8rP6lbLfNioU95JNHcQz4U24VBuNGvkg== X-Received: by 2002:a05:600c:4e91:b0:40e:49af:264c with SMTP id f17-20020a05600c4e9100b0040e49af264cmr482213wmq.62.1704882080468; Wed, 10 Jan 2024 02:21:20 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:19 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 16/18] tty: serial: samsung: shrink the clock selection to 8 clocks Date: Wed, 10 Jan 2024 10:21:00 +0000 Message-ID: <20240110102102.61587-17-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 provides a clock selection pool of maximum 4 clocks. Update the driver to consider a pool selection of maximum 8 clocks. The final scope is to reduce the memory footprint of ``struct s3c24xx_uart_info``. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 436739cf9225..5df2bcebf9fb 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -81,11 +81,11 @@ struct s3c24xx_uart_info { unsigned long tx_fifomask; unsigned long tx_fifoshift; unsigned long tx_fifofull; - unsigned int def_clk_sel; - unsigned long num_clks; unsigned long clksel_mask; unsigned long clksel_shift; unsigned long ucon_mask; + u8 def_clk_sel; + u8 num_clks; u8 iotype; /* uart port features */ @@ -1339,7 +1339,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, #define MAX_CLK_NAME_LENGTH 15 -static inline int s3c24xx_serial_getsource(struct uart_port *port) +static inline u8 s3c24xx_serial_getsource(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); u32 ucon; @@ -1352,8 +1352,7 @@ static inline int s3c24xx_serial_getsource(struct uart_port *port) return ucon >> info->clksel_shift; } -static void s3c24xx_serial_setsource(struct uart_port *port, - unsigned int clk_sel) +static void s3c24xx_serial_setsource(struct uart_port *port, u8 clk_sel) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); u32 ucon; @@ -1372,14 +1371,15 @@ static void s3c24xx_serial_setsource(struct uart_port *port, static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, unsigned int req_baud, struct clk **best_clk, - unsigned int *clk_num) + u8 *clk_num) { const struct s3c24xx_uart_info *info = ourport->info; struct clk *clk; unsigned long rate; - unsigned int cnt, baud, quot, best_quot = 0; + unsigned int baud, quot, best_quot = 0; char clkname[MAX_CLK_NAME_LENGTH]; int calc_deviation, deviation = (1 << 30) - 1; + u8 cnt; for (cnt = 0; cnt < info->num_clks; cnt++) { /* Keep selected clock if provided */ @@ -1472,9 +1472,10 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct s3c24xx_uart_port *ourport = to_ourport(port); struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; - unsigned int baud, quot, clk_sel = 0; + unsigned int baud, quot; unsigned int udivslot = 0; u32 ulcon, umcon; + u8 clk_sel = 0; /* * We don't support modem control lines. @@ -1775,10 +1776,9 @@ static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) struct device *dev = ourport->port.dev; const struct s3c24xx_uart_info *info = ourport->info; char clk_name[MAX_CLK_NAME_LENGTH]; - unsigned int clk_sel; struct clk *clk; - int clk_num; int ret; + u8 clk_sel, clk_num; clk_sel = ourport->cfg->clk_sel ? : info->def_clk_sel; for (clk_num = 0; clk_num < info->num_clks; clk_num++) { @@ -2286,9 +2286,9 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud, { struct clk *clk; unsigned long rate; - unsigned int clk_sel; u32 ulcon, ucon, ubrdiv; char clk_name[MAX_CLK_NAME_LENGTH]; + u8 clk_sel; ulcon = rd_regl(port, S3C2410_ULCON); ucon = rd_regl(port, S3C2410_UCON); From patchwork Wed Jan 10 10:21:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761679 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 EA867482D2 for ; Wed, 10 Jan 2024 10:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z3Sqwgxc" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40d87df95ddso41204685e9.0 for ; Wed, 10 Jan 2024 02:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882081; x=1705486881; 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=aIejJEXeNUqkKRlWpyybjPC4hGJCbHArkKwU6CRLU6k=; b=Z3SqwgxcnFKlWFa8xWVshMiT/It8Qky4i5hZWPM0juCESNRhqlR5uOvGMW/QR33GOn 5wVqTieLjrw9MHPdnAcPDSBVHY2qL4riUB8nnnZePRhGEEUNQ/EOISRNOMRfzcv5OpPe PXTjAj3ALhZITWOTD/mbIZ89XKw340RDc5/ofwMC6mQXv8f0EPRzH24GvaS9XQCofD52 jXtGdI5hE64frL1E8NLh3DWihwcwmUZNP65CmXw7QNKr8KOmIrRs2nrMyQg9hwmgEHwA r/8WK6eIxJw0qlske6k7MTB2hb4wxsx0s7QUj+ufqgbAshBoOExBOckVT1RIywaX01NT /psQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882081; x=1705486881; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aIejJEXeNUqkKRlWpyybjPC4hGJCbHArkKwU6CRLU6k=; b=scGU0qqXbgkkWdqIk5q1hsMHYob0fRiwYj/0CvBaTxQNzhPL1HoFKrmSTwighv9k8B HGGbBVhYn9MKEIeT1b3k9e/H27Nl4yF6Wj1gsRGqKI0Iu+CDzY6pvKudmAqLRt8fQm5b kzB07ftPzrPcuWZxfgT06D5QxqsOT7GD6XNAh6Z70zTqXzeUQC19XAFTcbFkZEHyY0W9 hF1lJHYANDA6d4V4iAg9U9BxqnbAUf4yBntMexhEBNAeSxRR6RiaOE9m3X3+ZQvenLXk MW/AkA1E9v63fF8vITIwtQo27LQ8+BPtQZtDvhPiTMXEDnUAaFrhCKJxleFvnGXSjefZ xUyw== X-Gm-Message-State: AOJu0Yxep3rx8O0RFNbHUwEEmP+hsfjFZ5HK9Hi+Gwegm+4HUtg17QmW f22G8WQbNJcLkO6QgL1Zvfeh1CYHFrDQmw== X-Google-Smtp-Source: AGHT+IFtDvi8wjZKg9pm0ERSI9OUVSk7oMwH+ipIk06V0XhYNU2+w7zsSgC+1btLE2dAAQHJq3B/vw== X-Received: by 2002:a05:600c:1d97:b0:40e:567f:38d7 with SMTP id p23-20020a05600c1d9700b0040e567f38d7mr188898wms.225.1704882081232; Wed, 10 Jan 2024 02:21:21 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:20 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 17/18] tty: serial: samsung: shrink port feature flags to u8 Date: Wed, 10 Jan 2024 10:21:01 +0000 Message-ID: <20240110102102.61587-18-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There's a single flag defined as of now. Shrink the feature flags to u8 and aim for a better memory footprint for ``struct s3c24xx_uart_info``. Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 5df2bcebf9fb..598d9fe7a492 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -90,7 +90,7 @@ struct s3c24xx_uart_info { /* uart port features */ - unsigned int has_divslot:1; + u8 has_divslot:1; }; struct s3c24xx_serial_drv_data { From patchwork Wed Jan 10 10:21:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 761678 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 B320D482F3 for ; Wed, 10 Jan 2024 10:21:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CQE4ccSf" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e4f692d06so9991325e9.1 for ; Wed, 10 Jan 2024 02:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882082; x=1705486882; 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=ummHx1igHBI+mPkPK31ezfxthw+Jgvbj/YdjUw2HyQ4=; b=CQE4ccSfqXSc+BhOt4XrXWba/QxpMhZcLYvTEBkWHsowNrLyZafLJZiZjDESoDRhCg lJWf127dheRmWez0fjaKfQ5AthFF9NyuDbrWkn3x+c6oz2i3WiJvTrUkVLNjxx5tHE84 2KQaxpgKa64pgc/et4xsC19sx9A7TalzxcJ7cSx9wjIXyvTf9ANde+uq3dBuoa0fpFJB HAHIIt/dGldVMlYQl9qsGnJjG2NZXX2sOKN8leHy8HKyWgD53Q79emymHzQKWpn7IRTv gbw54kXDNSnjapn1r8t55M3e6dlSqI9aysM85ZxNaGlzpJijWevQhrC5RUSC46KoI9SK nmrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882082; x=1705486882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ummHx1igHBI+mPkPK31ezfxthw+Jgvbj/YdjUw2HyQ4=; b=XuWXbtZBiVju6/uVh7rlL6sbJx3pM4GV42orMF5VapIBgftrzneP5LHY2nfytRQd/V ggWNh9k14OeKEzbhB2J1paSrc8DDAabDyrQL3uCNWsXfIePvK1RHg7ybgt2PmItZ26bE G0U2jcrESuXGo5MOQJ1eaVXvnisShr63pCFpoGQQBRsWS90hTulBiVlDPQ2t4zmJoY0z 1YwvTs3Ak6NdkbDgHU9RJW7QkbWxKj8xjFsahvOi3bBLX/GQhWB1RnLMIVuVg6b/5Siq +0s5KdI8J6SIhr+KrkOvYRKCllmIFQc/L9940a34pAZNY3Dw8QKFOr6Vs9qaA16An6dC i/mQ== X-Gm-Message-State: AOJu0YwOTvbKabPtNxLdG3iJDfme0ilx33ZcXV8HV10I2ewEMceQIw2i jxK84KZCB+UC7pZAx+AjMCt5VHCSzc1PTA== X-Google-Smtp-Source: AGHT+IG0xYD6noOiAF06pJmAKPKFGS5k9kf0z5T6NNAMgrhXlZB3r2GVRIKB+IrSXxoBiSdSWW9UzA== X-Received: by 2002:a7b:ce99:0:b0:40d:88b8:1bd1 with SMTP id q25-20020a7bce99000000b0040d88b81bd1mr525747wmj.185.1704882082174; Wed, 10 Jan 2024 02:21:22 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:21 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 18/18] tty: serial: samsung: shrink memory footprint of ``struct s3c24xx_uart_info`` Date: Wed, 10 Jan 2024 10:21:02 +0000 Message-ID: <20240110102102.61587-19-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use u32 for the members of ``struct s3c24xx_uart_info`` that are used for register interactions. The purpose of these members becomes clearer. The greater benefit of this change is that it also reduces the memory footprint of the struct, allowing 64-bit architectures to use a single cacheline for the entire struct. struct s3c24xx_uart_info { const char * name; /* 0 8 */ enum s3c24xx_port_type type; /* 8 4 */ unsigned int port_type; /* 12 4 */ unsigned int fifosize; /* 16 4 */ u32 rx_fifomask; /* 20 4 */ u32 rx_fifoshift; /* 24 4 */ u32 rx_fifofull; /* 28 4 */ u32 tx_fifomask; /* 32 4 */ u32 tx_fifoshift; /* 36 4 */ u32 tx_fifofull; /* 40 4 */ u32 clksel_mask; /* 44 4 */ u32 clksel_shift; /* 48 4 */ u32 ucon_mask; /* 52 4 */ u8 def_clk_sel; /* 56 1 */ u8 num_clks; /* 57 1 */ u8 iotype; /* 58 1 */ u8 has_divslot:1; /* 59: 0 1 */ /* size: 64, cachelines: 1, members: 17 */ /* padding: 4 */ /* bit_padding: 7 bits */ }; Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 598d9fe7a492..40dceb41acb7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -75,15 +75,15 @@ struct s3c24xx_uart_info { enum s3c24xx_port_type type; unsigned int port_type; unsigned int fifosize; - unsigned long rx_fifomask; - unsigned long rx_fifoshift; - unsigned long rx_fifofull; - unsigned long tx_fifomask; - unsigned long tx_fifoshift; - unsigned long tx_fifofull; - unsigned long clksel_mask; - unsigned long clksel_shift; - unsigned long ucon_mask; + u32 rx_fifomask; + u32 rx_fifoshift; + u32 rx_fifofull; + u32 tx_fifomask; + u32 tx_fifoshift; + u32 tx_fifofull; + u32 clksel_mask; + u32 clksel_shift; + u32 ucon_mask; u8 def_clk_sel; u8 num_clks; u8 iotype;