Commit 4a59d433 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Marcel Holtmann

Bluetooth: hci_intel: Add GPIO ACPI mapping table

In order to make GPIO ACPI library stricter prepare users of
gpiod_get_index() to correctly behave when there no mapping is
provided by firmware.

Here we add explicit mapping between _CRS GpioIo() resources and
their names used in the driver.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent fda7057f
...@@ -1205,9 +1205,19 @@ static const struct dev_pm_ops intel_pm_ops = { ...@@ -1205,9 +1205,19 @@ static const struct dev_pm_ops intel_pm_ops = {
SET_RUNTIME_PM_OPS(intel_suspend_device, intel_resume_device, NULL) SET_RUNTIME_PM_OPS(intel_suspend_device, intel_resume_device, NULL)
}; };
static const struct acpi_gpio_params reset_gpios = { 0, 0, false };
static const struct acpi_gpio_params host_wake_gpios = { 1, 0, false };
static const struct acpi_gpio_mapping acpi_hci_intel_gpios[] = {
{ "reset-gpios", &reset_gpios, 1 },
{ "host-wake-gpios", &host_wake_gpios, 1 },
{ },
};
static int intel_probe(struct platform_device *pdev) static int intel_probe(struct platform_device *pdev)
{ {
struct intel_device *idev; struct intel_device *idev;
int ret;
idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL); idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);
if (!idev) if (!idev)
...@@ -1217,6 +1227,10 @@ static int intel_probe(struct platform_device *pdev) ...@@ -1217,6 +1227,10 @@ static int intel_probe(struct platform_device *pdev)
idev->pdev = pdev; idev->pdev = pdev;
ret = devm_acpi_dev_add_driver_gpios(&pdev->dev, acpi_hci_intel_gpios);
if (ret)
dev_dbg(&pdev->dev, "Unable to add GPIO mapping table\n");
idev->reset = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); idev->reset = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(idev->reset)) { if (IS_ERR(idev->reset)) {
dev_err(&pdev->dev, "Unable to retrieve gpio\n"); dev_err(&pdev->dev, "Unable to retrieve gpio\n");
......
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