Commit 173b097d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman
Browse files

serial: 8250_dw: Replace ACPI device check by a quirk



Instead of checking for APMC0D08 ACPI device presence,
use a quirk based on driver data.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240306143322.3291123-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 801410b2
Loading
Loading
Loading
Loading
+26 −25
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
 * LCR is written whilst busy.  If it is, then a busy detect interrupt is
 * raised, the LCR needs to be rewritten and the uart status register read.
 */
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -55,6 +54,7 @@
#define DW_UART_QUIRK_ARMADA_38X	BIT(1)
#define DW_UART_QUIRK_SKIP_SET_RATE	BIT(2)
#define DW_UART_QUIRK_IS_DMA_FC		BIT(3)
#define DW_UART_QUIRK_APMC0D08		BIT(4)

static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb)
{
@@ -444,10 +444,7 @@ static void dw8250_prepare_rx_dma(struct uart_8250_port *p)

static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
{
	struct device_node *np = p->dev->of_node;

	if (np) {
		unsigned int quirks = data->pdata->quirks;
	unsigned int quirks = data->pdata ? data->pdata->quirks : 0;

#ifdef CONFIG_64BIT
	if (quirks & DW_UART_QUIRK_OCTEON) {
@@ -469,8 +466,7 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
		data->data.dma.prepare_tx_dma = dw8250_prepare_tx_dma;
		data->data.dma.prepare_rx_dma = dw8250_prepare_rx_dma;
	}

	} else if (acpi_dev_present("APMC0D08", NULL, -1)) {
	if (quirks & DW_UART_QUIRK_APMC0D08) {
		p->iotype = UPIO_MEM32;
		p->regshift = 2;
		p->serial_in = dw8250_serial_in32;
@@ -750,13 +746,18 @@ static const struct of_device_id dw8250_of_match[] = {
};
MODULE_DEVICE_TABLE(of, dw8250_of_match);

static const struct dw8250_platform_data dw8250_apmc0d08 = {
	.usr_reg = DW_UART_USR,
	.quirks = DW_UART_QUIRK_APMC0D08,
};

static const struct acpi_device_id dw8250_acpi_match[] = {
	{ "80860F0A", (kernel_ulong_t)&dw8250_dw_apb },
	{ "8086228A", (kernel_ulong_t)&dw8250_dw_apb },
	{ "AMD0020", (kernel_ulong_t)&dw8250_dw_apb },
	{ "AMDI0020", (kernel_ulong_t)&dw8250_dw_apb },
	{ "AMDI0022", (kernel_ulong_t)&dw8250_dw_apb },
	{ "APMC0D08", (kernel_ulong_t)&dw8250_dw_apb},
	{ "APMC0D08", (kernel_ulong_t)&dw8250_apmc0d08 },
	{ "BRCM2032", (kernel_ulong_t)&dw8250_dw_apb },
	{ "HISI0031", (kernel_ulong_t)&dw8250_dw_apb },
	{ "INT33C4", (kernel_ulong_t)&dw8250_dw_apb },