Commit e3fadb35 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones

mfd: dln2: Allow to be enumerated via ACPI

On some platforms user may want to enumerate DLN2 device, its children,
to be enumerated via ACPI. In order to achieve this, let's distinguish
children by _ADR value.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent b1cc5409
...@@ -645,35 +645,56 @@ static int dln2_start_rx_urbs(struct dln2_dev *dln2, gfp_t gfp) ...@@ -645,35 +645,56 @@ static int dln2_start_rx_urbs(struct dln2_dev *dln2, gfp_t gfp)
return 0; return 0;
} }
enum {
DLN2_ACPI_MATCH_GPIO = 0,
DLN2_ACPI_MATCH_I2C = 1,
DLN2_ACPI_MATCH_SPI = 2,
};
static struct dln2_platform_data dln2_pdata_gpio = { static struct dln2_platform_data dln2_pdata_gpio = {
.handle = DLN2_HANDLE_GPIO, .handle = DLN2_HANDLE_GPIO,
}; };
static struct mfd_cell_acpi_match dln2_acpi_match_gpio = {
.adr = DLN2_ACPI_MATCH_GPIO,
};
/* Only one I2C port seems to be supported on current hardware */ /* Only one I2C port seems to be supported on current hardware */
static struct dln2_platform_data dln2_pdata_i2c = { static struct dln2_platform_data dln2_pdata_i2c = {
.handle = DLN2_HANDLE_I2C, .handle = DLN2_HANDLE_I2C,
.port = 0, .port = 0,
}; };
static struct mfd_cell_acpi_match dln2_acpi_match_i2c = {
.adr = DLN2_ACPI_MATCH_I2C,
};
/* Only one SPI port supported */ /* Only one SPI port supported */
static struct dln2_platform_data dln2_pdata_spi = { static struct dln2_platform_data dln2_pdata_spi = {
.handle = DLN2_HANDLE_SPI, .handle = DLN2_HANDLE_SPI,
.port = 0, .port = 0,
}; };
static struct mfd_cell_acpi_match dln2_acpi_match_spi = {
.adr = DLN2_ACPI_MATCH_SPI,
};
static const struct mfd_cell dln2_devs[] = { static const struct mfd_cell dln2_devs[] = {
{ {
.name = "dln2-gpio", .name = "dln2-gpio",
.acpi_match = &dln2_acpi_match_gpio,
.platform_data = &dln2_pdata_gpio, .platform_data = &dln2_pdata_gpio,
.pdata_size = sizeof(struct dln2_platform_data), .pdata_size = sizeof(struct dln2_platform_data),
}, },
{ {
.name = "dln2-i2c", .name = "dln2-i2c",
.acpi_match = &dln2_acpi_match_i2c,
.platform_data = &dln2_pdata_i2c, .platform_data = &dln2_pdata_i2c,
.pdata_size = sizeof(struct dln2_platform_data), .pdata_size = sizeof(struct dln2_platform_data),
}, },
{ {
.name = "dln2-spi", .name = "dln2-spi",
.acpi_match = &dln2_acpi_match_spi,
.platform_data = &dln2_pdata_spi, .platform_data = &dln2_pdata_spi,
.pdata_size = sizeof(struct dln2_platform_data), .pdata_size = sizeof(struct dln2_platform_data),
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment