Re: [comedi] dt9812.c comedi driver loading issues

Ian Abbott <[email protected]> Mon, 31 Mar 2025 12:48:44 +0100
Newsgroups gmane.linux.comedi
Organization MEV Ltd.
Message-ID <[email protected]>
Hi Fred,

On 2025-03-29 20:45, 'fred brooks' via Comedi: Linux Control and=20
Measurement Device Interface wrote:
>=20
> Trying to get this to work with a DT9812 but am having some strange=20
> problems. The first thing is the returned product ID is sort of reversed=
=20
> from the device model.
>  =C2=A0usb 4-1: New USB device found, idVendor=3D0867, idProduct=3D1298,=
=20
> bcdDevice=3D 0.00
>=20
> The driver dt9812_usb_table in dt9812.c was changed to match that number.
>=20
> static const struct usb_device_id dt9812_usb_table[] =3D {
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 { USB_DEVICE(0x0867, 0x1298) },
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 { }
> };
>=20
> The original value inthe driver struct was=C2=A0=C2=A0(0x0867, 0x9812)
>=20
> Now the recompiled=C2=A0 dt9812 module actually loads and tried to run bu=
t=20
> this is the result:
>=20
> [240608.280804] comedi: version 0.7.76 - http://www.comedi.org <http://=
=20
> www.comedi.org/>
> [240608.298984] comedi comedi0: Wrong number of endpoints
> [240608.298990] dt9812 3-9.3:1.0: driver 'dt9812' failed to auto-=20
> configure device.
> [240608.299072] usbcore: registered new interface driver dt9812
>=20
> The number of end points returned is zero.
[snip]
> Running Debian=C2=A06.12.20-amd64 and I also tried with an Orange PI arm6=
4=20
> machine with the same result after the driver modifications=C2=A0to match=
=20
> the=C2=A0idProduct=3D1298
>=20
> Source of the error message.
> static int dt9812_find_endpoints(struct comedi_device *dev)
> {
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_interface *intf =3D comedi_to_usb=
_interface(dev);
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_host_interface *host =3D intf->cu=
r_altsetting;
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct dt9812_private *devpriv =3D dev->priv=
ate;
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_endpoint_descriptor *ep;
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 int i;
>=20
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (host->desc.bNumEndpoints !=3D 5) {
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dev_err(dev->cla=
ss_dev, "Wrong number of endpoints\n");
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -ENODEV;
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>=20
> Yes, the DT9812 works using the Windows driver=C2=A0 running Win11

Looking at the "DT9812_Kmdf.inf" file from the Windows drivers installed=20
by the "Omni-CD"
https://files.digilent.com/#downloads/DTSoftware/Omni-CD/
, in
C:\Program Files (x86)\Data Translation\DeviceDriversEV\DT9812
, the device ID USB\VID_0867&PID_1298 appears to be a "DT9812 Firmware=20
Loader" device. That .inf file also supports "DT9812" (PID 0x9812),=20
"DT9813" (PID 0x9813), and "DT9814" (PID 0x9814).  The "DT9812 Firmware=20
Loader" device uses a different kernel driver (.sys) file than the others:

* DT9812 Firmware Loader: DT9812ld_x86.sys or dt9812ld_x64.sys
* DT9812, DT9813, DT9814: DT9812k.sys or DT9812k_x64.sys

Perhaps the ID changes after the firmware is updated?  Or perhaps the=20
"DT9812 Firmware Loader" device is a hardware re-spin of the old device?=20
I don't really know, to be honest.

--=20
-=3D( Ian Abbott <[email protected]> || MEV Ltd. is a company  )=3D-
-=3D( registered in England & Wales.  Regd. number: 02862268.  )=3D-
-=3D( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=3D-
-=3D( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=3D-

--=20
You received this message because you are subscribed to the Google Groups "=
Comedi: Linux Control and Measurement Device Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/comedi_list=
/d63c20d2-71b6-4575-b46e-da442161bf05%40mev.co.uk.