On Mon, Jun 13, 2016 at 04:40:55PM -0400, Jaret Cantu wrote: > > > >According to your previous information, the single formula can't be used > >to get D_CAL value, do you have any good ways except for using a table? > > That is not exactly what I said: > > "I can't find any formula which would hit all of those same > percentages **without rounding up.**" > Sorry, my careless. > I did find a formula that hits all of the percentages with rounding > up, and I listed this formula (in shell form) previously. The > rounding (+ (119-80)/2) just makes it look a little more awkward > than I would like: > > $ for d in 119 116 114 112 109 106 103 100 97 95 93 90 88 86 83 79; > do echo "$d="$(( ( (119-$d) * 0xf + (119-80)/2 ) / (119-80) )); > d=$((d+1)); done > 119=0 > 116=1 > 114=2 > 112=3 > 109=4 > 106=5 > 103=6 > 100=7 > 97=8 > 95=9 > 93=10 > 90=11 > 88=12 > 86=13 > 83=14 > 79=15 > > These current percentage/register value pairs match the D_CAL table. > > > > Sending the patch for new algorithm to speed up this issue please. > > > There were also some Documentation changes from between when I > created this patch and the current HOL for which I had to modify the > patch. I will review and test your v4 patch, thanks. -- Best Regards, Peter Chen -- 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