[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8hetcRinFXXVAdy@hovoldconsulting.com>
Date: Wed, 5 Mar 2025 15:24:53 +0100
From: Johan Hovold <johan@...nel.org>
To: Boon Khai Ng <boon.khai.ng@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Tien Sung Ang <tien.sung.ang@...el.com>,
Tien Sung Ang <tien.sung.ang@...era.com>,
Boon Khai Ng <boon.khai.ng@...era.com>
Subject: Re: [PATCH v1] USB: serial: ftdi_sio: add support for Altera USB
Blaster 3
On Mon, Feb 03, 2025 at 04:48:22PM +0800, Boon Khai Ng wrote:
> The Altera on board USB Blaster 3 utilizes a FT2232 and FT4232
> chip.
I assume it's either an FT2243 or an FT4232 and not both?
> Add VID/PID for the on board USB Blaster 3 so it can be used
> as a serial device via ftdi_sio.
Can you say something more about these devices? I guess they are used
for programming FPGAs? Are they embedded in other products? And can the
same PID be used for more than one type of device that they are embedded
in?
Or are the PIDs tied to different types of "USB Blaster 3"s? If so this,
should also be reflected in the naming of the defines.
> Signed-off-by: Boon Khai Ng <boon.khai.ng@...el.com>
> ---
> drivers/usb/serial/ftdi_sio.c | 14 ++++++++++++++
> drivers/usb/serial/ftdi_sio_ids.h | 13 +++++++++++++
> 2 files changed, 27 insertions(+)
>
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index e07c5e3eb18c..3edce9c62213 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -1079,6 +1079,20 @@ static const struct usb_device_id id_table_combined[] = {
> .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
> /* GMC devices */
> { USB_DEVICE(GMC_VID, GMC_Z216C_PID) },
> + /* Altera USB Blaster 3 */
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_6022_PID, 1) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_6025_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_6026_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_6026_PID, 3) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_6029_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602A_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602A_PID, 3) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602C_PID, 1) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602D_PID, 1) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602D_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602E_PID, 1) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602E_PID, 2) },
> + { USB_DEVICE_INTERFACE_NUMBER(ALTR_UB3_VID, ALTR_UB3_602E_PID, 3) },
> { } /* Terminating entry */
> };
>
> diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
> index 5ee60ba2a73c..673e0cf84bdc 100644
> --- a/drivers/usb/serial/ftdi_sio_ids.h
> +++ b/drivers/usb/serial/ftdi_sio_ids.h
> @@ -1612,3 +1612,16 @@
> */
> #define GMC_VID 0x1cd7
> #define GMC_Z216C_PID 0x0217 /* GMC Z216C Adapter IR-USB */
> +
> +/*
> + * Altera USB Blaster 3 (http://www.altera.com).
> + */
> +#define ALTR_UB3_VID 0x09fb
This is a generic Altera VID so should just be name ALTERA_VID.
> +#define ALTR_UB3_6022_PID 0x6022
> +#define ALTR_UB3_6025_PID 0x6025
> +#define ALTR_UB3_6026_PID 0x6026
> +#define ALTR_UB3_6029_PID 0x6029
> +#define ALTR_UB3_602A_PID 0x602A
> +#define ALTR_UB3_602C_PID 0x602C
> +#define ALTR_UB3_602D_PID 0x602D
> +#define ALTR_UB3_602E_PID 0x602E
Please use lower case hex notation consistently for the values here.
But depending on the answer to my questions above, either these defines
should be renamed to reflect the Blaster type or product they are part
of, or just be dropped.
Johan
Powered by blists - more mailing lists