Re: [PATCH] acpi:apd:add AMD ACPI2Platform device support for x86 system.

From: Ken Xue
Date: Wed Nov 26 2014 - 05:42:18 EST


On ä, 2014-11-24 at 02:47 +0100, Rafael J. Wysocki wrote:
> On Monday, November 24, 2014 01:02:30 AM Xue, Ken wrote:
> >
> > On Tuesday, November 18, 2014 01:58:11 PM Ken Xue wrote:
> > > This new feature is to interpret AMD specific ACPI device to platform
> > > device such as I2C, UART found on AMD CZ and later chipsets. It is
> > > based on example INTEL LPSS. Now, it can support AMD I2C & UART.
> > >
> > > Signed-off-by: Ken Xue <Ken.Xue@xxxxxxx>
> > > Signed-off-by: Jeff Wu <Jeff.Wu@xxxxxxx>
> >
> > Generally speaking, this seems to duplicate much code from acpi_lpss which should be re-used instead. What about moving the code that will be common between acpi_lpss and the new driver into a new file (say acpi_soc.c)?
> >
> > Also, you need to avoid automatic creation of platform devices when !X86_AMD_PLATFORM_DEVICE in analogy with what acpi_lpss does, or bad things will happen.
> >
> > [ken] sounds fair enough. Let me take action to merge drivers to acpi_soc.c ? or you have other plan?
>
> I'd prefer the common code to reside in one file (or one .c file and one header
> file), and the driver-specific code to stay in separate per-driver files.
>
[Ken] I wrote a proto type for acpi_soc.c. please help to confirm if it
can match your ideal. if yes, i will submit a new patch after do more
test and refine codes. I think it will impact lpss driver greatly, even
i have taken it into account. below codes is for acpi_soc.c.