public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC
@ 2009-09-18 14:19 y
  0 siblings, 0 replies; 4+ messages in thread
From: y @ 2009-09-18 14:19 UTC (permalink / raw)
  To: linux-omap; +Cc: tomi.valkeinen, Matthias Ludwig

From: Matthias Ludwig <mludwig@ultratronik.de>

Signed-off-by: Matthias Ludwig <mludwig@ultratronik.de>
---

OMAP CPU can only provide a level of about 0.8V at TVOUT, which is not
compliant with NTSC nor PAL. If one wants to have a compliant signal
external buffers need to be added. This requires TVOUTBYPASS to be set.
This patch implements a simple way to set it from dss platform data.

Is there a more elegant way to get register address?

 arch/arm/plat-omap/include/mach/display.h |    1 +
 drivers/video/omap2/dss/venc.c            |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 4c7422e..3013be0 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -380,6 +380,7 @@ struct omap_dss_device {
 		struct {
 			enum omap_dss_venc_type type;
 			bool invert_polarity;
+			bool bypass_tvout;
 		} venc;
 	} phy;
 
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index cf7827e..cb35a0d 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -35,6 +35,7 @@
 #include <linux/regulator/consumer.h>
 
 #include <mach/display.h>
+#include <mach/control.h>
 #include <mach/cpu.h>
 
 #include "dss.h"
@@ -532,6 +533,21 @@ static void venc_power_on(struct omap_dss_device *dssdev)
 
 	venc_write_reg(VENC_OUTPUT_CONTROL, l);
 
+	if (dssdev->phy.venc.bypass_tvout) {
+		u32 dc1, dc1_addr;
+#ifdef CONFIG_ARCH_OMAP3430
+		dc1_addr = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#elif defined(CONFIG_ARCH_OMAP2430)
+		dc1_addr = OMAP243X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#elif defined(CONFIG_ARCH_OMAP2420)
+		dc1_addr = OMAP242X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#else
+		bug();
+#endif
+		dc1 = readl(dc1_addr) | OMAP2_TVOUTBYPASS;
+		writel(dc1, dc1_addr);
+	}
+
 	dispc_set_digit_size(dssdev->panel.timings.x_res,
 			dssdev->panel.timings.y_res/2);
 
-- 
1.6.2.5


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

* Re: [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC
       [not found] <1253283578-24377-1-git-send-email-y>
@ 2009-09-21  7:10 ` Tomi Valkeinen
  2009-09-21  8:37   ` Matthias Ludwig
  0 siblings, 1 reply; 4+ messages in thread
From: Tomi Valkeinen @ 2009-09-21  7:10 UTC (permalink / raw)
  To: ext y@ultratronik.de; +Cc: linux-omap@vger.kernel.org, Matthias Ludwig

Hi,

On Fri, 2009-09-18 at 16:19 +0200, ext y@ultratronik.de wrote:
> From: Matthias Ludwig <mludwig@ultratronik.de>
> 
> Signed-off-by: Matthias Ludwig <mludwig@ultratronik.de>
> ---
> 
> OMAP CPU can only provide a level of about 0.8V at TVOUT, which is not
> compliant with NTSC nor PAL. If one wants to have a compliant signal
> external buffers need to be added. This requires TVOUTBYPASS to be set.
> This patch implements a simple way to set it from dss platform data.
> 
> Is there a more elegant way to get register address?

Where does OMAP2_TVOUTBYPASS come from? It doesn't exist in my tree.

I have a hack in my board files that just do:

l = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1) | (1 << 18);
omap_ctrl_writel(l, OMAP343X_CONTROL_DEVCONF1);

A flag in the omap_dss_device would be the proper way to do it, as you
did, but I think venc.c should call some function somewhere in arch/arm/
to actually do the setup.

 Tomi

> 
>  arch/arm/plat-omap/include/mach/display.h |    1 +
>  drivers/video/omap2/dss/venc.c            |   16 ++++++++++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
> index 4c7422e..3013be0 100644
> --- a/arch/arm/plat-omap/include/mach/display.h
> +++ b/arch/arm/plat-omap/include/mach/display.h
> @@ -380,6 +380,7 @@ struct omap_dss_device {
>  		struct {
>  			enum omap_dss_venc_type type;
>  			bool invert_polarity;
> +			bool bypass_tvout;
>  		} venc;
>  	} phy;
>  
> diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
> index cf7827e..cb35a0d 100644
> --- a/drivers/video/omap2/dss/venc.c
> +++ b/drivers/video/omap2/dss/venc.c
> @@ -35,6 +35,7 @@
>  #include <linux/regulator/consumer.h>
>  
>  #include <mach/display.h>
> +#include <mach/control.h>
>  #include <mach/cpu.h>
>  
>  #include "dss.h"
> @@ -532,6 +533,21 @@ static void venc_power_on(struct omap_dss_device *dssdev)
>  
>  	venc_write_reg(VENC_OUTPUT_CONTROL, l);
>  
> +	if (dssdev->phy.venc.bypass_tvout) {
> +		u32 dc1, dc1_addr;
> +#ifdef CONFIG_ARCH_OMAP3430
> +		dc1_addr = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#elif defined(CONFIG_ARCH_OMAP2430)
> +		dc1_addr = OMAP243X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#elif defined(CONFIG_ARCH_OMAP2420)
> +		dc1_addr = OMAP242X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#else
> +		bug();
> +#endif
> +		dc1 = readl(dc1_addr) | OMAP2_TVOUTBYPASS;
> +		writel(dc1, dc1_addr);
> +	}
> +
>  	dispc_set_digit_size(dssdev->panel.timings.x_res,
>  			dssdev->panel.timings.y_res/2);
>  


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

* Re: [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC
  2009-09-21  7:10 ` [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC Tomi Valkeinen
@ 2009-09-21  8:37   ` Matthias Ludwig
  2009-09-21 12:45     ` Tomi Valkeinen
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Ludwig @ 2009-09-21  8:37 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap@vger.kernel.org

> Where does OMAP2_TVOUTBYPASS come from? It doesn't exist in my tree.

Ohh, i missed that in the patch, sorry. I added to
arch/arm/plat-omap/include/mach/control.h (see new patch attached).

> A flag in the omap_dss_device would be the proper way to do it, as you
> did, but I think venc.c should call some function somewhere in arch/arm/
> to actually do the setup.

Where would you place this function?

best regards,
Matthias

---
 arch/arm/plat-omap/include/mach/control.h |    1 +
 arch/arm/plat-omap/include/mach/display.h |    1 +
 drivers/video/omap2/dss/venc.c            |   16 ++++++++++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index 826d317..969d3bc 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -167,6 +167,7 @@
 
 /* CONTROL_DEVCONF1 bits */
 #define OMAP243X_MMC1_ACTIVE_OVERWRITE	(1 << 31)
+#define OMAP2_TVOUTBYPASS		(1 << 18)
 #define OMAP2_MMCSDIO2ADPCLKISEL	(1 << 6) /* MMC2 loop back clock */
 #define OMAP2_MCBSP5_CLKS_MASK		(1 << 4) /* > 242x */
 #define OMAP2_MCBSP4_CLKS_MASK		(1 << 2) /* > 242x */
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 4c7422e..3013be0 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -380,6 +380,7 @@ struct omap_dss_device {
 		struct {
 			enum omap_dss_venc_type type;
 			bool invert_polarity;
+			bool bypass_tvout;
 		} venc;
 	} phy;
 
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index cf7827e..cb35a0d 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -35,6 +35,7 @@
 #include <linux/regulator/consumer.h>
 
 #include <mach/display.h>
+#include <mach/control.h>
 #include <mach/cpu.h>
 
 #include "dss.h"
@@ -532,6 +533,21 @@ static void venc_power_on(struct omap_dss_device *dssdev)
 
 	venc_write_reg(VENC_OUTPUT_CONTROL, l);
 
+	if (dssdev->phy.venc.bypass_tvout) {
+		u32 dc1, dc1_addr;
+#ifdef CONFIG_ARCH_OMAP3430
+		dc1_addr = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#elif defined(CONFIG_ARCH_OMAP2430)
+		dc1_addr = OMAP243X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#elif defined(CONFIG_ARCH_OMAP2420)
+		dc1_addr = OMAP242X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
+#else
+		bug();
+#endif
+		dc1 = readl(dc1_addr) | OMAP2_TVOUTBYPASS;
+		writel(dc1, dc1_addr);
+	}
+
 	dispc_set_digit_size(dssdev->panel.timings.x_res,
 			dssdev->panel.timings.y_res/2);
 

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

* Re: [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC
  2009-09-21  8:37   ` Matthias Ludwig
@ 2009-09-21 12:45     ` Tomi Valkeinen
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2009-09-21 12:45 UTC (permalink / raw)
  To: ext Matthias Ludwig; +Cc: linux-omap@vger.kernel.org

On Mon, 2009-09-21 at 10:37 +0200, ext Matthias Ludwig wrote:
> > Where does OMAP2_TVOUTBYPASS come from? It doesn't exist in my tree.
> 
> Ohh, i missed that in the patch, sorry. I added to
> arch/arm/plat-omap/include/mach/control.h (see new patch attached).
> 
> > A flag in the omap_dss_device would be the proper way to do it, as you
> > did, but I think venc.c should call some function somewhere in arch/arm/
> > to actually do the setup.
> 
> Where would you place this function?

That I cannot say. Quick grep shows that there are multiple files in
plat-omap/ and mach-omap2/ handling CONTROL registers. None of those
files looked right for DSS, so perhaps there's need for another file for
DSS. But I have to say I haven't studied this problem at all, so I'm
just guessing here. Board file is of course safe place for the code for
now, but a better solution would be nice.

 Tomi

> 
> best regards,
> Matthias
> 
> ---
>  arch/arm/plat-omap/include/mach/control.h |    1 +
>  arch/arm/plat-omap/include/mach/display.h |    1 +
>  drivers/video/omap2/dss/venc.c            |   16 ++++++++++++++++
>  3 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
> index 826d317..969d3bc 100644
> --- a/arch/arm/plat-omap/include/mach/control.h
> +++ b/arch/arm/plat-omap/include/mach/control.h
> @@ -167,6 +167,7 @@
>  
>  /* CONTROL_DEVCONF1 bits */
>  #define OMAP243X_MMC1_ACTIVE_OVERWRITE	(1 << 31)
> +#define OMAP2_TVOUTBYPASS		(1 << 18)
>  #define OMAP2_MMCSDIO2ADPCLKISEL	(1 << 6) /* MMC2 loop back clock */
>  #define OMAP2_MCBSP5_CLKS_MASK		(1 << 4) /* > 242x */
>  #define OMAP2_MCBSP4_CLKS_MASK		(1 << 2) /* > 242x */
> diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
> index 4c7422e..3013be0 100644
> --- a/arch/arm/plat-omap/include/mach/display.h
> +++ b/arch/arm/plat-omap/include/mach/display.h
> @@ -380,6 +380,7 @@ struct omap_dss_device {
>  		struct {
>  			enum omap_dss_venc_type type;
>  			bool invert_polarity;
> +			bool bypass_tvout;
>  		} venc;
>  	} phy;
>  
> diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
> index cf7827e..cb35a0d 100644
> --- a/drivers/video/omap2/dss/venc.c
> +++ b/drivers/video/omap2/dss/venc.c
> @@ -35,6 +35,7 @@
>  #include <linux/regulator/consumer.h>
>  
>  #include <mach/display.h>
> +#include <mach/control.h>
>  #include <mach/cpu.h>
>  
>  #include "dss.h"
> @@ -532,6 +533,21 @@ static void venc_power_on(struct omap_dss_device *dssdev)
>  
>  	venc_write_reg(VENC_OUTPUT_CONTROL, l);
>  
> +	if (dssdev->phy.venc.bypass_tvout) {
> +		u32 dc1, dc1_addr;
> +#ifdef CONFIG_ARCH_OMAP3430
> +		dc1_addr = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#elif defined(CONFIG_ARCH_OMAP2430)
> +		dc1_addr = OMAP243X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#elif defined(CONFIG_ARCH_OMAP2420)
> +		dc1_addr = OMAP242X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1);
> +#else
> +		bug();
> +#endif
> +		dc1 = readl(dc1_addr) | OMAP2_TVOUTBYPASS;
> +		writel(dc1, dc1_addr);
> +	}
> +
>  	dispc_set_digit_size(dssdev->panel.timings.x_res,
>  			dssdev->panel.timings.y_res/2);
>  


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

end of thread, other threads:[~2009-09-21 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1253283578-24377-1-git-send-email-y>
2009-09-21  7:10 ` [RFC] OMAP: DSS2: Add flag to enable/disable TVOUTBYPASS for VENC Tomi Valkeinen
2009-09-21  8:37   ` Matthias Ludwig
2009-09-21 12:45     ` Tomi Valkeinen
2009-09-18 14:19 y

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