aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpi_apd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 1daf9c46df8e..5f112d811e42 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -42,6 +42,7 @@ struct apd_private_data;
42struct apd_device_desc { 42struct apd_device_desc {
43 unsigned int flags; 43 unsigned int flags;
44 unsigned int fixed_clk_rate; 44 unsigned int fixed_clk_rate;
45 struct property_entry *properties;
45 int (*setup)(struct apd_private_data *pdata); 46 int (*setup)(struct apd_private_data *pdata);
46}; 47};
47 48
@@ -76,9 +77,17 @@ static struct apd_device_desc cz_i2c_desc = {
76 .fixed_clk_rate = 133000000, 77 .fixed_clk_rate = 133000000,
77}; 78};
78 79
80static 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
79static struct apd_device_desc cz_uart_desc = { 87static struct apd_device_desc cz_uart_desc = {
80 .setup = acpi_apd_setup, 88 .setup = acpi_apd_setup,
81 .fixed_clk_rate = 48000000, 89 .fixed_clk_rate = 48000000,
90 .properties = uart_properties,
82}; 91};
83#endif 92#endif
84 93
@@ -125,6 +134,12 @@ static int acpi_apd_create_device(struct acpi_device *adev,
125 goto err_out; 134 goto err_out;
126 } 135 }
127 136
137 if (dev_desc->properties) {
138 ret = device_add_properties(&adev->dev, dev_desc->properties);
139 if (ret)
140 goto err_out;
141 }
142
128 adev->driver_data = pdata; 143 adev->driver_data = pdata;
129 pdev = acpi_create_platform_device(adev); 144 pdev = acpi_create_platform_device(adev);
130 if (!IS_ERR_OR_NULL(pdev)) 145 if (!IS_ERR_OR_NULL(pdev))