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)
commit55a9968c7e139209a9e93d4ca4321731bea5fc95
treedc34d2a72a6af85a8b7de107d2df70963bfe50ce
parentbe4491838359e78e42e88db4ac479e21c5eda1e0
gpio: pca953x: Improve bias setting

The commit 15add06841a3 ("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: 15add06841a3 ("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