]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/acpi/acpi_lpss.c
ACPI / platform: Add support for build-in properties
[mirror_ubuntu-zesty-kernel.git] / drivers / acpi / acpi_lpss.c
index 357a0b8f860b378850939b7ff83a018881d913d0..373657f7e35a9cac3a2a951cd030c00ef6fbd06d 100644 (file)
@@ -75,6 +75,7 @@ struct lpss_device_desc {
        const char *clk_con_id;
        unsigned int prv_offset;
        size_t prv_size_override;
+       struct property_entry *properties;
        void (*setup)(struct lpss_private_data *pdata);
 };
 
@@ -163,11 +164,19 @@ static const struct lpss_device_desc lpt_i2c_dev_desc = {
        .prv_offset = 0x800,
 };
 
+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 const struct lpss_device_desc lpt_uart_dev_desc = {
        .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
        .clk_con_id = "baudclk",
        .prv_offset = 0x800,
        .setup = lpss_uart_setup,
+       .properties = uart_properties,
 };
 
 static const struct lpss_device_desc lpt_sdio_dev_desc = {
@@ -189,6 +198,7 @@ static const struct lpss_device_desc byt_uart_dev_desc = {
        .clk_con_id = "baudclk",
        .prv_offset = 0x800,
        .setup = lpss_uart_setup,
+       .properties = uart_properties,
 };
 
 static const struct lpss_device_desc bsw_uart_dev_desc = {
@@ -197,6 +207,7 @@ static const struct lpss_device_desc bsw_uart_dev_desc = {
        .clk_con_id = "baudclk",
        .prv_offset = 0x800,
        .setup = lpss_uart_setup,
+       .properties = uart_properties,
 };
 
 static const struct lpss_device_desc byt_spi_dev_desc = {
@@ -384,7 +395,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
 
        dev_desc = (const struct lpss_device_desc *)id->driver_data;
        if (!dev_desc) {
-               pdev = acpi_create_platform_device(adev);
+               pdev = acpi_create_platform_device(adev, NULL);
                return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1;
        }
        pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
@@ -441,7 +452,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
        }
 
        adev->driver_data = pdata;
-       pdev = acpi_create_platform_device(adev);
+       pdev = acpi_create_platform_device(adev, dev_desc->properties);
        if (!IS_ERR_OR_NULL(pdev)) {
                return 1;
        }