Lines Matching refs:the
7 In addition we are starting to see peripherals integrated in the
11 In order to support this and re-use the existing drivers as much as
22 resources) this implementation follows the Device Tree way as much as
26 I2C), creates the physical devices and binds them to their ACPI handle in
27 the ACPI namespace.
29 This means that when ACPI_HANDLE(dev) returns non-NULL the device was
37 for the device and add supported ACPI IDs. If this same IP-block is used on
38 some other non-ACPI platform, the driver might work out of the box or needs
42 straightforward. Here is the simplest example:
59 If the driver needs to perform more complex initialization like getting and
65 DMA controllers enumerated via ACPI should be registered in the system to
68 dma_request_slave_channel() must register itself at the end of the probe
72 /* Handle the error if it's not a case of !CONFIG_ACPI */
75 is enough) which converts the FixedDMA resource provided by struct
76 acpi_dma_spec into the corresponding DMA channel. A piece of code for that case
81 /* Provide necessary information for the filter_func */
87 /* Choose the proper channel */
110 controller. In the xlate function the proper channel must be chosen based on
111 information in struct acpi_dma_spec and the properties of the controller
114 Clients must call dma_request_slave_channel() with the string parameter that
115 corresponds to a specific FixedDMA resource. By default "tx" means the first
116 entry of the FixedDMA resource array, "rx" means the second entry. The table
133 So, the FixedDMA with request line 0x0018 is "tx" and next one is "rx" in
136 In robust cases the client unfortunately needs to call
137 acpi_dma_request_slave_chan_by_index() directly and therefore choose the
143 This is extracted automatically by the SPI core and the slave devices are
144 enumerated once spi_register_master() is called by the bus driver.
146 Here is what the ACPI namespace for a SPI slave might look like:
165 the platform device drivers. Below is an example where we add ACPI support
166 to at25 SPI eeprom driver (this is meant for the above ACPI snippet):
183 Note that this driver actually needs more information like page size of the
184 eeprom etc. but at the time writing this there is no standard way of
204 Then the at25 SPI driver can get this configuration by calling _DSM on its
211 /* Fill in the input buffer */
216 /* Handle the error */
218 /* Extract the data here */
224 The slaves behind I2C bus controller only need to add the ACPI IDs like
225 with the platform and SPI drivers. The I2C core automatically enumerates
226 any slave devices behind the controller device once the adapter is
229 Below is an example of how to add ACPI support to the existing mpu3050
257 the device to the driver. ACPI 5.1 extended this with _DSD (Device
258 Specific Data) which made it possible to name the GPIOs among other things.
269 // Used to power on/off the device
278 // Interrupt for the device
293 // ACPI 5.1 _DSD used for naming the GPIOs
306 specifies the path to the controller. In order to use these GPIOs in Linux
307 we need to translate them to the corresponding Linux GPIO descriptors.
312 In the above example we can get the corresponding two GPIO descriptors with
328 /* Now we can use the GPIO descriptors */
330 There are also devm_* versions of these functions which release the
331 descriptors once the device is released.
333 See Documentation/acpi/gpio-properties.txt for more information about the
338 The MFD devices register their children as platform devices. For the child
340 parts of the ACPI namespace that relate to them. In the Linux MFD subsystem
343 o The children share the parent ACPI handle.
344 o The MFD cell can specify the ACPI id of the device.
346 For the first case, the MFD drivers do not need to do anything. The
348 to the parent device.
350 If the ACPI namespace has a device that we can match using an ACPI id or ACPI
351 adr, the cell should be set like:
360 /* set the resources relative to the parent */
365 the MFD device and if found, that ACPI companion device is bound to the
370 The Device Tree protocol uses device indentification based on the "compatible"
372 identifiers by drivers and the driver core. The set of all those strings may be
373 regarded as a device indentification namespace analogous to the ACPI/PNP device
376 identification string in the Device Tree (DT) namespace, especially if that ID
378 presumably having a matching driver in the kernel already.
380 In ACPI, the device identification object called _CID (Compatible ID) is used to
381 list the IDs of devices the given one is compatible with, but those IDs must
382 belong to one of the namespaces prescribed by the ACPI specification (see
383 Section 6.1.2 of ACPI 6.0 for details) and the DT namespace is not one of them.
384 Moreover, the specification mandates that either a _HID or an _ADR identificaion
387 be a device ID from one of the namespaces prescribed by the specification too.
389 The special DT namespace link device ID, PRP0001, provides a means to use the
390 existing DT-compatible device identification in ACPI and to satisfy the above
391 requirements following from the ACPI specification at the same time. Namely,
392 if PRP0001 is returned by _HID, the ACPI subsystem will look for the
393 "compatible" property in the device object's _DSD and will use the value of that
394 property to identify the corresponding device in analogy with the original DT
395 device identification algorithm. If the "compatible" property is not present
396 or its value is not valid, the device will not be enumerated by the ACPI
398 (except when an I2C or SPI link from the device to its parent is present, in
399 which case the ACPI core will leave the device enumeration to the parent's
400 driver) and the identification strings from the "compatible" property value will
401 be used to find a driver for the device along with the device IDs listed by _CID
404 Analogously, if PRP0001 is present in the list of device IDs returned by _CID,
405 the identification strings listed by the "compatible" property value (if present
406 and valid) will be used to look for a driver matching the device, but in that
407 case their relative priority with respect to the other device IDs listed by
408 _HID and _CID depends on the position of PRP0001 in the _CID return package.
409 Specifically, the device IDs returned by _HID and preceding PRP0001 in the _CID
410 return package will be checked first. Also in that case the bus type the device
411 will be enumerated to depends on the device ID returned by _HID.
414 the "compatible" property in the _DSD or a _CID as long as one of their
417 configuration information to the driver of the composite ancestor device.