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: 4cd654f847 ("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>
This commit is contained in:
Dave Penkler
2025-04-25 16:08:26 +02:00
committed by Greg Kroah-Hartman
parent 9a7988fa4d
commit 8ba7c33be0
+7 -3
View File
@@ -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;
}