libftdi Archives

Subject: Re: [PATCH] Proper initialisation of interface A.

From: Vladimir Yakovlev <nagos@xxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 14 Jan 2011 14:06:27 +0300
2011/1/12 Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>:
- Показать цитируемый текст -
> On Wednesday, 12. January 2011 12:47:34 Vladimir Yakovlev wrote:
>> >> This code do nothing (tested on FT2232H). Index alyaws set to 0, even
>> >> without my patch by ftdi_init()
>> >
>> > ftdi_usb_open_dev() gets called after ftdi_init(). The switch should
>> > set the "ftdi->index" to INTERFACE_A if "ftdi->type == TYPE_2232H" and
>> > it checks for "if !(ftdi->index)". Please correct me if I'm wrong.
>> >
>> > It still does the same as ftdi_set_interface(), so I'll remove it.
>>
>> With current version of libftdi you cant set channel A after B. Only
>> way to set A is re initialise device.
>> ftdi_set_interface(ftdi, INTERFACE_A);
>> do nothing (see code).
>> My patch intended to fix this problem.
>
> Yes, that is absolutely correct. I was referring to this
> piece of code from ftdi_usb_open_dev():
>
> --------------------------------------------
>    // Set default interface on dual/quad type chips
>    switch (ftdi->type)
>    {
>        case TYPE_2232C:
>        case TYPE_2232H:
>        case TYPE_4232H:
>            if (!ftdi->index)
>                ftdi->index = INTERFACE_A;
>            break;
>        default:
>            break;
>    }
> --------------------------------------------
>
> Thomas
>

Now ftdi_init set INTERFACE_A for all devices.
If all devices have INTERFACE_A, this code is not need. I tested on
FT2232HQ and FT245BM, both work with A.

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread