Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2016-01-26 Thread Maxime Ripard
On Mon, Jan 18, 2016 at 10:40:59AM +0100, Marcus Weseloh wrote: > Hi, > > 2016-01-17 19:51 GMT+01:00 Maxime Ripard : > > On Sun, Jan 10, 2016 at 10:11:11PM +0100, Marcus Weseloh wrote: > >> >> >> - /* Ensure that we have a parent clock fast enough */ > >> >> >> + /* > >> >> >> + * Ens

Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-28 Thread Marcus Weseloh
Hi again, 2015-12-28 0:29 GMT+01:00 Marcus Weseloh : > 2015-12-27 22:09 GMT+01:00 Maxime Ripard : [...] > [...] >>> - /* Ensure that we have a parent clock fast enough */ >>> + /* >>> + * Ensure that the parent clock is set to twice the max speed >>> + * of the spi device (possib

Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-27 Thread Marcus Weseloh
Hi, 2015-12-27 22:09 GMT+01:00 Maxime Ripard : > On Sat, Dec 26, 2015 at 04:53:05PM +0100, Marcus Weseloh wrote: >> This patch fixes multiple problems with the current clock calculations: >> >> 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to >> calculate SPI_CLK from CDR1, but

Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-27 Thread Maxime Ripard
On Sat, Dec 26, 2015 at 04:53:05PM +0100, Marcus Weseloh wrote: > This patch fixes multiple problems with the current clock calculations: > > 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to > calculate SPI_CLK from CDR1, but this formula is wrong. The actual > formula - determ

[PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-26 Thread Marcus Weseloh
This patch fixes multiple problems with the current clock calculations: 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to calculate SPI_CLK from CDR1, but this formula is wrong. The actual formula - determined by analyzing the actual waveforms - is AHB_CLK / (2^n). 2. The divis