[PATCH 0/3] Centralized parsing of ACPI device resources (was: Re: [PATCH 0/3] ACPI 5 support for GPIO, SPI and I2C)

2012-11-12 Thread Rafael J. Wysocki
On Saturday, November 03, 2012 09:46:30 AM Mika Westerberg wrote:
> Hi,
> 
> With ACPI 5 we can now describe how devices are connected to their bus
> using new resources: SPISerialBus and I2CSerialBus. Also it is now possible
> to add GPIO connections for the devices with the help of GpioIO and GpioInt
> resources.
> 
> This series adds support for these new resources.
> 
> The series based on the ACPI 5 enumeration support patches that are available
> on Rafael's linux-next branch:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 
> linux-next
> 
> Specifically patches from this thread:
> 
>   https://lkml.org/lkml/2012/10/31/154
> 
> Since these patches depend on the above patches on Rafael's linux-next branch
> I suggest that these be merged via that branch, if there are no objections.
> 
> The series follows the Device Tree way so that it would be easy to add ACPI
> support for the existing SPI and I2C drivers if one is familiar how the
> corresponding DT support is done.
> 
> For GPIO we introduce a function that maps between ACPI GPIO numbers and Linux
> ones - acpi_get_gpio().
> 
> SPI slave devices gets enumerated automatically if the master device has
> master->dev.acpi_handle set (this is analogous to master->dev.of_mode). The
> platform bus code in Rafael's branch assigns the ACPI handle to the master
> device.
> 
> I2C slave devices can be enumerated by calling acpi_i2c_register_devices() in
> the adapter driver.

Following the previous discussion, the patches below move some ACPI resources
parsing code from drivers/pnp/pnpacpi/rsparser.c to a new file
drivers/acpi/resource.c and reformat it so that it can be used by other
subsystems (patch [1/3]), convert the new ACPI platform devices creation
code to use the routines in drivers/acpi/resource.c instead of doing its
own resource parsing (patch [2/3]) and make the ACPI namespace scan attach
a list of _CRS resources to each struct acpi_device it creates, where
applicable (patch [3/3] - the ACPI platform device code is converted to use
that instead of executing _CRS by itself via acpi_walk_resources()).

The patchset is on top of the current linux-pm.git/linux-next branch and
has been tested somewhat.  Please let me know if you find any problems in it.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/3] ACPI 5 support for GPIO, SPI and I2C

2012-11-05 Thread Mika Westerberg
On Sun, Nov 04, 2012 at 07:29:10PM +0100, Linus Walleij wrote:
> On Sat, Nov 3, 2012 at 8:46 AM, Mika Westerberg
>  wrote:
> 
> > With ACPI 5 we can now describe how devices are connected to their bus
> > using new resources: SPISerialBus and I2CSerialBus. Also it is now possible
> > to add GPIO connections for the devices with the help of GpioIO and GpioInt
> > resources.
> >
> > This series adds support for these new resources.
> 
> I would very much like Grant to review and merge these patches, since he
> is way more familiar with these concepts than me, but I'll have a quick
> glance for syntax and semantics...

That sounds good, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/3] ACPI 5 support for GPIO, SPI and I2C

2012-11-04 Thread Linus Walleij
On Sat, Nov 3, 2012 at 8:46 AM, Mika Westerberg
 wrote:

> With ACPI 5 we can now describe how devices are connected to their bus
> using new resources: SPISerialBus and I2CSerialBus. Also it is now possible
> to add GPIO connections for the devices with the help of GpioIO and GpioInt
> resources.
>
> This series adds support for these new resources.

I would very much like Grant to review and merge these patches, since he
is way more familiar with these concepts than me, but I'll have a quick
glance for syntax and semantics...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] ACPI 5 support for GPIO, SPI and I2C

2012-11-03 Thread Mika Westerberg
Hi,

With ACPI 5 we can now describe how devices are connected to their bus
using new resources: SPISerialBus and I2CSerialBus. Also it is now possible
to add GPIO connections for the devices with the help of GpioIO and GpioInt
resources.

This series adds support for these new resources.

The series based on the ACPI 5 enumeration support patches that are available
on Rafael's linux-next branch:

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 
linux-next

Specifically patches from this thread:

https://lkml.org/lkml/2012/10/31/154

Since these patches depend on the above patches on Rafael's linux-next branch
I suggest that these be merged via that branch, if there are no objections.

The series follows the Device Tree way so that it would be easy to add ACPI
support for the existing SPI and I2C drivers if one is familiar how the
corresponding DT support is done.

For GPIO we introduce a function that maps between ACPI GPIO numbers and Linux
ones - acpi_get_gpio().

SPI slave devices gets enumerated automatically if the master device has
master->dev.acpi_handle set (this is analogous to master->dev.of_mode). The
platform bus code in Rafael's branch assigns the ACPI handle to the master
device.

I2C slave devices can be enumerated by calling acpi_i2c_register_devices() in
the adapter driver.

Thanks,
Mika

Mathias Nyman (1):
  gpio / ACPI: add ACPI support

Mika Westerberg (2):
  spi / ACPI: add ACPI enumeration support
  i2c / ACPI: add ACPI enumeration support

 drivers/acpi/Kconfig|6 ++
 drivers/acpi/Makefile   |1 +
 drivers/acpi/acpi_i2c.c |  234 +++
 drivers/gpio/Kconfig|4 +
 drivers/gpio/Makefile   |1 +
 drivers/gpio/gpiolib-acpi.c |   60 +++
 drivers/i2c/i2c-core.c  |9 ++
 drivers/spi/spi.c   |  231 +-
 include/linux/acpi_gpio.h   |   19 
 include/linux/acpi_i2c.h|   29 ++
 10 files changed, 593 insertions(+), 1 deletion(-)
 create mode 100644 drivers/acpi/acpi_i2c.c
 create mode 100644 drivers/gpio/gpiolib-acpi.c
 create mode 100644 include/linux/acpi_gpio.h
 create mode 100644 include/linux/acpi_i2c.h

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/