Commit 7ff55d17 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Rafael J. Wysocki

ACPI / APD: Provide build-in properties of the UART

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: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 478573c9
...@@ -42,6 +42,7 @@ struct apd_private_data; ...@@ -42,6 +42,7 @@ struct apd_private_data;
struct apd_device_desc { struct apd_device_desc {
unsigned int flags; unsigned int flags;
unsigned int fixed_clk_rate; unsigned int fixed_clk_rate;
struct property_entry *properties;
int (*setup)(struct apd_private_data *pdata); int (*setup)(struct apd_private_data *pdata);
}; };
...@@ -76,9 +77,17 @@ static struct apd_device_desc cz_i2c_desc = { ...@@ -76,9 +77,17 @@ static struct apd_device_desc cz_i2c_desc = {
.fixed_clk_rate = 133000000, .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 = { static struct apd_device_desc cz_uart_desc = {
.setup = acpi_apd_setup, .setup = acpi_apd_setup,
.fixed_clk_rate = 48000000, .fixed_clk_rate = 48000000,
.properties = uart_properties,
}; };
#endif #endif
...@@ -125,6 +134,12 @@ static int acpi_apd_create_device(struct acpi_device *adev, ...@@ -125,6 +134,12 @@ static int acpi_apd_create_device(struct acpi_device *adev,
goto err_out; goto err_out;
} }
if (dev_desc->properties) {
ret = device_add_properties(&adev->dev, dev_desc->properties);
if (ret)
goto err_out;
}
adev->driver_data = pdata; adev->driver_data = pdata;
pdev = acpi_create_platform_device(adev); pdev = acpi_create_platform_device(adev);
if (!IS_ERR_OR_NULL(pdev)) if (!IS_ERR_OR_NULL(pdev))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment