From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Inochi Amaoto <inochiama@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Chen Wang" <unicorn_wang@outlook.com>,
"Inochi Amaoto" <inochiama@outlook.com>,
"Yixun Lan" <dlan@gentoo.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] serial: 8250_dw: Add Sophgo SG2044 quirk
Date: Thu, 10 Oct 2024 18:00:34 +0300 [thread overview]
Message-ID: <ZwfsEpqgi9zH9P_t@smile.fi.intel.com> (raw)
In-Reply-To: <20241009233908.153188-3-inochiama@gmail.com>
On Thu, Oct 10, 2024 at 07:39:06AM +0800, Inochi Amaoto wrote:
> SG2044 relys on an internal divisor when calculating bitrate, which
> means a wrong clock for the most common bitrates. So add a quirk for
> this uart device to skip the set rate call and only relys on the
> internal UART divisor.
...
> +static const struct dw8250_platform_data dw8250_sophgo_sg2044_data = {
> + .usr_reg = DW_UART_USR,
> + .quirks = DW_UART_QUIRK_SKIP_SET_RATE,
> +};
> +
> static const struct dw8250_platform_data dw8250_starfive_jh7100_data = {
> .usr_reg = DW_UART_USR,
> .quirks = DW_UART_QUIRK_SKIP_SET_RATE,
For the bare minimum this should be deduplicated as to have one record for now.
static const struct dw8250_platform_data dw8250_skip_set_rate_data = {
.usr_reg = DW_UART_USR,
.quirks = DW_UART_QUIRK_SKIP_SET_RATE,
};
If we need different quirks in the future, they can be split again.
Or, if you certain that new quirks will come, mention this in
the commit message.
...
> { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data },
> { .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data },
> { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data },
> + { .compatible = "sophgo,sg2044-uart", .data = &dw8250_sophgo_sg2044_data },
> { .compatible = "starfive,jh7100-uart", .data = &dw8250_starfive_jh7100_data },
I think my proposal for having a common compatible for those two is a no-go
as compatible strings are for the (unique) hardware and shouldn't be abstracted
based on some Linux or other OS shortcuts / quirks.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-10-10 15:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 23:39 [PATCH 0/2] serial: 8250_dw: Introduce SG2044 uart support Inochi Amaoto
2024-10-09 23:39 ` [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: Add Sophgo SG2044 uarts Inochi Amaoto
2024-10-10 6:12 ` Krzysztof Kozlowski
2024-10-10 8:23 ` Inochi Amaoto
2024-10-10 14:54 ` Andy Shevchenko
2024-10-11 1:11 ` Inochi Amaoto
2024-10-09 23:39 ` [PATCH 2/2] serial: 8250_dw: Add Sophgo SG2044 quirk Inochi Amaoto
2024-10-10 15:00 ` Andy Shevchenko [this message]
2024-10-11 2:05 ` Inochi Amaoto
2024-10-11 0:49 ` [PATCH 0/2] serial: 8250_dw: Introduce SG2044 uart support Chen Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZwfsEpqgi9zH9P_t@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=inochiama@gmail.com \
--cc=inochiama@outlook.com \
--cc=jirislaby@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=robh@kernel.org \
--cc=unicorn_wang@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox