Re: [PATCH 3/4] msm_serial: Make baud_code detection more dynamic

2013-07-26 Thread Stephen Boyd
On 07/25, Bjorn Andersson wrote: > On Wed, Jul 24, 2013 at 10:37 AM, Stephen Boyd wrote: > > [snip] > > + unsigned int i, divisor; > > + const struct msm_baud_map *entry; > > + static const struct msm_baud_map table[] = { > > + { 1536, 0x00, 1 }, > > +

Re: [PATCH 3/4] msm_serial: Make baud_code detection more dynamic

2013-07-25 Thread Bjorn Andersson
On Wed, Jul 24, 2013 at 10:37 AM, Stephen Boyd wrote: > [snip] > + unsigned int i, divisor; > + const struct msm_baud_map *entry; > + static const struct msm_baud_map table[] = { > + { 1536, 0x00, 1 }, > + { 768, 0x11, 1 }, > + { 384,

Re: [PATCH 3/4] msm_serial: Make baud_code detection more dynamic

2013-07-24 Thread David Brown
On Wed, Jul 24, 2013 at 11:37:30AM -0700, Stephen Boyd wrote: Currently msm_set_baud_rate() assumes the uart clock rate is 1.8432 MHz. This is not always true, and limits our options to program the baud rate. Instead of assuming the rate and hard-coding the baud_code based on it, calculate the di

[PATCH 3/4] msm_serial: Make baud_code detection more dynamic

2013-07-24 Thread Stephen Boyd
Currently msm_set_baud_rate() assumes the uart clock rate is 1.8432 MHz. This is not always true, and limits our options to program the baud rate. Instead of assuming the rate and hard-coding the baud_code based on it, calculate the divider that we want and try to find the closest baud_code that ma