]> 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)
commit9db85a9393b7685af56e3bc0de9c74165dc74a83
treedc34d2a72a6af85a8b7de107d2df70963bfe50ce
parentd0c81a11f22253d7fcbf8090acd1a44fcecbfcd8
gpio: pca953x: Improve bias setting

The commit 09c8d214152b ("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: 09c8d214152b ("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