r4941 - developers/werner/gta03/cam/patches

werner at docs.openmoko.org werner at docs.openmoko.org
Fri Feb 27 10:06:46 CET 2009


Author: werner
Date: 2009-02-27 10:06:45 +0100 (Fri, 27 Feb 2009)
New Revision: 4941

Added:
   developers/werner/gta03/cam/patches/fix-s3c64xx_setrate_clksrc.patch
Modified:
   developers/werner/gta03/cam/patches/add-64xx-cam-clock.patch
   developers/werner/gta03/cam/patches/add-s3c-camif.patch
   developers/werner/gta03/cam/patches/mach-gta03-add-cam.patch
   developers/werner/gta03/cam/patches/series
Log:
The clocks seems to be fine now. The driver doesn't ask for a sensible
frequency (266 MHz instead of 44 MHz), but this is probably a different
issue. In any case, it gets what it asks for.



Modified: developers/werner/gta03/cam/patches/add-64xx-cam-clock.patch
===================================================================
--- developers/werner/gta03/cam/patches/add-64xx-cam-clock.patch	2009-02-27 04:39:05 UTC (rev 4940)
+++ developers/werner/gta03/cam/patches/add-64xx-cam-clock.patch	2009-02-27 09:06:45 UTC (rev 4941)
@@ -1,7 +1,7 @@
 Index: cam/arch/arm/plat-s3c/include/plat/clock.h
 ===================================================================
---- cam.orig/arch/arm/plat-s3c/include/plat/clock.h	2009-02-26 23:40:41.000000000 +0800
-+++ cam/arch/arm/plat-s3c/include/plat/clock.h	2009-02-26 23:40:59.000000000 +0800
+--- cam.orig/arch/arm/plat-s3c/include/plat/clock.h	2009-02-27 15:19:10.000000000 +0800
++++ cam/arch/arm/plat-s3c/include/plat/clock.h	2009-02-27 15:19:18.000000000 +0800
 @@ -50,6 +50,7 @@
  extern struct clk clk_ext;
  
@@ -12,14 +12,14 @@
  
 Index: cam/arch/arm/plat-s3c64xx/clock.c
 ===================================================================
---- cam.orig/arch/arm/plat-s3c64xx/clock.c	2009-02-26 23:26:09.000000000 +0800
-+++ cam/arch/arm/plat-s3c64xx/clock.c	2009-02-26 23:42:47.000000000 +0800
+--- cam.orig/arch/arm/plat-s3c64xx/clock.c	2009-02-27 15:19:10.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/clock.c	2009-02-27 15:19:18.000000000 +0800
 @@ -27,6 +27,12 @@
  #include <plat/devs.h>
  #include <plat/clock.h>
  
 +struct clk clk_h2 = {
-+	.name		= "clk_h2",
++	.name		= "hclk2",
 +	.id		= -1,
 +	.rate		= 0,
 +};
@@ -27,24 +27,61 @@
  struct clk clk_27m = {
  	.name		= "clk_27m",
  	.id		= -1,
-@@ -176,6 +182,12 @@
- 		.parent		= &clk_h,
- 		.enable		= s3c64xx_hclk_ctrl,
- 		.ctrlbit	= S3C_CLKCON_HCLK_SDMA1,
-+	}, {
+@@ -270,6 +276,7 @@
+ 	&clk_epll,
+ 	&clk_27m,
+ 	&clk_48m,
++	&clk_h2,
+ };
+ 
+ void s3c64xx_register_clocks(void)
+Index: cam/arch/arm/plat-s3c64xx/s3c6400-clock.c
+===================================================================
+--- cam.orig/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-27 15:19:10.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-27 15:49:59.000000000 +0800
+@@ -518,6 +518,33 @@
+ 	.reg_divider	= S3C_CLK_DIV2,
+ };
+ 
++static struct clk *clkset_camif_list[] = {
++	&clk_h2,
++};
++
++static struct clk_sources clkset_camif = {
++	.sources	= clkset_camif_list,
++	.nr_sources	= ARRAY_SIZE(clkset_camif_list),
++};
++
++static struct clksrc_clk clk_camif = {
++	.clk	= {
 +		.name		= "camera",
 +		.id		= -1,
-+		.parent		= &clk_h2,
++		.ctrlbit        = S3C_CLKCON_SCLK_CAM,
 +		.enable		= s3c64xx_sclk_ctrl,
-+		.ctrlbit	= S3C_CLKCON_SCLK_CAM,
- 	},
++		.set_parent	= s3c64xx_setparent_clksrc,
++		.get_rate	= s3c64xx_getrate_clksrc,
++		.set_rate	= s3c64xx_setrate_clksrc,
++		.round_rate	= s3c64xx_roundrate_clksrc,
++	},
++	.shift		= 0,
++	.mask		= 0,
++	.sources	= &clkset_camif,
++	.divider_shift	= S3C6400_CLKDIV0_CAM_SHIFT,
++	.reg_divider	= S3C_CLK_DIV0,
++};
++
+ /* Clock initialisation code */
+ 
+ static struct clksrc_clk *init_parents[] = {
+@@ -534,6 +561,7 @@
+ 	&clk_audio0,
+ 	&clk_audio1,
+ 	&clk_irda,
++	&clk_camif,
  };
  
-Index: cam/arch/arm/plat-s3c64xx/s3c6400-clock.c
-===================================================================
---- cam.orig/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-26 23:39:36.000000000 +0800
-+++ cam/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-26 23:39:49.000000000 +0800
-@@ -606,6 +606,7 @@
+ static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
+@@ -606,6 +634,7 @@
  	clk_fout_epll.rate = epll;
  	clk_fout_apll.rate = apll;
  
@@ -52,3 +89,11 @@
  	clk_h.rate = hclk;
  	clk_p.rate = pclk;
  	clk_f.rate = fclk;
+@@ -633,6 +662,7 @@
+ 	&clk_audio0.clk,
+ 	&clk_audio1.clk,
+ 	&clk_irda.clk,
++	&clk_camif.clk,
+ };
+ 
+ void __init s3c6400_register_clocks(void)

Modified: developers/werner/gta03/cam/patches/add-s3c-camif.patch
===================================================================
--- developers/werner/gta03/cam/patches/add-s3c-camif.patch	2009-02-27 04:39:05 UTC (rev 4940)
+++ developers/werner/gta03/cam/patches/add-s3c-camif.patch	2009-02-27 09:06:45 UTC (rev 4941)
@@ -1,8 +1,8 @@
 Index: cam/drivers/media/video/s3c_camera_driver.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ cam/drivers/media/video/s3c_camera_driver.c	2009-02-27 11:44:41.000000000 +0800
-@@ -0,0 +1,1884 @@
++++ cam/drivers/media/video/s3c_camera_driver.c	2009-02-27 15:24:15.000000000 +0800
+@@ -0,0 +1,1885 @@
 +/* drivers/media/video/s3c_camera_driver.c
 + *
 + * Copyright (c) 2008 Samsung Electronics
@@ -1782,9 +1782,10 @@
 +
 +	if (IS_ERR(cam_clock)) {
 +		printk("Failed to find camera clock source\n");
-+		ret = PTR_ERR(cam_clock);
++		return PTR_ERR(cam_clock);
 +	}
 +
++printk("cam_clock %p\n", cam_clock);
 +	clk_enable(cam_clock);
 +
 +	/* Print banner */
@@ -1845,7 +1846,7 @@
 +
 +void s3c_camif_open_sensor(camif_cis_t *cis)
 +{
-+printk("cam_clock %p cis %p\n", cam_clock, cis);
++printk("@@@ s3c_camif_open_sensor: cam_clock %p cis %p\n", cam_clock, cis);
 +	clk_set_rate(cam_clock, cis->camclk);
 +	s3c_camif_reset(cis->reset_type, cis->reset_udelay);
 +}
@@ -1890,7 +1891,7 @@
 Index: cam/drivers/media/video/s3c_camif.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ cam/drivers/media/video/s3c_camif.c	2009-02-26 23:54:22.000000000 +0800
++++ cam/drivers/media/video/s3c_camif.c	2009-02-27 15:24:15.000000000 +0800
 @@ -0,0 +1,1872 @@
 +/* drivers/media/video/s3c_camif.c
 + *
@@ -3767,7 +3768,7 @@
 Index: cam/drivers/media/video/s3c_camif.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ cam/drivers/media/video/s3c_camif.h	2009-02-26 23:54:22.000000000 +0800
++++ cam/drivers/media/video/s3c_camif.h	2009-02-27 15:24:15.000000000 +0800
 @@ -0,0 +1,404 @@
 +/* drivers/media/video/s3c_camif.h
 + *
@@ -4176,7 +4177,7 @@
 Index: cam/drivers/media/video/videodev2_s3c.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ cam/drivers/media/video/videodev2_s3c.h	2009-02-26 23:54:22.000000000 +0800
++++ cam/drivers/media/video/videodev2_s3c.h	2009-02-27 15:24:15.000000000 +0800
 @@ -0,0 +1,210 @@
 +#ifndef __VIDEODEV2_S3C_H_
 +#define __VIDEODEV2_S3C_H_

Added: developers/werner/gta03/cam/patches/fix-s3c64xx_setrate_clksrc.patch
===================================================================
--- developers/werner/gta03/cam/patches/fix-s3c64xx_setrate_clksrc.patch	                        (rev 0)
+++ developers/werner/gta03/cam/patches/fix-s3c64xx_setrate_clksrc.patch	2009-02-27 09:06:45 UTC (rev 4941)
@@ -0,0 +1,28 @@
+Some of the rate selection logic in s3c64xx_setrate_clksrc uses what
+appears to be parent clock selection logic. This patch corrects it.
+
+I also added a BUG_ON, since an overly large divider can cause
+unrelated clocks to be changed.
+
+Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+---
+
+Index: cam/arch/arm/plat-s3c64xx/s3c6400-clock.c
+===================================================================
+--- cam.orig/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-27 16:17:15.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-02-27 16:52:50.000000000 +0800
+@@ -239,10 +239,11 @@
+ 
+ 	rate = clk_round_rate(clk, rate);
+ 	div = clk_get_rate(clk->parent) / rate;
++	BUG_ON(div > 16);
+ 
+ 	val = __raw_readl(reg);
+-	val &= ~sclk->mask;
+-	val |= (rate - 1) << sclk->shift;
++	val &= ~(0xf << sclk->shift);
++	val |= (div - 1) << sclk->shift;
+ 	__raw_writel(val, reg);
+ 
+ 	return 0;

Modified: developers/werner/gta03/cam/patches/mach-gta03-add-cam.patch
===================================================================
--- developers/werner/gta03/cam/patches/mach-gta03-add-cam.patch	2009-02-27 04:39:05 UTC (rev 4940)
+++ developers/werner/gta03/cam/patches/mach-gta03-add-cam.patch	2009-02-27 09:06:45 UTC (rev 4941)
@@ -1,7 +1,7 @@
 Index: cam/arch/arm/mach-s3c6410/mach-om-gta03.c
 ===================================================================
---- cam.orig/arch/arm/mach-s3c6410/mach-om-gta03.c	2009-02-27 12:15:24.000000000 +0800
-+++ cam/arch/arm/mach-s3c6410/mach-om-gta03.c	2009-02-27 12:17:54.000000000 +0800
+--- cam.orig/arch/arm/mach-s3c6410/mach-om-gta03.c	2009-02-27 14:02:45.000000000 +0800
++++ cam/arch/arm/mach-s3c6410/mach-om-gta03.c	2009-02-27 14:05:14.000000000 +0800
 @@ -84,6 +84,8 @@
  #include <plat/regs-usb-hs-otg.h>
  
@@ -21,8 +21,8 @@
  
 Index: cam/arch/arm/mach-s3c6410/Kconfig
 ===================================================================
---- cam.orig/arch/arm/mach-s3c6410/Kconfig	2009-02-27 12:18:00.000000000 +0800
-+++ cam/arch/arm/mach-s3c6410/Kconfig	2009-02-27 12:19:57.000000000 +0800
+--- cam.orig/arch/arm/mach-s3c6410/Kconfig	2009-02-27 14:02:44.000000000 +0800
++++ cam/arch/arm/mach-s3c6410/Kconfig	2009-02-27 14:02:52.000000000 +0800
 @@ -70,6 +70,7 @@
  	select S3C6410_SETUP_SDHCI
  	select S3C64XX_SETUP_I2C1

Modified: developers/werner/gta03/cam/patches/series
===================================================================
--- developers/werner/gta03/cam/patches/series	2009-02-27 04:39:05 UTC (rev 4940)
+++ developers/werner/gta03/cam/patches/series	2009-02-27 09:06:45 UTC (rev 4941)
@@ -2,7 +2,8 @@
 add-s3c-camif-regs.patch
 add-samsung-cams-i2c.patch
 add-s5k4.patch
+add-s3c-cam-platform.patch
+mach-gta03-add-cam.patch
 add-64xx-cam-clock.patch
 add-s3c-camif.patch
-add-s3c-cam-platform.patch
-mach-gta03-add-cam.patch
+fix-s3c64xx_setrate_clksrc.patch




More information about the commitlog mailing list