[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5n-6z6SOSZy-BMW@smile.fi.intel.com>
Date: Wed, 29 Jan 2025 12:11:55 +0200
From: "andriy.shevchenko@...ux.intel.com" <andriy.shevchenko@...ux.intel.com>
To: Kartik Rajput <kkartik@...dia.com>
Cc: Jon Hunter <jonathanh@...dia.com>, "robh@...nel.org" <robh@...nel.org>,
"robert.marko@...tura.hr" <robert.marko@...tura.hr>,
"arnd@...nel.org" <arnd@...nel.org>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"jirislaby@...nel.org" <jirislaby@...nel.org>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>,
"hvilleneuve@...onoff.com" <hvilleneuve@...onoff.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"schnelle@...ux.ibm.com" <schnelle@...ux.ibm.com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>
Subject: Re: [PATCH 2/2] serial: tegra-utc: Add driver for Tegra UART Trace
Controller (UTC)
On Wed, Jan 29, 2025 at 08:04:27AM +0000, Kartik Rajput wrote:
> On Wed, 2025-01-29 at 09:07 +0200, Andy Shevchenko wrote:
> > On Tue, Jan 28, 2025 at 12:16:33PM +0530, Kartik Rajput wrote:
...
> > > + ret = of_property_read_u32(np, "current-speed", &tup-
> > > >baudrate);
> >
> > Why not clock-frequency? But if needed, add this to the above
> > mentioned API as
> > I know more than one driver may utilise this.
>
> "current-speed" is to specify the baudrate at which the UTC is
> operating. Not sure if "clock-frequency" is the ideal property for this
> as we are not configuring any clocks in the driver.
I didn't say anything about configuring clocks. The clock-frequency property is
standard way to provide a functional frequency of the UART (usually some MHz
crystal) which you can divide by the known HW coefficients and get the baud rate
(but yes, I agree that this is HW-dependent and needs to be thought through).
> Also, to add this in uart_read_port_properties() would require updating
> uart_port stucture to store the baudrate value. Would this be fine?
Sure, it requires some members to be defined beforehand.
> Asking because I do not see termios related configurations stored in
> uart_port structure.
Yeah, the only one is uartclk. But again, if you need current-speed to be
parsed, consider doing this in the uart_read_port_properties() and saving
as uartclk in the known way.
Technically it's possible to add a new member to uart_port, but it has
a lot of downsides as I can see: additional memory, added ambiguity to
how parse uartclk and current speed if they both are defined.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists