linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: linux-kernel@vger.kernel.org
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-acpi@vger.kernel.org, devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Lee Jones <lee.jones@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>, Aaron Lu <aaron.lu@intel.com>,
	Darren Hart <dvhart@linux.intel.com>
Subject: [PATCH v3 00/15] Add ACPI _DSD and unified device properties support
Date: Wed, 01 Oct 2014 04:08:05 +0200	[thread overview]
Message-ID: <1852462.V1jlbi8OPt@vostro.rjw.lan> (raw)
In-Reply-To: <1410868367-11056-1-git-send-email-mika.westerberg@linux.intel.com>

Hi Everyone,

Since Dmitry was suggesting that instead of using struct fw_dev_node pointers,
as we did in the previous version, we could pass the parent device along with
the child pointer to iterator functions while walking the children of a given
device node, the following patches do just that.  Some things look better this
way, but some look worse.  Please tell me what you think.

Mika has tested them on Minnowboard and Minnowboard MAX using the MFD patch
(number 5 previously) that is not included as it has been already applied.

The cover letter below is still applicable mostly, so I'm leaving it as is.

The only patches that changed are [2, 4, 6, 9, 12/15], so I didn't add any
ACKs to them to be prudent.

On Tuesday, September 16, 2014 02:52:31 PM Mika Westerberg wrote:
> This is a second revision of the patches first submitted here [1].
> 
> The recent publication of the ACPI 5.1 specification [2] adds a reserved name
> for Device Specific Data (_DSD, Section 6.2.5). This mechanism allows for
> passing arbitrary hardware description data to the OS. The exact format of the
> _DSD data is specific to the UUID paired with it [3].   
> 
> An ACPI Device Properties UUID has been defined [4] to provide a format
> compatible with existing device tree schemas. The purpose for this was to
> allow for the reuse of the existing schemas and encourage the development
> of firmware agnostic device drivers.
> 
> This series accomplishes the following (as well as some other dependencies):
> 
>  * Add _DSD support to the ACPI core
>    This simply reads the UUID and the accompanying Package
> 
>  * Add ACPI Device Properties _DSD format support
>    This understands the hierarchical key:value pair structure
>    defined by the Device Properties UUID
> 
>  * Add a unified device properties API with ACPI and OF backends
>    This provides for the firmware agnostic device properties
>    Interface to be used by drivers
> 
>  * Provides 3 example drivers that were previously Device Tree aware that
>    can now be used with either Device Tree or ACPI Device Properties. The
>    drivers use "PRP0001" as their _HID which means that the match should be
>    done using driver's .of_match_table instead.
> 
> The patch series has been tested on Minnoboard and Minnowboard MAX and the
> relevant part of DSDTs are at the end of this cover letter.
> 
> This series does not provide for a means to append to a system DSDT. That
> will ultimately be required to make the most effective use of the _DSD
> mechanism. Work is underway on that as a separate effort.
> 
> Most important changes to the previous RFC version:
> 
>   * Added wrapper functions for most used property types
>   * Return -EOVERFLOW in case integer would not fit to a type
>   * Dropped dev_prop_ops
>   * We now have dev_node_xxx() functions to access firmware node
>     properties without dev pointer
>   * The accessor function names try to be close to their corresponding of_*
>     counterpart
>   * Tried to have a bit better examples in the documentation patch
>   * gpiolib got support for _DSD and also it now understand firmware node
>     properties with dev_node_get_named_gpiod() that requests the GPIO
>     properly.
>   * Support for "PRP0001" _HID/_CID. This means that the match should be
>     done using driver .of_match_table instead.
>   * Add unified property support for at25 SPI eeprom driver as well.
> 
> [1] https://lkml.org/lkml/2014/8/17/10
> [2] http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf
> [3] http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm
> [4] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
> 
> Aaron Lu (2):
>   input: gpio_keys_polled - Add support for GPIO descriptors
>   input: gpio_keys_polled - Make use of device property API
> 
> Max Eliaser (2):
>   leds: leds-gpio: Make use of device property API
>   leds: leds-gpio: Add ACPI probing support
> 
> Mika Westerberg (11):
>   ACPI: Add support for device specific properties
>   ACPI: Allow drivers to match using Device Tree compatible property
>   ACPI: Document ACPI device specific properties
>   mfd: Add ACPI support
>   gpio / ACPI: Add support for _DSD device properties
>   gpio: Add support for unified device properties interface
>   gpio: sch: Consolidate core and resume banks
>   leds: leds-gpio: Add support for GPIO descriptors
>   input: gpio_keys_polled - Add ACPI probing support
>   misc: at25: Make use of device property API
>   misc: at25: Add ACPI probing support
> 
> Rafael J. Wysocki (1):
>   Driver core: Unified device properties interface for platform firmware
> 
>  Documentation/acpi/enumeration.txt        |  27 ++
>  Documentation/acpi/properties.txt         | 410 +++++++++++++++++++++
>  drivers/acpi/Makefile                     |   1 +
>  drivers/acpi/internal.h                   |   6 +
>  drivers/acpi/property.c                   | 584 ++++++++++++++++++++++++++++++
>  drivers/acpi/scan.c                       |  93 ++++-
>  drivers/base/Makefile                     |   2 +-
>  drivers/base/property.c                   | 196 ++++++++++
>  drivers/gpio/devres.c                     |  35 ++
>  drivers/gpio/gpio-sch.c                   | 293 ++++++---------
>  drivers/gpio/gpiolib-acpi.c               |  78 +++-
>  drivers/gpio/gpiolib.c                    |  85 ++++-
>  drivers/gpio/gpiolib.h                    |   7 +-
>  drivers/input/keyboard/gpio_keys_polled.c | 169 +++++----
>  drivers/leds/leds-gpio.c                  | 188 +++++-----
>  drivers/mfd/mfd-core.c                    |  40 ++
>  drivers/misc/eeprom/at25.c                |  41 +--
>  drivers/of/base.c                         | 188 ++++++++++
>  include/acpi/acpi_bus.h                   |   8 +
>  include/linux/acpi.h                      |  90 ++++-
>  include/linux/gpio/consumer.h             |   7 +
>  include/linux/gpio_keys.h                 |   3 +
>  include/linux/leds.h                      |   1 +
>  include/linux/mfd/core.h                  |   3 +
>  include/linux/of.h                        |  37 ++
>  include/linux/property.h                  | 193 ++++++++++
>  26 files changed, 2377 insertions(+), 408 deletions(-)
>  create mode 100644 Documentation/acpi/properties.txt
>  create mode 100644 drivers/acpi/property.c
>  create mode 100644 drivers/base/property.c
>  create mode 100644 include/linux/property.h
> 
> DSDT modifications for Minnowboard (for leds-gpio.c and gpio_keys_polled.c)
> ---------------------------------------------------------------------------
> 
>     Scope (\_SB.PCI0.LPC)
>     {
>         Device (LEDS)
>         {
>             Name (_HID, "PRP0001")
> 
>             Name (_CRS, ResourceTemplate () {
>                 GpioIo (Exclusive, PullDown, 0, 0, IoRestrictionOutputOnly,
>                         "\\_SB.PCI0.LPC", 0, ResourceConsumer) {10}
>                 GpioIo (Exclusive, PullDown, 0, 0, IoRestrictionOutputOnly,
>                         "\\_SB.PCI0.LPC", 0, ResourceConsumer) {11}
>             })
> 
>             Name (_DSD, Package () {
>                   ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                   Package () {
>                       Package () {"compatible", Package () {"gpio-leds"}},
>                   }
>             })
> 
>             Device (LEDH)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package () {
>                         Package () {"label", "Heartbeat"},
>                         Package () {"gpios", Package () {^^LEDS, 0, 0, 0}},
>                         Package () {"linux,default-trigger", "heartbeat"},
>                         Package () {"linux,default-state", "off"},
>                         Package () {"linux,retain-state-suspended", 1},
>                     }
>                 })
>             }
> 
>             Device (LEDM)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package () {
>                         Package () {"label", "MMC0 Activity"},
>                         Package () {"gpios", Package () {^^LEDS, 1, 0, 0}},
>                         Package () {"linux,default-trigger", "mmc0"},
>                         Package () {"linux,default-state", "off"},
>                         Package () {"linux,retain-state-suspended", 1},
>                     }
>                 })
>             }
>         }
>         
>         Device (BTNS)
>         {
>             Name (_HID, "PRP0001")
> 
>             Name (_CRS, ResourceTemplate () {
>                 GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
>                         "\\_SB.PCI0.LPC", 0, ResourceConsumer) {0, 1, 2, 3}
>             })
> 
>             Name (_DSD, Package () {
>                 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                 Package () {
>                     Package () {"compatible", Package () {"gpio-keys-polled"}},
>                     Package () {"poll-interval", 100},
>                     Package () {"autorepeat", 1}
>                 }
>             })
> 
>             Device (BTN0)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package () {
>                         Package () {"linux,code", 105},
>                         Package () {"linux,input-type", 1},
>                         Package () {"gpios", Package () {^^BTNS, 0, 0, 1}},
>                     }
>                 })
>             }
> 
>             Device (BTN1)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package () {
>                         Package () {"linux,code", 108},
>                         Package () {"linux,input-type", 1},
>                         Package () {"gpios", Package (4) {^^BTNS, 0, 1, 1}},
>                     }
>                 })
>             }
>             
>             Device (BTN2)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package () {
>                         Package () {"linux,code", 103},
>                         Package () {"linux,input-type", 1},
>                         Package () {"gpios", Package () {^^BTNS, 0, 2, 1}},
>                     }
>                 })
>             }
>             
>             Device (BTN3)
>             {
>                 Name (_DSD, Package () {
>                     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                     Package ()
>                     {
>                         Package () {"linux,code", 106},
>                         Package () {"linux,input-type", 1},
>                         Package () {"gpios", Package (4) {^^BTNS, 0, 3, 1}},
>                     }
>                 })
>             }
>         }
>     }
> 
> DSDT modifications for Minnowboard MAX (for at25.c)
> ---------------------------------------------------
> 
>     Scope (\_SB.SPI1)
>     {
>         Device (AT25)
>         {
>             Name (_HID, "PRP0001")
>             Method (_CRS, 0, Serialized) {
>                 Name (UBUF, ResourceTemplate () {
>                     SpiSerialBus (0x0000, PolarityLow, FourWireMode, 0x08,
>                         ControllerInitiated, 0x007A1200, ClockPolarityLow,
>                         ClockPhaseSecond, "\\_SB.SPI1",
>                         0x00, ResourceConsumer)
>                 })
>                 Return (UBUF)
>             }
> 
>             Name (_DSD, Package () {
>                 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>                 Package () {
>                     Package () {"compatible", Package () {"atmel,at25"}},
> 		    Package () {"size", 1024},
> 		    Package () {"pagesize", 32},
> 		    Package () {"address-width", 16},
>                 }
>             })
> 
>             Method (_STA, 0, NotSerialized)
>             {
>                 Return (0xF)
>             }
>         }
>     }
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  parent reply	other threads:[~2014-10-01  2:03 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 11:52 [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 01/16] ACPI: Add support for device specific properties Mika Westerberg
2014-10-06 13:50   ` Grant Likely
2014-10-06 14:32     ` Mika Westerberg
2014-10-06 16:25       ` Darren Hart
2014-09-16 11:52 ` [RFC PATCH v2 02/16] Driver core: Unified device properties interface for platform firmware Mika Westerberg
2014-09-17 18:28   ` Greg Kroah-Hartman
2014-09-16 11:52 ` [RFC PATCH v2 03/16] ACPI: Allow drivers to match using Device Tree compatible property Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 04/16] ACPI: Document ACPI device specific properties Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 05/16] mfd: Add ACPI support Mika Westerberg
2014-09-16 21:54   ` Lee Jones
2014-09-24 12:00   ` Lee Jones
2014-09-16 11:52 ` [RFC PATCH v2 06/16] gpio / ACPI: Add support for _DSD device properties Mika Westerberg
2014-09-23 15:27   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 07/16] gpio: Add support for unified device properties interface Mika Westerberg
2014-09-23 15:25   ` Linus Walleij
2014-09-23 15:45     ` Arnd Bergmann
2014-09-23 15:52       ` Mika Westerberg
2014-09-23 16:17         ` Dmitry Torokhov
2014-09-23 20:31           ` Rafael J. Wysocki
2014-09-23 16:25       ` Rafael J. Wysocki
2014-09-23 16:26         ` Arnd Bergmann
2014-09-23 20:47           ` Rafael J. Wysocki
2014-09-24  7:55             ` Arnd Bergmann
2014-09-24 14:08               ` Rafael J. Wysocki
2014-09-23 21:15           ` Darren Hart
2014-09-24  9:12             ` Arnd Bergmann
2014-09-24  9:38               ` Mika Westerberg
2014-09-24 14:11                 ` Rafael J. Wysocki
2014-09-26  3:21               ` Darren Hart
2014-09-26  8:36                 ` Arnd Bergmann
2014-09-26 14:42                   ` Rafael J. Wysocki
2014-10-07 13:37                 ` Linus Walleij
2014-10-07 15:37                   ` Andy Shevchenko
2014-10-07 23:57                   ` Rafael J. Wysocki
2014-09-16 11:52 ` [RFC PATCH v2 08/16] gpio: sch: Consolidate core and resume banks Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 09/16] leds: leds-gpio: Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:18   ` Alexandre Courbot
2014-09-24  7:55   ` Linus Walleij
2014-09-24  9:42     ` Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 10/16] leds: leds-gpio: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 11/16] leds: leds-gpio: Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 12/16] input: gpio_keys_polled - Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:22   ` Alexandre Courbot
2014-09-24  8:02   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 13/16] input: gpio_keys_polled - Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 14/16] input: gpio_keys_polled - Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 15/16] misc: at25: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 16/16] misc: at25: Add ACPI probing support Mika Westerberg
2014-09-21  0:26 ` [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Rafael J. Wysocki
2014-09-24  8:34   ` Lee Jones
2014-09-24  9:45     ` Mika Westerberg
2014-09-22 23:29 ` Bryan Wu
2014-10-01  2:08 ` Rafael J. Wysocki [this message]
2014-10-01  2:08   ` [PATCH v3 01/15] ACPI: Add support for device specific properties Rafael J. Wysocki
2014-10-01  7:38     ` Arnd Bergmann
2014-10-01  2:10   ` [PATCH v3 02/15] Driver core: Unified device properties interface for platform firmware Rafael J. Wysocki
2014-10-01  7:47     ` Arnd Bergmann
2014-10-01 22:09       ` Rafael J. Wysocki
2014-10-01 23:01         ` Rafael J. Wysocki
2014-10-02  7:46         ` Arnd Bergmann
2014-10-02 16:50           ` Rafael J. Wysocki
2014-10-02  0:03     ` Greg Kroah-Hartman
2014-10-01  2:10   ` [PATCH v3 03/15] ACPI: Allow drivers to match using Device Tree compatible property Rafael J. Wysocki
2014-10-01  7:48     ` Arnd Bergmann
2014-10-03 13:43     ` Mark Rutland
2014-10-03 17:59       ` Dmitry Torokhov
2014-10-04  0:02         ` Rafael J. Wysocki
2014-10-01  2:11   ` [PATCH v3 04/15] ACPI: Document ACPI device specific properties Rafael J. Wysocki
2014-10-01  7:59     ` Arnd Bergmann
2014-10-02 10:41       ` Mika Westerberg
2014-10-02 11:51         ` Arnd Bergmann
2014-10-02 12:15           ` Mika Westerberg
2014-10-02 12:46             ` Arnd Bergmann
2014-10-02 13:36               ` Mika Westerberg
2014-10-02 14:29                 ` Arnd Bergmann
2014-10-02 14:38                   ` Mika Westerberg
2014-10-02 14:55                     ` Arnd Bergmann
2014-10-03 13:56                       ` Mark Rutland
2014-10-03 15:02                         ` Arnd Bergmann
2014-10-03 23:58                           ` Rafael J. Wysocki
2014-10-04 10:56                             ` Arnd Bergmann
2014-10-05 21:40                               ` Rafael J. Wysocki
2014-10-03  2:03                 ` Rafael J. Wysocki
2014-10-03  8:12                   ` Mika Westerberg
2014-10-03 13:58                   ` Mark Rutland
2014-10-03 14:38                     ` Rafael J. Wysocki
2014-10-03 14:35                       ` Mark Rutland
2014-10-04  0:13                         ` Rafael J. Wysocki
2014-10-04 10:59                           ` Arnd Bergmann
2014-10-05 22:26                             ` Rafael J. Wysocki
2014-10-03 13:48             ` Mark Rutland
2014-10-04  0:16               ` Rafael J. Wysocki
2014-10-01  2:12   ` [PATCH v3 05/15] gpio / ACPI: Add support for _DSD device properties Rafael J. Wysocki
2014-10-01  8:03     ` Arnd Bergmann
2014-10-05 10:36       ` Alexandre Courbot
2014-10-05 21:20         ` Rafael J. Wysocki
2014-10-01  2:14   ` [PATCH v3 06/15] gpio: Support for unified device properties interface Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 07/15] gpio: sch: Consolidate core and resume banks Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 08/15] leds: leds-gpio: Add support for GPIO descriptors Rafael J. Wysocki
2014-10-01  8:05     ` Arnd Bergmann
2014-10-01  2:16   ` [PATCH v3 09/15] leds: leds-gpio: Make use of device property API Rafael J. Wysocki
2014-10-03 14:07     ` Mark Rutland
2014-10-04  0:18       ` Rafael J. Wysocki
2014-10-01  2:17   ` [PATCH v3 10/15] leds: leds-gpio: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  9:13       ` Mika Westerberg
2014-10-01 10:01         ` Arnd Bergmann
2014-10-01 11:59           ` Mika Westerberg
2014-10-01 13:52             ` Arnd Bergmann
2014-10-01 14:04               ` Mika Westerberg
2014-10-01 14:14                 ` Arnd Bergmann
2014-10-02  9:55                   ` Mika Westerberg
2014-10-02 10:44                     ` Arnd Bergmann
2014-10-01 16:30       ` Dmitry Torokhov
2014-10-01 18:11         ` Darren Hart
2014-10-01 18:21           ` Dmitry Torokhov
2014-10-01 18:22           ` Arnd Bergmann
2014-10-01  2:17   ` [PATCH v3 11/15] input: gpio_keys_polled - Add support for GPIO descriptors Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  2:20   ` [PATCH v3 12/15] input: gpio_keys_polled - Make use of device property API Rafael J. Wysocki
2014-10-01  2:20   ` [PATCH v3 13/15] input: gpio_keys_polled - Add ACPI probing support Rafael J. Wysocki
2014-10-01  7:48     ` Dmitry Torokhov
2014-10-01  9:15       ` Mika Westerberg
2014-10-01 16:28         ` Dmitry Torokhov
2014-10-02  9:53           ` Mika Westerberg
2014-10-01  2:21   ` [PATCH v3 14/15] misc: at25: Make use of device property API Rafael J. Wysocki
2014-10-01  8:14     ` Arnd Bergmann
2014-10-01  2:22   ` [PATCH v3 15/15] misc: at25: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:15     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1852462.V1jlbi8OPt@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=aaron.lu@intel.com \
    --cc=arnd@arndb.de \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dvhart@linux.intel.com \
    --cc=gnurou@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).