linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Init device ids from ACPI of_compatible
@ 2016-07-13 11:53 Crestez Dan Leonard
  2016-07-13 11:53 ` [PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible Crestez Dan Leonard
                   ` (3 more replies)
  0 siblings, 4 replies; 48+ messages in thread
From: Crestez Dan Leonard @ 2016-07-13 11:53 UTC (permalink / raw)
  To: linux-acpi, Rafael J. Wysocki, Jarkko Nikula, Mika Westerberg
  Cc: Crestez Dan Leonard, Len Brown, linux-i2c, Wolfram Sang,
	linux-spi, Mark Brown, linux-kernel, Octavian Purdila

When using devicetree stuff like i2c_client.name or spi_device.modalias
is initialized to the first DT compatible id with the vendor prefix
stripped. Since some drivers rely on this in order to differentiate between
hardware variants try to replicate it when using ACPI with DT ids.

This also makes it so that the i2c_device_id parameter passed to probe is
non-NULL when matching with ACPI and DT ids.

These patches are on top of linux-pm/linux-next. I delayed v2 until ACPI
overlays got in in order to avoid conflicts. I tested using ACPI overlays but
there is no actual dependency. This series just extends the PRP0001 feature to
be more useful for I2C/SPI.

The patches only touches the ACPI-specific parts of the i2c and spi core.

Here is an example .dsl for an SPI accelerometer connected to minnowboard max:

Device (ACCL)
{
    Name (_ADR, Zero)
    Name (_HID, "PRP0001")
    Name (_CID, "PRP0001")
    Name (_UID, One)

    Method (_CRS, 0, Serialized)
    {
	Name (RBUF, ResourceTemplate ()
	{
	    SPISerialBus(1, PolarityLow, FourWireMode, 16,
		    ControllerInitiated, 1000000, ClockPolarityLow,
		    ClockPhaseFirst, "\\_SB.SPI1",)
	    GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000,
		     "\\_SB.GPO2", 0x00, ResourceConsumer, , )
	    { // Pin list
		    1
	    }
	})
	Return (RBUF)
    }
    Name (_DSD, Package ()
    {
	ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
	Package ()
	{
	    Package () {"compatible", "st,lis3dh"},
	}
    })
}

Link to v1: https://www.spinics.net/lists/linux-acpi/msg66469.html
Changes:
 * Rebase on after acpi overlays got it.
 * Change acpi_of_modalias outlen param to size_t
 * Use {} after else

Crestez Dan Leonard (3):
  acpi: Export acpi_of_modalias equiv of of_modalias_node
  acpi i2c: Initialize info.type from of_compatible
  acpi spi: Initialize modalias from of_compatible

 drivers/acpi/bus.c      | 36 ++++++++++++++++++++++++++++++++++++
 drivers/i2c/i2c-core.c  |  8 +++++++-
 drivers/spi/spi.c       | 11 ++++++++++-
 include/acpi/acpi_bus.h |  1 +
 4 files changed, 54 insertions(+), 2 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-02-09 13:53 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 11:53 [PATCH v2 0/3] Init device ids from ACPI of_compatible Crestez Dan Leonard
2016-07-13 11:53 ` [PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible Crestez Dan Leonard
2016-07-13 12:22   ` Rafael J. Wysocki
2016-07-19  7:08     ` Mika Westerberg
2016-07-19 10:22   ` Mark Brown
2016-07-20 11:21     ` Crestez Dan Leonard
2016-07-20 11:37       ` Mark Brown
     [not found] ` <cover.1468409668.git.leonard.crestez-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-07-13 11:53   ` [PATCH v2 1/3] acpi: Export acpi_of_modalias equiv of of_modalias_node Crestez Dan Leonard
     [not found]     ` <fde8d7c9312a887553feab9877a33f01e5ceda47.1468409668.git.leonard.crestez-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-07-13 12:19       ` Rafael J. Wysocki
2016-07-19  7:14       ` Mika Westerberg
2016-07-13 11:53   ` [PATCH v2 2/3] acpi i2c: Initialize info.type from of_compatible Crestez Dan Leonard
2016-07-13 12:20     ` Rafael J. Wysocki
     [not found]       ` <CAJZ5v0jz-E0RTBWVzO0Vc_jChUSeSseFeewi1UtsjLudoVP7Pw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-19  7:07         ` Mika Westerberg
2016-07-13 12:09   ` [PATCH v2 0/3] Init device ids from ACPI of_compatible Rafael J. Wysocki
2016-07-13 14:15 ` Dan O'Donovan
2017-01-23 16:08 ` [PATCH v3 " Dan O'Donovan
2017-01-23 16:08   ` [PATCH v3 2/3] i2c: acpi: Initialize info.type from of_compatible Dan O'Donovan
2017-01-23 17:10     ` Andy Shevchenko
     [not found]   ` <1485187737-22414-1-git-send-email-dan-M3NBUjLqch7QT0dZR+AlfA@public.gmane.org>
2017-01-23 16:08     ` [PATCH v3 1/3] ACPI / bus: Export acpi_of_modalias equiv of of_modalias_node Dan O'Donovan
2017-01-23 16:08     ` [PATCH v3 3/3] spi: acpi: Initialize modalias from of_compatible Dan O'Donovan
2017-01-23 17:11       ` Andy Shevchenko
2017-01-27 10:35         ` Dan O'Donovan
2017-01-27 13:43           ` Andy Shevchenko
2017-01-30  9:41       ` Rafael J. Wysocki
2017-01-31 20:17         ` Mark Brown
     [not found]           ` <20170131201736.cmiyq2obzrhgdsck-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-01-31 21:18             ` Rafael J. Wysocki
2017-01-23 17:13   ` [PATCH v3 0/3] Init device ids from ACPI of_compatible Andy Shevchenko
2017-01-24 15:11   ` Jarkko Nikula
     [not found]     ` <6ff3138c-ac16-d310-28b7-cee0b0e5f11c-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-24 15:19       ` Andy Shevchenko
2017-01-27 13:30   ` [PATCH v4 " Dan O'Donovan
2017-01-27 13:30     ` [PATCH v4 1/3] ACPI / bus: Export acpi_of_modalias equiv of of_modalias_node Dan O'Donovan
2017-02-02 11:41       ` Rafael J. Wysocki
2017-02-02 13:30         ` Dan O'Donovan
2017-01-27 13:30     ` [PATCH v4 2/3] i2c: acpi: Initialize info.type from of_compatible Dan O'Donovan
2017-01-28 21:38       ` Wolfram Sang
2017-01-27 13:30     ` [PATCH v4 3/3] spi: acpi: Initialize modalias " Dan O'Donovan
2017-02-01 18:34       ` Mark Brown
2017-02-04  8:00     ` [PATCH v5 0/3] Init device ids from ACPI of_compatible Dan O'Donovan
2017-02-04  8:00       ` [PATCH v5 1/3] ACPI / bus: Export acpi_of_modalias equiv of of_modalias_node Dan O'Donovan
     [not found]       ` <1486195228-10929-1-git-send-email-dan-M3NBUjLqch7QT0dZR+AlfA@public.gmane.org>
2017-02-04  8:00         ` [PATCH v5 2/3] i2c: acpi: Initialize info.type from of_compatible Dan O'Donovan
2017-02-04  8:00       ` [PATCH v5 3/3] spi: acpi: Initialize modalias " Dan O'Donovan
2017-02-04 10:16         ` Mark Brown
2017-02-05 16:30       ` [PATCH v6 0/3] Init device ids from ACPI of_compatible Dan O'Donovan
2017-02-05 16:30         ` [PATCH v6 1/3] ACPI / bus: Export acpi_of_modalias equiv of of_modalias_node Dan O'Donovan
2017-02-05 16:30         ` [PATCH v6 2/3] i2c: acpi: Initialize info.type from of_compatible Dan O'Donovan
2017-02-05 16:30         ` [PATCH v6 3/3] spi: acpi: Initialize modalias " Dan O'Donovan
     [not found]           ` <1486312214-20770-4-git-send-email-dan-M3NBUjLqch7QT0dZR+AlfA@public.gmane.org>
2017-02-06 16:31             ` Mark Brown
     [not found]         ` <1486312214-20770-1-git-send-email-dan-M3NBUjLqch7QT0dZR+AlfA@public.gmane.org>
2017-02-09 13:53           ` [PATCH v6 0/3] Init device ids from ACPI of_compatible Rafael J. Wysocki

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).