Skip to content

Commit 7ff55d1

Browse files
Heikki Krogerusrafaeljw
authored andcommitted
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: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 478573c commit 7ff55d1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/acpi/acpi_apd.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct apd_private_data;
4242
struct apd_device_desc {
4343
unsigned int flags;
4444
unsigned int fixed_clk_rate;
45+
struct property_entry *properties;
4546
int (*setup)(struct apd_private_data *pdata);
4647
};
4748

@@ -76,9 +77,17 @@ static struct apd_device_desc cz_i2c_desc = {
7677
.fixed_clk_rate = 133000000,
7778
};
7879

80+
static struct property_entry uart_properties[] = {
81+
PROPERTY_ENTRY_U32("reg-io-width", 4),
82+
PROPERTY_ENTRY_U32("reg-shift", 2),
83+
PROPERTY_ENTRY_BOOL("snps,uart-16550-compatible"),
84+
{ },
85+
};
86+
7987
static struct apd_device_desc cz_uart_desc = {
8088
.setup = acpi_apd_setup,
8189
.fixed_clk_rate = 48000000,
90+
.properties = uart_properties,
8291
};
8392
#endif
8493

@@ -125,6 +134,12 @@ static int acpi_apd_create_device(struct acpi_device *adev,
125134
goto err_out;
126135
}
127136

137+
if (dev_desc->properties) {
138+
ret = device_add_properties(&adev->dev, dev_desc->properties);
139+
if (ret)
140+
goto err_out;
141+
}
142+
128143
adev->driver_data = pdata;
129144
pdev = acpi_create_platform_device(adev);
130145
if (!IS_ERR_OR_NULL(pdev))

0 commit comments

Comments
 (0)