]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: gpib: Fix setting controller-in-charge
authorDave Penkler <dpenkler@gmail.com>
Fri, 18 Apr 2025 17:34:28 +0000 (19:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 14:08:26 +0000 (16:08 +0200)
The gpio board can only act as system controller.
By the IEEE488.1 standard a system controller becomes
controller-in-charge when it asserts the interface-clear control
line.

Remove the setting of controller-in-charge from bb_take_control
and move it to bb_interface_clear.

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-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/gpio/gpib_bitbang.c

index 29aab72c1f0fc4239f689402939285d62b332940..a92c4eda99a0b14e9baf7320b32b1e1b4f5cffff 100644 (file)
@@ -872,7 +872,6 @@ static int bb_take_control(struct gpib_board *board, int synchronous)
 {
        dbg_printk(2, "%d\n", synchronous);
        set_atn(board, 1);
-       set_bit(CIC_NUM, &board->status);
        return 0;
 }
 
@@ -908,6 +907,7 @@ static void bb_interface_clear(struct gpib_board *board, int assert)
                gpiod_direction_output(IFC, 0);
                priv->talker_state = talker_idle;
                priv->listener_state = listener_idle;
+               set_bit(CIC_NUM, &board->status);
        } else {
                gpiod_direction_output(IFC, 1);
        }