[pkg-fso-commits] [SCM] linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko branch, andy-tracking, updated. upstream/20090303.gitb9de904e-140-g23b564c
Andy Green
agreen at octopus.localdomain
Mon Jun 8 17:29:32 UTC 2009
The following commit has been merged in the andy-tracking branch:
commit 7885f1816cc1bf4734f0556f10c7288f5d7917f5
Author: Werner Almesberger <werner at openmoko.org>
Date: Mon Mar 9 21:02:36 2009 +0000
Adjust MCLK for use with PLL
The PLL converts a 26.6 MHz input clock to 87.8 MHz, which is later
divided by two and becomes PCLK. (See comments below for details.)
All this looks like a textbook example for platform stuff, but let's
take it one step a time.
Signed-off-by: Werner Almesberger <werner at openmoko.org>
diff --git a/drivers/media/video/samsung/4xa_sensor.c b/drivers/media/video/samsung/4xa_sensor.c
index 4c5f3fb..b7f9061 100644
--- a/drivers/media/video/samsung/4xa_sensor.c
+++ b/drivers/media/video/samsung/4xa_sensor.c
@@ -29,6 +29,27 @@
#include "../s3c_camif.h"
#include "4xa_sensor.h"
+
+/*
+ * Samsung's original code:
+ * .camclk = 44000000, / * for 20 fps: 44MHz, for 12 fps (more
+ * stable): 26MHz * /
+ *
+ * Experimenting with the controls yielded the following:
+ *
+ * PLL_CLK gets divided according to TCMD.Div8_r (1,00h) and then by
+ * SEL_MAIN.Half_PCLK_Enable (5,8Fh) until it finally becomes PCLK.
+ *
+ * Div8_r = 0: 1/4, 1: 1/2 (default)
+ * Half_PCLK_Enable = 0: 1/1 (default), 1: 1/2
+ *
+ * Thus our 26.6 MHz MCLK becomes an 87.78 MHz PLL_CLK and eventually a PCLK
+ * of 43.89 MHz.
+ */
+
+#define CAMCLK 26600000 /* 26.6 MHz */
+
+
static struct i2c_driver sensor_driver;
/* This is an abstract CIS sensor for MSDMA input. */
@@ -36,8 +57,7 @@ static struct i2c_driver sensor_driver;
camif_cis_t msdma_input = {
.itu_fmt = CAMIF_ITU601,
.order422 = CAMIF_CBYCRY, /* another case: YCRYCB */
- .camclk = 44000000, /* for 20 fps: 44MHz, for 12 fps (more
- stable): 26MHz */
+ .camclk = CAMCLK,
.source_x = 800,
.source_y = 600,
.win_hor_ofst = 0,
@@ -54,8 +74,7 @@ camif_cis_t msdma_input = {
camif_cis_t interlace_input = {
.itu_fmt = CAMIF_ITU601,
.order422 = CAMIF_CBYCRY, /* another case: YCRYCB */
- .camclk = 44000000, /* for 20 fps: 44MHz, for 12 fps (more
- stable): 26MHz */
+ .camclk = CAMCLK,
.source_x = 800,
.source_y = 600,
.win_hor_ofst = 0,
@@ -73,8 +92,7 @@ camif_cis_t interlace_input = {
static camif_cis_t data = {
.itu_fmt = CAMIF_ITU601,
.order422 = CAMIF_YCBYCR,
- .camclk = 44000000, /* for 20 fps: 44MHz, for 12 fps (more
- stable): 26MHz */
+ .camclk = CAMCLK,
.source_x = 800,
.source_y = 600,
.win_hor_ofst = 0,
--
linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko
More information about the pkg-fso-commits
mailing list