linux/drivers/gpu/drm/rcar-du
Kuninori Morimoto 0bc69592ab drm: rcar-du: Calculate DPLLCR to be more small jitter
In general, PLL has VCO (= Voltage controlled oscillator),
one of the very important electronic feature called as "jitter"
is related to this VCO.
In academic generalism, VCO should be maximum to be more small jitter.
In high frequency clock, jitter will be large impact.
Thus, selecting Hi VCO is general theory.

   fin                                 fvco        fout      fclkout
in --> [1/M] --> |PD| -> [LPF] -> [VCO] -> [1/P] -+-> [1/FDPLL] -> out
             +-> |  |                             |
             |                                    |
             +-----------------[1/N]<-------------+

	fclkout = fvco / P / FDPLL -- (1)

In PD, it will loop until fin/M = fvco/P/N

	fvco = fin * P *  N / M -- (2)

(1) + (2) indicates

	fclkout = fin * N / M / FDPLL

In this device, N = (n + 1), M = (m + 1), P = 2, FDPLL = (fdpll + 1).

	fclkout = fin * (n + 1) / (m + 1) / (fdpll + 1)

This is the datasheet formula.
One note here is that it should be 2kHz < fvco < 4096MHz
To be smaller jitter, fvco should be maximum,
in other words, N as large as possible, M as small as possible driver
should select. Here, basically M=1.
This patch do it.

Reported-by: HIROSHI INOSE <hiroshi.inose.rb@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[Small clarifications in comments, renamed finnm to fout]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2018-02-14 18:05:25 +02:00
..
Kconfig drm: rcar-du: Add Gen3 HDMI encoder support 2017-04-04 17:04:13 +03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcar_du_crtc.c drm: rcar-du: Calculate DPLLCR to be more small jitter 2018-02-14 18:05:25 +02:00
rcar_du_crtc.h drm: rcar-du: Repair vblank for DRM page flips using the VSP 2017-08-03 16:17:30 +03:00
rcar_du_drv.c drm: rcar-du: Implement system suspend/resume support 2017-12-04 13:04:11 +02:00
rcar_du_drv.h drm: rcar-du: Implement system suspend/resume support 2017-12-04 13:04:11 +02:00
rcar_du_encoder.c drm: Convert to using %pOF instead of full_name 2017-07-26 13:45:06 +02:00
rcar_du_encoder.h drm: rcar-du: Hardcode encoders types to DRM_MODE_ENCODER_NONE 2017-04-04 17:04:04 +03:00
rcar_du_group.c drm: rcar-du: Configure DPAD0 routing through last group on Gen3 2017-08-03 16:17:24 +03:00
rcar_du_group.h drm: rcar-du: Restart the DU group when a plane source changes 2016-02-20 02:58:55 +02:00
rcar_du_kms.c drm/rcar-du: Use drm_gem_fb_create() 2017-10-01 17:02:53 +02:00
rcar_du_kms.h drm/rcar-du: Update copyright notice 2014-09-15 11:34:06 +03:00
rcar_du_lvdscon.c drm: rcar-du: Don't set connector DPMS property 2017-12-04 13:04:11 +02:00
rcar_du_lvdscon.h drm: rcar-du: Constify node argument to rcar_du_lvds_connector_init() 2016-11-14 03:35:12 +02:00
rcar_du_lvdsenc.c drm: rcar-du: Fix comments to comply with the kernel coding style 2017-08-03 16:17:22 +03:00
rcar_du_lvdsenc.h drm: rcar-du: Add support for LVDS mode selection 2017-04-04 17:03:57 +03:00
rcar_du_plane.c drm: rcar-du: Clip planes to screen boundaries 2017-12-04 18:38:31 +02:00
rcar_du_plane.h drm: rcar-du: Share plane atomic check code between Gen2 and Gen3 2017-12-04 13:04:11 +02:00
rcar_du_regs.h drm: rcar-du: Add DPLL support 2017-04-04 17:04:19 +03:00
rcar_du_vsp.c drm: rcar-du: Clip planes to screen boundaries 2017-12-04 18:38:31 +02:00
rcar_du_vsp.h drm: rcar-du: Remove zpos field from rcar_du_vsp_plane_state structure 2018-02-14 18:05:24 +02:00
rcar_dw_hdmi.c drm: rcar-du: Remove an unneeded NULL check 2017-08-03 16:17:25 +03:00
rcar_lvds_regs.h drm: rcar-du: lvds: Add R-Car Gen3 support 2016-02-23 09:34:32 +02:00