All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c:dw: Add APM X-Gene ACPI I2C device support
@ 2015-12-08  0:16 ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: wsa, Ken.Xue, Jeff.Wu, rjw, mika.westerberg, lenb
  Cc: linux-i2c, linux-acpi, linux-arm-kernel, jcm, patches, Loc Ho

Add APM X-Gene ACPI I2C device support. These patches follow
the same implementation as AMD I2C driver - changes in ACPI APD 
and Designware I2C drivers.

Signed-off-by: Loc Ho <lho@apm.com>
---
Loc Ho (2):
  acpi:apd: Add APM X-Gene ACPI I2C device support
  i2c:dw: Add APM X-Gene ACPI I2C device support

 drivers/acpi/acpi_apd.c                     |    8 +++++++-
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 2 files changed, 8 insertions(+), 1 deletions(-)

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

* [PATCH 0/2] i2c:dw: Add APM X-Gene ACPI I2C device support
@ 2015-12-08  0:16 ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: linux-arm-kernel

Add APM X-Gene ACPI I2C device support. These patches follow
the same implementation as AMD I2C driver - changes in ACPI APD 
and Designware I2C drivers.

Signed-off-by: Loc Ho <lho@apm.com>
---
Loc Ho (2):
  acpi:apd: Add APM X-Gene ACPI I2C device support
  i2c:dw: Add APM X-Gene ACPI I2C device support

 drivers/acpi/acpi_apd.c                     |    8 +++++++-
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 2 files changed, 8 insertions(+), 1 deletions(-)

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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-08  0:16 ` Loc Ho
@ 2015-12-08  0:16   ` Loc Ho
  -1 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: wsa, Ken.Xue, Jeff.Wu, rjw, mika.westerberg, lenb
  Cc: linux-i2c, linux-acpi, linux-arm-kernel, jcm, patches, Loc Ho

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: Loc Ho <lho@apm.com>
---
 drivers/acpi/acpi_apd.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index a450e7a..6a9cb8d 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -51,7 +51,7 @@ struct apd_private_data {
 	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)
 
 static int acpi_apd_setup(struct apd_private_data *pdata)
@@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
 	.fixed_clk_rate = 133000000,
 };
 
+static struct apd_device_desc xgene_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 100000000,
+};
+
 static struct apd_device_desc cz_uart_desc = {
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 48000000,
@@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "AMD0010", APD_ADDR(cz_i2c_desc) },
 	{ "AMD0020", APD_ADDR(cz_uart_desc) },
 	{ "AMD0030", },
+	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
 	{ }
 };
 
-- 
1.7.1

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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-08  0:16   ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: linux-arm-kernel

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: Loc Ho <lho@apm.com>
---
 drivers/acpi/acpi_apd.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index a450e7a..6a9cb8d 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -51,7 +51,7 @@ struct apd_private_data {
 	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)
 
 static int acpi_apd_setup(struct apd_private_data *pdata)
@@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
 	.fixed_clk_rate = 133000000,
 };
 
+static struct apd_device_desc xgene_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 100000000,
+};
+
 static struct apd_device_desc cz_uart_desc = {
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 48000000,
@@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "AMD0010", APD_ADDR(cz_i2c_desc) },
 	{ "AMD0020", APD_ADDR(cz_uart_desc) },
 	{ "AMD0030", },
+	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
 	{ }
 };
 
-- 
1.7.1

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

* [PATCH 2/2] i2c:dw: Add APM X-Gene ACPI I2C device support
  2015-12-08  0:16 ` Loc Ho
@ 2015-12-08  0:16   ` Loc Ho
  -1 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: wsa, Ken.Xue, Jeff.Wu, rjw, mika.westerberg, lenb
  Cc: linux-i2c, linux-acpi, linux-arm-kernel, jcm, patches, Loc Ho

Enable APM X-Gene ACPI I2C device support by adding the
corresponding ACPI ID. The platform ACPI APD corresponding
change is required to provide the proper clock frequency input.

Signed-off-by: Loc Ho <lho@apm.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 809579e..423371d 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -117,6 +117,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "80860F41", 0 },
 	{ "808622C1", 0 },
 	{ "AMD0010", 0 },
+	{ "APMC0D0F", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
-- 
1.7.1

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

* [PATCH 2/2] i2c:dw: Add APM X-Gene ACPI I2C device support
@ 2015-12-08  0:16   ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-08  0:16 UTC (permalink / raw)
  To: linux-arm-kernel

Enable APM X-Gene ACPI I2C device support by adding the
corresponding ACPI ID. The platform ACPI APD corresponding
change is required to provide the proper clock frequency input.

Signed-off-by: Loc Ho <lho@apm.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 809579e..423371d 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -117,6 +117,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "80860F41", 0 },
 	{ "808622C1", 0 },
 	{ "AMD0010", 0 },
+	{ "APMC0D0F", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
-- 
1.7.1

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

* Re: [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-08  0:16   ` Loc Ho
@ 2015-12-08  2:49     ` Ken Xue
  -1 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-08  2:49 UTC (permalink / raw)
  To: Loc Ho
  Cc: wsa, rjw, mika.westerberg, lenb, linux-i2c, linux-acpi,
	linux-arm-kernel, jcm, patches, Annie.Wang

On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> 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: Loc Ho <lho@apm.com>
> ---
>  drivers/acpi/acpi_apd.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> index a450e7a..6a9cb8d 100644
> --- a/drivers/acpi/acpi_apd.c
> +++ b/drivers/acpi/acpi_apd.c
> @@ -51,7 +51,7 @@ struct apd_private_data {
>  	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)
>  
>  static int acpi_apd_setup(struct apd_private_data *pdata)
> @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
>  	.fixed_clk_rate = 133000000,
>  };
>  
> +static struct apd_device_desc xgene_i2c_desc = {
> +	.setup = acpi_apd_setup,
> +	.fixed_clk_rate = 100000000,
> +};
> +
>  static struct apd_device_desc cz_uart_desc = {
>  	.setup = acpi_apd_setup,
>  	.fixed_clk_rate = 48000000,
> @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
>  	{ "AMD0010", APD_ADDR(cz_i2c_desc) },
>  	{ "AMD0020", APD_ADDR(cz_uart_desc) },
>  	{ "AMD0030", },
> +	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
It is better to split AMD devices and ARM devices with macros:
CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.


>  	{ }
>  };
>  



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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-08  2:49     ` Ken Xue
  0 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-08  2:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> 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: Loc Ho <lho@apm.com>
> ---
>  drivers/acpi/acpi_apd.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> index a450e7a..6a9cb8d 100644
> --- a/drivers/acpi/acpi_apd.c
> +++ b/drivers/acpi/acpi_apd.c
> @@ -51,7 +51,7 @@ struct apd_private_data {
>  	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)
>  
>  static int acpi_apd_setup(struct apd_private_data *pdata)
> @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
>  	.fixed_clk_rate = 133000000,
>  };
>  
> +static struct apd_device_desc xgene_i2c_desc = {
> +	.setup = acpi_apd_setup,
> +	.fixed_clk_rate = 100000000,
> +};
> +
>  static struct apd_device_desc cz_uart_desc = {
>  	.setup = acpi_apd_setup,
>  	.fixed_clk_rate = 48000000,
> @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
>  	{ "AMD0010", APD_ADDR(cz_i2c_desc) },
>  	{ "AMD0020", APD_ADDR(cz_uart_desc) },
>  	{ "AMD0030", },
> +	{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
It is better to split AMD devices and ARM devices with macros:
CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.


>  	{ }
>  };
>  

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

* Re: [PATCH 2/2] i2c:dw: Add APM X-Gene ACPI I2C device support
  2015-12-08  0:16   ` Loc Ho
@ 2015-12-08 11:36     ` Mika Westerberg
  -1 siblings, 0 replies; 18+ messages in thread
From: Mika Westerberg @ 2015-12-08 11:36 UTC (permalink / raw)
  To: Loc Ho
  Cc: wsa, Ken.Xue, Jeff.Wu, rjw, lenb, linux-i2c, linux-acpi,
	linux-arm-kernel, jcm, patches

On Mon, Dec 07, 2015 at 05:16:14PM -0700, Loc Ho wrote:
> Enable APM X-Gene ACPI I2C device support by adding the
> corresponding ACPI ID. The platform ACPI APD corresponding
> change is required to provide the proper clock frequency input.
> 
> Signed-off-by: Loc Ho <lho@apm.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* [PATCH 2/2] i2c:dw: Add APM X-Gene ACPI I2C device support
@ 2015-12-08 11:36     ` Mika Westerberg
  0 siblings, 0 replies; 18+ messages in thread
From: Mika Westerberg @ 2015-12-08 11:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 07, 2015 at 05:16:14PM -0700, Loc Ho wrote:
> Enable APM X-Gene ACPI I2C device support by adding the
> corresponding ACPI ID. The platform ACPI APD corresponding
> change is required to provide the proper clock frequency input.
> 
> Signed-off-by: Loc Ho <lho@apm.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-08  2:49     ` Ken Xue
@ 2015-12-09 22:03       ` Loc Ho
  -1 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-09 22:03 UTC (permalink / raw)
  To: Ken Xue
  Cc: wsa, rjw, mika.westerberg, Len Brown, linux-i2c, linux-acpi,
	linux-arm-kernel, Jon Masters, patches, Annie.Wang

Hi Ken,

On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
>
> On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> > 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: Loc Ho <lho@apm.com>
> > ---
> >  drivers/acpi/acpi_apd.c |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> > index a450e7a..6a9cb8d 100644
> > --- a/drivers/acpi/acpi_apd.c
> > +++ b/drivers/acpi/acpi_apd.c
> > @@ -51,7 +51,7 @@ struct apd_private_data {
> >       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)
> >
> >  static int acpi_apd_setup(struct apd_private_data *pdata)
> > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
> >       .fixed_clk_rate = 133000000,
> >  };
> >
> > +static struct apd_device_desc xgene_i2c_desc = {
> > +     .setup = acpi_apd_setup,
> > +     .fixed_clk_rate = 100000000,
> > +};
> > +
> >  static struct apd_device_desc cz_uart_desc = {
> >       .setup = acpi_apd_setup,
> >       .fixed_clk_rate = 48000000,
> > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
> >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
> >       { "AMD0020", APD_ADDR(cz_uart_desc) },
> >       { "AMD0030", },
> > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> It is better to split AMD devices and ARM devices with macros:
> CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.

This gets pretty ugly to me with define as it would look like this:

#if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
#define APD_ADDR(desc) ((unsigned long)&desc)

static int acpi_apd_setup(struct apd_private_data *pdata)
{
   .....
}

#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
static struct apd_device_desc cz_i2c_desc = {
    ....
};

static struct apd_device_desc xgene_i2c_desc = {
    ...
};
#endif

#ifdef CONFIG_ARM64
static struct apd_device_desc cz_uart_desc = {
    ....
};
#endif

#else

#define APD_ADDR(desc) (0UL)

#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */

And...

#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
{ "AMD0010", APD_ADDR(cz_i2c_desc) },
{ "AMD0020", APD_ADDR(cz_uart_desc) },
{ "AMD0030", },
#endif
#ifdef CONFIG_ARM64
{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
#endif

Sure you want this?

-Loc

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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-09 22:03       ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-09 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ken,

On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
>
> On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> > 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: Loc Ho <lho@apm.com>
> > ---
> >  drivers/acpi/acpi_apd.c |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> > index a450e7a..6a9cb8d 100644
> > --- a/drivers/acpi/acpi_apd.c
> > +++ b/drivers/acpi/acpi_apd.c
> > @@ -51,7 +51,7 @@ struct apd_private_data {
> >       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)
> >
> >  static int acpi_apd_setup(struct apd_private_data *pdata)
> > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
> >       .fixed_clk_rate = 133000000,
> >  };
> >
> > +static struct apd_device_desc xgene_i2c_desc = {
> > +     .setup = acpi_apd_setup,
> > +     .fixed_clk_rate = 100000000,
> > +};
> > +
> >  static struct apd_device_desc cz_uart_desc = {
> >       .setup = acpi_apd_setup,
> >       .fixed_clk_rate = 48000000,
> > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
> >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
> >       { "AMD0020", APD_ADDR(cz_uart_desc) },
> >       { "AMD0030", },
> > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> It is better to split AMD devices and ARM devices with macros:
> CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.

This gets pretty ugly to me with define as it would look like this:

#if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
#define APD_ADDR(desc) ((unsigned long)&desc)

static int acpi_apd_setup(struct apd_private_data *pdata)
{
   .....
}

#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
static struct apd_device_desc cz_i2c_desc = {
    ....
};

static struct apd_device_desc xgene_i2c_desc = {
    ...
};
#endif

#ifdef CONFIG_ARM64
static struct apd_device_desc cz_uart_desc = {
    ....
};
#endif

#else

#define APD_ADDR(desc) (0UL)

#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */

And...

#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
{ "AMD0010", APD_ADDR(cz_i2c_desc) },
{ "AMD0020", APD_ADDR(cz_uart_desc) },
{ "AMD0030", },
#endif
#ifdef CONFIG_ARM64
{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
#endif

Sure you want this?

-Loc

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

* Re: [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-09 22:03       ` Loc Ho
@ 2015-12-10  6:14         ` Ken Xue
  -1 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-10  6:14 UTC (permalink / raw)
  To: Loc Ho
  Cc: wsa, rjw, mika.westerberg, Len Brown, linux-i2c, linux-acpi,
	linux-arm-kernel, Jon Masters, patches, Annie.Wang

On Wed, 2015-12-09 at 14:03 -0800, Loc Ho wrote:
> Hi Ken,
> 
> On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
> >
> > On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> > > 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: Loc Ho <lho@apm.com>
> > > ---
> > >  drivers/acpi/acpi_apd.c |    8 +++++++-
> > >  1 files changed, 7 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> > > index a450e7a..6a9cb8d 100644
> > > --- a/drivers/acpi/acpi_apd.c
> > > +++ b/drivers/acpi/acpi_apd.c
> > > @@ -51,7 +51,7 @@ struct apd_private_data {
> > >       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)
> > >
> > >  static int acpi_apd_setup(struct apd_private_data *pdata)
> > > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
> > >       .fixed_clk_rate = 133000000,
> > >  };
> > >
> > > +static struct apd_device_desc xgene_i2c_desc = {
> > > +     .setup = acpi_apd_setup,
> > > +     .fixed_clk_rate = 100000000,
> > > +};
> > > +
> > >  static struct apd_device_desc cz_uart_desc = {
> > >       .setup = acpi_apd_setup,
> > >       .fixed_clk_rate = 48000000,
> > > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
> > >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
> > >       { "AMD0020", APD_ADDR(cz_uart_desc) },
> > >       { "AMD0030", },
> > > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> > It is better to split AMD devices and ARM devices with macros:
> > CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.
> 
> This gets pretty ugly to me with define as it would look like this:
> 
> #if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
> #define APD_ADDR(desc) ((unsigned long)&desc)
> 
> static int acpi_apd_setup(struct apd_private_data *pdata)
> {
>    .....
> }
> 
> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
> static struct apd_device_desc cz_i2c_desc = {
>     ....
> };
> 
> static struct apd_device_desc xgene_i2c_desc = {
>     ...
> };
> #endif
> 
> #ifdef CONFIG_ARM64
> static struct apd_device_desc cz_uart_desc = {
>     ....
> };
> #endif
> 
> #else
> 
> #define APD_ADDR(desc) (0UL)
> 
> #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */
> 
> And...
> 
> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
> { "AMD0010", APD_ADDR(cz_i2c_desc) },
> { "AMD0020", APD_ADDR(cz_uart_desc) },
> { "AMD0030", },
> #endif
> #ifdef CONFIG_ARM64
> { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> #endif
> 
> Sure you want this?
Yes. Even though it may look like too much macros for just several
devices now. But I think AMD and other ARM socs may also try to leverage
APD for more and more ACPI devices.
It is a good direction that 1)improve efficiency of matching ACPI
handler 2) split devices and potential hook routines into different
classes clearly

It also will be more convenient to move ARM devices out of APD if there
is a new design for ARM ACPI device.


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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-10  6:14         ` Ken Xue
  0 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-10  6:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2015-12-09 at 14:03 -0800, Loc Ho wrote:
> Hi Ken,
> 
> On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
> >
> > On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
> > > 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: Loc Ho <lho@apm.com>
> > > ---
> > >  drivers/acpi/acpi_apd.c |    8 +++++++-
> > >  1 files changed, 7 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
> > > index a450e7a..6a9cb8d 100644
> > > --- a/drivers/acpi/acpi_apd.c
> > > +++ b/drivers/acpi/acpi_apd.c
> > > @@ -51,7 +51,7 @@ struct apd_private_data {
> > >       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)
> > >
> > >  static int acpi_apd_setup(struct apd_private_data *pdata)
> > > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
> > >       .fixed_clk_rate = 133000000,
> > >  };
> > >
> > > +static struct apd_device_desc xgene_i2c_desc = {
> > > +     .setup = acpi_apd_setup,
> > > +     .fixed_clk_rate = 100000000,
> > > +};
> > > +
> > >  static struct apd_device_desc cz_uart_desc = {
> > >       .setup = acpi_apd_setup,
> > >       .fixed_clk_rate = 48000000,
> > > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
> > >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
> > >       { "AMD0020", APD_ADDR(cz_uart_desc) },
> > >       { "AMD0030", },
> > > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> > It is better to split AMD devices and ARM devices with macros:
> > CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.
> 
> This gets pretty ugly to me with define as it would look like this:
> 
> #if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
> #define APD_ADDR(desc) ((unsigned long)&desc)
> 
> static int acpi_apd_setup(struct apd_private_data *pdata)
> {
>    .....
> }
> 
> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
> static struct apd_device_desc cz_i2c_desc = {
>     ....
> };
> 
> static struct apd_device_desc xgene_i2c_desc = {
>     ...
> };
> #endif
> 
> #ifdef CONFIG_ARM64
> static struct apd_device_desc cz_uart_desc = {
>     ....
> };
> #endif
> 
> #else
> 
> #define APD_ADDR(desc) (0UL)
> 
> #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */
> 
> And...
> 
> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
> { "AMD0010", APD_ADDR(cz_i2c_desc) },
> { "AMD0020", APD_ADDR(cz_uart_desc) },
> { "AMD0030", },
> #endif
> #ifdef CONFIG_ARM64
> { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
> #endif
> 
> Sure you want this?
Yes. Even though it may look like too much macros for just several
devices now. But I think AMD and other ARM socs may also try to leverage
APD for more and more ACPI devices.
It is a good direction that 1)improve efficiency of matching ACPI
handler 2) split devices and potential hook routines into different
classes clearly

It also will be more convenient to move ARM devices out of APD if there
is a new design for ARM ACPI device.

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

* Re: [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-10  6:14         ` Ken Xue
@ 2015-12-10  6:57           ` Loc Ho
  -1 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-10  6:57 UTC (permalink / raw)
  To: Ken Xue
  Cc: wsa, rjw, mika.westerberg, Len Brown, linux-i2c, linux-acpi,
	linux-arm-kernel, Jon Masters, patches, Annie.Wang

Hi,

On Wed, Dec 9, 2015 at 10:14 PM, Ken Xue <ken.xue@amd.com> wrote:
> On Wed, 2015-12-09 at 14:03 -0800, Loc Ho wrote:
>> Hi Ken,
>>
>> On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
>> >
>> > On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
>> > > 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: Loc Ho <lho@apm.com>
>> > > ---
>> > >  drivers/acpi/acpi_apd.c |    8 +++++++-
>> > >  1 files changed, 7 insertions(+), 1 deletions(-)
>> > >
>> > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
>> > > index a450e7a..6a9cb8d 100644
>> > > --- a/drivers/acpi/acpi_apd.c
>> > > +++ b/drivers/acpi/acpi_apd.c
>> > > @@ -51,7 +51,7 @@ struct apd_private_data {
>> > >       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)
>> > >
>> > >  static int acpi_apd_setup(struct apd_private_data *pdata)
>> > > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
>> > >       .fixed_clk_rate = 133000000,
>> > >  };
>> > >
>> > > +static struct apd_device_desc xgene_i2c_desc = {
>> > > +     .setup = acpi_apd_setup,
>> > > +     .fixed_clk_rate = 100000000,
>> > > +};
>> > > +
>> > >  static struct apd_device_desc cz_uart_desc = {
>> > >       .setup = acpi_apd_setup,
>> > >       .fixed_clk_rate = 48000000,
>> > > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
>> > >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
>> > >       { "AMD0020", APD_ADDR(cz_uart_desc) },
>> > >       { "AMD0030", },
>> > > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
>> > It is better to split AMD devices and ARM devices with macros:
>> > CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.
>>
>> This gets pretty ugly to me with define as it would look like this:
>>
>> #if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
>> #define APD_ADDR(desc) ((unsigned long)&desc)
>>
>> static int acpi_apd_setup(struct apd_private_data *pdata)
>> {
>>    .....
>> }
>>
>> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
>> static struct apd_device_desc cz_i2c_desc = {
>>     ....
>> };
>>
>> static struct apd_device_desc xgene_i2c_desc = {
>>     ...
>> };
>> #endif
>>
>> #ifdef CONFIG_ARM64
>> static struct apd_device_desc cz_uart_desc = {
>>     ....
>> };
>> #endif
>>
>> #else
>>
>> #define APD_ADDR(desc) (0UL)
>>
>> #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */
>>
>> And...
>>
>> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
>> { "AMD0010", APD_ADDR(cz_i2c_desc) },
>> { "AMD0020", APD_ADDR(cz_uart_desc) },
>> { "AMD0030", },
>> #endif
>> #ifdef CONFIG_ARM64
>> { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
>> #endif
>>
>> Sure you want this?
> Yes. Even though it may look like too much macros for just several
> devices now. But I think AMD and other ARM socs may also try to leverage
> APD for more and more ACPI devices.
> It is a good direction that 1)improve efficiency of matching ACPI
> handler 2) split devices and potential hook routines into different
> classes clearly
>
> It also will be more convenient to move ARM devices out of APD if there
> is a new design for ARM ACPI device.
>

Okay... I will generate v2 when ready. One more question, does AMD
ARM64 SoC need it later?

-Loc

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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-10  6:57           ` Loc Ho
  0 siblings, 0 replies; 18+ messages in thread
From: Loc Ho @ 2015-12-10  6:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Dec 9, 2015 at 10:14 PM, Ken Xue <ken.xue@amd.com> wrote:
> On Wed, 2015-12-09 at 14:03 -0800, Loc Ho wrote:
>> Hi Ken,
>>
>> On Mon, Dec 7, 2015 at 6:49 PM, Ken Xue <ken.xue@amd.com> wrote:
>> >
>> > On Mon, 2015-12-07 at 17:16 -0700, Loc Ho wrote:
>> > > 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: Loc Ho <lho@apm.com>
>> > > ---
>> > >  drivers/acpi/acpi_apd.c |    8 +++++++-
>> > >  1 files changed, 7 insertions(+), 1 deletions(-)
>> > >
>> > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
>> > > index a450e7a..6a9cb8d 100644
>> > > --- a/drivers/acpi/acpi_apd.c
>> > > +++ b/drivers/acpi/acpi_apd.c
>> > > @@ -51,7 +51,7 @@ struct apd_private_data {
>> > >       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)
>> > >
>> > >  static int acpi_apd_setup(struct apd_private_data *pdata)
>> > > @@ -76,6 +76,11 @@ static struct apd_device_desc cz_i2c_desc = {
>> > >       .fixed_clk_rate = 133000000,
>> > >  };
>> > >
>> > > +static struct apd_device_desc xgene_i2c_desc = {
>> > > +     .setup = acpi_apd_setup,
>> > > +     .fixed_clk_rate = 100000000,
>> > > +};
>> > > +
>> > >  static struct apd_device_desc cz_uart_desc = {
>> > >       .setup = acpi_apd_setup,
>> > >       .fixed_clk_rate = 48000000,
>> > > @@ -135,6 +140,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
>> > >       { "AMD0010", APD_ADDR(cz_i2c_desc) },
>> > >       { "AMD0020", APD_ADDR(cz_uart_desc) },
>> > >       { "AMD0030", },
>> > > +     { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
>> > It is better to split AMD devices and ARM devices with macros:
>> > CONFIG_X86_AMD_PLATFORM_DEVICE and CONFIG_ARM64.
>>
>> This gets pretty ugly to me with define as it would look like this:
>>
>> #if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
>> #define APD_ADDR(desc) ((unsigned long)&desc)
>>
>> static int acpi_apd_setup(struct apd_private_data *pdata)
>> {
>>    .....
>> }
>>
>> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
>> static struct apd_device_desc cz_i2c_desc = {
>>     ....
>> };
>>
>> static struct apd_device_desc xgene_i2c_desc = {
>>     ...
>> };
>> #endif
>>
>> #ifdef CONFIG_ARM64
>> static struct apd_device_desc cz_uart_desc = {
>>     ....
>> };
>> #endif
>>
>> #else
>>
>> #define APD_ADDR(desc) (0UL)
>>
>> #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */
>>
>> And...
>>
>> #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
>> { "AMD0010", APD_ADDR(cz_i2c_desc) },
>> { "AMD0020", APD_ADDR(cz_uart_desc) },
>> { "AMD0030", },
>> #endif
>> #ifdef CONFIG_ARM64
>> { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
>> #endif
>>
>> Sure you want this?
> Yes. Even though it may look like too much macros for just several
> devices now. But I think AMD and other ARM socs may also try to leverage
> APD for more and more ACPI devices.
> It is a good direction that 1)improve efficiency of matching ACPI
> handler 2) split devices and potential hook routines into different
> classes clearly
>
> It also will be more convenient to move ARM devices out of APD if there
> is a new design for ARM ACPI device.
>

Okay... I will generate v2 when ready. One more question, does AMD
ARM64 SoC need it later?

-Loc

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

* Re: [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
  2015-12-10  6:57           ` Loc Ho
@ 2015-12-10  7:19             ` Ken Xue
  -1 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-10  7:19 UTC (permalink / raw)
  To: Loc Ho
  Cc: wsa, rjw, mika.westerberg, Len Brown, linux-i2c, linux-acpi,
	linux-arm-kernel, Jon Masters, patches, Annie.Wang

On Wed, 2015-12-09 at 22:57 -0800, Loc Ho wrote:
> >> Sure you want this?
> > Yes. Even though it may look like too much macros for just several
> > devices now. But I think AMD and other ARM socs may also try to leverage
> > APD for more and more ACPI devices.
> > It is a good direction that 1)improve efficiency of matching ACPI
> > handler 2) split devices and potential hook routines into different
> > classes clearly
> >
> > It also will be more convenient to move ARM devices out of APD if there
> > is a new design for ARM ACPI device.
> >
> 
> Okay... I will generate v2 when ready. One more question, does AMD
> ARM64 SoC need it later?
> 

Thanks. I am not sure about driver design for AMD ARM64 SoC.



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

* [PATCH 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support
@ 2015-12-10  7:19             ` Ken Xue
  0 siblings, 0 replies; 18+ messages in thread
From: Ken Xue @ 2015-12-10  7:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2015-12-09 at 22:57 -0800, Loc Ho wrote:
> >> Sure you want this?
> > Yes. Even though it may look like too much macros for just several
> > devices now. But I think AMD and other ARM socs may also try to leverage
> > APD for more and more ACPI devices.
> > It is a good direction that 1)improve efficiency of matching ACPI
> > handler 2) split devices and potential hook routines into different
> > classes clearly
> >
> > It also will be more convenient to move ARM devices out of APD if there
> > is a new design for ARM ACPI device.
> >
> 
> Okay... I will generate v2 when ready. One more question, does AMD
> ARM64 SoC need it later?
> 

Thanks. I am not sure about driver design for AMD ARM64 SoC.

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

end of thread, other threads:[~2015-12-10  7:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08  0:16 [PATCH 0/2] i2c:dw: Add APM X-Gene ACPI I2C device support Loc Ho
2015-12-08  0:16 ` Loc Ho
2015-12-08  0:16 ` [PATCH 1/2] acpi:apd: " Loc Ho
2015-12-08  0:16   ` Loc Ho
2015-12-08  2:49   ` Ken Xue
2015-12-08  2:49     ` Ken Xue
2015-12-09 22:03     ` Loc Ho
2015-12-09 22:03       ` Loc Ho
2015-12-10  6:14       ` Ken Xue
2015-12-10  6:14         ` Ken Xue
2015-12-10  6:57         ` Loc Ho
2015-12-10  6:57           ` Loc Ho
2015-12-10  7:19           ` Ken Xue
2015-12-10  7:19             ` Ken Xue
2015-12-08  0:16 ` [PATCH 2/2] i2c:dw: " Loc Ho
2015-12-08  0:16   ` Loc Ho
2015-12-08 11:36   ` Mika Westerberg
2015-12-08 11:36     ` Mika Westerberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.