spi: Enhance and export helpers for ACPI resources

Merge series from Stefan Binding <sbinding@opensource.cirrus.com>:

This series enhances the helpers for ACPI resources to cope with
multiple resources and exports them for use in the x86 platform code's
multi-instantiate driver.
This commit is contained in:
Mark Brown 2022-02-01 17:39:36 +00:00
commit 70ee8d48f4
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
2 changed files with 141 additions and 16 deletions

View file

@ -16,6 +16,7 @@
#include <linux/gpio/consumer.h>
#include <uapi/linux/spi/spi.h>
#include <linux/acpi.h>
struct dma_chan;
struct software_node;
@ -759,6 +760,13 @@ extern int devm_spi_register_controller(struct device *dev,
struct spi_controller *ctlr);
extern void spi_unregister_controller(struct spi_controller *ctlr);
#if IS_ENABLED(CONFIG_ACPI)
extern struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
struct acpi_device *adev,
int index);
int acpi_spi_count_resources(struct acpi_device *adev);
#endif
/*
* SPI resource management while processing a SPI message
*/
@ -1452,7 +1460,19 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n)
* use spi_new_device() to describe each device. You can also call
* spi_unregister_device() to start making that device vanish, but
* normally that would be handled by spi_unregister_controller().
*
* You can also use spi_alloc_device() and spi_add_device() to use a two
* stage registration sequence for each spi_device. This gives the caller
* some more control over the spi_device structure before it is registered,
* but requires that caller to initialize fields that would otherwise
* be defined using the board info.
*/
extern struct spi_device *
spi_alloc_device(struct spi_controller *ctlr);
extern int
spi_add_device(struct spi_device *spi);
extern struct spi_device *
spi_new_device(struct spi_controller *, struct spi_board_info *);