You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opto_ac5: still in use here, ported to uspace and tested on hardware #4880
opto_ac5 was removed in #4513 because nobody was known to use it or to be able to test it. I have been running an Opto22 PCI-AC5 on my milling machine since 2012 (step/dir on port 0, spindle speed and I/O on port 1), so I ported the driver to uspace instead of staying on RTAI.
The change is limited to the PCI part: pci_get_device()/ioremap_nocache() become a rtapi_pci driver (probe/remove, rtapi_pci_ioremap_bar), and readl()/writel() go through two small helpers. Pins, params, functions and the read/write logic are untouched.
The uspace rtapi_pci matches subvendor/subdevice exactly, PCI_ANY_ID is not a wildcard there, so the id table has to list 148a:ac05.
The version that was removed would not have built on master anyway: hal_export_functf() lost an argument and the driver was never compiled for uspace, so nobody saw it. Fixed in the branch.
Tested on Debian 13, 6.12 PREEMPT_RT kernel, i7-2600, base thread at 90 us, with my full machine config: first on 2.9.10 out of tree with halcompile, then on master with the driver back in tree. Jogging, spindle speed and inputs behave like they did under RTAI. On master the base thread max is around 15 us, digital-read around 5 us.
If the board are still in production, and you stick around to test it trough the review process, send in the PR and we will handle it trough there.
About the driver being removed, as you mentioned it was just cause no one showed up to tell us if it was still working, we will mark you down as our new tester for this hardware ;-)
if ((pboard->port[portnum].mask&mask) ==0) { // is it an input bit ?rtapi_boolb= (pins&mask) ==0;
hal_set_bool(pDigital->pValue, b);
hal_set_bool(pDigital->pValueNot, !b);
}
Activity
grandixximo commentedon Nov 22, 2026
If the board are still in production, and you stick around to test it trough the review process, send in the PR and we will handle it trough there.
About the driver being removed, as you mentioned it was just cause no one showed up to tell us if it was still working, we will mark you down as our new tester for this hardware ;-)
BsAtHome commentedon Nov 22, 2026
To prevent multiple read/write to/from the HAL pins, you may want to change this: https://github.com/Josbleuet/linuxcnc/blob/a4c80f85662e5e0ff2521344ab02273b82205567/src/hal/drivers/opto_ac5.c#L414-L420 into:
and https://github.com/Josbleuet/linuxcnc/blob/a4c80f85662e5e0ff2521344ab02273b82205567/src/hal/drivers/opto_ac5.c#L457-L464 into:
And, when you do want to add it again, the files need a bit of a indent cleanup (please use only spaces). Better do that at the same time.
BsAtHome commentedon Nov 23, 2026
Merged in #4883