Commit b625fe69 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rafael J. Wysocki
Browse files

ACPI: docs: enumeration: Discourage to use custom _DSM methods



Since we have _DSD established and specified (ACPI v5.1+) there is no
need to use custom _DSM methods. Rewrite documentation to use _DSD.

Fixes: f60e7074 ("misc: at25: Make use of device property API")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7e57714c
Loading
Loading
Loading
Loading
+21 −27
Original line number Diff line number Diff line
@@ -188,43 +188,37 @@ to at25 SPI eeprom driver (this is meant for the above ACPI snippet)::
	};

Note that this driver actually needs more information like page size of the
eeprom etc. but at the time writing this there is no standard way of
passing those. One idea is to return this in _DSM method like::
eeprom, etc. This information can be passed via _DSD method like::

	Device (EEP0)
	{
		...
		Method (_DSM, 4, NotSerialized)
		Name (_DSD, Package ()
		{
			Store (Package (6)
			ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
			Package ()
			{
				"byte-len", 1024,
				"addr-mode", 2,
				"page-size, 32
			}, Local0)

			// Check UUIDs etc.

			Return (Local0)
				Package () { "size", 1024 },
				Package () { "pagesize", 32 },
				Package () { "address-width", 16 },
			}
		})
	}

Then the at25 SPI driver can get this configuration by calling _DSM on its
ACPI handle like::

	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
	struct acpi_object_list input;
	acpi_status status;

	/* Fill in the input buffer */
Then the at25 SPI driver can get this configuration by calling device property
APIs during ->probe() phase like::

	status = acpi_evaluate_object(ACPI_HANDLE(&spi->dev), "_DSM",
				      &input, &output);
	if (ACPI_FAILURE(status))
		/* Handle the error */
	err = device_property_read_u32(dev, "size", &size);
	if (err)
		...error handling...

	/* Extract the data here */
	err = device_property_read_u32(dev, "pagesize", &page_size);
	if (err)
		...error handling...

	kfree(output.pointer);
	err = device_property_read_u32(dev, "address-width", &addr_width);
	if (err)
		...error handling...

I2C serial bus support
======================