ACPI: Expose struct acpi_device and acpi_bus_get_device() to non-ACPI builds

We may find use for struct acpi_device and acpi_bus_get_device() in
generic code without wanting to add #if IS_ENABLED(CONFIG_ACPI) churn
there.

Code can use ACPI_HANDLE() test to let compiler optimize out code
blocks that are not used in !CONFIG_ACPI builds but structure
definitions and function stubs must be available.

This patch moves CONFIG_ACPI test so that struct acpi_device
definition is available for all builds that include acpi_bus.h and
provides a stub for acpi_bus_get_device().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
i2c: Use stable dev_name for ACPI enumerated I2C slaves

Current I2C adapter id - client address "x-00yy" based device naming
scheme is not always stable enough to be used in name based matching,
for instance within ALSA SoC subsystem.

This is problematic in PC kind of platforms where I2C adapter numbers
can change due variable amount of bus controllers, probe order, add-on
cards or just because of BIOS settings.

This patch addresses the problem by using the ACPI device name with
"i2c-" prefix for ACPI enumerated I2C slaves. For them device name
"x-00yz" becomes "i2c-INTABCD:ij" after this patch.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
spi: Use stable dev_name for ACPI enumerated SPI slaves

Current spi bus_num.chip_select "spix.y" based device naming scheme
may not be stable enough to be used in name based matching, for
instance within ALSA SoC subsystem.

This can be problem in PC kind of platforms if there are changes in
SPI bus configuration, amount of busses or probe order.

This patch addresses the problem by using the ACPI device name with
"spi-" prefix for ACPI enumerated SPI slave. For them device name
"spix.y" becomes "spi-INTABCD:ij".

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Merge branch 'acpi-assorted-next' into bleeding-edge

* acpi-assorted-next:
  spi: Use stable dev_name for ACPI enumerated SPI slaves
  i2c: Use stable dev_name for ACPI enumerated I2C slaves
  ACPI: Expose struct acpi_device and acpi_bus_get_device() to non-ACPI builds