linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yenchia Chen <yenchia.chen@mediatek.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	yj.chiang@mediatek.com, tbergstrom@nvidia.com,
	treapking@chromium.org, u.kleine-koenig@baylibre.com,
	yujiaoliang@vivo.com, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2] serial: 8250_mtk: Add ACPI support
Date: Fri, 24 Jan 2025 17:09:10 +0200	[thread overview]
Message-ID: <Z5OtFqtf4dpvvc9v@smile.fi.intel.com> (raw)
In-Reply-To: <20250124031835.1788995-1-yenchia.chen@mediatek.com>

On Fri, Jan 24, 2025 at 11:18:32AM +0800, Yenchia Chen wrote:
> Add ACPI support to 8250_mtk driver. This makes it possible to
> use UART on ARM-based desktops with EDK2 UEFI firmware.

...

> +#include <linux/acpi.h>

This will not be needed (see below)

>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> @@ -15,6 +16,7 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/serial_8250.h>
>  #include <linux/serial_reg.h>

> +#include <linux/units.h>

This might not be needed either (see below)

>  #include <linux/console.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/tty.h>

You probably want to sort header inclusions first for easier maintenance and
feature additions like this one.

Can you add that one?

...

> +	} else if (!acpi_dev_handle) {

> +	}

This should look like

	struct fwnode_handle *fwnode = dev_fwnode(&pdev->dev);
	...
	if (is_of_node(fwnode)) {
		...parse OF...
	} else if (!fwnode) {
		return -ENODEV;
	}

...

>  	uart.port.uartclk = clk_get_rate(data->uart_clk);
> +	if (!uart.port.uartclk)
> +		uart.port.uartclk = 26 * HZ_PER_MHZ;

Why doesn't your table provide the clock-frequency property?

What I expect to see is the use of uart_read_port_properties().

...

>  #ifdef CONFIG_SERIAL_8250_DMA
>  	if (data->dma)
>  		uart.dma = data->dma;
>  #endif

Btw, how do you handle DMA in ACPI case?

...

> -	/* Disable Rate Fix function */
> -	writel(0x0, uart.port.membase +
> +	if (!acpi_dev_handle) {
> +		/* Disable Rate Fix function */
> +		writel(0x0, uart.port.membase +
>  			(MTK_UART_RATE_FIX << uart.port.regshift));
> +	}

	if (is_of_node()) {
		...
	}

...

> +static const struct acpi_device_id mtk8250_acpi_match[] = {
> +	{ "MTKI0511", 0 },

No ', 0' part, please.

> +	{},

No comma in the terminator line.

> +};

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2025-01-24 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24  3:18 [PATCH v2] serial: 8250_mtk: Add ACPI support Yenchia Chen
2025-01-24 15:09 ` Andy Shevchenko [this message]

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=Z5OtFqtf4dpvvc9v@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=tbergstrom@nvidia.com \
    --cc=treapking@chromium.org \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=yenchia.chen@mediatek.com \
    --cc=yj.chiang@mediatek.com \
    --cc=yujiaoliang@vivo.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;
as well as URLs for NNTP newsgroup(s).