diff options
author | Dave Penkler <dpenkler@gmail.com> | 2025-04-18 20:34:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-25 17:08:26 +0300 |
commit | 8ba7c33be02ca099470b3acc21f859b3be4d1d61 (patch) | |
tree | 1ee6175f45de066214536cda4ea5e5f59a797306 | |
parent | 9a7988fa4d80a49fa444f7717837ebfd35b34181 (diff) | |
download | linux-8ba7c33be02ca099470b3acc21f859b3be4d1d61.tar.xz |
staging: gpib: Fix request_system_control in gpio
The implementation of the bb_request_system_control function
confused setting controller-in-charge with becoming system-controller.
Remove setting controller-in-charge and add initialization of the
control lines for the system-controller role.
Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver")
Tested-by: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250418173434.2892-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/gpib/gpio/gpib_bitbang.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 9670522fe36e..29aab72c1f0f 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -889,9 +889,13 @@ static int bb_request_system_control(struct gpib_board *board, int request_contr if (!request_control) return -EINVAL; - set_bit(CIC_NUM, &board->status); - // drive DAV & EOI false, enable NRFD & NDAC irqs - SET_DIR_WRITE(board->private_data); + gpiod_direction_output(REN, 1); /* user space must enable REN if needed */ + gpiod_direction_output(IFC, 1); /* user space must toggle IFC if needed */ + if (sn7516x) + gpiod_direction_output(DC, 0); /* enable ATN as output on SN75161/2 */ + + gpiod_direction_input(SRQ); + return 0; } |