]> 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)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 6 Oct 2021 11:01:45 +0000 (13:01 +0200)
commitf62cebb951318578f0084e1d69a5ffd453c8683b
treedc34d2a72a6af85a8b7de107d2df70963bfe50ce
parentbeec297782bce561f75c22bfab9dd3ef38e2b2ac
gpio: pca953x: Improve bias setting

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>
drivers/gpio/gpio-pca953x.c