Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2047784lqp; Tue, 16 Apr 2024 06:09:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8uF5K9nUTPKYoYSQ8LQnLhPqg5wmrD9bZ6d08AqhFXtTNppjYCuZzDtegGD54qmLNMSAn387g5g3VNurkBaG3e423ftm1sVS9w7vm9A== X-Google-Smtp-Source: AGHT+IHVxVuyo3N7G4s/gZtfsXVRHyg8vBqUttRqYO8YpR2ZMDJx0GxKNFYg1nRbhbpYpZhmz6Zq X-Received: by 2002:a05:6e02:1d81:b0:368:884a:18da with SMTP id h1-20020a056e021d8100b00368884a18damr16030437ila.19.1713272973041; Tue, 16 Apr 2024 06:09:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713272973; cv=pass; d=google.com; s=arc-20160816; b=c7ipIjQCi+yuw+V1ycNnKzRJkOSwl5KSEZkuVIZB8UuC/q0ETnxh+qGnzIF4sz+VQ3 M3PzG+aHeKUtN/UI1ll0p6Va4/00fRSrf/8tuFZSTSkyqVr1DFyhVwV44d42ez9sw6H2 wSsFj5pcpBOzjWLX3muQfuvqYWm8cxLEkUPqoI+RAVeiom/lPPnNK2gtnsCDPY3ZgeVS sMTN3dnEtdC/NrWLV5F6ypBBufe8sztKwo4P+NAryX59rYsLmD+ZKcLAVTeZRmmuRjvE XBlacaNAt/vzpaXB2li07UHahJob7jodWTKAEfZRkHPQ7x/XpI+PqE6lP79fON1AE7j/ /usg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=mTpO0cGiHBKqJRh0o/22NMtUp4Gs856K6CxolXkEPh8=; fh=UAlP0tWVS1VUiTuieYB0+FkAEm6iJ8ONagIjk60unwM=; b=OA/yUud0hStpnNIEF6Pdh2cgKTlLpKPCUqozU9Gzh5WUC1GWv/1GjmtGaLSNoCZI+8 jN/sztSWWd2eIm4wpt9jJypIxf4EMA2WDEFrh6WCbUzztqGzvR7n95KjdZdouvhT3ycq D04Udul5wHk4K9GW+0VX4hzWOT12QMW1qGQAMizTbPOPYZ0LIMfKDcdF+WLXTwUq7bt8 AnShODjo//YNrTM9tHHg6ZxwKCssAYx3Bsag4zH+ILAzFPPT5T0/HZ8fXMuq22ymzE3c HZNBUmMjgKe9gRwj6kLETBgUkIm211/H9K/NeoLY8232ZKiVAFvGtbQpV8kN2aimR82h YpJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@finest.io header.s=s1-ionos header.b=ieObK0E0; arc=pass (i=1 spf=pass spfdomain=finest.io dkim=pass dkdomain=finest.io); spf=pass (google.com: domain of linux-kernel+bounces-146836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146836-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l71-20020a63884a000000b005dc86450fc8si9516038pgd.515.2024.04.16.06.09.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 06:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@finest.io header.s=s1-ionos header.b=ieObK0E0; arc=pass (i=1 spf=pass spfdomain=finest.io dkim=pass dkdomain=finest.io); spf=pass (google.com: domain of linux-kernel+bounces-146836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146836-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 840092868BC for ; Tue, 16 Apr 2024 12:57:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC80F12CD8C; Tue, 16 Apr 2024 12:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=finest.io header.i=parker@finest.io header.b="ieObK0E0" Received: from mout.perfora.net (mout.perfora.net [74.208.4.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B60D212BF15; Tue, 16 Apr 2024 12:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.208.4.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713272217; cv=none; b=PvCEHE55no3KhZo1CaZOBoID4/36D9g5SxY3ktU3/3tK5cDgqLZFcTuSQzvxdvVD5o+wqSJFjJoCF3OSYjKnw8C39W3SbBA4CwPDfodEItS2fDAa/anvJSA+ni8cLQu4EMHK7TTAJncGpLwbZOzZBK/weVSHb01NHD8w4KmdIfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713272217; c=relaxed/simple; bh=L0bwfC7QPhgn8nVwSuegcUdEIriV44jAxrlwA2aq5c0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HYKwgar4jXvlR7ghaWaQid5R+6pFIwb2l7b9zV+LfH6kncQQhGSBGANhdAtu6GWV44UsmpFI4Ge0H7Z/qwWo3DDQ39i3wrJBEd3XavbcsVg1kqk0ucCnsfeod1a4Z2Y3qpwuVb8b5s/GBKSTZdjUsW2Woi5r+Wx8gZcfyE3/RFM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=finest.io; spf=pass smtp.mailfrom=finest.io; dkim=pass (2048-bit key) header.d=finest.io header.i=parker@finest.io header.b=ieObK0E0; arc=none smtp.client-ip=74.208.4.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=finest.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=finest.io DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=finest.io; s=s1-ionos; t=1713272197; x=1713876997; i=parker@finest.io; bh=mTpO0cGiHBKqJRh0o/22NMtUp4Gs856K6CxolXkEPh8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ieObK0E0v6lboH7g9dZor/h29uZfJqxU/0wuV78NzDvtJdYCauN9mBkF0XEOkLmh yL6uNVrod1j2xx+ZRWzRhawLCJ4Wnfo3PERzokjla7LFdp4+SgUoeq7HeUcdHOGR+ SwKgfCqAxDqdtVlA7p0z7r8oB/xvdF4RsfW3tyYJznhue9rNre+BMWTtheN6mGZQj 1nKx9oAt9v+ME/39GHVxD7hCYU4bUXp69wBsS2INhwT5b2dovbJut5qjRZsLYvT3D IlTByh/+1shVDVyss6+kdUotk1G8/FEpQSRjlGS9dapOW3e4h093+7BuG6tfs93da 5jTkw1AazMIv/5x1rA== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from finest.io ([98.159.241.229]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LkNen-1sTaH81BE3-00m0QQ; Tue, 16 Apr 2024 14:56:37 +0200 From: Parker Newman To: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Parker Newman Subject: [PATCH v3 5/8] serial: exar: moved generic_rs485 further up in 8250_exar.c Date: Tue, 16 Apr 2024 08:55:32 -0400 Message-ID: X-Mailer: git-send-email 2.43.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:GqCZO7Z93IKq1C/aerb2hYCsxQYB1t8YENfP/S8qxEtpnUdsE0H Tn0jVn6erNub9waiGGs7+IUub0CryZOSn0+zwk1BRe1WZU1P+LNXfbwn51wSFkl6Zk6lVwG 0A8N36FJdhlGVWHaOc61gNnAyI3pYbZhi+j9gi7+32+ICow6yDoDVHY5rxpfctCY2hnkHlh 0fpx6hlDLjznNBPiZ2WCw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:J5uH9/3EKuQ=;U9TNMJS12lgnpmTEANSvnUuQjMY cJGgBTZV8u4iHkjBxWEpVLdD27Udc2q1Cgjc+UcAfz1fVg5ZRH0JZNqUpTb2EtIF25O/vYXEp 1i6MKG3jM9UaxeZhamV4s9ojgibrdaG52g/138SdmDLeKNkjkGDbVy0O1Ea2lHWhVg5z1NiLS 0lgBNJWpkt79gozRMsq7aYiQ8cqmMm6XUBo2w7fjNuKoMuAjcCIfNP7wa/+Mk8edz5YmL5lWF yHHU19DNCMYvKNNj9ONaZGupFfh82LOwVunEpb2ubOHKmVFtkAyv7dCi3nFj9OF2wVDtOxTS9 PTCiPMAJtnJt1ikuPcTSRNpsRuqNYRRt4RzRYVeKBVk/R981kkXVxsSxItOIhEKVVj92iINSH UOnYiHlXk8ZT1wENtpDO96yDvwGLvUpJCha+gBx13v+W/W3cjKPjJZwNpNTGpm1me+geBD61J IjnAvokY32/CoNsvy1l2WeAb05s7yqIDvYlMCNsAwkS7vOE7y1PIU84dtnw8fYOPlDMx5BaMo 1vaGT+V/KKprbi34RKn9qVbNUH89PPWWSSCiO0spakfy5SM4UFR9pi3N0JAksOSptsogCbzD2 qN25iIIbwIakp1DC6TpCZM2UNltqSE9R36EJ8FPL1jn1ad0wtZcWlFI3MayjJdtOvXIAQOcs5 zFkbva+meSjOdCkhaNRtCpNDGm4Z+XXpH7Goou9XYo0hc8qFBQsseZ4tMGdRD6mIK7dURfeBC A0Cp3UsNai7tBzTJE72KnvmOx50oc17/f2uLPEC6dOyYNSiwWPsyX8= From: Parker Newman Preparatory patch moving generic_rs485_config and generic_rs485_supported higher in the file to allow for CTI setup functions to use it. Changes in v3: - split into separate preparatory patch Signed-off-by: Parker Newman =2D-- drivers/tty/serial/8250/8250_exar.c | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250= /8250_exar.c index cf7900bd2974..7e47a4145c7b 100644 =2D-- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -197,6 +197,31 @@ struct exar8250 { int line[]; }; +static int generic_rs485_config(struct uart_port *port, struct ktermios *= termios, + struct serial_rs485 *rs485) +{ + bool is_rs485 =3D !!(rs485->flags & SER_RS485_ENABLED); + u8 __iomem *p =3D port->membase; + u8 value; + + value =3D readb(p + UART_EXAR_FCTR); + if (is_rs485) + value |=3D UART_FCTR_EXAR_485; + else + value &=3D ~UART_FCTR_EXAR_485; + + writeb(value, p + UART_EXAR_FCTR); + + if (is_rs485) + writeb(UART_EXAR_RS485_DLY(4), p + UART_MSR); + + return 0; +} + +static const struct serial_rs485 generic_rs485_supported =3D { + .flags =3D SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND, +}; + static void exar_pm(struct uart_port *port, unsigned int state, unsigned = int old) { /* @@ -458,27 +483,6 @@ static void xr17v35x_unregister_gpio(struct uart_8250= _port *port) port->port.private_data =3D NULL; } -static int generic_rs485_config(struct uart_port *port, struct ktermios *= termios, - struct serial_rs485 *rs485) -{ - bool is_rs485 =3D !!(rs485->flags & SER_RS485_ENABLED); - u8 __iomem *p =3D port->membase; - u8 value; - - value =3D readb(p + UART_EXAR_FCTR); - if (is_rs485) - value |=3D UART_FCTR_EXAR_485; - else - value &=3D ~UART_FCTR_EXAR_485; - - writeb(value, p + UART_EXAR_FCTR); - - if (is_rs485) - writeb(UART_EXAR_RS485_DLY(4), p + UART_MSR); - - return 0; -} - static int sealevel_rs485_config(struct uart_port *port, struct ktermios = *termios, struct serial_rs485 *rs485) { @@ -517,10 +521,6 @@ static int sealevel_rs485_config(struct uart_port *po= rt, struct ktermios *termio return 0; } -static const struct serial_rs485 generic_rs485_supported =3D { - .flags =3D SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND, -}; - static const struct exar8250_platform exar8250_default_platform =3D { .register_gpio =3D xr17v35x_register_gpio, .unregister_gpio =3D xr17v35x_unregister_gpio, =2D- 2.43.2