Lines Matching full:fact
155 #define CH341_CLK_DIV(ps, fact) (1 << (12 - 3 * (ps) - (fact))) argument
172 * baudrate = 48000000 / (2^(12 - 3 * ps - fact) * div), where
175 * 0 <= fact <= 1,
176 * 2 <= div <= 256 if fact = 0, or
177 * 9 <= div <= 256 if fact = 1
181 unsigned int fact, div, clk_div; in ch341_get_divisor() local
192 * Start with highest possible base clock (fact = 1) that will give a in ch341_get_divisor()
195 fact = 1; in ch341_get_divisor()
205 clk_div = CH341_CLK_DIV(ps, fact); in ch341_get_divisor()
212 /* Halve base clock (fact = 0) if required. */ in ch341_get_divisor()
216 fact = 0; in ch341_get_divisor()
231 * Prefer lower base clock (fact = 0) if even divisor. in ch341_get_divisor()
235 if (fact == 1 && div % 2 == 0) { in ch341_get_divisor()
237 fact = 0; in ch341_get_divisor()
240 return (0x100 - div) << 8 | fact << 2 | ps; in ch341_get_divisor()