13f3e2c2 | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Set control lines in attach
When the driver is attached the state of the main control lines is not defined and can lead to hangs. Set the control lines to a known state (logic false).
staging: gpib: Set control lines in attach
When the driver is attached the state of the main control lines is not defined and can lead to hangs. Set the control lines to a known state (logic false).
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-9-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
125cda86 | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Cleanup allocate_gpios code
The function was using unnecessary variables error and retval. Simplify the code by testing for failure first and remove the redundant variables.
Tested-b
staging: gpib: Cleanup allocate_gpios code
The function was using unnecessary variables error and retval. Simplify the code by testing for failure first and remove the redundant variables.
Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250418173434.2892-8-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
427ab512 | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Change error code for no listener
When doing a write a test is made to see whether there are any listeners. The code was returning ENODEV which is incorrect. The user library translat
staging: gpib: Change error code for no listener
When doing a write a test is made to see whether there are any listeners. The code was returning ENODEV which is incorrect. The user library translates ENOTCONN to a user level no listener error code.
Change the error code to ENOTCONN.
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-7-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
8da1ce7e | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Remove atn_asserted global variable
atn_asserted was introduced to deal with an issue where certain models of the Raspberry Pi would lose interrupts under heavy load. Using a combinat
staging: gpib: Remove atn_asserted global variable
atn_asserted was introduced to deal with an issue where certain models of the Raspberry Pi would lose interrupts under heavy load. Using a combination of edge and level interrupts the problem was resolved so the work-around is no longer needed.
This patch removes the work-around.
Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250418173434.2892-6-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
b56611d9 | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Remove dependency on LED subsystem
The yoga pin map is compatible with the others so that its led can be used as the activity led. Using the LED subsytem required adding a dtoverlay t
staging: gpib: Remove dependency on LED subsystem
The yoga pin map is compatible with the others so that its led can be used as the activity led. Using the LED subsytem required adding a dtoverlay to the boot config as well as setting up the activity led via sysfs. To simplify the setup we remove the dependency on the LED subsystem and use the on board led as for the other pin maps.
Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250418173434.2892-5-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
2eab123b | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Enable SRQ irq on request_system_control
The SRQ irq was being enabled on attach but the board is not set up to handle it until it becomes system controller.
Move the enabling of the
staging: gpib: Enable SRQ irq on request_system_control
The SRQ irq was being enabled on attach but the board is not set up to handle it until it becomes system controller.
Move the enabling of the SRQ irq to bb_request_system_control.
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-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
f56f2d6c | 18-Apr-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Fix setting controller-in-charge
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 inter
staging: gpib: Fix setting controller-in-charge
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>
show more ...
|
ed375186 | 25-Feb-2025 |
Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> |
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay co
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay configuration.
The ni_usb_t1_delay(), from NI, is the only function returning -1 at this point. The caller, t1_delay_ioctl(), doesn't check for errors and sets board->t1_nano_sec to -1 and returns success. The board->t1_nano_sec value is also used in ni_usb_setup_t1_delay() besides the ioctl call and a value of -1 is treated as being above 1100ns. It may or may not have a noticeable effect, but it's obviously not right considering the content of ni_usb_setup_t1_delay().
Typical delays are in the 200-2000 range, but definitely not more than INT_MAX so we can fix this code by changing the return type to int and adding a check for errors. While we're at it, lets change the error code in ni_usb_t1_delay() from -1 and instead propagate the error from ni_usb_write_registers().
Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver") Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> Link: https://lore.kernel.org/r/20250225014811.77995-1-rodrigo.gobbi.7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
d2167c03 | 19-Mar-2025 |
Michael Rubin <matchstick@neverthere.org> |
staging: gpib: gpio: struct gpib_board
Using Linux code style for struct gpib_board.
Adhering to Linux code style.
In general, a pointer, or a struct that has elements that can reasonably be direc
staging: gpib: gpio: struct gpib_board
Using Linux code style for struct gpib_board.
Adhering to Linux code style.
In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef.
Signed-off-by: Michael Rubin <matchstick@neverthere.org> Acked-By: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250319215924.19387-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
3e2bcc16 | 14-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Use C99 syntax and make static
Some drivers were still using the old syntax for initializing structs: field : value;
This caused sparse to emit the following warning, for example: co
staging: gpib: Use C99 syntax and make static
Some drivers were still using the old syntax for initializing structs: field : value;
This caused sparse to emit the following warning, for example: common/gpib_os.c:2026:1: warning: obsolete struct initializer, use C99 syntax
Use C99 syntax: .field = value;
Some local structs and arrays were not declared static causing sparse to emit the following warning, for example: warning: symbol 'ib_fops' was not declared. Should it be static?
Declare the local structs and arrays as static.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250114165403.16410-5-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
95cfc752 | 11-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Modernize gpib_interface_t initialization and make static
All interface drivers were using the old style initialization of this struct
field : value;
This generated the followng spa
staging: gpib: Modernize gpib_interface_t initialization and make static
All interface drivers were using the old style initialization of this struct
field : value;
This generated the followng sparse warning, for example: agilent_82357a/agilent_82357a.c:1492:1: warning: obsolete struct initializer, use C99 syntax
Change the initialization to use the C99 syntax
.field = value;
This also resolves the checkpatch constraint of no indentation
These structs were also not declared as static, unnecessarily polluting the symbol namespace and generating the following sparse warnings, for example:
agilent_82357a/agilent_82357a.c:1465:18: warning: symbol 'agilent_82357a_gpib_interface' was not declared. Should it be static?
Declare them as static and remove any conflicting extern declarations in the corresponding include files.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250111160514.26954-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|