Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp879771lqb; Wed, 17 Apr 2024 13:34:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXL0sEJnMQW9gIUc3Spazo0AmCKCYLjuAkBFW5hxE8odHPWbHDSrrTarJzjvDjejIvtaYzQ/A/WD8n1CYu0jTENXjSkRjV9LEUyzTsoQ== X-Google-Smtp-Source: AGHT+IFt80y5LadieHuLbeTFKi+dzklJ6TmxSNXPdBjR3yp/ej63kiJi4nGMHmSdhKoSe+DaZW/M X-Received: by 2002:a05:6a21:3397:b0:1a9:68c6:c0a7 with SMTP id yy23-20020a056a21339700b001a968c6c0a7mr1120623pzb.9.1713386069861; Wed, 17 Apr 2024 13:34:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713386069; cv=pass; d=google.com; s=arc-20160816; b=pwOEsvNdTtSky1468A7tChAMKRIKULKbTJ0nIcP0ThlVB46ZickKuABfb8wpppjov4 yimpcaXi3CYaz4nVqYGP3tTNy3bgeygOwuPklKC0hjWfHDxHN1gDddIzOSyGkEtM2OEg 03+R+EkK1yQ457RwmTKHpypI9tz8qJQg8+f7XwfRAu9BiVO8QR2Tl7xE0qhRT1++AcHv 54wM2tIUOWp7+YOx01n+jrRrxTsc41U8rvfaCh/Uk2wzQkcunkobGZTZ9ABRf+67crtp hnzH3/35QzBVBIP2t3pookLopqsY5N3lOVen3IU4GqCdDRwBDcCVF+00kfSJdPIRV8X9 RaHw== 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=Z9AbLZEBOkDvrJrfG/E6jqiIitDCq87/g7vX9tqZDiw=; fh=UAlP0tWVS1VUiTuieYB0+FkAEm6iJ8ONagIjk60unwM=; b=OiFjy0QF6R7F6K0IS42MNEBC9GPkoOxRH7FLVJ9ptpUiYXb8YRaf9QRTUNwNxkuUpa 2ZEfL1WbPbDzfxf8loW+C+GKxifb6eivBZvLqHlrJ+AoGjsS/F0V+/Wd8G9+0ZCnap3b vkCaVuaUE0RvD+JqSoRnqO6ZQVCbjiZGWXWQytZMe2cOOuGWUPMM/9rj1MILrnq/VdM1 yRSP7n8QRScFqsE19qZ7GapWP7rqBSza1c4Lv8tM2HWb1JamlRxKmBQXYaK7TwGXdiee pLUBkZ9VpZf41hdb3j2AWl9ZaXjxYqoM9vWsnv5YmM/Auu1urAy5URBy7U8U79uR4TcM 4lKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@finest.io header.s=s1-ionos header.b=bYxcPUO5; arc=pass (i=1 spf=pass spfdomain=finest.io dkim=pass dkdomain=finest.io); spf=pass (google.com: domain of linux-kernel+bounces-149183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149183-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j11-20020a63594b000000b005f05c95f71dsi23365pgm.358.2024.04.17.13.34.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 13:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@finest.io header.s=s1-ionos header.b=bYxcPUO5; arc=pass (i=1 spf=pass spfdomain=finest.io dkim=pass dkdomain=finest.io); spf=pass (google.com: domain of linux-kernel+bounces-149183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149183-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 69998B2389A for ; Wed, 17 Apr 2024 20:32:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BB02482DB; Wed, 17 Apr 2024 20:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=finest.io header.i=parker@finest.io header.b="bYxcPUO5" Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) (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 1B5E244C8B; Wed, 17 Apr 2024 20:32:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.208.4.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713385922; cv=none; b=cFWU9ofShr/YETchO+wKmlVdJ/tr7cHY+WEzUeNtCrHdWLNZ92EHIu9p+EMNfDBC25b2IE9p5KnnAOLrMSrOsy1fql1gx/F+lmlGaslHe8h/HFyf/ACpSSEDH5RqoBVEZZ73kKBTe8emHKImGlvvkPVp5pmR5JyB62fz6KDjF9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713385922; c=relaxed/simple; bh=AGfQ1vH4ziuzqG5ajV83OU6e/9coaYTCg7Z/7ojNInk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sogaxjzpf63EA6t1Cq1QcwGQ1GoFyGKyuTGRB8CNC70M7+YGNUBJQp0IUU3EiIUoHo10K9miAoHaIdKmQpUVMtRZ1gtOIzca+tbEUEYL6gZ8BvQZNIeAnm/e0cHKdnmAud1JLuLFB4dQdAtQK22WIWytH+Pk0rIZqVlTsvZ412w= 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=bYxcPUO5; arc=none smtp.client-ip=74.208.4.197 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=1713385915; x=1713990715; i=parker@finest.io; bh=Z9AbLZEBOkDvrJrfG/E6jqiIitDCq87/g7vX9tqZDiw=; 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=bYxcPUO5Qp4D4rvd8088kE87aI/lPlK76dq9VEFD6NyqQsfOVXRS/gcKFVIvjOFs T2/pU+iZ5o1zKYqnZqv+RCDj3r/6uGfLewgiDK66+T/H+qqV36Y6p6Yv4YECv7EHF 5l+dtxslN+qPPQH0f6CHm7pE84JjIufZWndQJPmybfe8RqSFhEkXfbPH10bxjZ4nK XBm6m/fjnOAw6wx+PgENOTmAtmco9jOMF2qBWaRUii5mw8lXoTIFuyJ54jJ3t9wsA mYB6I2/bpGKAjb8Y5F5AAHcPFIQQ/k3gKcu6Ub9leHgbQRcAaHEChri7z7isTI8Fu UT8PHUcn4s556ikHxQ== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from finest.io ([98.159.241.229]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MxE9c-1sumjz0sSu-00xdro; Wed, 17 Apr 2024 22:31:55 +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 v4 4/7] serial: exar: moved generic_rs485 further up in 8250_exar.c Date: Wed, 17 Apr 2024 16:31:26 -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:+hpOLbZKCVK1NoaArMhv+73t32rBcfbUsYZPyRUPiiIU0hqKy83 q076np94c4pmFMV4vh+U7HZ8W1WiNTnQj+F+Z1923DNH4QOtgp29V3WLT0I95rMkHLtfv30 9yr0DkzEJkosiQ8kJU0vUlAGD1xP6IjOHKz0B3RPahuryIxNMRcuyepJqEeUCECGg/xyaiH nmEFvAWCQo7lxDDheAb9w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Mx0TjLfV/CQ=;vIIrygbyWdnlaJ/s4Jea8H0fTKU D7oKZEIK/ztumR/B/4iuMy7z6AyB3olY8J2SwyAl0vmaB3kWdh7bKbR7V2tcjWzvJyn09VAfQ e794Wl5u6tXEPYjWE9SxbJF/oXRseeFKGSSNIByZtsC4wMJytPrANgIYNOuDDPJPtVrdp1BLv REO7XYvEVgHoIgA+B9SfZjuOScCPSyw6FmiM1C6hFaLPs+idfQpN5JxkmQughzNi5P1J29QIr z+R6N6IrsV4qJushuIx0OO61iIlCuFRwxCh4jiiCMHT9MX+v3CvGewB9x2mWl5QHwVwYkp/26 em9EBl//JMs2pBMFzDQCbguVbt8gTsL4zpNZL3JVbrsVvxMDXN+GSu0ujIrFXEz/RVeivYiEc ZsKCaefTFLVS+8QrX0TNTNWP9wNL4v42DTiRy2Ep0+j4GoooxbJJZZ5tGoVY3DQfSAPlRZvxg +RJ8cXG4sB/X8Y+EXFV1K6G2ubn6pfTyKfIyMJfclo3llyN3QOb2+QRATsmB8mrQPszubMRQm mq+r56zqOE02UTC9Vc7Hbj11BN9s4DgKzANW2b1Qcr47fgdStRMlSu/3ZTu02V8M3ZLpLlyeE 2zeflT0ruzarQKCeQ+2Br78GB4mizdAAcjJ1bC0ediK3WsMZetqgNorU5EfokGOKw3iC9YmPL m6ZzR53Lw5K3vYaW93IcrlzWGekYpaJwNSR667CUBGiv/Ta2OkaEx/QXr5isBD0hWK8BQtpkI gr1y39CSlQ3webvt5BQFd3NfpBjef4xImIbu4GtX9l430GnUBY3aYc= 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 them. Signed-off-by: Parker Newman =2D-- Changes in v3: - split into separate preparatory patch 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 f14f73d250bb..e68029a59122 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) { /* @@ -459,27 +484,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) { @@ -518,10 +522,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