linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller
@ 2017-04-22  3:23 Hanjun Guo
  2017-04-22  3:23 ` [PATCH 2/2] i2c: designware: Add ACPI HID " Hanjun Guo
  2017-04-24 11:51 ` [PATCH 1/2] ACPI / APD: Add clock frequency " Kefeng Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Hanjun Guo @ 2017-04-22  3:23 UTC (permalink / raw)
  To: linux-acpi, linux-i2c
  Cc: Rafael J. Wysocki, Wolfram Sang, Jarkko Nikula, Andy Shevchenko,
	Mika Westerberg, linuxarm, wangkefeng.wang, Hanjun Guo

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(+)

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
 	{ }
 };
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] i2c: designware: Add ACPI HID for Hisilicon Hip07/08 I2C controller
  2017-04-22  3:23 [PATCH 1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller Hanjun Guo
@ 2017-04-22  3:23 ` Hanjun Guo
  2017-04-24  9:34   ` Jarkko Nikula
  2017-04-24 11:51 ` [PATCH 1/2] ACPI / APD: Add clock frequency " Kefeng Wang
  1 sibling, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2017-04-22  3:23 UTC (permalink / raw)
  To: linux-acpi, linux-i2c
  Cc: Rafael J. Wysocki, Wolfram Sang, Jarkko Nikula, Andy Shevchenko,
	Mika Westerberg, linuxarm, wangkefeng.wang, Hanjun Guo

From: Hanjun Guo <hanjun.guo@linaro.org>

Add ACPI HID HISI02A1 and HISI02A2 for Hisilicon Hip07/08,
which have different clock frequency.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 79c4b4e..90c7c10 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -129,6 +129,8 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
 	{ "AMDI0010", ACCESS_INTR_MASK },
 	{ "AMDI0510", 0 },
 	{ "APMC0D0F", 0 },
+	{ "HISI02A1", 0 },
+	{ "HISI02A2", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] i2c: designware: Add ACPI HID for Hisilicon Hip07/08 I2C controller
  2017-04-22  3:23 ` [PATCH 2/2] i2c: designware: Add ACPI HID " Hanjun Guo
@ 2017-04-24  9:34   ` Jarkko Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2017-04-24  9:34 UTC (permalink / raw)
  To: Hanjun Guo, linux-acpi, linux-i2c
  Cc: Rafael J. Wysocki, Wolfram Sang, Andy Shevchenko, Mika Westerberg,
	linuxarm, wangkefeng.wang, Hanjun Guo

On 04/22/2017 06:23 AM, Hanjun Guo wrote:
> From: Hanjun Guo <hanjun.guo@linaro.org>
>
> Add ACPI HID HISI02A1 and HISI02A2 for Hisilicon Hip07/08,
> which have different clock frequency.
>
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 79c4b4e..90c7c10 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -129,6 +129,8 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
>  	{ "AMDI0010", ACCESS_INTR_MASK },
>  	{ "AMDI0510", 0 },
>  	{ "APMC0D0F", 0 },
> +	{ "HISI02A1", 0 },
> +	{ "HISI02A2", 0 },
>  	{ }

Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller
  2017-04-22  3:23 [PATCH 1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller Hanjun Guo
  2017-04-22  3:23 ` [PATCH 2/2] i2c: designware: Add ACPI HID " Hanjun Guo
@ 2017-04-24 11:51 ` Kefeng Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Kefeng Wang @ 2017-04-24 11:51 UTC (permalink / raw)
  To: Hanjun Guo, linux-acpi, linux-i2c
  Cc: Rafael J. Wysocki, Wolfram Sang, Jarkko Nikula, Andy Shevchenko,
	Mika Westerberg, linuxarm, Hanjun Guo



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
>  	{ }
>  };
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-24 11:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-22  3:23 [PATCH 1/2] ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller Hanjun Guo
2017-04-22  3:23 ` [PATCH 2/2] i2c: designware: Add ACPI HID " Hanjun Guo
2017-04-24  9:34   ` Jarkko Nikula
2017-04-24 11:51 ` [PATCH 1/2] ACPI / APD: Add clock frequency " Kefeng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).