Merge branch 'device-properties' into acpi-soc
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Sep 2016 01:12:20 +0000 (03:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Sep 2016 01:12:20 +0000 (03:12 +0200)
1  2 
drivers/acpi/acpi_apd.c

diff --combined drivers/acpi/acpi_apd.c
@@@ -42,6 -42,7 +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);
  };
  
@@@ -76,9 -77,17 +77,17 @@@ static struct apd_device_desc cz_i2c_de
        .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
  
@@@ -87,11 -96,6 +96,11 @@@ static struct apd_device_desc xgene_i2c
        .setup = acpi_apd_setup,
        .fixed_clk_rate = 100000000,
  };
 +
 +static struct apd_device_desc vulcan_spi_desc = {
 +      .setup = acpi_apd_setup,
 +      .fixed_clk_rate = 133000000,
 +};
  #endif
  
  #else
@@@ -130,6 -134,12 +139,12 @@@ static int acpi_apd_create_device(struc
                        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;
        pdev = acpi_create_platform_device(adev);
        if (!IS_ERR_OR_NULL(pdev))
@@@ -154,7 -164,6 +169,7 @@@ static const struct acpi_device_id acpi
  #endif
  #ifdef CONFIG_ARM64
        { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
 +      { "BRCM900D", APD_ADDR(vulcan_spi_desc) },
  #endif
        { }
  };