Commit b790eb20 authored by Loc Ho's avatar Loc Ho Committed by Rafael J. Wysocki

ACPI / APD: Add APM X-Gene ACPI I2C device support

Add APM X-Gene ACPI I2C device support by hooks into existent
ACPI APD driver.  To fully enable support, require another
patch to add the X-Gene ACPI node into the DW I2C driver.
Signed-off-by: default avatarLoc Ho <lho@apm.com>
Reviewed-by: default avatarKen Xue <Ken.Xue@amd.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent fa9e93b1
...@@ -51,7 +51,7 @@ struct apd_private_data { ...@@ -51,7 +51,7 @@ struct apd_private_data {
const struct apd_device_desc *dev_desc; const struct apd_device_desc *dev_desc;
}; };
#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE #if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
#define APD_ADDR(desc) ((unsigned long)&desc) #define APD_ADDR(desc) ((unsigned long)&desc)
static int acpi_apd_setup(struct apd_private_data *pdata) static int acpi_apd_setup(struct apd_private_data *pdata)
...@@ -71,6 +71,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata) ...@@ -71,6 +71,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
return 0; return 0;
} }
#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
static struct apd_device_desc cz_i2c_desc = { static struct apd_device_desc cz_i2c_desc = {
.setup = acpi_apd_setup, .setup = acpi_apd_setup,
.fixed_clk_rate = 133000000, .fixed_clk_rate = 133000000,
...@@ -80,6 +81,14 @@ static struct apd_device_desc cz_uart_desc = { ...@@ -80,6 +81,14 @@ static struct apd_device_desc cz_uart_desc = {
.setup = acpi_apd_setup, .setup = acpi_apd_setup,
.fixed_clk_rate = 48000000, .fixed_clk_rate = 48000000,
}; };
#endif
#ifdef CONFIG_ARM64
static struct apd_device_desc xgene_i2c_desc = {
.setup = acpi_apd_setup,
.fixed_clk_rate = 100000000,
};
#endif
#else #else
...@@ -132,9 +141,14 @@ static int acpi_apd_create_device(struct acpi_device *adev, ...@@ -132,9 +141,14 @@ static int acpi_apd_create_device(struct acpi_device *adev,
static const struct acpi_device_id acpi_apd_device_ids[] = { static const struct acpi_device_id acpi_apd_device_ids[] = {
/* Generic apd devices */ /* Generic apd devices */
#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
{ "AMD0010", APD_ADDR(cz_i2c_desc) }, { "AMD0010", APD_ADDR(cz_i2c_desc) },
{ "AMD0020", APD_ADDR(cz_uart_desc) }, { "AMD0020", APD_ADDR(cz_uart_desc) },
{ "AMD0030", }, { "AMD0030", },
#endif
#ifdef CONFIG_ARM64
{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
#endif
{ } { }
}; };
......
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