From: Dave Penkler <dpenkler@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: marcello.carla@gmx.com, Dave Penkler <dpenkler@gmail.com>
Subject: [PATCH 1/8] staging: gpib: Fix request_system_control in gpio
Date: Fri, 18 Apr 2025 19:34:27 +0200 [thread overview]
Message-ID: <20250418173434.2892-2-dpenkler@gmail.com> (raw)
In-Reply-To: <20250418173434.2892-1-dpenkler@gmail.com>
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>
---
drivers/staging/gpib/gpio/gpib_bitbang.c | 10 +++++++---
1 file 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;
}
--
2.49.0
next prev parent reply other threads:[~2025-04-18 17:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 17:34 [PATCH 0/8] staging: gpib: Fixes and cleanup for gpio driver Dave Penkler
2025-04-18 17:34 ` Dave Penkler [this message]
2025-04-18 17:34 ` [PATCH 2/8] staging: gpib: Fix setting controller-in-charge Dave Penkler
2025-04-18 17:34 ` [PATCH 3/8] staging: gpib: Enable SRQ irq on request_system_control Dave Penkler
2025-04-18 17:34 ` [PATCH 4/8] staging: gpib: Remove dependency on LED subsystem Dave Penkler
2025-04-18 17:34 ` [PATCH 5/8] staging: gpib: Remove atn_asserted global variable Dave Penkler
2025-04-18 17:34 ` [PATCH 6/8] staging: gpib: Change error code for no listener Dave Penkler
2025-04-18 17:34 ` [PATCH 7/8] staging: gpib: Cleanup allocate_gpios code Dave Penkler
2025-04-18 17:34 ` [PATCH 8/8] staging: gpib: Set control lines in attach Dave Penkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250418173434.2892-2-dpenkler@gmail.com \
--to=dpenkler@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=marcello.carla@gmx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox