diff mbox

[1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller

Message ID 1492831424-40581-1-git-send-email-guohanjun@huawei.com
State Awaiting Upstream
Headers show

Commit Message

Hanjun Guo April 22, 2017, 3:23 a.m. UTC
From: Hanjun Guo <hanjun.guo@linaro.org>

I2C clock frequency of Designware ip for Hisilicon Hip07 is 200M,
but 250M for Hip08, use two ACPI IDs to differentiate them.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/acpi/acpi_apd.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Kefeng Wang April 24, 2017, 11:51 a.m. UTC | #1
On 2017/4/22 11:23, Hanjun Guo wrote:
> From: Hanjun Guo <hanjun.guo@linaro.org>
> 
> I2C clock frequency of Designware ip for Hisilicon Hip07 is 200M,
> but 250M for Hip08, use two ACPI IDs to differentiate them.

It is valuable to support i2c on hisilicon D0x board, Hip05/06/07 using same clock frequency,
it should have their own ACPI ID. For both two patches,

Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>

> 
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> ---
>  drivers/acpi/acpi_apd.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> index 26696b6..8f57648 100644
> --- a/drivers/acpi/acpi_apd.c
> +++ b/drivers/acpi/acpi_apd.c
> @@ -106,6 +106,16 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
>  	.setup = acpi_apd_setup,
>  	.fixed_clk_rate = 133000000,
>  };
> +
> +static const struct apd_device_desc hip07_i2c_desc = {
> +	.setup = acpi_apd_setup,
> +	.fixed_clk_rate = 200000000,
> +};
> +
> +static const struct apd_device_desc hip08_i2c_desc = {
> +	.setup = acpi_apd_setup,
> +	.fixed_clk_rate = 250000000,
> +};
>  #endif
>  
>  #else
> @@ -169,6 +179,8 @@ static int acpi_apd_create_device(struct acpi_device *adev,
>  #ifdef CONFIG_ARM64
>  	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
>  	{ "BRCM900D", APD_ADDR(vulcan_spi_desc) },
> +	{ "HISI0A21", APD_ADDR(hip07_i2c_desc) },
> +	{ "HISI0A22", APD_ADDR(hip08_i2c_desc) },
>  #endif
>  	{ }
>  };
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 26696b6..8f57648 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -106,6 +106,16 @@  static int acpi_apd_setup(struct apd_private_data *pdata)
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 133000000,
 };
+
+static const struct apd_device_desc hip07_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 200000000,
+};
+
+static const struct apd_device_desc hip08_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 250000000,
+};
 #endif
 
 #else
@@ -169,6 +179,8 @@  static int acpi_apd_create_device(struct acpi_device *adev,
 #ifdef CONFIG_ARM64
 	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
 	{ "BRCM900D", APD_ADDR(vulcan_spi_desc) },
+	{ "HISI0A21", APD_ADDR(hip07_i2c_desc) },
+	{ "HISI0A22", APD_ADDR(hip08_i2c_desc) },
 #endif
 	{ }
 };