linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org,
	Feng Kan <fkan@apm.com>
Subject: [PATCHv2 3/3] serial: 8250_dw: Add quirk for APM X-Gene SoC
Date: Tue, 23 Aug 2016 11:33:28 +0300	[thread overview]
Message-ID: <1471941208-27963-4-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1471941208-27963-1-git-send-email-heikki.krogerus@linux.intel.com>

The APM X-Gene SoC UART is the only board that still needs
the hard-coded values, so handle it separately in
dw8250_quirks(). The other ACPI platforms are able to
provide the values with device properties.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Feng Kan <fkan@apm.com>
---
 drivers/tty/serial/8250/8250_dw.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index e199696..5c0c123 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -298,12 +298,17 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 			p->serial_out = dw8250_serial_out32be;
 		}
 	} else if (has_acpi_companion(p->dev)) {
-		p->iotype = UPIO_MEM32;
-		p->regshift = 2;
-		p->serial_in = dw8250_serial_in32;
+		const struct acpi_device_id *id;
+
+		id = acpi_match_device(p->dev->driver->acpi_match_table,
+				       p->dev);
+		if (id && !strcmp(id->id, "APMC0D08")) {
+			p->iotype = UPIO_MEM32;
+			p->regshift = 2;
+			p->serial_in = dw8250_serial_in32;
+			data->uart_16550_compatible = true;
+		}
 		p->set_termios = dw8250_set_termios;
-		/* So far none of there implement the Busy Functionality */
-		data->uart_16550_compatible = true;
 	}
 
 	/* Platforms with iDMA */
-- 
2.8.1


  parent reply	other threads:[~2016-08-23  8:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23  8:33 [PATCHv2 0/3] serial: dw8250: ACPI tuning Heikki Krogerus
2016-08-23  8:33 ` [PATCHv2 1/3] ACPI / APD: Provide build-in properties of the UART Heikki Krogerus
2016-08-23  8:33 ` [PATCHv2 2/3] ACPI / LPSS: " Heikki Krogerus
2016-08-23  8:33 ` Heikki Krogerus [this message]
2016-08-31 14:16   ` [PATCHv2 3/3] serial: 8250_dw: Add quirk for APM X-Gene SoC Greg Kroah-Hartman
2016-08-25 12:47 ` [PATCHv2 0/3] serial: dw8250: ACPI tuning Andy Shevchenko
2016-09-12 22:11 ` Rafael J. Wysocki

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=1471941208-27963-4-git-send-email-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=fkan@apm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=wangkefeng.wang@huawei.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).