Re: [PATCH v3 5/9] OMAP4 : DSS2 : HDMI: HDMI driver header file addition

2011-03-08 Thread K, Mythri P
Hi Tomi,

On Mon, Mar 7, 2011 at 3:16 PM, Tomi Valkeinen tomi.valkei...@ti.com wrote:
 On Fri, 2011-03-04 at 01:48 -0600, K, Mythri P wrote:
 Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
 Register and timing declaration to be used by the corresponding c file
 is added in this file.

 The subject and description are wrong. Always before sending patches do
 a quick sanity check, by check the subjects, looking at the stats in the
 intro letter, etc.
My bad ,will reread.

 Signed-off-by: Mythri P K mythr...@ti.com

snip

 +const u8 header[8] = {0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0};

 Bad variable name, use something more descriptive.

will rename to edid_header.
 +

snip
 +static int hdmi_wait_phy_pwr(int val)

 These comments apply also to the function below.

 The parameter should be an enum.

 The function is misnamed. This doesn't wait for the power mode to
 change, as the name implies. This sets the power mode.


will make refsel an enum and add other option , also make all these
functions to take enum as a parameter.

snip

 +        * SW HACK : DDC needs time to stablize else it sometimes reads 0 
 values
 +        * or right shifted values.
 +        */
 +       usleep_range(800, 1000);

 This is still unclear. Is it an OMAP HW problem? OMAP HW feature? A
 feature in HDMI TVs? A HDMI spec delay? Or unknown reason?

there is an internal DDC (i2c bus) , without this delay I have
sometimes seen that while reading EDID
we sometimes (Not always and only with some TV's , even with a
particular TV it is not consistent)
read a shifted value or EDID value is 0. I can clarify with the h/w
team , but  can we add this as a s/w hack for time being?

snip

Thanks and regards,
Mythri.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 5/9] OMAP4 : DSS2 : HDMI: HDMI driver header file addition

2011-03-08 Thread Tomi Valkeinen
On Tue, 2011-03-08 at 02:17 -0600, K, Mythri P wrote:
 Hi Tomi,
 
 On Mon, Mar 7, 2011 at 3:16 PM, Tomi Valkeinen tomi.valkei...@ti.com wrote:
  On Fri, 2011-03-04 at 01:48 -0600, K, Mythri P wrote:
  Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
  Register and timing declaration to be used by the corresponding c file
  is added in this file.
 
  The subject and description are wrong. Always before sending patches do
  a quick sanity check, by check the subjects, looking at the stats in the
  intro letter, etc.

snip

  +* SW HACK : DDC needs time to stablize else it sometimes reads 0 
  values
  +* or right shifted values.
  +*/
  +   usleep_range(800, 1000);
 
  This is still unclear. Is it an OMAP HW problem? OMAP HW feature? A
  feature in HDMI TVs? A HDMI spec delay? Or unknown reason?
 
 there is an internal DDC (i2c bus) , without this delay I have
 sometimes seen that while reading EDID
 we sometimes (Not always and only with some TV's , even with a
 particular TV it is not consistent)
 read a shifted value or EDID value is 0. I can clarify with the h/w
 team , but  can we add this as a s/w hack for time being?

Sure, I have nothing against this work-around as such. I just want it to
be clearly described in the comment. The comment should explain as much
as possible about the hack/workaround, because if the problem is not
described in the TRM/errata, the comment is the only place where the
reader can get information about it.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 5/9] OMAP4 : DSS2 : HDMI: HDMI driver header file addition

2011-03-07 Thread Tomi Valkeinen
On Fri, 2011-03-04 at 01:48 -0600, K, Mythri P wrote:
 Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
 Register and timing declaration to be used by the corresponding c file
 is added in this file.

The subject and description are wrong. Always before sending patches do
a quick sanity check, by check the subjects, looking at the stats in the
intro letter, etc.

 Signed-off-by: Mythri P K mythr...@ti.com
 ---
  drivers/video/omap2/dss/Kconfig   |8 +
  drivers/video/omap2/dss/Makefile  |1 +
  drivers/video/omap2/dss/display.c |3 +
  drivers/video/omap2/dss/dss.h |   31 +
  drivers/video/omap2/dss/hdmi.c| 1332 
 +
  drivers/video/omap2/dss/hdmi.h|5 +
  6 files changed, 1380 insertions(+), 0 deletions(-)
  create mode 100644 drivers/video/omap2/dss/hdmi.c
 
 diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
 index db01473..7749ddb 100644
 --- a/drivers/video/omap2/dss/Kconfig
 +++ b/drivers/video/omap2/dss/Kconfig
 @@ -60,6 +60,14 @@ config OMAP2_DSS_VENC
 help
   OMAP Video Encoder support for S-Video and composite TV-out.
 
 +config OMAP2_DSS_HDMI
 +   bool HDMI support
 +   depends on ARCH_OMAP4
 +default y
 +   help
 + HDMI Interface. This adds the High Definition Multimedia Interface.
 + See http://www.hdmi.org/ for HDMI specification.
 +
  config OMAP2_DSS_SDI
 bool SDI support
 depends on ARCH_OMAP3
 diff --git a/drivers/video/omap2/dss/Makefile 
 b/drivers/video/omap2/dss/Makefile
 index 7db17b5..5998b69 100644
 --- a/drivers/video/omap2/dss/Makefile
 +++ b/drivers/video/omap2/dss/Makefile
 @@ -5,3 +5,4 @@ omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
  omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
  omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
  omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
 +omapdss-$(CONFIG_OMAP2_DSS_HDMI) += hdmi.o
 diff --git a/drivers/video/omap2/dss/display.c 
 b/drivers/video/omap2/dss/display.c
 index e10b303..cbab61a 100644
 --- a/drivers/video/omap2/dss/display.c
 +++ b/drivers/video/omap2/dss/display.c
 @@ -447,6 +447,9 @@ void dss_init_device(struct platform_device *pdev,
 r = dsi_init_display(dssdev);
 break;
  #endif
 +   case OMAP_DISPLAY_TYPE_HDMI:
 +   r = hdmi_init_display(dssdev);
 +   break;
 default:
 BUG();
 }
 diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
 index 004c782..5d4a7f6 100644
 --- a/drivers/video/omap2/dss/dss.h
 +++ b/drivers/video/omap2/dss/dss.h
 @@ -168,6 +168,16 @@ struct dsi_clock_info {
 bool use_dss2_fck;
  };
 
 +/* HDMI PLL structure */
 +struct hdmi_pll_info {
 +   u16 regn;
 +   u16 regm;
 +   u32 regmf;
 +   u16 regm2;
 +   u16 regsd;
 +   u16 dcofreq;
 +};
 +
  struct seq_file;
  struct platform_device;
 
 @@ -432,6 +442,27 @@ static inline void venc_uninit_platform_driver(void)
  }
  #endif
 
 +/* HDMI */
 +#ifdef CONFIG_OMAP2_DSS_HDMI
 +int hdmi_init_platform_driver(void);
 +void hdmi_uninit_platform_driver(void);
 +int hdmi_init_display(struct omap_dss_device *dssdev);
 +#else
 +static inline int hdmi_init_display(struct omap_dss_device *dssdev)
 +{
 +   return 0;
 +}
 +static inline int hdmi_init_platform_driver(void)
 +{
 +   return 0;
 +}
 +static inline void hdmi_uninit_platform_driver(void)
 +{
 +}
 +#endif
 +int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
 +void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
 +
  /* RFBI */
  #ifdef CONFIG_OMAP2_DSS_RFBI
  int rfbi_init_platform_driver(void);
 diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
 new file mode 100644
 index 000..a6f7936
 --- /dev/null
 +++ b/drivers/video/omap2/dss/hdmi.c
 @@ -0,0 +1,1332 @@
 +/*
 + * hdmi.c
 + *
 + * HDMI interface DSS driver setting for TI's OMAP4 family of processor.
 + * Copyright (C) 2010-2011 Texas Instruments Incorporated - 
 http://www.ti.com/
 + * Authors: Yong Zhi
 + * Mythri pk mythr...@ti.com
 + *
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms of the GNU General Public License version 2 as published 
 by
 + * the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but 
 WITHOUT
 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 + * more details.
 + *
 + * You should have received a copy of the GNU General Public License along 
 with
 + * this program.  If not, see http://www.gnu.org/licenses/.
 + */
 +
 +#define DSS_SUBSYS_NAME HDMI
 +
 +#include linux/kernel.h
 +#include linux/module.h
 +#include linux/err.h
 +#include linux/io.h
 +#include linux/interrupt.h
 +#include linux/mutex.h
 +#include linux/delay.h
 +#include linux/string.h
 

[PATCH v3 5/9] OMAP4 : DSS2 : HDMI: HDMI driver header file addition

2011-03-03 Thread Mythri P K
Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
Register and timing declaration to be used by the corresponding c file
is added in this file.

Signed-off-by: Mythri P K mythr...@ti.com
---
 drivers/video/omap2/dss/Kconfig   |8 +
 drivers/video/omap2/dss/Makefile  |1 +
 drivers/video/omap2/dss/display.c |3 +
 drivers/video/omap2/dss/dss.h |   31 +
 drivers/video/omap2/dss/hdmi.c| 1332 +
 drivers/video/omap2/dss/hdmi.h|5 +
 6 files changed, 1380 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap2/dss/hdmi.c

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index db01473..7749ddb 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -60,6 +60,14 @@ config OMAP2_DSS_VENC
help
  OMAP Video Encoder support for S-Video and composite TV-out.
 
+config OMAP2_DSS_HDMI
+   bool HDMI support
+   depends on ARCH_OMAP4
+default y
+   help
+ HDMI Interface. This adds the High Definition Multimedia Interface.
+ See http://www.hdmi.org/ for HDMI specification.
+
 config OMAP2_DSS_SDI
bool SDI support
depends on ARCH_OMAP3
diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index 7db17b5..5998b69 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -5,3 +5,4 @@ omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
 omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
 omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
 omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
+omapdss-$(CONFIG_OMAP2_DSS_HDMI) += hdmi.o
diff --git a/drivers/video/omap2/dss/display.c 
b/drivers/video/omap2/dss/display.c
index e10b303..cbab61a 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -447,6 +447,9 @@ void dss_init_device(struct platform_device *pdev,
r = dsi_init_display(dssdev);
break;
 #endif
+   case OMAP_DISPLAY_TYPE_HDMI:
+   r = hdmi_init_display(dssdev);
+   break;
default:
BUG();
}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 004c782..5d4a7f6 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -168,6 +168,16 @@ struct dsi_clock_info {
bool use_dss2_fck;
 };
 
+/* HDMI PLL structure */
+struct hdmi_pll_info {
+   u16 regn;
+   u16 regm;
+   u32 regmf;
+   u16 regm2;
+   u16 regsd;
+   u16 dcofreq;
+};
+
 struct seq_file;
 struct platform_device;
 
@@ -432,6 +442,27 @@ static inline void venc_uninit_platform_driver(void)
 }
 #endif
 
+/* HDMI */
+#ifdef CONFIG_OMAP2_DSS_HDMI
+int hdmi_init_platform_driver(void);
+void hdmi_uninit_platform_driver(void);
+int hdmi_init_display(struct omap_dss_device *dssdev);
+#else
+static inline int hdmi_init_display(struct omap_dss_device *dssdev)
+{
+   return 0;
+}
+static inline int hdmi_init_platform_driver(void)
+{
+   return 0;
+}
+static inline void hdmi_uninit_platform_driver(void)
+{
+}
+#endif
+int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
+void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
+
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
 int rfbi_init_platform_driver(void);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
new file mode 100644
index 000..a6f7936
--- /dev/null
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -0,0 +1,1332 @@
+/*
+ * hdmi.c
+ *
+ * HDMI interface DSS driver setting for TI's OMAP4 family of processor.
+ * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Authors: Yong Zhi
+ * Mythri pk mythr...@ti.com
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see http://www.gnu.org/licenses/.
+ */
+
+#define DSS_SUBSYS_NAME HDMI
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/err.h
+#include linux/io.h
+#include linux/interrupt.h
+#include linux/mutex.h
+#include linux/delay.h
+#include linux/string.h
+#include plat/display.h
+
+#include dss.h
+#include hdmi.h
+
+static struct {
+   struct mutex lock;
+   struct omap_display_platform_data *pdata;
+   struct platform_device *pdev;
+   void __iomem *base_wp;  /* HDMI wrapper */
+   int code;
+   int mode;
+   u8 edid[HDMI_EDID_MAX_LENGTH];
+   u8 edid_set;
+   struct hdmi_config cfg;
+}