aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpio/gpio-pca953x.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-05 08:54:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-05 08:54:36 +0200
commit168ae5a74b4a9ebf0bd9c5ea7008af0b7a6ccf04 (patch)
treeb3d8e85dd327bd288064a43e1020b770d18db30b /drivers/gpio/gpio-pca953x.c
parentMerge tag 'usb-for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next (diff)
parentLinux 5.9-rc8 (diff)
downloadwireguard-linux-168ae5a74b4a9ebf0bd9c5ea7008af0b7a6ccf04.tar.xz
wireguard-linux-168ae5a74b4a9ebf0bd9c5ea7008af0b7a6ccf04.zip
Merge 5.9-rc8 into usb-next
We need the USB fixes in here as well for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio/gpio-pca953x.c')
-rw-r--r--drivers/gpio/gpio-pca953x.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index bd2e96c34f82..fb61f2fc6ed7 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -818,6 +818,8 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
int level;
bool ret;
+ bitmap_zero(pending, MAX_LINE);
+
mutex_lock(&chip->i2c_lock);
ret = pca953x_irq_pending(chip, pending);
mutex_unlock(&chip->i2c_lock);
@@ -940,6 +942,7 @@ out:
static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
{
DECLARE_BITMAP(val, MAX_LINE);
+ unsigned int i;
int ret;
ret = device_pca95xx_init(chip, invert);
@@ -947,7 +950,9 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
goto out;
/* To enable register 6, 7 to control pull up and pull down */
- memset(val, 0x02, NBANK(chip));
+ for (i = 0; i < NBANK(chip); i++)
+ bitmap_set_value8(val, 0x02, i * BANK_SZ);
+
ret = pca953x_write_regs(chip, PCA957X_BKEN, val);
if (ret)
goto out;