RE: ftdi_sio FT2232H baud rate calculations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

It is not supposed to use difrac[0] all the time.  I agree that the code is ambiguous and should be written in the form that you have suggested.


Best regards,

Mark



-----Original Message-----
From: Daniel Glöckner [mailto:dg@xxxxxxxxx] 
Sent: 06 January 2011 23:47
To: Mark Adamson
Cc: linux-usb@xxxxxxxxxxxxxxx
Subject: ftdi_sio FT2232H baud rate calculations

Hi,
these calculations done in ftdi_2232h_baud_base_to_divisor look
suspicious to me:

	/* hi-speed baud rate is 10-bit sampling instead of 16-bit */
	divisor3 = (base / 10 / baud) * 8;

	divisor = divisor3 >> 3;
	divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;

Is it supposed to always use divfrac[0] (== 0)?
If not, I'd write

	divisor3 = base * 8 / (baud * 10);

instead.

  Daniel


-- 
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055

emlix - your embedded linux partner

-- 
This message has been scanned for viruses and
dangerous content by Alchemist CleanFeed, and is believed to be clean.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux