public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* why does aptina_pll_calculate insist on exact division?
@ 2018-08-14  6:35 Helmut Grohne
  2018-08-14  7:30 ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Helmut Grohne @ 2018-08-14  6:35 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media

Hi,

I tried using the aptina_pll_calculate for a "new" imager and ran into
problems. After filling out aptina_pll_limits from the data sheet, I was
having a hard time finding a valid pix_clock. Most of the ones I tried
are rejected by aptina_pll_calculate for various reasons. In particular,
no pix_clock close to pix_clock_max is allowed.

Why does the calculation method insist on exact division and avoiding
fractional numbers?

I'm using an ext_clock of 50 MHz. This clock is derived from a 33 MHz
clock and the 50 MHz is not attained exactly. Rather it ends up being
more like 49.999976 Hz. This raises the question, what value I should
put into ext_clock (or the corresponding device tree property). Should I
use the requested frequency or the actual frequency? Worse, depending on
the precise value of the ext_clock, aptina_pll_calculate may or may not
be able to compute pll parameters.

On the other hand, the manufacturer provided configuration tool happily
computes pll parameters that result in close, but not exactly, the
requested pix_clock. In particular, the pll parameters do not
necessarily result in a whole number. It appears to merely approximate
the requested frequency.

Can you explain where the requirement to avoid fractional numbers comes
from? Would it be reasonable to use a different algorithm that avoids
this requirement?

Helmut

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-08-27 12:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14  6:35 why does aptina_pll_calculate insist on exact division? Helmut Grohne
2018-08-14  7:30 ` Laurent Pinchart
2018-08-14  8:40   ` Helmut Grohne
2018-08-23  7:52     ` [PATCH] media: aptina-pll: allow approximating the requested pix_clock Helmut Grohne
2018-08-23 11:12       ` Laurent Pinchart
2018-08-24 12:05         ` Helmut Grohne
2018-08-25 11:32           ` Sakari Ailus
2018-08-27  8:44             ` Helmut Grohne
2018-08-23 11:30       ` Sakari Ailus
2018-08-24 12:05         ` Helmut Grohne
2018-08-14  8:48   ` why does aptina_pll_calculate insist on exact division? Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox