Skip to content

Commit 8ba7c33

Browse files
dpenklergregkh
authored andcommitted
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: 4cd654f ("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>
1 parent 9a7988f commit 8ba7c33

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/staging/gpib/gpio/gpib_bitbang.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,13 @@ static int bb_request_system_control(struct gpib_board *board, int request_contr
889889
if (!request_control)
890890
return -EINVAL;
891891

892-
set_bit(CIC_NUM, &board->status);
893-
// drive DAV & EOI false, enable NRFD & NDAC irqs
894-
SET_DIR_WRITE(board->private_data);
892+
gpiod_direction_output(REN, 1); /* user space must enable REN if needed */
893+
gpiod_direction_output(IFC, 1); /* user space must toggle IFC if needed */
894+
if (sn7516x)
895+
gpiod_direction_output(DC, 0); /* enable ATN as output on SN75161/2 */
896+
897+
gpiod_direction_input(SRQ);
898+
895899
return 0;
896900
}
897901

0 commit comments

Comments
 (0)