0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ========================================
0004 Probing devices in other D states than 0
0005 ========================================
0006
0007 Introduction
0008 ============
0009
0010 In some cases it may be preferred to leave certain devices powered off for the
0011 entire system bootup if powering on these devices has adverse side effects,
0012 beyond just powering on the said device.
0013
0014 How it works
0015 ============
0016
0017 The _DSC (Device State for Configuration) object that evaluates to an integer
0018 may be used to tell Linux the highest allowed D state for a device during
0019 probe. The support for _DSC requires support from the kernel bus type if the
0020 bus driver normally sets the device in D0 state for probe.
0021
0022 The downside of using _DSC is that as the device is not powered on, even if
0023 there's a problem with the device, the driver likely probes just fine but the
0024 first user will find out the device doesn't work, instead of a failure at probe
0025 time. This feature should thus be used sparingly.
0026
0027 I²C
0028 ---
0029
0030 If an I²C driver indicates its support for this by setting the
0031 I2C_DRV_ACPI_WAIVE_D0_PROBE flag in struct i2c_driver.flags field and the
0032 _DSC object evaluates to integer higher than the D state of the device,
0033 the device will not be powered on (put in D0 state) for probe.
0034
0035 D states
0036 --------
0037
0038 The D states and thus also the allowed values for _DSC are listed below. Refer
0039 to [1] for more information on device power states.
0040
0041 .. code-block:: text
0042
0043 Number State Description
0044 0 D0 Device fully powered on
0045 1 D1
0046 2 D2
0047 3 D3hot
0048 4 D3cold Off
0049
0050 References
0051 ==========
0052
0053 [1] https://uefi.org/specifications/ACPI/6.4/02_Definition_of_Terms/Definition_of_Terms.html#device-power-state-definitions
0054
0055 Example
0056 =======
0057
0058 An ASL example describing an ACPI device using _DSC object to tell Operating
0059 System the device should remain powered off during probe looks like this. Some
0060 objects not relevant from the example point of view have been omitted.
0061
0062 .. code-block:: text
0063
0064 Device (CAM0)
0065 {
0066 Name (_HID, "SONY319A")
0067 Name (_UID, Zero)
0068 Name (_CRS, ResourceTemplate ()
0069 {
0070 I2cSerialBus(0x0020, ControllerInitiated, 0x00061A80,
0071 AddressingMode7Bit, "\\_SB.PCI0.I2C0",
0072 0x00, ResourceConsumer)
0073 })
0074 Method (_DSC, 0, NotSerialized)
0075 {
0076 Return (0x4)
0077 }
0078 }