From patchwork Fri Nov 18 12:25:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 772B8C4321E for ; Fri, 18 Nov 2022 12:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241626AbiKRM0G (ORCPT ); Fri, 18 Nov 2022 07:26:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241474AbiKRM0G (ORCPT ); Fri, 18 Nov 2022 07:26:06 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B23976C1 for ; Fri, 18 Nov 2022 04:26:04 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id a14so9048797wru.5 for ; Fri, 18 Nov 2022 04:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=NW75qAvpRVogQL0T7QAGtVl+SEYpXGObCi3yPFwvGso=; b=EqyvRD3fnkEs58HS1MMX5qKFpQrHn13x7ClAlbDNa0KboEO7GCK0S4b7nS7OAhLKeT d5pA1JlHIqA5uDZ5453AtnwgFjEy25mt04/RlMfEixLcMyq/8tefIWEaQs7Qfo7Gmcp1 s3X0MHBEdJ+EGYDP/9P7hQLRWqTV4nezFH/AzwzA9BAQW34JZuz7YZYA/kCnrs+TiFvx FqefR5rly249zxebdONWx4i+S+5fCU8uG8XdhkveuD9oNtoQBkACJAFaYs3OJ35DeL55 MWgPs/47rcLpZEWszfJTbRMLi93GOPdUQgcHBaoThC0j5l4a1iWx8q+Y4GFnLg6PsgM9 50Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NW75qAvpRVogQL0T7QAGtVl+SEYpXGObCi3yPFwvGso=; b=bkhGo/3Wt/MpaYgGXV2if7BhEcjAYPruDv0+2I4hIRbrv3y1Asd2lSu+vfll837Xnc et5vhw/0Czag2bvYXBPFjwBNwvgXcrYNWGrDVWA4zBDq/HlnN+PMiBxMj7XeDc+oGygx mdzR+ledk9I6mbadQFNw5uKcidvQYHar3zdDjK5hyoM3GsICb4oLWJUCBwYngkrQ3wd3 YTS7ANOOhBNouKuW2ocu/TZUGopiHvWsN2vUYWChFL39ZgYHFNTwaSjZm89nT3kKQ/PT vCtb8JI/1ynbMG+RnvCiTguF8niPEE7QUdu6QRsV3eTnLtMHh7auxmz1LzP7565u5qQd jujg== X-Gm-Message-State: ANoB5pldJpMtSiJD3sF9kC9FpsLdKrqHa4BqK5QZBNQlHlYmHu53+a31 xiNo+Rcvox5NvO3s9zoZ7nlEw61bWR5B0A== X-Google-Smtp-Source: AA0mqf5gwSln0Qe4LaacO8yLD4GGoADA7DHRk2d/vZu5FcHfF7IDeTUrhaVrDTj+csJFbAxgCr6Fqg== X-Received: by 2002:a05:6000:78d:b0:22e:3d63:80bc with SMTP id bu13-20020a056000078d00b0022e3d6380bcmr4390469wrb.30.1668774363188; Fri, 18 Nov 2022 04:26:03 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:02 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 01/15] tty: serial: qcom-geni-serial: drop unneeded forward definitions Date: Fri, 18 Nov 2022 13:25:25 +0100 Message-Id: <20221118122539.384993-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski If we shuffle the code a bit, we can drop all forward definitions of various static functions. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 79 +++++++++++++-------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 83b66b73303a..9f2212e7b5ec 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -147,11 +147,6 @@ static const struct uart_ops qcom_geni_console_pops; static const struct uart_ops qcom_geni_uart_pops; static struct uart_driver qcom_geni_console_driver; static struct uart_driver qcom_geni_uart_driver; -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop); -static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop); -static unsigned int qcom_geni_serial_tx_empty(struct uart_port *port); -static void qcom_geni_serial_stop_rx(struct uart_port *uport); -static void qcom_geni_serial_handle_rx(struct uart_port *uport, bool drop); #define to_dev_port(ptr, member) \ container_of(ptr, struct qcom_geni_serial_port, member) @@ -590,6 +585,11 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) return ret; } +static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport) +{ + return !readl(uport->membase + SE_GENI_TX_FIFO_STATUS); +} + static void qcom_geni_serial_start_tx(struct uart_port *uport) { u32 irq_en; @@ -635,25 +635,29 @@ static void qcom_geni_serial_stop_tx(struct uart_port *uport) writel(M_CMD_CANCEL_EN, uport->membase + SE_GENI_M_IRQ_CLEAR); } -static void qcom_geni_serial_start_rx(struct uart_port *uport) +static void qcom_geni_serial_handle_rx(struct uart_port *uport, bool drop) { - u32 irq_en; u32 status; + u32 word_cnt; + u32 last_word_byte_cnt; + u32 last_word_partial; + u32 total_bytes; struct qcom_geni_serial_port *port = to_dev_port(uport, uport); - status = readl(uport->membase + SE_GENI_STATUS); - if (status & S_GENI_CMD_ACTIVE) - qcom_geni_serial_stop_rx(uport); - - geni_se_setup_s_cmd(&port->se, UART_START_READ, 0); - - irq_en = readl(uport->membase + SE_GENI_S_IRQ_EN); - irq_en |= S_RX_FIFO_WATERMARK_EN | S_RX_FIFO_LAST_EN; - writel(irq_en, uport->membase + SE_GENI_S_IRQ_EN); + status = readl(uport->membase + SE_GENI_RX_FIFO_STATUS); + word_cnt = status & RX_FIFO_WC_MSK; + last_word_partial = status & RX_LAST; + last_word_byte_cnt = (status & RX_LAST_BYTE_VALID_MSK) >> + RX_LAST_BYTE_VALID_SHFT; - irq_en = readl(uport->membase + SE_GENI_M_IRQ_EN); - irq_en |= M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN; - writel(irq_en, uport->membase + SE_GENI_M_IRQ_EN); + if (!word_cnt) + return; + total_bytes = BYTES_PER_FIFO_WORD * (word_cnt - 1); + if (last_word_partial && last_word_byte_cnt) + total_bytes += last_word_byte_cnt; + else + total_bytes += BYTES_PER_FIFO_WORD; + port->handle_rx(uport, total_bytes, drop); } static void qcom_geni_serial_stop_rx(struct uart_port *uport) @@ -694,29 +698,25 @@ static void qcom_geni_serial_stop_rx(struct uart_port *uport) qcom_geni_serial_abort_rx(uport); } -static void qcom_geni_serial_handle_rx(struct uart_port *uport, bool drop) +static void qcom_geni_serial_start_rx(struct uart_port *uport) { + u32 irq_en; u32 status; - u32 word_cnt; - u32 last_word_byte_cnt; - u32 last_word_partial; - u32 total_bytes; struct qcom_geni_serial_port *port = to_dev_port(uport, uport); - status = readl(uport->membase + SE_GENI_RX_FIFO_STATUS); - word_cnt = status & RX_FIFO_WC_MSK; - last_word_partial = status & RX_LAST; - last_word_byte_cnt = (status & RX_LAST_BYTE_VALID_MSK) >> - RX_LAST_BYTE_VALID_SHFT; + status = readl(uport->membase + SE_GENI_STATUS); + if (status & S_GENI_CMD_ACTIVE) + qcom_geni_serial_stop_rx(uport); - if (!word_cnt) - return; - total_bytes = BYTES_PER_FIFO_WORD * (word_cnt - 1); - if (last_word_partial && last_word_byte_cnt) - total_bytes += last_word_byte_cnt; - else - total_bytes += BYTES_PER_FIFO_WORD; - port->handle_rx(uport, total_bytes, drop); + geni_se_setup_s_cmd(&port->se, UART_START_READ, 0); + + irq_en = readl(uport->membase + SE_GENI_S_IRQ_EN); + irq_en |= S_RX_FIFO_WATERMARK_EN | S_RX_FIFO_LAST_EN; + writel(irq_en, uport->membase + SE_GENI_S_IRQ_EN); + + irq_en = readl(uport->membase + SE_GENI_M_IRQ_EN); + irq_en |= M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN; + writel(irq_en, uport->membase + SE_GENI_M_IRQ_EN); } static void qcom_geni_serial_handle_tx(struct uart_port *uport, bool done, @@ -1122,11 +1122,6 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, qcom_geni_serial_start_rx(uport); } -static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport) -{ - return !readl(uport->membase + SE_GENI_TX_FIFO_STATUS); -} - #ifdef CONFIG_SERIAL_QCOM_GENI_CONSOLE static int qcom_geni_console_setup(struct console *co, char *options) { From patchwork Fri Nov 18 12:25:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02CBEC4332F for ; Fri, 18 Nov 2022 12:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241571AbiKRM0I (ORCPT ); Fri, 18 Nov 2022 07:26:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241437AbiKRM0H (ORCPT ); Fri, 18 Nov 2022 07:26:07 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D0F9737D for ; Fri, 18 Nov 2022 04:26:06 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id y16so8983014wrt.12 for ; Fri, 18 Nov 2022 04:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=Ix98Buqrm8hc4zZgibw2ROra30KJmpCLaRPoOVSax6U=; b=fr2y+fgpu7yMtDfL/F6WHS15il9rZPexAjvuSgluGk58Q50xnOVM6u6jOY/KO/1xsY z0h4BK4SSg7EJEYSkG0kxrjxd1rgA+X6ACOkAllPjRlzpLsrQq0hvwHKvHKHJuOR5xU2 cZzLi6EJWcv5J0IkgWUjzxMJMKjT9OYRPIs5OE0izDQEyfjW1RzYl6QriSImMbbaYz+a 5+TVTTdxVl8vu0gTd84Is720pu7ojdK4DjYoPZxYWz3YB9KwsD0iT8Jt7cPDjEnwXfE1 /8UwXwEItbZYJxEGYmqU+eTGqdPED/DcOQ5nZ/yf6Zi90pQJuD7R8aumxus6kn1JyLm4 MnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Ix98Buqrm8hc4zZgibw2ROra30KJmpCLaRPoOVSax6U=; b=RIk/fpZDxWDsDzFCcrZEeOP7LSw9hlaunhRamQxoS+L1UqwirsTqkZkuJ7B5e0X4DI r4h6RPfFUNIlssbuXuHh1bvKoO5XA70o9PxucGspHXHjJ7BiD93puFjgMLn2WlXi6+Um bVH6l3JI73gprBrEFUIzQfaK4gL+nl1bQE7bxtKUgn/fDpkJGys7Nv/vW7n4JGUANYL5 xETEG4FUZV7wTc5td/i+ZmHqztf2t0AQSpyMGH2cfcElrxP1Thkf+d/18r/icUgUjx/D wSo1LAIlKgn7gPvaBRn+fFMLieAN8PwgZODgejPpyGf6F8bkPdmxjuF3Wk6QJvxYthAn r9gg== X-Gm-Message-State: ANoB5plBt29694OtclnnxfNR7Tl0eaKWx5ZG1PYoiqUyuXi+74tP+YWf ZMDsYDXVDi+fsuTLmJWccISjBg== X-Google-Smtp-Source: AA0mqf4w0Sogr6egE1uHzDv9Nl0SENIbQJhiBOjTBFjUjGbvkSUShCyBnX0yw4Jf9SDeOD3OxkfGuw== X-Received: by 2002:a05:6000:1d94:b0:238:3d85:8e2c with SMTP id bk20-20020a0560001d9400b002383d858e2cmr4248475wrb.650.1668774365147; Fri, 18 Nov 2022 04:26:05 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:04 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 03/15] tty: serial: qcom-geni-serial: align #define values Date: Fri, 18 Nov 2022 13:25:27 +0100 Message-Id: <20221118122539.384993-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski Keep the #define symbols aligned for better readability. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 62 +++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 7af5df6833c7..97ee7c074b79 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -39,57 +39,57 @@ #define SE_UART_MANUAL_RFR 0x2ac /* SE_UART_TRANS_CFG */ -#define UART_TX_PAR_EN BIT(0) -#define UART_CTS_MASK BIT(1) +#define UART_TX_PAR_EN BIT(0) +#define UART_CTS_MASK BIT(1) /* SE_UART_TX_STOP_BIT_LEN */ -#define TX_STOP_BIT_LEN_1 0 -#define TX_STOP_BIT_LEN_2 2 +#define TX_STOP_BIT_LEN_1 0 +#define TX_STOP_BIT_LEN_2 2 /* SE_UART_RX_TRANS_CFG */ -#define UART_RX_PAR_EN BIT(3) +#define UART_RX_PAR_EN BIT(3) /* SE_UART_RX_WORD_LEN */ -#define RX_WORD_LEN_MASK GENMASK(9, 0) +#define RX_WORD_LEN_MASK GENMASK(9, 0) /* SE_UART_RX_STALE_CNT */ -#define RX_STALE_CNT GENMASK(23, 0) +#define RX_STALE_CNT GENMASK(23, 0) /* SE_UART_TX_PARITY_CFG/RX_PARITY_CFG */ -#define PAR_CALC_EN BIT(0) -#define PAR_EVEN 0x00 -#define PAR_ODD 0x01 -#define PAR_SPACE 0x10 +#define PAR_CALC_EN BIT(0) +#define PAR_EVEN 0x00 +#define PAR_ODD 0x01 +#define PAR_SPACE 0x10 /* SE_UART_MANUAL_RFR register fields */ -#define UART_MANUAL_RFR_EN BIT(31) -#define UART_RFR_NOT_READY BIT(1) -#define UART_RFR_READY BIT(0) +#define UART_MANUAL_RFR_EN BIT(31) +#define UART_RFR_NOT_READY BIT(1) +#define UART_RFR_READY BIT(0) /* UART M_CMD OP codes */ -#define UART_START_TX 0x1 +#define UART_START_TX 0x1 /* UART S_CMD OP codes */ -#define UART_START_READ 0x1 - -#define UART_OVERSAMPLING 32 -#define STALE_TIMEOUT 16 -#define DEFAULT_BITS_PER_CHAR 10 -#define GENI_UART_CONS_PORTS 1 -#define GENI_UART_PORTS 3 -#define DEF_FIFO_DEPTH_WORDS 16 -#define DEF_TX_WM 2 -#define DEF_FIFO_WIDTH_BITS 32 -#define UART_RX_WM 2 +#define UART_START_READ 0x1 + +#define UART_OVERSAMPLING 32 +#define STALE_TIMEOUT 16 +#define DEFAULT_BITS_PER_CHAR 10 +#define GENI_UART_CONS_PORTS 1 +#define GENI_UART_PORTS 3 +#define DEF_FIFO_DEPTH_WORDS 16 +#define DEF_TX_WM 2 +#define DEF_FIFO_WIDTH_BITS 32 +#define UART_RX_WM 2 /* SE_UART_LOOPBACK_CFG */ -#define RX_TX_SORTED BIT(0) -#define CTS_RTS_SORTED BIT(1) -#define RX_TX_CTS_RTS_SORTED (RX_TX_SORTED | CTS_RTS_SORTED) +#define RX_TX_SORTED BIT(0) +#define CTS_RTS_SORTED BIT(1) +#define RX_TX_CTS_RTS_SORTED (RX_TX_SORTED | CTS_RTS_SORTED) /* UART pin swap value */ -#define DEFAULT_IO_MACRO_IO0_IO1_MASK GENMASK(3, 0) +#define DEFAULT_IO_MACRO_IO0_IO1_MASK GENMASK(3, 0) #define IO_MACRO_IO0_SEL 0x3 -#define DEFAULT_IO_MACRO_IO2_IO3_MASK GENMASK(15, 4) +#define DEFAULT_IO_MACRO_IO2_IO3_MASK GENMASK(15, 4) #define IO_MACRO_IO2_IO3_SWAP 0x4640 /* We always configure 4 bytes per FIFO word */ From patchwork Fri Nov 18 12:25:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BD3DC43219 for ; Fri, 18 Nov 2022 12:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241835AbiKRM0a (ORCPT ); Fri, 18 Nov 2022 07:26:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240866AbiKRM01 (ORCPT ); Fri, 18 Nov 2022 07:26:27 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A6197362 for ; Fri, 18 Nov 2022 04:26:08 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id cl5so9003266wrb.9 for ; Fri, 18 Nov 2022 04:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=lTVRxd5tZFYcvUoBnJpH34+lxjijlQ63axYU+EIhaXk=; b=BhYh54GUE+xzT/TMuZWnyrjmyv/UsQhZctMlScPYOoyvy4C/TGMOlYbyvWZLzt/xos lOWqQqfNM+T8o3IfIe/9N0HpoFMnPdF38KUpr4N/Sg7SW74bskjcgO7Buo/9wpNgZho3 FO7NnEic/tkdb+wEC89PNJaSNh7hACaj4jHPwRb4dqWfhBS8Lju/+5HDiN7mxRi8FYq/ DtkHmNbWUux+9CD70LNDEYtuEMlg2gQSts9D2qFRkcO7pnf0V2SRcALAG1HtAYVFojO2 Lb3v8sws7nnhiZRGFRPRHD5pQ3bzj1pYbIHAhwosIPDJJ/Lm673SaRAZkQ2tz2JIZov7 tcaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lTVRxd5tZFYcvUoBnJpH34+lxjijlQ63axYU+EIhaXk=; b=Vn9l/soW4Ji60FZ1WKPmzrRAjAnz6r7D0BYNXWe+bm9ywJevYlAJNg1e6YRFgVluA3 T3ogVSccVDkVAOIBRQU5TY22K2Udfw8ehnPatXHaWkTfVvbzaphYUm6K9+lOkmWLmV0E Jtze3cTny8BbgQ65NPZD8+ZaSvVeaRnI1u8P27pC7OZ+cGS1FuNLkpdK+Vs+Lpg8oSO8 ycD/U/Q8hMlWDfoE+2p/yOnTQp7llUpPKDz6Js/RWAC88XJMNhMWFYTC4p/NnEsXyMQN u1bhHYyybQmhcQE0pvhIB8HHgMfxfpbYUmT71Z8Pw4Df0YyIyt1Y8NDdB1mdXO+v+FZg F0/g== X-Gm-Message-State: ANoB5pkDtqUvku5Rti9KE9/kuUkJyJSCdHrmI/Wkxsn8Dn4co+C3mpEY jgS/mc+wAp0dkZcd7oA2zIkmdA== X-Google-Smtp-Source: AA0mqf5iPYk7yKUwfRVq+d+rtQIV3SwGoqAMEmt0k4jMrvuEN+ublImMTsgO0pTl5epO8aXVn66pCg== X-Received: by 2002:adf:f54e:0:b0:241:c68b:6b41 with SMTP id j14-20020adff54e000000b00241c68b6b41mr223529wrp.95.1668774367058; Fri, 18 Nov 2022 04:26:07 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:06 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 05/15] tty: serial: qcom-geni-serial: remove stray newlines Date: Fri, 18 Nov 2022 13:25:29 +0100 Message-Id: <20221118122539.384993-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski Remove stray newlines around #ifdefs for consistency with the rest of the driver code. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 1db2795804e9..dd1491a72deb 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -317,7 +317,6 @@ static void qcom_geni_serial_abort_rx(struct uart_port *uport) } #ifdef CONFIG_CONSOLE_POLL - static int qcom_geni_serial_get_char(struct uart_port *uport) { struct qcom_geni_private_data *private_data = uport->private_data; @@ -542,7 +541,6 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) { return -EPERM; } - #endif /* CONFIG_SERIAL_QCOM_GENI_CONSOLE */ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) From patchwork Fri Nov 18 12:25:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CE3DC433FE for ; Fri, 18 Nov 2022 12:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241793AbiKRM0o (ORCPT ); Fri, 18 Nov 2022 07:26:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241595AbiKRM01 (ORCPT ); Fri, 18 Nov 2022 07:26:27 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE38976DB for ; Fri, 18 Nov 2022 04:26:09 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id v1so8963356wrt.11 for ; Fri, 18 Nov 2022 04:26:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=vMYlxBECUyROeU2qoZzKEqhzlBfoiS2AeDouftWiN14=; b=h3ylSwylTpt/gTd5gxjRVlnohrLzxyaHkKxHSNdsMOgFdjULJkYTK9ag3H5B7bZGNF xpg0lzKa/Kdgi+wwNxNugBCVUxhRzAeEO0K9bZo5r+rixRV2dZT8E1XYBNEu5gFMBPMk u3QrTixzNo2+yRMl1tCa5RS9oH4RsO/lSqL1j8ZDZ+J1rahMob66xdS+/rt/GuPB8Fa0 /MnLjQYgrfLogwNpXSQwcE4A3zNxtyujkrgVt9k5TS5qYNyuHkGAJQeOPW+XFCv5Erio Cw+8ATnanhtooLYJuYJCabSEaLbnbmt3/ey5xxHhjF+06VG3BizN8UcivtyLeLRJEKaH BL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vMYlxBECUyROeU2qoZzKEqhzlBfoiS2AeDouftWiN14=; b=r1ZEybUrfAiQ/yc8Inuj1qh0TJRm4KwMJYHoJ+KzPg/RIuzhp0gDbqRx+Ux5FSJJhX KxnsD9WVaEZ5Odtm6tydl0lYjYLSdswlY6L/fyGcRkpUNi4d5yUveZHmnhR1RLXsvy5B B2nL1lBkFTnjXrRVvC/IsiSTbza6pvL2yXIUY1dZxR53XF1RQOhCpft0U43OGCAwBgwb WUKCzyHxI8oBubUXAygIhclySTF/CXMQ9D+dCbXwCh24DsXwvpinpGxYe7dTVgfpyvzw 5R+6cYpXVe3bnjYrEEFImwYwvobVNV2NdBDKn4ajrdkh1gMP/v/VgibM5ziG5WjsrJn8 m9BA== X-Gm-Message-State: ANoB5pnNRg1RRd6ixsvY7kt3hqtu65I/owBk4fIvgPZmc+Kp9VyO3+Mv foZXP0MNoSuBzK/IW6J5Y6N64g== X-Google-Smtp-Source: AA0mqf6XQpZNIv4JSPh2Iy9S4x4cMT6r1bE9lJXiqxSKL5yWDvqbOxuNaKATf/tjq89JAK0wQcExfA== X-Received: by 2002:a5d:408b:0:b0:236:53d2:1668 with SMTP id o11-20020a5d408b000000b0023653d21668mr4185721wrp.694.1668774369037; Fri, 18 Nov 2022 04:26:09 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:08 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 07/15] tty: serial: qcom-geni-serial: remove unneeded tabs Date: Fri, 18 Nov 2022 13:25:31 +0100 Message-Id: <20221118122539.384993-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski Remove redundant indentation in struct member assignment. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 22c1869c60f4..39041538e5d2 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -138,26 +138,26 @@ static struct uart_driver qcom_geni_uart_driver; static struct qcom_geni_serial_port qcom_geni_uart_ports[GENI_UART_PORTS] = { [0] = { .uport = { - .iotype = UPIO_MEM, - .ops = &qcom_geni_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, + .iotype = UPIO_MEM, + .ops = &qcom_geni_uart_pops, + .flags = UPF_BOOT_AUTOCONF, + .line = 0, }, }, [1] = { .uport = { - .iotype = UPIO_MEM, - .ops = &qcom_geni_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, + .iotype = UPIO_MEM, + .ops = &qcom_geni_uart_pops, + .flags = UPF_BOOT_AUTOCONF, + .line = 1, }, }, [2] = { .uport = { - .iotype = UPIO_MEM, - .ops = &qcom_geni_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, + .iotype = UPIO_MEM, + .ops = &qcom_geni_uart_pops, + .flags = UPF_BOOT_AUTOCONF, + .line = 2, }, }, }; From patchwork Fri Nov 18 12:25:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6ECDC4332F for ; Fri, 18 Nov 2022 12:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235268AbiKRM0l (ORCPT ); Fri, 18 Nov 2022 07:26:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241793AbiKRM03 (ORCPT ); Fri, 18 Nov 2022 07:26:29 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E5B976FE for ; Fri, 18 Nov 2022 04:26:11 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id a14so9049286wru.5 for ; Fri, 18 Nov 2022 04:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=pF1K9Osvm2bfxV7B3KPTmbXBc6bO2Z5qPB/LIZda4KU=; b=CxzI5e9N5IVV6UCsvmfkxAyhT/XdAotthqZtvueaQdC/kcNGJNscZX+6tGcAM4V6Pe EAhGgvhwvKRispf0xbrhrVd3lWFN8luWYVNjQ33vNr/niFWXQ0vdS4SGgjAp37f0goIY 3h1A/JAIJH9o46Sfq4OoIcTZCzWJ7or2/TjzXCWh7I0wLqFfw8JQQhwTpqbIBlhRT8mW lyHA6uue5Kvf3hlOZW7hSn1zgP7ZHq0dQCeFAl4OCxkLm6RhbpGWhZZ5J0+Crm8PlA5J 8luF2weu1CWp8n0yyZ/n/5tSas/gLib7hteSOR7EEtfTUw77XE2GtH6HMnjj4dnourDh RxgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=pF1K9Osvm2bfxV7B3KPTmbXBc6bO2Z5qPB/LIZda4KU=; b=JuzIC7C8fxjyM7Jx5fZCIih/Op0f2z4ZG1KSiMLnP6THTDRKFWRg0bXgFt4ybXfxaq F75L701Lg+mvmov3BjDW5qpaesHxgl/E5lMPgftHInlIlBKREVBgTT1P8lLeFTewEoXm hBDV2FY4YmV3+FUSJ5/hXXJ/2668QTaSiQ/mYsSNYQY++FQmwx1VkjIXq6kuUHWK+o8U AoWEYz8vGHwjyC1ZC4Kj/T673M0xb8gpLsJHq4eunR7IFfQ4IUM73SWAa/Y63Xe3CQOZ cUoOheiFFF7R7KoctmLx2zrv+oNOGLlOO4Gj9042Iq8KicY3qZYTDPLpHR3q2zKHKQNu w2NQ== X-Gm-Message-State: ANoB5pn1ev1vryQVmkXOvvcRAxKjF1K63mGwwI4qa1YWsJkTsHdWPR86 nwyEAQ1gZrSVvWK1KsF1Ph8KHQ== X-Google-Smtp-Source: AA0mqf62NToJtguB/effj1ssvAbUmdtDlXIOSFaU/pbCO/XUA3+Wm0tCpH6C0v/sBB6nX0Gt77n5Lw== X-Received: by 2002:adf:f6cb:0:b0:236:7a11:b061 with SMTP id y11-20020adff6cb000000b002367a11b061mr4394865wrp.292.1668774370893; Fri, 18 Nov 2022 04:26:10 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:10 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 09/15] tty: serial: qcom-geni-serial: drop the return value from handle_rx Date: Fri, 18 Nov 2022 13:25:33 +0100 Message-Id: <20221118122539.384993-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski The return value of the handle_rx() callback is never checked. Drop it. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 4b155ca0ac74..72d0e7b91080 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -114,7 +114,7 @@ struct qcom_geni_serial_port { u32 tx_fifo_width; u32 rx_fifo_depth; bool setup; - int (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); + void (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); unsigned int baud; void *rx_fifo; u32 loopback; @@ -499,7 +499,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, spin_unlock_irqrestore(&uport->lock, flags); } -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) { u32 i; unsigned char buf[sizeof(u32)]; @@ -534,16 +534,15 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) } if (!drop) tty_flip_buffer_push(tport); - return 0; } #else -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) { - return -EPERM; + } #endif /* CONFIG_SERIAL_QCOM_GENI_CONSOLE */ -static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) { struct tty_port *tport; struct qcom_geni_serial_port *port = to_dev_port(uport); @@ -554,7 +553,7 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) tport = &uport->state->port; ioread32_rep(uport->membase + SE_GENI_RX_FIFOn, port->rx_fifo, words); if (drop) - return 0; + return; ret = tty_insert_flip_string(tport, port->rx_fifo, bytes); if (ret != bytes) { @@ -564,7 +563,6 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) } uport->icount.rx += ret; tty_flip_buffer_push(tport); - return ret; } static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport) From patchwork Fri Nov 18 12:25:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AF74C4321E for ; Fri, 18 Nov 2022 12:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241828AbiKRM1R (ORCPT ); Fri, 18 Nov 2022 07:27:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241846AbiKRM0c (ORCPT ); Fri, 18 Nov 2022 07:26:32 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F1609AC83 for ; Fri, 18 Nov 2022 04:26:15 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id t4so3509593wmj.5 for ; Fri, 18 Nov 2022 04:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=j23hZnphv0jcgZfiOY9qWXNDpMCFFj9PRM3bEUKGmc4=; b=XgxLUl8pt1XNL0iLDiU427YWuA+WEaiaCkEvGhMxKvHS7AzO0WGlJgFy/efbY2ozcc DOQb1IEBoBtO3VW7x+t4MJQYkrfiPsUkhRvFkGp9UAoID4XLDZR8DnoIwBtbmXRAHpOc 1oAXfiRsZyf4XuQMoOBnck65CaxmocuvADWKoZ3v+xS5uJMkpxOVxStEib7omyU7FG7X C0XU2f6TZgVvuoiBIgwqpOGHZ+qbVlVWTpDgUyO2oTqQxS4y7gMJWOMZmlX9oupLSzvj V5IED7b3gL8JPqwwin/Vx0dh/ewtVRM8QWnjapPvxRs6gVqFpNBCjdSiH9oBrQFTwi9T vmSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=j23hZnphv0jcgZfiOY9qWXNDpMCFFj9PRM3bEUKGmc4=; b=AtKspoOXSobFULYrIbrUEUl7NVv0g30kJ25IFC+p7WM+wIVEY1jte5RRALEsMRJmYd ARB/mMetWTh+Nor0ecCzMhizifqVAxDt0iV7eC9wJiijlUK1q0rcplSFSKP/azS+R1n6 o29xUBX2cMUCVWB+2z64MaJOgolTLk6sufA44WkzO6Ma67va0hzbYe/nUKEuszdzFj8d uLI7N6a9SfKdU8atI1RlsKG8e4xSjGmRXHeNhrl9UxCi4Ma4K93xaSYFS4VFcT9uSFmk V9ueGcUouFkIzADFMOJlO/3vcP3qb1DqT1donszxZyJChtb0AvY4oV6KaTej4CiZsS8E 7JMg== X-Gm-Message-State: ANoB5pmxhQ59l9cCTqQHtct8WHsQL3wrO3T14qz9Bt+kVp/uavnaoDyE BBHgaSL8hvxHoLIqfuxnGqs5oA== X-Google-Smtp-Source: AA0mqf6r1UopoD85mncIUva/+dvusTt3tcZCpOD8lLQGcqCaB9WfI6v27mi+Pj5NXkUPSpwj0H1JlQ== X-Received: by 2002:a05:600c:19d0:b0:3cf:e7b7:d87d with SMTP id u16-20020a05600c19d000b003cfe7b7d87dmr7852582wmq.95.1668774373630; Fri, 18 Nov 2022 04:26:13 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:13 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 12/15] tty: serial: provide devm_uart_add_one_port() Date: Fri, 18 Nov 2022 13:25:36 +0100 Message-Id: <20221118122539.384993-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski Provide a devres variant of uart_add_one_port() that removes the managed port at device detach. Signed-off-by: Bartosz Golaszewski --- .../driver-api/driver-model/devres.rst | 3 ++ drivers/tty/serial/serial_core.c | 36 +++++++++++++++++++ include/linux/serial_core.h | 6 ++++ 3 files changed, 45 insertions(+) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst index 56082265e8e5..5d07a8c1eadb 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -436,6 +436,9 @@ RTC SERDEV devm_serdev_device_open() +SERIAL + devm_uart_add_one_port() + SLAVE DMA ENGINE devm_acpi_dma_controller_register() diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 179ee199df34..005190b279b3 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3217,6 +3217,42 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport) } EXPORT_SYMBOL(uart_remove_one_port); +struct uart_port_devres { + struct uart_driver *drv; + struct uart_port *port; +}; + +static void devm_uart_remove_one_port(struct device *dev, void *data) +{ + struct uart_port_devres *res = data; + + uart_remove_one_port(res->drv, res->port); +} + +int devm_uart_add_one_port(struct device *dev, + struct uart_driver *drv, struct uart_port *port) +{ + struct uart_port_devres *res; + int ret; + + res = devres_alloc(devm_uart_remove_one_port, sizeof(*res), GFP_KERNEL); + if (!res) + return -1; + + ret = uart_add_one_port(drv, port); + if (ret) { + devres_free(res); + return -1; + } + + res->drv = drv; + res->port = port; + devres_add(dev, res); + + return 0; +} +EXPORT_SYMBOL(devm_uart_add_one_port); + /** * uart_match_port - are the two ports equivalent? * @port1: first port diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d657f2a42a7b..d0911f04706e 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -771,6 +771,12 @@ int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); bool uart_match_port(const struct uart_port *port1, const struct uart_port *port2); +/* + * UART devres + */ +int devm_uart_add_one_port(struct device *dev, + struct uart_driver *drv, struct uart_port *port); + /* * Power Management */ From patchwork Fri Nov 18 12:25:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A00E1C46467 for ; Fri, 18 Nov 2022 12:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235357AbiKRM1T (ORCPT ); Fri, 18 Nov 2022 07:27:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241422AbiKRM0c (ORCPT ); Fri, 18 Nov 2022 07:26:32 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 249419AC84 for ; Fri, 18 Nov 2022 04:26:16 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id w14so9026345wru.8 for ; Fri, 18 Nov 2022 04:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=Ko+jjIDfILZRTvWmBV6W3WbxjLYlDDq9YeO4lkVcz7M=; b=wG6BBClFrP2ZpUq0SJaBVD26AkZ5G8xLeHuWRnkPNUG3LlK+lWfYOfpgG0tc92N1uK bUTXlgbeYtc5LiKT1YUb/h911q40aey2mzMn78dr2JFvwzletg79ZcqvbOqrXqsNPsLm G2G20KJ/8PP5178vDp02V87OlmQrRXPFUZ0X4zuCszl2nNuRrM7r5jfaJ+MCW4Yr+03y NYHlmAhr7aIddmXYZzez/xrD5V2fac10Sn4OTaFyEWP1LkUWHxMAyJDb92U7QmoxelwL UXB9oa4sFaWx8nqZScC9nLt2IRbGlSv/rrH8gH+Jcb34jmw9LvrWuqIiIPgmzi0KhhBH W9Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Ko+jjIDfILZRTvWmBV6W3WbxjLYlDDq9YeO4lkVcz7M=; b=mC9utxDAwusAFF7dtO7fj38SpvcLFRUsGXGOzw8a2kv57U+nx+fChdkcoGv1tx90sW LdljfI5yPkuzavJtE8S5zUJ+tTd9no638qR2NynDTToNkaexSU2u+Q6IpZo39vjfR84n AIO2YTx7qyjT01IXOBYR0keiIZp0lpaY84ifROV2OfKUtdocyS40yoy+qpdcg9hNL3C/ FVljUBIId2T+4EN/k573DOZ82AxXFuEz8jB7qEBFGBI2qwyhVVelnOr5LgvHh8wvDEXl wZDLXhCS2vZFJm2mpb+2PwR1AyTmUfJ1mlcJ6iCesJq4/yTVxdABkRJ0/mEcmWnSK+bp 1Sjw== X-Gm-Message-State: ANoB5pmyLf1PcgJqM257BDquY1HbQpKHufrBNdNUxcIDVW8+i3b8gb5J WOAmsiDSIqE1TDenHgWA2snjXQ== X-Google-Smtp-Source: AA0mqf7Q8YXDa6glOlpsZy8Ib6F5FK6TZn0OFn0WyHhGik6nIMe0ij6UF+WYSrTLepeQhB0pHEU/Rg== X-Received: by 2002:a5d:5685:0:b0:235:f0a6:fafd with SMTP id f5-20020a5d5685000000b00235f0a6fafdmr4232376wrv.75.1668774374613; Fri, 18 Nov 2022 04:26:14 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:14 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 13/15] tty: serial: qcom-geni-serial: use devres for uart port management Date: Fri, 18 Nov 2022 13:25:37 +0100 Message-Id: <20221118122539.384993-14-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski Shrink and simplify the probe() and remove() code by using the managed variant of uart_add_one_port. Signed-off-by: Bartosz Golaszewski --- drivers/tty/serial/qcom_geni_serial.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 091b8f277a04..cdd476d504da 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1457,7 +1457,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) uport->private_data = &port->private_data; platform_set_drvdata(pdev, port); - ret = uart_add_one_port(drv, uport); + ret = devm_uart_add_one_port(&pdev->dev, drv, uport); if (ret) return ret; @@ -1466,7 +1466,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) IRQF_TRIGGER_HIGH, port->name, uport); if (ret) { dev_err(uport->dev, "Failed to get IRQ ret %d\n", ret); - uart_remove_one_port(drv, uport); return ret; } @@ -1483,7 +1482,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) port->wakeup_irq); if (ret) { device_init_wakeup(&pdev->dev, false); - uart_remove_one_port(drv, uport); return ret; } } @@ -1493,12 +1491,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) static int qcom_geni_serial_remove(struct platform_device *pdev) { - struct qcom_geni_serial_port *port = platform_get_drvdata(pdev); - struct uart_driver *drv = port->private_data.drv; - dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false); - uart_remove_one_port(drv, &port->uport); return 0; } From patchwork Fri Nov 18 12:25:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 626187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A2D7C4167D for ; Fri, 18 Nov 2022 12:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241829AbiKRM1S (ORCPT ); Fri, 18 Nov 2022 07:27:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241857AbiKRM0c (ORCPT ); Fri, 18 Nov 2022 07:26:32 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 053D59AC8F for ; Fri, 18 Nov 2022 04:26:16 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id y16so8983642wrt.12 for ; Fri, 18 Nov 2022 04:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; 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=WB27jhF4DCx/Ah98HAn4Zt+8vZMKTVFmQpCWXcHg7GM=; b=Hv4j2/dPaM9EBDU7n724L6eQsr4DNXdBQjGvzrtzZDn429adWSeIfWvr+e7+Mjbgfp 3NqMO0rr+HQIQsWTe0RTQiVILKK9vcb549WGRP+cGKonal19zGGv1Alpm8bIh/5R+0Qx cmEgAbVp47aUAPBQ9KyV+jYDb8GBGDTlHuhjGoG2bCMdjDAQPThWMPAsyiNiQKPsXH1e ViA7Y5Os/+LZ5VG6GxXLwsooznyMtBZ6aUVhvCJkYCiN+ehm1J0ehhTMxdBOyeIUV+yE uTUeMjURKolrFZr6a24URF5pNbnymttJUzfMWu0gmdhKQndYGm2GqegJmBr9Nb+ks9/J +cvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WB27jhF4DCx/Ah98HAn4Zt+8vZMKTVFmQpCWXcHg7GM=; b=eNSoBiLScFZVwcpv23EIcShvruPVxMrsoV11oBIEjge1HGtiaXB6hzbWTVxCpFLAWp e+sRFQrlKToz/FpwK+mqEimXupBiGN/Qn0Be2RwO4JX+TyDhNQcaxoDNud2U/5nj2/GP pgipbX3/fJWd/aew9rpgn982j+Op63Cm5J2MRf8SXcMUBHNUZEZ0/8Jc0LpiWkPWfvxZ bvMNfwBgATjON0Gb2sZDrMZHjH3Jo0lUDXMnQRrbEoWqR3F2Mrj2uEA/JoLomRGKBcjh lcHbM4jYIywnokbrhfOdsJ42aIdF9+0itxl4GCp876/2zrGy5Gn3HJAEO/8+1nVzBonl EEPw== X-Gm-Message-State: ANoB5pleGkjgh+nAOAmd4CbCkVWLJ715X0xtFsgHhqfi5w3O19Iw8ve0 2bzEuYB3/F5PSB/HivAj+7DFZw== X-Google-Smtp-Source: AA0mqf5RPSNmKNYUH2/qrCXqX9bGdjEIkUCG//ScGngr0QgwxAVFX2JzCF6xdpSKvgMJWLHkf5jG+A== X-Received: by 2002:a5d:6a46:0:b0:241:c2d5:7407 with SMTP id t6-20020a5d6a46000000b00241c2d57407mr1285401wrw.623.1668774375543; Fri, 18 Nov 2022 04:26:15 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:b10c:1279:a704:75d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003c6f3e5ba42sm9873958wmg.46.2022.11.18.04.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 04:26:15 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 14/15] soc: qcom-geni-se: add more symbol definitions Date: Fri, 18 Nov 2022 13:25:38 +0100 Message-Id: <20221118122539.384993-15-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118122539.384993-1-brgl@bgdev.pl> References: <20221118122539.384993-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski The following symbols will be used when adding support for SE DMA in the qcom geni serial driver. Signed-off-by: Bartosz Golaszewski --- include/linux/qcom-geni-se.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index f5672785c0c4..400213daa461 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -103,6 +103,7 @@ struct geni_se { #define SE_DMA_TX_FSM_RST 0xc58 #define SE_DMA_RX_IRQ_STAT 0xd40 #define SE_DMA_RX_IRQ_CLR 0xd44 +#define SE_DMA_RX_LEN_IN 0xd54 #define SE_DMA_RX_FSM_RST 0xd58 #define SE_HW_PARAM_0 0xe24 #define SE_HW_PARAM_1 0xe28 @@ -235,6 +236,8 @@ struct geni_se { #define RX_SBE BIT(2) #define RX_RESET_DONE BIT(3) #define RX_FLUSH_DONE BIT(4) +#define RX_DMA_PARITY_ERR BIT(5) +#define RX_DMA_BREAK GENMASK(8, 7) #define RX_GENI_GP_IRQ GENMASK(10, 5) #define RX_GENI_CANCEL_IRQ BIT(11) #define RX_GENI_GP_IRQ_EXT GENMASK(13, 12)