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,
Ken Xue <Ken.Xue@amd.com>
Subject: [PATCH 1/3] ACPI / APD: Provide build-in properties of the UART
Date: Mon, 22 Aug 2016 17:24:13 +0300 [thread overview]
Message-ID: <1471875855-110782-2-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1471875855-110782-1-git-send-email-heikki.krogerus@linux.intel.com>
The UART driver, dw8250.c, needs some details regarding the
Designware UART. For ACPI enumerated devices the values are
hard-coded, but since the driver also reads the values from
device properties, providing them with build-in properties.
This allows us to later remove the hard-coded values from
the driver.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Ken Xue <Ken.Xue@amd.com>
---
drivers/acpi/acpi_apd.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index c80c8f8..a51dbef 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -42,6 +42,7 @@ struct apd_private_data;
struct apd_device_desc {
unsigned int flags;
unsigned int fixed_clk_rate;
+ struct property_entry *properties;
int (*setup)(struct apd_private_data *pdata);
};
@@ -67,6 +68,9 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
pdata->clk = clk;
}
+ if (pdata->properties)
+ return device_add_properties(&pdata->adev->dev,
+ pdata->properties);
return 0;
}
@@ -76,9 +80,17 @@ static struct apd_device_desc cz_i2c_desc = {
.fixed_clk_rate = 133000000,
};
+static struct property_entry uart_properties[] = {
+ PROPERTY_ENTRY_U32("reg-io-width", 4),
+ PROPERTY_ENTRY_U32("reg-shift", 2),
+ PROPERTY_ENTRY_BOOL("snps,uart-16550-compatible"),
+ { },
+};
+
static struct apd_device_desc cz_uart_desc = {
.setup = acpi_apd_setup,
.fixed_clk_rate = 48000000,
+ .properties = uart_properties,
};
#endif
--
2.8.1
next prev parent reply other threads:[~2016-08-22 14:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 14:24 [PATCH 0/3] serial: dw8250: ACPI tuning Heikki Krogerus
2016-08-22 14:24 ` Heikki Krogerus [this message]
2016-08-22 15:00 ` [PATCH 1/3] ACPI / APD: Provide build-in properties of the UART kbuild test robot
2016-08-23 6:37 ` Heikki Krogerus
2016-08-22 16:01 ` kbuild test robot
2016-08-22 14:24 ` [PATCH 2/3] ACPI / LPSS: " Heikki Krogerus
2016-08-23 7:03 ` Mika Westerberg
2016-08-22 14:24 ` [PATCH 3/3] serial: 8250_dw: Add quirk for APM X-Gene SoC Heikki Krogerus
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=1471875855-110782-2-git-send-email-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=Ken.Xue@amd.com \
--cc=andriy.shevchenko@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.