]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iio: accel: mma9551: use NULL for GPIO connection ID
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 10 Jun 2017 18:58:41 +0000 (21:58 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 11 Jun 2017 15:05:53 +0000 (16:05 +0100)
commited3edc0909a84d80b3db3eca9c76a95e29ccae07
treef2654167d598c221e21cf3f42069967a993824bf
parent9eba381bf83b42b312cbae8050e357138782ba9a
iio: accel: mma9551: use NULL for GPIO connection ID

While using GPIO library API we might get into troubles in the future,
because we can't rely on label name in the driver since vendor firmware
might provide any GPIO pin there, e.g. "reset", and even mark it in _DSD
(in which case the request will fail).

To avoid inconsistency and potential issues we have two options:
a) generate GPIO ACPI mapping table and supply it via
acpi_dev_add_driver_gpios(), or
b) just pass NULL as connection ID.

The b) approach is much simpler and would work since the driver relies
on GPIO indices only. Moreover, the _CRS fallback mechanism, when
requesting GPIO, is going to be stricter, and supplying non-NULL
connection ID when neither _DSD, nor GPIO ACPI mapping is present, will
make request fail.

See
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=ed7fcf1ed5ea4ea01243995ae085757a77cf0f3e for more background.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/mma9551.c