]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pca953x: Improve bias setting
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 23 Sep 2021 22:46:40 +0000 (01:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:15 +0000 (11:40 +0200)
commit3a95b8d2e2d2269c3a2d8bd325a9fe265eb77123
tree8602c81d5b39f8a83bdc513e95b93ac81d1a3ce6
parentd2de8e9f6b05a434874ff91e8f565b45626071d2
gpio: pca953x: Improve bias setting

commit f62cebb951318578f0084e1d69a5ffd453c8683b upstream.

The commit 68a0c306d101 ("gpio: pca953x: add ->set_config implementation")
introduced support for bias setting. However this, due to being half-baked,
brought potential issues:
 - the turning bias via disabling makes the pin floating for a while;
 - once enabled, bias can't be disabled.

Fix all these by adding support for bias disabling and move the disabling
part under the corresponding conditional.

While at it, add support for default setting, since it's cheap to add.

Fixes: 68a0c306d101 ("gpio: pca953x: add ->set_config implementation")
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-pca953x.c