Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27946677rwd; Tue, 4 Jul 2023 10:06:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHlyhFInnwtfTwUKL8mPfzN38WNlVefsbLygIMI1tStTKoTgznf8rm1Fhy/m4SqpJGYaiDL X-Received: by 2002:a92:c608:0:b0:345:b536:61f with SMTP id p8-20020a92c608000000b00345b536061fmr14365260ilm.31.1688490376817; Tue, 04 Jul 2023 10:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688490376; cv=none; d=google.com; s=arc-20160816; b=U+q/fYYPFT/CMZqSCyg86APhc9LyDNYFvdJJ3c5GiEJkdlg+yOVEiXas+dvCpMs/7x 0gL+rxfBvxwNkzGdhZl9b03lftx5ZVErKsZYVKgi+bN6sE63vRmPqmFtxsGSXmhHR8np wJ6eM49kwKS67FB8AND0a5mU2fQyiZVXxSlJ0rFB1vofDuTaoeI2J4j8Ib/V8lIWQNhV HXjdMMA7DLjuarojXvKV7IZ9dUapu8VhbsvVor+HSDRXQlZZwEG1cpNIhtkWZ3RMDkmb gwtRVQpXV0OyRSJIys0feVy17VIVNgBxMYLvRuB6XlrclHFRAziHajpcEYJOC9Ap40T3 7+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7VH5qhRUQQO/2ofVARxlwQClx7ST02rj40p4YbQWthw=; fh=2W/isY9xspzh+lfYPApeMpJ5AuLS07QxtNQWlFqyxFg=; b=vfE9c9w45Y/iz1aUxPeuCnTvRqNiuCB6wdrT1TKYWCMnAjTwqJ6fLCrNpiYJ0VFgIn +A4HtvFsUhz2C0KpXgwvjstypUek3s2Cx1eETsldQDI6zcTe/HXmchmK+Ho3yFdX6kjH gBQc94y5ZyrUeRziB7AL/pqYtvAkWEJKJ32Fq816GIGjY7348GyGCwfuABG/j3l+CKgY bJXBnUmqNfUvDYUUqTVpGC4/Hf8fe76wvkeIaHce9NTUqPcd+5Biyxvcph3/cRro8pcG X8c2+7k2nlfpREPFk5vxCl9xDFmi0Qyi98onugl2h+i9bZSDTJbdOJGnLpJpwVVKWzLl B7+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZbKVjQMO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k36-20020a634b64000000b005503f25aac2si21363836pgl.241.2023.07.04.10.06.00; Tue, 04 Jul 2023 10:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZbKVjQMO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231743AbjGDQ5Z (ORCPT + 99 others); Tue, 4 Jul 2023 12:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbjGDQ5X (ORCPT ); Tue, 4 Jul 2023 12:57:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59DBDD; Tue, 4 Jul 2023 09:57:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B3F161302; Tue, 4 Jul 2023 16:57:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B6F1C433C7; Tue, 4 Jul 2023 16:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688489841; bh=MVK2bS+f6XohwJ0w4CtQX6uyCqJA+y7IuaOf1eEVzMY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZbKVjQMOI7tOQZ0qiLl39Yj+RCq0pT415EnZJAX39Pns8On/Yo8yX2ouWsBdWza6D WpRp6Yt/StzDscW5QhJbD+YnX8/m/NiWzf/Hj1mqYBozI2Luwyacdg2qo/Vh+7QJCA 5o4cwhVHaLh5jIhngMo8peEvsW2yIk6JEvpBMZKOm3Dx+OSpoQ+En7lzK0iGgkKY45 Uk3SiVvO+oLuOC1uSnO+f/nX6eLMRJ8nMZGfWcBzdcsWXcLmornN1VljMOyR4XRxGY C8+fNAgSf3VRPEEf+Q2Xta8a2s2uzfPNpJmztkio125pZazEIDRNmsQef9tyoTZV4C OnfqP7ysrKfuA== Date: Tue, 4 Jul 2023 17:57:15 +0100 From: Conor Dooley To: Dmitry Rokosov Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, neil.armstrong@linaro.org, jbrunet@baylibre.com, jirislaby@kernel.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, kelvin.zhang@amlogic.com, xianwei.zhao@amlogic.com, kernel@sberdevices.ru, rockosov@gmail.com, linux-amlogic@lists.infradead.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 3/5] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs Message-ID: <20230704-pogo-zeppelin-5fa281f5c9e6@spud> References: <20230704135936.14697-1-ddrokosov@sberdevices.ru> <20230704135936.14697-4-ddrokosov@sberdevices.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cFEFPb639xHq5Qr+" Content-Disposition: inline In-Reply-To: <20230704135936.14697-4-ddrokosov@sberdevices.ru> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cFEFPb639xHq5Qr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 04, 2023 at 04:59:34PM +0300, Dmitry Rokosov wrote: > It is worth noting that the devname ttyS is a widely recognized tty name > and is commonly used by many uart device drivers. Given the established > usage and compatibility concerns, it may not be feasible to change the > devname for older SoCs. However, for new definitions, it is acceptable > and even recommended to use a new devname to help ensure clarity and > avoid any potential conflicts on lower or upper software levels. > In > addition, modify the meson_uart_dt match data for g12a, a1, and s4 to > their appropriate values to ensure proper devname values and > functionality. IMO, this is a separate change that should be in another patch, had to go looking through a several of unrelated $subject patches to understand how the binding patch was going to work. Cheers, Conor. > For more information please refer to IRC discussion at [1]. >=20 > Links: > [1]: https://libera.irclog.whitequark.org/linux-amlogic/2023-07-03 >=20 > Signed-off-by: Dmitry Rokosov > --- > drivers/tty/serial/meson_uart.c | 33 +++++++++++++++++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_u= art.c > index 87c0eb5f2dba..361f9326b527 100644 > --- a/drivers/tty/serial/meson_uart.c > +++ b/drivers/tty/serial/meson_uart.c > @@ -82,6 +82,7 @@ static struct uart_driver meson_uart_driver; > static struct uart_port *meson_ports[AML_UART_PORT_NUM]; > =20 > struct meson_uart_data { > + const char *dev_name; > bool has_xtal_div2; > }; > =20 > @@ -683,6 +684,7 @@ static int meson_uart_probe_clocks(struct platform_de= vice *pdev, > =20 > static int meson_uart_probe(struct platform_device *pdev) > { > + const struct meson_uart_data *priv_data; > struct resource *res_mem; > struct uart_port *port; > u32 fifosize =3D 64; /* Default is 64, 128 for EE UART_0 */ > @@ -729,6 +731,18 @@ static int meson_uart_probe(struct platform_device *= pdev) > if (ret) > return ret; > =20 > + priv_data =3D device_get_match_data(&pdev->dev); > + > + if (priv_data) { > + struct console *cons =3D meson_uart_driver.cons; > + > + meson_uart_driver.dev_name =3D priv_data->dev_name; > + > + if (cons) > + strscpy(cons->name, priv_data->dev_name, > + sizeof(cons->name)); > + } > + > if (!meson_uart_driver.state) { > ret =3D uart_register_driver(&meson_uart_driver); > if (ret) > @@ -748,7 +762,7 @@ static int meson_uart_probe(struct platform_device *p= dev) > port->x_char =3D 0; > port->ops =3D &meson_uart_ops; > port->fifosize =3D fifosize; > - port->private_data =3D (void *)device_get_match_data(&pdev->dev); > + port->private_data =3D (void *)priv_data; > =20 > meson_ports[pdev->id] =3D port; > platform_set_drvdata(pdev, port); > @@ -780,6 +794,17 @@ static int meson_uart_remove(struct platform_device = *pdev) > } > =20 > static struct meson_uart_data meson_g12a_uart_data =3D { > + .dev_name =3D "ttyAML", > + .has_xtal_div2 =3D true, > +}; > + > +static struct meson_uart_data meson_a1_uart_data =3D { > + .dev_name =3D "ttyS", > + .has_xtal_div2 =3D false, > +}; > + > +static struct meson_uart_data meson_s4_uart_data =3D { > + .dev_name =3D "ttyS", > .has_xtal_div2 =3D true, > }; > =20 > @@ -794,7 +819,11 @@ static const struct of_device_id meson_uart_dt_match= [] =3D { > }, > { > .compatible =3D "amlogic,meson-s4-uart", > - .data =3D (void *)&meson_g12a_uart_data, > + .data =3D (void *)&meson_s4_uart_data, > + }, > + { > + .compatible =3D "amlogic,meson-a1-uart", > + .data =3D (void *)&meson_a1_uart_data, > }, > { /* sentinel */ }, > }; > --=20 > 2.36.0 >=20 --cFEFPb639xHq5Qr+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZKRPawAKCRB4tDGHoIJi 0mZzAP47gQmIoHiEKtf6/SExpFCyadxEql+D7dStRjofvLIEgAD9F25QTpMwc7zH /3Dk88CYjPnAzUZCHEyVxiL5r2QW9Ak= =wvA0 -----END PGP SIGNATURE----- --cFEFPb639xHq5Qr+--