Re: [PATCH] OMAPDSS: HDMI: fix missing unlock on error in hdmi_dump_regs()

2012-10-21 Thread Sumit Semwal

On Sunday 21 October 2012 06:24 PM, Wei Yongjun wrote:

From: Wei Yongjun 

Add the missing unlock on the error handling path in function
hdmi_dump_regs().

Signed-off-by: Wei Yongjun 

Looks good to me; feel free to add:
Reviewed-by: Sumit Semwal 

---
no test
---
  drivers/video/omap2/dss/hdmi.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a48a7dd..8c9b8b3 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -644,8 +644,10 @@ static void hdmi_dump_regs(struct seq_file *s)
  {
mutex_lock(&hdmi.lock);

-   if (hdmi_runtime_get())
+   if (hdmi_runtime_get()) {
+   mutex_unlock(&hdmi.lock);
return;
+   }

hdmi.ip_data.ops->dump_wrapper(&hdmi.ip_data, s);
hdmi.ip_data.ops->dump_pll(&hdmi.ip_data, s);


--
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



--
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 V4 0/5] OMAPDSS: Enable dynamic debug printing

2012-10-10 Thread Sumit Semwal

Tomi, Chandrabhanu,

On Friday 05 October 2012 06:16 PM, Tomi Valkeinen wrote:

On Sat, 2012-09-29 at 16:19 +0530, Chandrabhanu Mahapatra wrote:

Hi everyone,
this patch series aims at cleaning up of DSS of printk()'s enabled with
dss_debug and replace them with generic dynamic debug printing.


Except for the missing debug print conversions in dsi.c this looks good.
Do you want me to apply the current series and you can send the dsi.c
patch later, or do you want to fix the dsi.c also before I apply?


With the change for DSI, please feel free to add

Reviewed-by: Sumit Semwal 

BR,
~Sumit.


  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 V4 2/5] OMAPDSS: Create new debug config options

2012-09-29 Thread Sumit Semwal

Hi Chandrabhanu,

On Saturday 29 September 2012 04:19 PM, Chandrabhanu Mahapatra wrote:

The config option CONFIG_OMAP2_DSS_DEBUG_SUPPORT has been removed and replaced
with CONFIG_OMAP2_DSS_DEBUG and CONFIG_OMAP2_DSS_DEBUGFS. CONFIG_OMAP2_DSS_DEBUG
enables DEBUG flag and CONFIG_OMAP2_DSS_DEBUGFS enables creation of debugfs for
OMAPDSS. Both the config options are disabled by default and can be enabled
independently of one another as per convenience.

Signed-off-by: Chandrabhanu Mahapatra 
---
  drivers/video/omap2/dss/Kconfig  |   21 +++--
  drivers/video/omap2/dss/Makefile |2 +-
  drivers/video/omap2/dss/core.c   |6 +++---
  drivers/video/omap2/dss/dss.c|2 +-
  drivers/video/omap2/dss/dss.h|2 +-
  5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 80f5390..866a563 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -18,16 +18,25 @@ config OMAP2_VRAM_SIZE
  You can also set this with "vram=" kernel argument, or
  in the board file.

-config OMAP2_DSS_DEBUG_SUPPORT
-bool "Debug support"
-   default y
+config OMAP2_DSS_DEBUG
+   bool "Debug support"
+   default n
+   help
+ This enables printing of debug messages. Alternatively, debug messages
+ can also be enabled by setting CONFIG_DYNAMIC_DEBUG and then setting
+ appropriate flags in /dynamic_debug/control.
+
+config OMAP2_DSS_DEBUGFS
+   bool "Debugfs filesystem support"
+   default n
You can make it as 'depends on CONFIG_DEBUG_FS', so that your check 
below [1] becomes cleaner.

help
- This enables debug messages. You need to enable printing
- with 'debug' module parameter.
+ This enables debugfs for OMAPDSS at /omapdss. This enables
+ querying about clock configuration and register configuration of dss,
+ dispc, dsi, hdmi and rfbi.

  config OMAP2_DSS_COLLECT_IRQ_STATS
bool "Collect DSS IRQ statistics"
-   depends on OMAP2_DSS_DEBUG_SUPPORT
+   depends on OMAP2_DSS_DEBUGFS
default n
help
  Collect DSS IRQ statistics, printable via debugfs.
diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index 86493e3..4070191 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -8,4 +8,4 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
  omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
  omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o \
hdmi_panel.o ti_hdmi_4xxx_ip.o
-ccflags-$(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) += -DDEBUG
+ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index b2af72d..1e1f50f 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -138,7 +138,7 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long 
tput)
return 0;
  }

-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUGFS)

[1]: here.

  static int dss_debug_show(struct seq_file *s, void *unused)
  {
void (*func)(struct seq_file *) = s->private;
@@ -193,7 +193,7 @@ int dss_debugfs_create_file(const char *name, void 
(*write)(struct seq_file *))

return 0;
  }
-#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
+#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUGFS */
  static inline int dss_initialize_debugfs(void)
  {
return 0;
@@ -205,7 +205,7 @@ int dss_debugfs_create_file(const char *name, void 
(*write)(struct seq_file *))
  {
return 0;
  }
-#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
+#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUGFS */

  /* PLATFORM DEVICE */
  static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void 
*d)
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2ab1c3e..fe30855 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -746,7 +746,7 @@ static void dss_runtime_put(void)
  }

  /* DEBUGFS */
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUGFS)
  void dss_debug_dump_clocks(struct seq_file *s)
  {
dss_dump_clocks(s);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index ffbba7e..a8a1ab4 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -301,7 +301,7 @@ enum dss_hdmi_venc_clk_source_select 
dss_get_hdmi_venc_clk_source(void);
  const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
  void dss_dump_clocks(struct seq_file *s);

-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBU

[Patch v3 2/2] OMAP2PLUS:DSS2: Use opt_clock_available from pdata

2011-03-01 Thread Sumit Semwal
hwmod databases provide information about which optional clocks are available
for a given platform. This is available via a function pointer opt_clock_enable
in pdata.

Use this information during get/enable/disable/put of clocks.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   46 ++--
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 5a93e66..3d0277d 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -699,6 +699,7 @@ static int dss_get_clock(struct clk **clock, const char 
*clk_name)
 static int dss_get_clocks(void)
 {
int r;
+   struct omap_display_platform_data *pdata = dss.pdev->dev.platform_data;
 
dss.dss_ick = NULL;
dss.dss_fck = NULL;
@@ -714,17 +715,28 @@ static int dss_get_clocks(void)
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
-   if (r)
+   if (!pdata->opt_clock_available) {
+   r = -ENODEV;
goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
-   if (r)
-   goto err;
+   if (pdata->opt_clock_available("sys_clk")) {
+   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
+   if (r)
+   goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
-   if (r)
-   goto err;
+   if (pdata->opt_clock_available("tv_clk")) {
+   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
+   if (r)
+   goto err;
+   }
+
+   if (pdata->opt_clock_available("video_clk")) {
+   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
+   if (r)
+   goto err;
+   }
 
return 0;
 
@@ -747,9 +759,11 @@ static void dss_put_clocks(void)
 {
if (dss.dss_video_fck)
clk_put(dss.dss_video_fck);
-   clk_put(dss.dss_tv_fck);
+   if (dss.dss_tv_fck)
+   clk_put(dss.dss_tv_fck);
+   if (dss.dss_sys_clk)
+   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_fck);
-   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_ick);
 }
 
@@ -798,11 +812,11 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
clk_enable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_enable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_enable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_enable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_enable(dss.dss_video_fck);
 
dss.num_clks_enabled += num_clks;
@@ -826,11 +840,11 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
clk_disable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_disable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_disable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_disable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_disable(dss.dss_video_fck);
 
dss.num_clks_enabled -= num_clks;
-- 
1.7.1

--
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


[Patch v3 1/2] OMAP2PLUS:DSS2: add opt_clock_available in pdata

2011-03-01 Thread Sumit Semwal
Provide a function in pdata to allow dss submodules to check if a given
clock is available on a platform as an optional clock.

Signed-off-by: Senthilvadivu Guruswamy 
(based on implementation from Senthil)

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   22 ++
 arch/arm/plat-omap/include/plat/display.h |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5ab6a74..6b1efc5 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -42,6 +42,20 @@ static struct omap_device_pm_latency omap_dss_latency[] = {
},
 };
 
+/* oh_core is used for getting opt-clocks */
+static struct omap_hwmod   *oh_core;
+
+static bool opt_clock_available(const char *clk_role)
+{
+   int i;
+
+   for (i = 0; i < oh_core->opt_clks_cnt; i++) {
+   if (!strcmp(oh_core->opt_clks[i].role, clk_role))
+   return true;
+   }
+   return false;
+}
+
 int __init omap_display_init(struct omap_dss_board_info *board_data)
 {
int r = 0;
@@ -73,9 +87,16 @@ int __init omap_display_init(struct omap_dss_board_info 
*board_data)
oh_count = ARRAY_SIZE(oh_name) - 2;
/* last 2 hwmod dev in oh_name are not available for omap3 */
 
+   /* opt_clks are always associated with dss hwmod */
+   oh_core = omap_hwmod_lookup("dss_core");
+   if (!oh_core) {
+   pr_err("Could not look up dss_core.\n");
+   return -ENODEV;
+   }
 
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
+   pdata.opt_clock_available = opt_clock_available;
 
for (i = 0; i < oh_count; i++) {
oh = omap_hwmod_lookup(oh_name[i]);
@@ -83,6 +104,7 @@ int __init omap_display_init(struct omap_dss_board_info 
*board_data)
pr_err("Could not look up %s\n", oh_name[i]);
return -ENODEV;
}
+
od = omap_device_build(dev_name[i], -1, oh, &pdata,
sizeof(struct omap_display_platform_data),
omap_dss_latency,
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 2fb057e..4101bcd 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -240,6 +240,8 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 struct omap_display_platform_data {
struct omap_dss_board_info *board_data;
/* TODO: Additional members to be added when PM is considered */
+
+   bool (*opt_clock_available)(const char *clk_role);
 };
 
 struct omap_video_timings {
-- 
1.7.1

--
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


[Patch v3 0/2] OMAP2PLUS:DSS2: use opt-clocks information from hwmod.

2011-03-01 Thread Sumit Semwal
This series uses information about opt-clocks provided by omap_hwmod framework
to select which of the non-mandatory DSS clocks are available on a given
platform.

A function pointer opt_clock_available is exported via pdata, which checks the
clock roles returned by hwmod database.
In the driver, while doing clk-get, it is checked if as per hwmod a given clock
is an opt-clock or not, and is handled accordingly.

Tested on: OMAP3430sdp

Sumit Semwal (2):
  OMAP2PLUS:DSS2: add opt_clock_available in pdata
  OMAP2PLUS:DSS2: Use opt_clock_available from pdata

changes from v2:
- made oh_core a static variable, looked up only once in omap_display_init.

changes from v1:
- made opt_clock_available a function pointer in the omap_display_platform_data
  to avoid having to copy the opt-clock role names.


 arch/arm/mach-omap2/display.c |   22 ++
 arch/arm/plat-omap/include/plat/display.h |2 +
 drivers/video/omap2/dss/dss.c |   46 +++--
 3 files changed, 54 insertions(+), 16 deletions(-)

--
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


[Patch v2 2/2] OMAP2PLUS:DSS2: Use opt_clock_available from pdata

2011-02-28 Thread Sumit Semwal
hwmod databases provide information about which optional clocks are available
for a given platform. This is available via a function pointer opt_clock_enable
in pdata.

Use this information during get/enable/disable/put of clocks.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   46 ++--
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 5a93e66..3d0277d 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -699,6 +699,7 @@ static int dss_get_clock(struct clk **clock, const char 
*clk_name)
 static int dss_get_clocks(void)
 {
int r;
+   struct omap_display_platform_data *pdata = dss.pdev->dev.platform_data;
 
dss.dss_ick = NULL;
dss.dss_fck = NULL;
@@ -714,17 +715,28 @@ static int dss_get_clocks(void)
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
-   if (r)
+   if (!pdata->opt_clock_available) {
+   r = -ENODEV;
goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
-   if (r)
-   goto err;
+   if (pdata->opt_clock_available("sys_clk")) {
+   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
+   if (r)
+   goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
-   if (r)
-   goto err;
+   if (pdata->opt_clock_available("tv_clk")) {
+   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
+   if (r)
+   goto err;
+   }
+
+   if (pdata->opt_clock_available("video_clk")) {
+   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
+   if (r)
+   goto err;
+   }
 
return 0;
 
@@ -747,9 +759,11 @@ static void dss_put_clocks(void)
 {
if (dss.dss_video_fck)
clk_put(dss.dss_video_fck);
-   clk_put(dss.dss_tv_fck);
+   if (dss.dss_tv_fck)
+   clk_put(dss.dss_tv_fck);
+   if (dss.dss_sys_clk)
+   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_fck);
-   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_ick);
 }
 
@@ -798,11 +812,11 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
clk_enable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_enable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_enable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_enable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_enable(dss.dss_video_fck);
 
dss.num_clks_enabled += num_clks;
@@ -826,11 +840,11 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
clk_disable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_disable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_disable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_disable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_disable(dss.dss_video_fck);
 
dss.num_clks_enabled -= num_clks;
-- 
1.7.1

--
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


[Patch v2 1/2] OMAP2PLUS:DSS2: add opt_clock_available in pdata

2011-02-28 Thread Sumit Semwal
Provide a function in pdata to allow dss submodules to check if a given
clock is available on a platform as an optional clock.

Signed-off-by: Senthilvadivu Guruswamy 
(based on implementation from Senthil)

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   20 
 arch/arm/plat-omap/include/plat/display.h |2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5ab6a74..9f4f862 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -42,6 +42,25 @@ static struct omap_device_pm_latency omap_dss_latency[] = {
},
 };
 
+static bool opt_clock_available(const char *clk_role)
+{
+   int i;
+   struct omap_hwmod *oh;
+
+   /* opt_clks are always associated with dss hwmod */
+   oh = omap_hwmod_lookup("dss_core");
+   if (!oh) {
+   pr_err("Could not look up dss_core.\n");
+   return -ENODEV;
+   }
+
+   for (i = 0; i < oh->opt_clks_cnt; i++) {
+   if (!strcmp(oh->opt_clks[i].role, clk_role))
+   return true;
+   }
+   return false;
+}
+
 int __init omap_display_init(struct omap_dss_board_info *board_data)
 {
int r = 0;
@@ -76,6 +95,7 @@ int __init omap_display_init(struct omap_dss_board_info 
*board_data)
 
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
+   pdata.opt_clock_available = opt_clock_available;
 
for (i = 0; i < oh_count; i++) {
oh = omap_hwmod_lookup(oh_name[i]);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 2fb057e..4101bcd 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -240,6 +240,8 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 struct omap_display_platform_data {
struct omap_dss_board_info *board_data;
/* TODO: Additional members to be added when PM is considered */
+
+   bool (*opt_clock_available)(const char *clk_role);
 };
 
 struct omap_video_timings {
-- 
1.7.1

--
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


[Patch v2 0/2] OMAP2PLUS:DSS2: use opt-clocks information from hwmod.

2011-02-28 Thread Sumit Semwal
This series uses information about opt-clocks provided by omap_hwmod framework
to select which of the non-mandatory DSS clocks are available on a given
platform.

A function pointer opt_clock_available is exported via pdata, which checks the
clock roles returned by hwmod database.
In the driver, while doing clk-get, it is checked if as per hwmod a given clock
is an opt-clock or not, and is handled accordingly.

Tested on: OMAP3430sdp

Sumit Semwal (2):
  OMAP2PLUS:DSS2: add opt_clock_available in pdata
  OMAP2PLUS:DSS2: Use opt_clock_available from pdata

changes from v1:
- made opt_clock_available a function pointer in the omap_display_platform_data
  to avoid having to copy the opt-clock role names.

Based on top of:
http://gitorious.org/linux-omap-dss2/linux/commits/master
commit: ad1c76c: OMAP: Overo Palo43 LCD support


 arch/arm/mach-omap2/display.c |   20 
 arch/arm/plat-omap/include/plat/display.h |2 +
 drivers/video/omap2/dss/dss.c |   46 +++--
 3 files changed, 52 insertions(+), 16 deletions(-)

--
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


[Patch 1/2] OMAP2PLUS: DSS2: Add dss_opt_clk_roles in pdata

2011-02-25 Thread Sumit Semwal
Provide dss_opt_clks roles in pdata, so that it can be retrieved
in dss driver, thus avoiding the hardcoding of clock role names.

Signed-off-by: Senthilvadivu Guruswamy 
(based on implementation from Senthil)

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   41 -
 arch/arm/plat-omap/include/plat/display.h |3 +-
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index cc7b4f3..f189c07 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -48,6 +49,7 @@ int __init omap_display_init(struct omap_dss_board_info
int r = 0;
struct omap_hwmod *oh;
struct omap_device *od;
+   struct omap_hwmod_opt_clk *oc = NULL;
int i;
struct omap_display_platform_data pdata;
 
@@ -61,7 +63,7 @@ int __init omap_display_init(struct omap_dss_board_info
"dss_dsi2", "dss_hdmi"};
char *dev_name[] = {"omap_dss", "omap_dispc", "omap_rfbi", "omap_venc", 
"omap_dsi1",
"omap_dsi2", "omap_hdmi"};
-   int oh_count;
+   int oh_count, oc_count;
 
memset(&pdata, 0, sizeof(pdata));
 
@@ -74,7 +76,44 @@ int __init omap_display_init(struct omap_dss_board_info
oh_count = ARRAY_SIZE(oh_name) - 2;
/* last 2 hwmod dev in oh_name are not available for omap3 */
 
+   /* opt_clks are always associated with dss hwmod */
+   oh = omap_hwmod_lookup("dss_core");
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name[0]);
+   return -ENODEV;
+   }
+   oc = oh->opt_clks;
+   oc_count = oh->opt_clks_cnt;
+
+   /* copy roles of opt_clocks available from hwmod into pdata */
+   pdata.dss_opt_clk_roles = kzalloc(sizeof(char *) * oc_count,
+ GFP_KERNEL);
+   if (!pdata.dss_opt_clk_roles) {
+   pr_err("could not allocate memory for dss_opt_clk_roles\n");
+   return -ENOMEM;
+   }
+
+   for (i = 0; i < oc_count; i++) {
+   int oc_length = strlen(oc[i].role);
+
+   pdata.dss_opt_clk_roles[i] = kzalloc(oc_length + 1,
+GFP_KERNEL);
+   if (!pdata.dss_opt_clk_roles[i]) {
+   int j = i - 1;
+
+   pr_err("kzalloc failed for dss_opt_clk[%i]\n", i);
+   for (; j >= 0; j--)
+   kfree(pdata.dss_opt_clk_roles[j]);
+
+   kfree(pdata.dss_opt_clk_roles);
+
+   return -ENOMEM;
+   }
+
+   strncpy(pdata.dss_opt_clk_roles[i], oc[i].role, oc_length+1);
+   }
 
+   pdata.dss_opt_clks_count = oc_count;
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
 
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 2fb057e..5f5fc0d 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -239,7 +239,8 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 
 struct omap_display_platform_data {
struct omap_dss_board_info *board_data;
-   /* TODO: Additional members to be added when PM is considered */
+   char **dss_opt_clk_roles;
+   int dss_opt_clks_count;
 };
 
 struct omap_video_timings {
-- 
1.7.1

--
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


[Patch 2/2] OMAP2PLUS: DSS2: Use opt-clocks from hwmod

2011-02-25 Thread Sumit Semwal
hwmod databases provide information on which optional clocks are available for
a given platform. Use this information during get/enable/disable/put of clocks.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   54 -
 1 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 921ff91..9a85f9d 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -706,6 +706,18 @@ static int dss_get_clock(struct clk **clock, const char 
*clk_name)
return 0;
 }
 
+static inline bool opt_clock_available(const char *clk_role)
+{
+   int i;
+   struct omap_display_platform_data *pdata = dss.pdev->dev.platform_data;
+
+   for (i = 0; i < pdata->dss_opt_clks_count; i++) {
+   if (strcmp(pdata->dss_opt_clk_roles[i], clk_role) == 0)
+   return true;
+   }
+   return false;
+}
+
 static int dss_get_clocks(void)
 {
int r;
@@ -724,17 +736,23 @@ static int dss_get_clocks(void)
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
-   if (r)
-   goto err;
+   if (opt_clock_available("sys_clk")) {
+   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
+   if (r)
+   goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
-   if (r)
-   goto err;
+   if (opt_clock_available("tv_clk")) {
+   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
+   if (r)
+   goto err;
+   }
 
-   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
-   if (r)
-   goto err;
+   if (opt_clock_available("video_clk")) {
+   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
+   if (r)
+   goto err;
+   }
 
return 0;
 
@@ -757,9 +775,11 @@ static void dss_put_clocks(void)
 {
if (dss.dss_video_fck)
clk_put(dss.dss_video_fck);
-   clk_put(dss.dss_tv_fck);
+   if (dss.dss_tv_fck)
+   clk_put(dss.dss_tv_fck);
+   if (dss.dss_sys_clk)
+   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_fck);
-   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_ick);
 }
 
@@ -808,11 +828,11 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
clk_enable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_enable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_enable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_enable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_enable(dss.dss_video_fck);
 
dss.num_clks_enabled += num_clks;
@@ -836,11 +856,11 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
clk_disable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
clk_disable(dss.dss_fck);
-   if (clks & DSS_CLK_SYSCK)
+   if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_disable(dss.dss_sys_clk);
-   if (clks & DSS_CLK_TVFCK)
+   if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
clk_disable(dss.dss_tv_fck);
-   if (clks & DSS_CLK_VIDFCK)
+   if ((clks & DSS_CLK_VIDFCK) && dss.dss_video_fck)
clk_disable(dss.dss_video_fck);
 
dss.num_clks_enabled -= num_clks;
-- 
1.7.1

--
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


[Patch 0/2] OMAP2PLUS:DSS2: use opt-clocks information from hwmod.

2011-02-25 Thread Sumit Semwal
This series uses information about opt-clocks provided by omap_hwmod framework
to select which of the non-mandatory DSS clocks are available on a given
platform.
The clock roles returned by hwmod database are added to pdata, and in the
driver, while doing clk-get, it is checked if as per hwmod a given clock 
is an opt-clock or not, and is handled accordingly.

Tested on: OMAP3430sdp, panda(OMAP4430)

Sumit Semwal (2):
  OMAP2PLUS: DSS2: Add dss_opt_clk_roles in pdata
  OMAP2PLUS: DSS2: Use opt-clocks from hwmod

 arch/arm/mach-omap2/display.c |   41 +-
 arch/arm/plat-omap/include/plat/display.h |3 +-
 drivers/video/omap2/dss/dss.c |   54 -
 3 files changed, 79 insertions(+), 19 deletions(-)

--
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


[PATCH v11 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-02-15 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

This IRQ is stored in dss_irq as part of dss structure, and freed it in
dss_exit().

Reviewed-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   22 +++---
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 4d7a816..f4d90f2 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -79,6 +79,7 @@ static struct {
enum dss_clk_source dispc_clk_source;
 
u32 ctx[DSS_SZ_REGS / sizeof(u32)];
+   int dss_irq;
 } dss;
 
 static void dss_clk_enable_all_no_ctx(void);
@@ -609,11 +610,18 @@ static int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
-   cpu_is_omap24xx()
-   ? dss_irq_handler_omap2
-   : dss_irq_handler_omap3,
-   0, "OMAP DSS", NULL);
+   dss.dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss.dss_irq < 0) {
+   DSSERR("omap2 dss: platform_get_irq failed\n");
+   r = -ENODEV;
+   goto fail1;
+   }
+
+   r = request_irq(dss.dss_irq,
+   cpu_is_omap24xx()
+   ? dss_irq_handler_omap2
+   : dss_irq_handler_omap3,
+   0, "OMAP DSS", NULL);
 
if (r < 0) {
DSSERR("omap2 dss: request_irq failed\n");
@@ -641,7 +649,7 @@ static int dss_init(bool skip_init)
return 0;
 
 fail2:
-   free_irq(INT_24XX_DSS_IRQ, NULL);
+   free_irq(dss.dss_irq, NULL);
 fail1:
iounmap(dss.base);
 fail0:
@@ -653,7 +661,7 @@ static void dss_exit(void)
if (cpu_is_omap34xx())
clk_put(dss.dpll4_m4_ck);
 
-   free_irq(INT_24XX_DSS_IRQ, NULL);
+   free_irq(dss.dss_irq, NULL);
 
iounmap(dss.base);
 }
-- 
1.7.1

--
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


[PATCH v4 1/3] OMAP2PLUS: DSS2: Add OMAP4 Kconfig support

2011-02-15 Thread Sumit Semwal
From: Mayuresh Janorkar 

Enable DSS2 and OMAPFB for OMAP4 in Kconfig

Signed-off-by: Mayuresh Janorkar 
---
 drivers/video/omap2/dss/Kconfig|6 +++---
 drivers/video/omap2/omapfb/Kconfig |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 43b6440..db01473 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,8 +1,8 @@
 menuconfig OMAP2_DSS
-tristate "OMAP2/3 Display Subsystem support (EXPERIMENTAL)"
-depends on ARCH_OMAP2 || ARCH_OMAP3
+tristate "OMAP2+ Display Subsystem support (EXPERIMENTAL)"
+depends on ARCH_OMAP2PLUS
 help
-  OMAP2/3 Display Subsystem support.
+ OMAP2+ Display Subsystem support.
 
 if OMAP2_DSS
 
diff --git a/drivers/video/omap2/omapfb/Kconfig 
b/drivers/video/omap2/omapfb/Kconfig
index 65149b2..aa33386 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,5 +1,5 @@
 menuconfig FB_OMAP2
-tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
+tristate "OMAP2+ frame buffer support (EXPERIMENTAL)"
 depends on FB && OMAP2_DSS
 
select OMAP2_VRAM
@@ -8,10 +8,10 @@ menuconfig FB_OMAP2
 select FB_CFB_COPYAREA
 select FB_CFB_IMAGEBLIT
 help
-  Frame buffer driver for OMAP2/3 based boards.
+ Frame buffer driver for OMAP2+ based boards.
 
 config FB_OMAP2_DEBUG_SUPPORT
-   bool "Debug support for OMAP2/3 FB"
+bool "Debug support for OMAP2+ FB"
default y
depends on FB_OMAP2
help
-- 
1.7.1

--
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


[PATCH v4 1/3] OMAP2PLUS: DSS2: Add OMAP4 Kconfig support

2011-02-15 Thread Sumit Semwal
From: Mayuresh Janorkar 

Enable DSS2 and OMAPFB for OMAP4 in Kconfig

Signed-off-by: Mayuresh Janorkar 
---
 drivers/video/omap2/dss/Kconfig|6 +++---
 drivers/video/omap2/omapfb/Kconfig |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 43b6440..db01473 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,8 +1,8 @@
 menuconfig OMAP2_DSS
-tristate "OMAP2/3 Display Subsystem support (EXPERIMENTAL)"
-depends on ARCH_OMAP2 || ARCH_OMAP3
+tristate "OMAP2+ Display Subsystem support (EXPERIMENTAL)"
+depends on ARCH_OMAP2PLUS
 help
-  OMAP2/3 Display Subsystem support.
+ OMAP2+ Display Subsystem support.
 
 if OMAP2_DSS
 
diff --git a/drivers/video/omap2/omapfb/Kconfig 
b/drivers/video/omap2/omapfb/Kconfig
index 65149b2..aa33386 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,5 +1,5 @@
 menuconfig FB_OMAP2
-tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
+tristate "OMAP2+ frame buffer support (EXPERIMENTAL)"
 depends on FB && OMAP2_DSS
 
select OMAP2_VRAM
@@ -8,10 +8,10 @@ menuconfig FB_OMAP2
 select FB_CFB_COPYAREA
 select FB_CFB_IMAGEBLIT
 help
-  Frame buffer driver for OMAP2/3 based boards.
+ Frame buffer driver for OMAP2+ based boards.
 
 config FB_OMAP2_DEBUG_SUPPORT
-   bool "Debug support for OMAP2/3 FB"
+bool "Debug support for OMAP2+ FB"
default y
depends on FB_OMAP2
help
-- 
1.7.1

--
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


[PATCH v3 4/4] OMAP4: DSS2: clocks: Add ick as dummy clock

2011-01-31 Thread Sumit Semwal
DSS code uses ick as one of the clocks in clk_get/clk_put. OMAP4 clock database
doesn't have ick for DSS, so adding ick as dummy clock.

This is needed for backward compatibility with OMAP2/3.

Once pm_runtime* APIs get introduced in DSS, this will be revisited.

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock44xx_data.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 9bd3ae5..615a361 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3112,6 +3112,11 @@ static struct omap_clk omap44xx_clks[] = {
CLK("omap_dss", "dss_clk",  &dss_dss_clk,   
CK_443X),
CLK("omap_dss", "video_clk",&dss_48mhz_clk, 
CK_443X),
CLK("omap_dss", "fck",  &dss_fck,   
CK_443X),
+   /*
+* On OMAP4, DSS ick is a dummy clock; this is needed for compatibility
+* with OMAP2/3.
+*/
+   CLK("omap_dss", "ick",  &dummy_ck,  
CK_443X),
CLK(NULL,   "efuse_ctrl_cust_fck",  &efuse_ctrl_cust_fck,   
CK_443X),
CLK(NULL,   "emif1_fck",&emif1_fck, 
CK_443X),
CLK(NULL,   "emif2_fck",&emif2_fck, 
CK_443X),
-- 
1.7.1

--
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


[PATCH v3 3/4] OMAP2PLUS: DSS2: Generalize external clock names in struct dss of dss.c

2011-01-31 Thread Sumit Semwal
From: Archit Taneja 

The dss struct in dss.c has omap2/3 specific clock names. Making them generic,
to increase readability and extendability.

Signed-off-by: Sumit Semwal 
Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dss.c |   82 
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2873c30..c7cdbea 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -64,10 +64,10 @@ static struct {
 
struct clk  *dpll4_m4_ck;
struct clk  *dss_ick;
-   struct clk  *dss1_fck;
-   struct clk  *dss2_fck;
-   struct clk  *dss_54m_fck;
-   struct clk  *dss_96m_fck;
+   struct clk  *dss_fck;
+   struct clk  *dss_sys_clk;
+   struct clk  *dss_tv_fck;
+   struct clk  *dss_video_fck;
unsignednum_clks_enabled;
 
unsigned long   cache_req_pck;
@@ -749,28 +749,28 @@ static int dss_get_clocks(void)
int r;
 
dss.dss_ick = NULL;
-   dss.dss1_fck = NULL;
-   dss.dss2_fck = NULL;
-   dss.dss_54m_fck = NULL;
-   dss.dss_96m_fck = NULL;
+   dss.dss_fck = NULL;
+   dss.dss_sys_clk = NULL;
+   dss.dss_tv_fck = NULL;
+   dss.dss_video_fck = NULL;
 
r = dss_get_clock(&dss.dss_ick, "ick");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss1_fck, "fck");
+   r = dss_get_clock(&dss.dss_fck, "fck");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss2_fck, "sys_clk");
+   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_54m_fck, "tv_clk");
+   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_96m_fck, "video_clk");
+   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
if (r)
goto err;
 
@@ -779,25 +779,25 @@ static int dss_get_clocks(void)
 err:
if (dss.dss_ick)
clk_put(dss.dss_ick);
-   if (dss.dss1_fck)
-   clk_put(dss.dss1_fck);
-   if (dss.dss2_fck)
-   clk_put(dss.dss2_fck);
-   if (dss.dss_54m_fck)
-   clk_put(dss.dss_54m_fck);
-   if (dss.dss_96m_fck)
-   clk_put(dss.dss_96m_fck);
+   if (dss.dss_fck)
+   clk_put(dss.dss_fck);
+   if (dss.dss_sys_clk)
+   clk_put(dss.dss_sys_clk);
+   if (dss.dss_tv_fck)
+   clk_put(dss.dss_tv_fck);
+   if (dss.dss_video_fck)
+   clk_put(dss.dss_video_fck);
 
return r;
 }
 
 static void dss_put_clocks(void)
 {
-   if (dss.dss_96m_fck)
-   clk_put(dss.dss_96m_fck);
-   clk_put(dss.dss_54m_fck);
-   clk_put(dss.dss1_fck);
-   clk_put(dss.dss2_fck);
+   if (dss.dss_video_fck)
+   clk_put(dss.dss_video_fck);
+   clk_put(dss.dss_tv_fck);
+   clk_put(dss.dss_fck);
+   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_ick);
 }
 
@@ -807,13 +807,13 @@ unsigned long dss_clk_get_rate(enum dss_clock clk)
case DSS_CLK_ICK:
return clk_get_rate(dss.dss_ick);
case DSS_CLK_FCK:
-   return clk_get_rate(dss.dss1_fck);
+   return clk_get_rate(dss.dss_fck);
case DSS_CLK_SYSCK:
-   return clk_get_rate(dss.dss2_fck);
+   return clk_get_rate(dss.dss_sys_clk);
case DSS_CLK_TVFCK:
-   return clk_get_rate(dss.dss_54m_fck);
+   return clk_get_rate(dss.dss_tv_fck);
case DSS_CLK_VIDFCK:
-   return clk_get_rate(dss.dss_96m_fck);
+   return clk_get_rate(dss.dss_video_fck);
}
 
BUG();
@@ -845,13 +845,13 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_enable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
-   clk_enable(dss.dss1_fck);
+   clk_enable(dss.dss_fck);
if (clks & DSS_CLK_SYSCK)
-   clk_enable(dss.dss2_fck);
+   clk_enable(dss.dss_sys_clk);
if (clks & DSS_CLK_TVFCK)
-   clk_enable(dss.dss_54m_fck);
+   clk_enable(dss.dss_tv_fck);
if (clks & DSS_CLK_VIDFCK)
-   clk_enable(dss.dss_96m_fck);
+   clk_enable(dss.dss_video_fck);
 
dss.num_clks_enabled += num_clks;
 }
@@ -873,13 +873,13 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_disable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
-   clk_disable(dss.dss1_fck);
+   clk_disable(dss.dss_fck);
 

[PATCH v3 2/4] OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS driver

2011-01-31 Thread Sumit Semwal
From: Archit Taneja 

enum dss_clock structure is replaced with generic names that
could be used across OMAP2420, 2430, 3xxx, 44xx platforms.

Signed-off-by: Sumit Semwal 
Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/core.c|4 +-
 drivers/video/omap2/dss/dispc.c   |   10 +++---
 drivers/video/omap2/dss/dpi.c |   16 +-
 drivers/video/omap2/dss/dsi.c |   18 +-
 drivers/video/omap2/dss/dss.c |   62 ++--
 drivers/video/omap2/dss/dss.h |   10 +++---
 drivers/video/omap2/dss/manager.c |4 +-
 drivers/video/omap2/dss/overlay.c |4 +-
 drivers/video/omap2/dss/rfbi.c|   10 +++---
 drivers/video/omap2/dss/sdi.c |8 ++--
 drivers/video/omap2/dss/venc.c|8 ++--
 11 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 85add9c..3c4ad3a 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -184,7 +184,7 @@ static int omap_dss_probe(struct platform_device *pdev)
}
 
/* keep clocks enabled to prevent context saves/restores during init */
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
r = rfbi_init_platform_driver();
if (r) {
@@ -251,7 +251,7 @@ static int omap_dss_probe(struct platform_device *pdev)
pdata->default_device = dssdev;
}
 
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 
return 0;
 
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 381942d..cc58208 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -551,9 +551,9 @@ void dispc_restore_context(void)
 static inline void enable_clocks(bool enable)
 {
if (enable)
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
else
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 }
 
 bool dispc_go_busy(enum omap_channel channel)
@@ -2311,7 +2311,7 @@ unsigned long dispc_fclk_rate(void)
unsigned long r = 0;
 
if (dss_get_dispc_clk_source() == DSS_SRC_DSS1_ALWON_FCLK)
-   r = dss_clk_get_rate(DSS_CLK_FCK1);
+   r = dss_clk_get_rate(DSS_CLK_FCK);
else
 #ifdef CONFIG_OMAP2_DSS_DSI
r = dsi_get_dsi1_pll_rate();
@@ -2439,7 +2439,7 @@ void dispc_dump_regs(struct seq_file *s)
 {
 #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dispc_read_reg(r))
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
DUMPREG(DISPC_REVISION);
DUMPREG(DISPC_SYSCONFIG);
@@ -2596,7 +2596,7 @@ void dispc_dump_regs(struct seq_file *s)
DUMPREG(DISPC_VID_PRELOAD(0));
DUMPREG(DISPC_VID_PRELOAD(1));
 
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 #undef DUMPREG
 }
 
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 75fb0a5..746f1b6 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -107,7 +107,7 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
bool is_tft;
int r = 0;
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
dssdev->panel.acbi, dssdev->panel.acb);
@@ -137,7 +137,7 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
dispc_set_lcd_timings(dssdev->manager->id, t);
 
 err0:
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
return r;
 }
 
@@ -173,14 +173,14 @@ int omapdss_dpi_display_enable(struct omap_dss_device 
*dssdev)
goto err1;
}
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
r = dpi_basic_init(dssdev);
if (r)
goto err2;
 
 #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dss_clk_enable(DSS_CLK_FCK2);
+   dss_clk_enable(DSS_CLK_SYSCK);
r = dsi_pll_init(dssdev, 0, 1);
if (r)
goto err3;
@@ -199,10 +199,10 @@ err4:
 #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
dsi_pll_uninit();
 err3:
-   dss_clk_disable(DSS_CLK_FCK2);
+   dss_clk_disable(DSS_CLK_SYSCK);
 #endif
 err2:
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
if (cpu_is_omap34xx())
regulator_disable(dpi.vdds_dsi_reg);
 err1:
@@ -219,10 +219,10 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
*dssdev)
 #

[PATCH v3 1/4] OMAP2PLUS: clocks: Align DSS clock names and roles

2011-01-31 Thread Sumit Semwal
Currently, clock database has  tuples for DSS2. Because of
this, the clock names are different across different OMAP platforms.

This patch aligns the DSS2 clock names and roles across OMAP 2420, 2430, 3xxx,
44xx platforms in the clock databases, hwmod databases for opt-clocks, and DSS
clock handling.

This ensures that clk_get/put/enable/disable APIs in DSS can use uniform role
names.

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c   |6 +++---
 arch/arm/mach-omap2/clock2430_data.c   |6 +++---
 arch/arm/mach-omap2/clock3xxx_data.c   |   10 +-
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 drivers/video/omap2/dss/dss.c  |8 
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index d2abc2f..3c1712b 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1787,9 +1787,9 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "fck",  &dss1_fck,  CK_242X),
+   CLK("omap_dss", "sys_clk",  &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_clk",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 663f298..136171c 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1891,9 +1891,9 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "fck",  &dss1_fck,  CK_243X),
+   CLK("omap_dss", "sys_clk",  &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_clk",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 5c97b93..414de70 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,11 +3357,11 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
-   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
-   CLK("omap_dss", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("omap_dss", "video_fck",&dss_96m_fck,   CK_3XXX),
-   CLK("omap_dss", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
+   CLK("omap_dss", "fck",  &dss1_alwon_fck_3430es1, CK_3430ES1),
+   CLK("omap_dss", "fck",  &dss1_alwon_fck_3430es2, CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("omap_dss", "tv_clk",   &dss_tv_fck,CK_3XXX),
+   CLK("omap_dss", "video_clk",&dss_96m_fck,   CK_3XXX),
+   CLK("omap_dss", "sys_clk",  &dss2_alwon_fck, CK_3XXX),
CLK("omap_dss", "ick",  &dss_ick_3430es1,   CK_3430ES1),
CLK("omap_dss", "ick",  &dss_ick_3430es2,   CK_3

[PATCH v3 0/4] OMAP2PLUS: DSS: Generalize clock names

2011-01-31 Thread Sumit Semwal
This patch series changes dss clock names to generic role names for all DSS
clocks across clk APIs, hwmod data, dss driver. 

It also changes the enums used within DSS framework to refer to the clocks
to make them generic and related to functionality than value.
eg. DSS_CLK_TVFCK replaces DSS_CLK_54M,
dss_tv_fck replaces dss_54m_fck

This serves as the base for common hwmod DSS opt-clock roles across all OMAP
platforms, and increases extendability.

In addition, since ick doesn't exist on OMAP4, the last patch adds a dummy clk
for the same in clock44xx_data.c.

===
Note: This is interim change set to enable DSS on OMAP2/3/4 platforms; there is 
an
ongoing design discussion for de-centralizing the DSS clock framework handling
in favour of using pm_runtime APIs directly in each DSS IP.

Once a consensus is reached on that, much of this code will become cleaner, as
each DSS IP block handles its own clocks using the common clocks framework.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init
(This patch is required for OMAP bootup w/ 20110115 linux-next)
+
DSS hwmod patch series: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42914.html
+
hwmod opt-clock change: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg43264.html

Change log:
===
changes since v2:
-
Per comments from Rajendra, removed 'work-around' code for adding opt-clocks
in the clock framework in  format; now the opt-clocks are same
as .
[http://www.mail-archive.com/linux-omap@vger.kernel.org/msg43205.html].

Hwmod patch mentioned above is required for the same.

changes since v1:
-
added dummy clk patch for OMAP4.

--- 

Archit Taneja (2):
  OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS
driver
  OMAP2PLUS: DSS2: Generalize external clock names in struct dss of
dss.c

Sumit Semwal (2):
  OMAP2PLUS: clocks: Align DSS clock names and roles
  OMAP4: DSS2: clocks: Add ick as dummy clock

 arch/arm/mach-omap2/clock2420_data.c   |6 +-
 arch/arm/mach-omap2/clock2430_data.c   |6 +-
 arch/arm/mach-omap2/clock3xxx_data.c   |   10 +-
 arch/arm/mach-omap2/clock44xx_data.c   |   15 ++-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 drivers/video/omap2/dss/core.c |4 +-
 drivers/video/omap2/dss/dispc.c|   10 +-
 drivers/video/omap2/dss/dpi.c  |   16 ++--
 drivers/video/omap2/dss/dsi.c  |   18 ++--
 drivers/video/omap2/dss/dss.c  |  144 ++--
 drivers/video/omap2/dss/dss.h  |   10 +-
 drivers/video/omap2/dss/manager.c  |4 +-
 drivers/video/omap2/dss/overlay.c  |4 +-
 drivers/video/omap2/dss/rfbi.c |   10 +-
 drivers/video/omap2/dss/sdi.c  |8 +-
 drivers/video/omap2/dss/venc.c |8 +-
 16 files changed, 140 insertions(+), 135 deletions(-)

--
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


[PATCH v3 3/3] OMAP4: DSS2: Add hwmod device names for OMAP4.

2011-01-27 Thread Sumit Semwal
From: Mayuresh Janorkar 

Add hwmod device names for OMAP4; this enables device build for omap4 dss
hwmod IPs.

Signed-off-by: Sumit Semwal 
Signed-off-by: Mayuresh Janorkar 
---
 arch/arm/mach-omap2/display.c |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5c0a78b..cc7b4f3 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -53,20 +53,27 @@ int __init omap_display_init(struct omap_dss_board_info
 
/*
 * omap: valid DSS hwmod names
-* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
-* omap3: dss_dsi1
+* omap2,3,4: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3,4: dss_dsi1
+* omap4: dss_dsi2, dss_hdmi
 */
-   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
-   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1",
+   "dss_dsi2", "dss_hdmi"};
+   char *dev_name[] = {"omap_dss", "omap_dispc", "omap_rfbi", "omap_venc", 
"omap_dsi1",
+   "omap_dsi2", "omap_hdmi"};
int oh_count;
 
memset(&pdata, 0, sizeof(pdata));
 
if (cpu_is_omap24xx())
-   oh_count = ARRAY_SIZE(oh_name) - 1;
-   /* last hwmod dev in oh_name is not available for omap2 */
-   else
+   oh_count = ARRAY_SIZE(oh_name) - 3;
+   /* last 3 hwmod dev in oh_name are not available for omap2 */
+   else if (cpu_is_omap44xx())
oh_count = ARRAY_SIZE(oh_name);
+   else
+   oh_count = ARRAY_SIZE(oh_name) - 2;
+   /* last 2 hwmod dev in oh_name are not available for omap3 */
+
 
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
-- 
1.7.1

--
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


[PATCH v3 2/3] OMAP4: hwmod data: add DSS DISPC DSI1,2 RFBI HDMI VENC

2011-01-27 Thread Sumit Semwal
From: Benoit Cousson 

Add dss, dispc, dsi1, dsi2, hdmi, rfbi and venc hwmods.
In OMAP4 there are severals IPs that can be reached by differents
interconnect paths depending of the access initiator (MPU vs. SDMA).
In the case of the DSS, both L3 direct path and L4 CFG path can be
used to access all the DSS IPs. The two ocp_ip already exists to support
the two address spaces.

  ++-- L3_MAIN --+ MPU
  IP  ||
  +-- L4_CFG --+

L3 main address range is specified first, since it is used by default.
dss is also considered as an IP as dispc, rfbi, and named as dss_core.

Signed-off-by: Benoit Cousson 
Signed-off-by: Mayuresh Janorkar 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  603 
 1 files changed, 603 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd..0bd579e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -43,6 +43,13 @@
 static struct omap_hwmod omap44xx_dma_system_hwmod;
 static struct omap_hwmod omap44xx_dmm_hwmod;
 static struct omap_hwmod omap44xx_dsp_hwmod;
+static struct omap_hwmod omap44xx_dss_core_hwmod;
+static struct omap_hwmod omap44xx_dss_dispc_hwmod;
+static struct omap_hwmod omap44xx_dss_dsi1_hwmod;
+static struct omap_hwmod omap44xx_dss_dsi2_hwmod;
+static struct omap_hwmod omap44xx_dss_hdmi_hwmod;
+static struct omap_hwmod omap44xx_dss_rfbi_hwmod;
+static struct omap_hwmod omap44xx_dss_venc_hwmod;
 static struct omap_hwmod omap44xx_emif_fw_hwmod;
 static struct omap_hwmod omap44xx_iva_hwmod;
 static struct omap_hwmod omap44xx_l3_instr_hwmod;
@@ -237,12 +244,21 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = 
{
.user   = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* dss -> l3_main_1 */
+static struct omap_hwmod_ocp_if omap44xx_dss__l3_main_1 = {
+   .master = &omap44xx_dss_core_hwmod,
+   .slave  = &omap44xx_l3_main_1_hwmod,
+   .clk= "l3_div_ck",
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* l3_main_1 slave ports */
 static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
&omap44xx_dsp__l3_main_1,
&omap44xx_l3_main_2__l3_main_1,
&omap44xx_l4_cfg__l3_main_1,
&omap44xx_mpu__l3_main_1,
+   &omap44xx_dss__l3_main_1,
 };
 
 static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
@@ -746,6 +762,584 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*  DSS related classes  */
+ /*
+ * 'dispc' class
+ * display controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_dispc_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
+  SYSC_HAS_ENAWAKEUP | SYSC_HAS_MIDLEMODE |
+  SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
+  SYSS_HAS_RESET_STATUS),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap44xx_dispc_hwmod_class = {
+   .name = "dispc",
+   .sysc = &omap44xx_dispc_sysc,
+};
+
+/* dss_dispc */
+static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = {
+   { .irq = 25 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = {
+   { .dma_req = 5 + OMAP44XX_DMA_REQ_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
+   {
+   .pa_start   = 0x48041000,
+   .pa_end = 0x48041fff,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_per -> dss_dispc */
+static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
+   .master = &omap44xx_l4_per_hwmod,
+   .slave  = &omap44xx_dss_dispc_hwmod,
+   .clk= "l4_div_ck",
+   .addr   = omap44xx_dss_dispc_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_dss_dispc_addrs),
+   .user   = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = {
+   {
+   .pa_start   = 0x58001000,
+   .pa_end = 0x58001fff,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l3_main_2 -> dss_dispc */
+static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = {
+   .master = &omap44xx_l3_main_2_hwmod,
+   .slave  = &omap44xx_dss_dispc_hwmod,
+   .clk= &quo

[PATCH v3 1/3] OMAP2PLUS: DSS2: Add OMAP4 Kconfig support

2011-01-27 Thread Sumit Semwal
From: Mayuresh Janorkar 

Enable DSS2 and OMAPFB for OMAP4 in Kconfig

Signed-off-by: Mayuresh Janorkar 
---
 drivers/video/omap2/dss/Kconfig|6 +++---
 drivers/video/omap2/omapfb/Kconfig |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 43b6440..0d031b2 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,8 +1,8 @@
 menuconfig OMAP2_DSS
-tristate "OMAP2/3 Display Subsystem support (EXPERIMENTAL)"
-depends on ARCH_OMAP2 || ARCH_OMAP3
+   tristate "OMAP2+ Display Subsystem support (EXPERIMENTAL)"
+   depends on ARCH_OMAP2PLUS
 help
-  OMAP2/3 Display Subsystem support.
+   OMAP2+ Display Subsystem support.
 
 if OMAP2_DSS
 
diff --git a/drivers/video/omap2/omapfb/Kconfig 
b/drivers/video/omap2/omapfb/Kconfig
index 65149b2..1da712e 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,5 +1,5 @@
 menuconfig FB_OMAP2
-tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
+tristate "OMAP2+ frame buffer support (EXPERIMENTAL)"
 depends on FB && OMAP2_DSS
 
select OMAP2_VRAM
@@ -8,10 +8,10 @@ menuconfig FB_OMAP2
 select FB_CFB_COPYAREA
 select FB_CFB_IMAGEBLIT
 help
-  Frame buffer driver for OMAP2/3 based boards.
+   Frame buffer driver for OMAP2+ based boards.
 
 config FB_OMAP2_DEBUG_SUPPORT
-   bool "Debug support for OMAP2/3 FB"
+   bool "Debug support for OMAP2+ FB"
default y
depends on FB_OMAP2
help
-- 
1.7.1

--
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


[PATCH v3 0/3] OMAP4: hwmod DSS support

2011-01-27 Thread Sumit Semwal
This patch series enables support for OMAP4 DSS, and adds hwmod support
for dss, dispc, dsi1, dsi2, hdmi, rfbi and venc hwmods.

In OMAP4 there are severals IPs that can be reached by differents
interconnect paths depending of the access initiator (MPU vs. SDMA).

In the case of the DSS, both L3 direct path and L4 CFG path can be
used to access all the DSS IPs.
dss is also considered as an IP as dispc, rfbi, and named as dss_core.

TODO:
This patch doesn't handle the opt clocks via hwmod - there will be a separate
patch series which will take opt clock roles from hwmod, populate them in
the device structure, so that the driver can ask for relevant opt-clocks.

Also TBD is the migration to pm_runtime APIs, which need to be adapted a little
for handling DSS-family of clocks completely.

Changes from v2:

1. Corrected author name in patch 3/3.
2. Added some hwmod data in the database, missed during merge of a couple of 
patches.

Changes from v1:

- dss_dss device is renamed as dss_core as per suggestion from Benoit Cousson.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init
(This patch is required for OMAP bootup w/ 20110115 linux-next)
+
DSS hwmod patch series: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42914.html
+
patch series: OMAP2PLUS: DSS: Generalize clock names
 (http://www.mail-archive.com/linux-omap@vger.kernel.org/msg43058.html)


Benoit Cousson (1):
  OMAP4: hwmod data: add DSS DISPC DSI1,2 RFBI HDMI VENC

Mayuresh Janorkar (2):
  OMAP2PLUS: DSS2: Add OMAP4 Kconfig support
  OMAP4: DSS2: Add hwmod device names for OMAP4.

 arch/arm/mach-omap2/display.c  |   21 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  603 
 drivers/video/omap2/dss/Kconfig|6 +-
 drivers/video/omap2/omapfb/Kconfig |6 +-
 4 files changed, 623 insertions(+), 13 deletions(-)

--
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


[PATCH v2 3/3] OMAP4: DSS2: Add hwmod device names for OMAP4.

2011-01-25 Thread Sumit Semwal
Add hwmod device names for OMAP4; this enables device build for omap4 dss
hwmod IPs.
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5c0a78b..10d699a 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -53,20 +53,27 @@ int __init omap_display_init(struct omap_dss_board_info
 
/*
 * omap: valid DSS hwmod names
-* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
-* omap3: dss_dsi1
+* omap2,3,4: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3,4: dss_dsi1
+* omap4: dss_dsi2, dss_hdmi
 */
-   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
-   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1",
+   "dss_dsi2", "dss_hdmi"};
+   char *dev_name[] = {"omap_dss", "omap_dispc", "omap_rfbi", "omap_venc", 
"omap_dsi1",
+   "omap_dsi2", "omap_hdmi"};
int oh_count;
 
memset(&pdata, 0, sizeof(pdata));
 
if (cpu_is_omap24xx())
-   oh_count = ARRAY_SIZE(oh_name) - 1;
-   /* last hwmod dev in oh_name is not available for omap2 */
-   else
+   oh_count = ARRAY_SIZE(oh_name) - 3;
+   /* last 3 hwmod dev in oh_name are not available for omap2 */
+   else if (cpu_is_omap44xx())
oh_count = ARRAY_SIZE(oh_name);
+   else
+   oh_count = ARRAY_SIZE(oh_name) - 2;
+   /* last 2 hwmod dev in oh_name are not available for omap3 */
+
 
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
-- 
1.7.1

--
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


[PATCH v2 2/3] OMAP4: hwmod data: add DSS DISPC DSI1,2 RFBI HDMI VENC

2011-01-25 Thread Sumit Semwal
From: Benoit Cousson 

Add dss, dispc, dsi1, dsi2, hdmi, rfbi and venc hwmods.
In OMAP4 there are severals IPs that can be reached by differents
interconnect paths depending of the access initiator (MPU vs. SDMA).
In the case of the DSS, both L3 direct path and L4 CFG path can be
used to access all the DSS IPs. The two ocp_ip already exists to support
the two address spaces.

  ++-- L3_MAIN --+ MPU
  IP  ||
  +-- L4_CFG --+

L3 main address range is specified first, since it is used by default.
dss is also considered as an IP as dispc, rfbi, and named as dss_core.

Signed-off-by: Benoit Cousson 
Signed-off-by: Mayuresh Janorkar 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  588 
 1 files changed, 588 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd..7bca77e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -43,6 +43,13 @@
 static struct omap_hwmod omap44xx_dma_system_hwmod;
 static struct omap_hwmod omap44xx_dmm_hwmod;
 static struct omap_hwmod omap44xx_dsp_hwmod;
+static struct omap_hwmod omap44xx_dss_core_hwmod;
+static struct omap_hwmod omap44xx_dss_dispc_hwmod;
+static struct omap_hwmod omap44xx_dss_dsi1_hwmod;
+static struct omap_hwmod omap44xx_dss_dsi2_hwmod;
+static struct omap_hwmod omap44xx_dss_hdmi_hwmod;
+static struct omap_hwmod omap44xx_dss_rfbi_hwmod;
+static struct omap_hwmod omap44xx_dss_venc_hwmod;
 static struct omap_hwmod omap44xx_emif_fw_hwmod;
 static struct omap_hwmod omap44xx_iva_hwmod;
 static struct omap_hwmod omap44xx_l3_instr_hwmod;
@@ -237,12 +244,21 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = 
{
.user   = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* dss -> l3_main_1 */
+static struct omap_hwmod_ocp_if omap44xx_dss__l3_main_1 = {
+   .master = &omap44xx_dss_core_hwmod,
+   .slave  = &omap44xx_l3_main_1_hwmod,
+   .clk= "l3_div_ck",
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* l3_main_1 slave ports */
 static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
&omap44xx_dsp__l3_main_1,
&omap44xx_l3_main_2__l3_main_1,
&omap44xx_l4_cfg__l3_main_1,
&omap44xx_mpu__l3_main_1,
+   &omap44xx_dss__l3_main_1,
 };
 
 static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
@@ -746,6 +762,569 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*  DSS related classes  */
+ /*
+ * 'dispc' class
+ * display controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_dispc_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
+  SYSC_HAS_ENAWAKEUP | SYSC_HAS_MIDLEMODE |
+  SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
+  SYSS_HAS_RESET_STATUS),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap44xx_dispc_hwmod_class = {
+   .name = "dispc",
+   .sysc = &omap44xx_dispc_sysc,
+};
+
+/* dss_dispc */
+static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = {
+   { .irq = 25 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = {
+   { .dma_req = 5 + OMAP44XX_DMA_REQ_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
+   {
+   .pa_start   = 0x48041000,
+   .pa_end = 0x48041fff,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_per -> dss_dispc */
+static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
+   .master = &omap44xx_l4_per_hwmod,
+   .slave  = &omap44xx_dss_dispc_hwmod,
+   .clk= "l4_div_ck",
+   .addr   = omap44xx_dss_dispc_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_dss_dispc_addrs),
+   .user   = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = {
+   {
+   .pa_start   = 0x58001000,
+   .pa_end = 0x58001fff,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l3_main_2 -> dss_dispc */
+static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = {
+   .master = &omap44xx_l3_main_2_hwmod,
+   .slave  = &omap44xx_dss_dispc_hwmod,
+   .clk= &quo

[PATCH v2 1/3] OMAP2PLUS: DSS2: Add OMAP4 Kconfig support

2011-01-25 Thread Sumit Semwal
From: Mayuresh Janorkar 

Enable DSS2 and OMAPFB for OMAP4 in Kconfig

Signed-off-by: Mayuresh Janorkar 
---
 drivers/video/omap2/dss/Kconfig|6 +++---
 drivers/video/omap2/omapfb/Kconfig |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 43b6440..0d031b2 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,8 +1,8 @@
 menuconfig OMAP2_DSS
-tristate "OMAP2/3 Display Subsystem support (EXPERIMENTAL)"
-depends on ARCH_OMAP2 || ARCH_OMAP3
+   tristate "OMAP2+ Display Subsystem support (EXPERIMENTAL)"
+   depends on ARCH_OMAP2PLUS
 help
-  OMAP2/3 Display Subsystem support.
+   OMAP2+ Display Subsystem support.
 
 if OMAP2_DSS
 
diff --git a/drivers/video/omap2/omapfb/Kconfig 
b/drivers/video/omap2/omapfb/Kconfig
index 65149b2..1da712e 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,5 +1,5 @@
 menuconfig FB_OMAP2
-tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
+tristate "OMAP2+ frame buffer support (EXPERIMENTAL)"
 depends on FB && OMAP2_DSS
 
select OMAP2_VRAM
@@ -8,10 +8,10 @@ menuconfig FB_OMAP2
 select FB_CFB_COPYAREA
 select FB_CFB_IMAGEBLIT
 help
-  Frame buffer driver for OMAP2/3 based boards.
+   Frame buffer driver for OMAP2+ based boards.
 
 config FB_OMAP2_DEBUG_SUPPORT
-   bool "Debug support for OMAP2/3 FB"
+   bool "Debug support for OMAP2+ FB"
default y
depends on FB_OMAP2
help
-- 
1.7.1

--
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


[PATCH v2 0/3] OMAP4: hwmod DSS support

2011-01-25 Thread Sumit Semwal
This patch series enables support for OMAP4 DSS, and adds hwmod support
for dss, dispc, dsi1, dsi2, hdmi, rfbi and venc hwmods.

In OMAP4 there are severals IPs that can be reached by differents
interconnect paths depending of the access initiator (MPU vs. SDMA).

In the case of the DSS, both L3 direct path and L4 CFG path can be
used to access all the DSS IPs.
dss is also considered as an IP as dispc, rfbi, and named as dss_core.

TODO:
This patch doesn't handle the opt clocks via hwmod - there will be a separate
patch series which will take opt clock roles from hwmod, populate them in
the device structure, so that the driver can ask for relevant opt-clocks.

Also TBD is the migration to pm_runtime APIs, which need to be adapted a little
for handling DSS-family of clocks completely.

Changes from v1:

- dss_dss device is renamed as dss_core as per suggestion from Benoit Cousson.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init
(This patch is required for OMAP bootup w/ 20110115 linux-next)
+
DSS hwmod patch series: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42914.html
+
patch series: OMAP2PLUS: DSS: Generalize clock names
 (http://www.mail-archive.com/linux-omap@vger.kernel.org/msg43058.html)



Benoit Cousson (1):
  OMAP4: hwmod data: add DSS DISPC DSI1,2 RFBI HDMI VENC

Mayuresh Janorkar (1):
  OMAP2PLUS: DSS2: Add OMAP4 support

Sumit Semwal (1):
  OMAP4: DSS2: Add hwmod device names for OMAP4.

 arch/arm/mach-omap2/display.c  |   21 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  588 
 drivers/video/omap2/dss/Kconfig|6 +-
 drivers/video/omap2/omapfb/Kconfig |6 +-
 4 files changed, 608 insertions(+), 13 deletions(-)

--
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


[PATCH v2 3/4] OMAP2PLUS: DSS2: Generalize external clock names in struct dss of dss.c

2011-01-25 Thread Sumit Semwal
From: Archit Taneja 

The dss struct in dss.c has omap2/3 specific clock names. Making them generic,
to increase readability and extendability.

Signed-off-by: Sumit Semwal 
Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dss.c |   82 
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2873c30..c7cdbea 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -64,10 +64,10 @@ static struct {
 
struct clk  *dpll4_m4_ck;
struct clk  *dss_ick;
-   struct clk  *dss1_fck;
-   struct clk  *dss2_fck;
-   struct clk  *dss_54m_fck;
-   struct clk  *dss_96m_fck;
+   struct clk  *dss_fck;
+   struct clk  *dss_sys_clk;
+   struct clk  *dss_tv_fck;
+   struct clk  *dss_video_fck;
unsignednum_clks_enabled;
 
unsigned long   cache_req_pck;
@@ -749,28 +749,28 @@ static int dss_get_clocks(void)
int r;
 
dss.dss_ick = NULL;
-   dss.dss1_fck = NULL;
-   dss.dss2_fck = NULL;
-   dss.dss_54m_fck = NULL;
-   dss.dss_96m_fck = NULL;
+   dss.dss_fck = NULL;
+   dss.dss_sys_clk = NULL;
+   dss.dss_tv_fck = NULL;
+   dss.dss_video_fck = NULL;
 
r = dss_get_clock(&dss.dss_ick, "ick");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss1_fck, "fck");
+   r = dss_get_clock(&dss.dss_fck, "fck");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss2_fck, "sys_clk");
+   r = dss_get_clock(&dss.dss_sys_clk, "sys_clk");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_54m_fck, "tv_clk");
+   r = dss_get_clock(&dss.dss_tv_fck, "tv_clk");
if (r)
goto err;
 
-   r = dss_get_clock(&dss.dss_96m_fck, "video_clk");
+   r = dss_get_clock(&dss.dss_video_fck, "video_clk");
if (r)
goto err;
 
@@ -779,25 +779,25 @@ static int dss_get_clocks(void)
 err:
if (dss.dss_ick)
clk_put(dss.dss_ick);
-   if (dss.dss1_fck)
-   clk_put(dss.dss1_fck);
-   if (dss.dss2_fck)
-   clk_put(dss.dss2_fck);
-   if (dss.dss_54m_fck)
-   clk_put(dss.dss_54m_fck);
-   if (dss.dss_96m_fck)
-   clk_put(dss.dss_96m_fck);
+   if (dss.dss_fck)
+   clk_put(dss.dss_fck);
+   if (dss.dss_sys_clk)
+   clk_put(dss.dss_sys_clk);
+   if (dss.dss_tv_fck)
+   clk_put(dss.dss_tv_fck);
+   if (dss.dss_video_fck)
+   clk_put(dss.dss_video_fck);
 
return r;
 }
 
 static void dss_put_clocks(void)
 {
-   if (dss.dss_96m_fck)
-   clk_put(dss.dss_96m_fck);
-   clk_put(dss.dss_54m_fck);
-   clk_put(dss.dss1_fck);
-   clk_put(dss.dss2_fck);
+   if (dss.dss_video_fck)
+   clk_put(dss.dss_video_fck);
+   clk_put(dss.dss_tv_fck);
+   clk_put(dss.dss_fck);
+   clk_put(dss.dss_sys_clk);
clk_put(dss.dss_ick);
 }
 
@@ -807,13 +807,13 @@ unsigned long dss_clk_get_rate(enum dss_clock clk)
case DSS_CLK_ICK:
return clk_get_rate(dss.dss_ick);
case DSS_CLK_FCK:
-   return clk_get_rate(dss.dss1_fck);
+   return clk_get_rate(dss.dss_fck);
case DSS_CLK_SYSCK:
-   return clk_get_rate(dss.dss2_fck);
+   return clk_get_rate(dss.dss_sys_clk);
case DSS_CLK_TVFCK:
-   return clk_get_rate(dss.dss_54m_fck);
+   return clk_get_rate(dss.dss_tv_fck);
case DSS_CLK_VIDFCK:
-   return clk_get_rate(dss.dss_96m_fck);
+   return clk_get_rate(dss.dss_video_fck);
}
 
BUG();
@@ -845,13 +845,13 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_enable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
-   clk_enable(dss.dss1_fck);
+   clk_enable(dss.dss_fck);
if (clks & DSS_CLK_SYSCK)
-   clk_enable(dss.dss2_fck);
+   clk_enable(dss.dss_sys_clk);
if (clks & DSS_CLK_TVFCK)
-   clk_enable(dss.dss_54m_fck);
+   clk_enable(dss.dss_tv_fck);
if (clks & DSS_CLK_VIDFCK)
-   clk_enable(dss.dss_96m_fck);
+   clk_enable(dss.dss_video_fck);
 
dss.num_clks_enabled += num_clks;
 }
@@ -873,13 +873,13 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_disable(dss.dss_ick);
if (clks & DSS_CLK_FCK)
-   clk_disable(dss.dss1_fck);
+   clk_disable(dss.dss_fck);
 

[PATCH v2 4/4] OMAP4: DSS2: clocks: Add ick as dummy clock

2011-01-25 Thread Sumit Semwal
DSS code uses ick as one of the clocks in clk_get/clk_put. OMAP4 clock database
doesn't have ick for DSS, so adding ick as dummy clock.

Once pm_runtime* APIs get introduced in DSS, this will be revisited.

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock44xx_data.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 74db324..8603b1f 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3109,6 +3109,8 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL,   "dsp_fck",  &dsp_fck,   
CK_443X),
/* dss clocks */
CLK(NULL,   "fck",  &dss_fck,   
CK_443X),
+   CLK("omap_dss", "ick",  &dummy_ck,  
CK_443X),
+   /* on OMAP4, ick is a dummy clock */
/*
 * clocks handled via hwmod opt_clk mechanism need dev=NULL,
 * con=clock name as per actual clk structure, NOT role
-- 
1.7.1

--
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


[PATCH v2 1/4] OMAP2PLUS: opt-clocks: align dss clock roles and names

2011-01-25 Thread Sumit Semwal
opt clocks require (NULL, act-clock-name) as entries in clock database,
so that hwmod can replace it with (dev, role) tuple during hwmod data init.

These role names are aligned to be same across OMAP2420, 2430, 3xxx, 44xx
platforms, and also with dss clk handling code, so clk_get/put/enable/disable
APIs in dss can use uniform role names.

Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c   |   10 +++---
 arch/arm/mach-omap2/clock2430_data.c   |   10 +++---
 arch/arm/mach-omap2/clock3xxx_data.c   |   22 +++---
 arch/arm/mach-omap2/clock44xx_data.c   |7 ++-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 drivers/video/omap2/dss/dss.c  |8 
 6 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index d2abc2f..72a1872 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1787,9 +1787,13 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "fck",  &dss1_fck,  CK_242X),
+   /*
+* clocks handled via hwmod opt_clk mechanism need dev=NULL,
+* con=clock name as per actual clk structure, NOT role
+*/
+   CLK(NULL,   "dss2_fck", &dss2_fck,  CK_242X),
+   CLK(NULL,   "dss_54m_fck",  &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 663f298..b99f881 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1891,9 +1891,13 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "fck",  &dss1_fck,  CK_243X),
+   /*
+* clocks handled via hwmod opt_clk mechanism need dev=NULL,
+* con=clock name as per actual clk structure, NOT role
+*/
+   CLK(NULL,   "dss2_fck", &dss2_fck,  CK_243X),
+   CLK(NULL,   "dss_54m_fck",  &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 5c97b93..c32df5d 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,13 +3357,21 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
-   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
-   CLK("omap_dss", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("omap_dss", "video_fck",&dss_96m_fck,   CK_3XXX),
-   CLK("omap_dss", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
-   CLK("omap_dss", "ick",  &dss_ick_3430es1,   CK_3430ES1),
-   CLK("omap_dss", "ick",  &dss_ick_3430es2,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   /* DSS clocks */
+   CLK("omap_dss", "fck",  &dss1_alwon_fck_3430es1, CK_3430ES1),
+   CLK("omap_dss", "fck",  &dss1_alwon_fck_343

[PATCH v2 2/4] OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS driver

2011-01-25 Thread Sumit Semwal
From: Archit Taneja 

enum dss_clock structure is replaced with generic names that
could be used across OMAP2420, 2430, 3xxx, 44xx platforms.

Signed-off-by: Sumit Semwal 
Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/core.c|4 +-
 drivers/video/omap2/dss/dispc.c   |   10 +++---
 drivers/video/omap2/dss/dpi.c |   16 +-
 drivers/video/omap2/dss/dsi.c |   18 +-
 drivers/video/omap2/dss/dss.c |   62 ++--
 drivers/video/omap2/dss/dss.h |   10 +++---
 drivers/video/omap2/dss/manager.c |4 +-
 drivers/video/omap2/dss/overlay.c |4 +-
 drivers/video/omap2/dss/rfbi.c|   10 +++---
 drivers/video/omap2/dss/sdi.c |8 ++--
 drivers/video/omap2/dss/venc.c|8 ++--
 11 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 85add9c..3c4ad3a 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -184,7 +184,7 @@ static int omap_dss_probe(struct platform_device *pdev)
}
 
/* keep clocks enabled to prevent context saves/restores during init */
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
r = rfbi_init_platform_driver();
if (r) {
@@ -251,7 +251,7 @@ static int omap_dss_probe(struct platform_device *pdev)
pdata->default_device = dssdev;
}
 
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 
return 0;
 
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 381942d..cc58208 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -551,9 +551,9 @@ void dispc_restore_context(void)
 static inline void enable_clocks(bool enable)
 {
if (enable)
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
else
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 }
 
 bool dispc_go_busy(enum omap_channel channel)
@@ -2311,7 +2311,7 @@ unsigned long dispc_fclk_rate(void)
unsigned long r = 0;
 
if (dss_get_dispc_clk_source() == DSS_SRC_DSS1_ALWON_FCLK)
-   r = dss_clk_get_rate(DSS_CLK_FCK1);
+   r = dss_clk_get_rate(DSS_CLK_FCK);
else
 #ifdef CONFIG_OMAP2_DSS_DSI
r = dsi_get_dsi1_pll_rate();
@@ -2439,7 +2439,7 @@ void dispc_dump_regs(struct seq_file *s)
 {
 #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dispc_read_reg(r))
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
DUMPREG(DISPC_REVISION);
DUMPREG(DISPC_SYSCONFIG);
@@ -2596,7 +2596,7 @@ void dispc_dump_regs(struct seq_file *s)
DUMPREG(DISPC_VID_PRELOAD(0));
DUMPREG(DISPC_VID_PRELOAD(1));
 
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 #undef DUMPREG
 }
 
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 75fb0a5..746f1b6 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -107,7 +107,7 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
bool is_tft;
int r = 0;
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
dssdev->panel.acbi, dssdev->panel.acb);
@@ -137,7 +137,7 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
dispc_set_lcd_timings(dssdev->manager->id, t);
 
 err0:
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
return r;
 }
 
@@ -173,14 +173,14 @@ int omapdss_dpi_display_enable(struct omap_dss_device 
*dssdev)
goto err1;
}
 
-   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
r = dpi_basic_init(dssdev);
if (r)
goto err2;
 
 #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dss_clk_enable(DSS_CLK_FCK2);
+   dss_clk_enable(DSS_CLK_SYSCK);
r = dsi_pll_init(dssdev, 0, 1);
if (r)
goto err3;
@@ -199,10 +199,10 @@ err4:
 #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
dsi_pll_uninit();
 err3:
-   dss_clk_disable(DSS_CLK_FCK2);
+   dss_clk_disable(DSS_CLK_SYSCK);
 #endif
 err2:
-   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
if (cpu_is_omap34xx())
regulator_disable(dpi.vdds_dsi_reg);
 err1:
@@ -219,10 +219,10 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
*dssdev)
 #

[PATCH v2 0/4] OMAP2PLUS: DSS: Generalize clock names

2011-01-25 Thread Sumit Semwal
This patch series changes dss clock names to generic role names for all DSS
clocks across clk APIs, hwmod data, dss driver. 

It also changes the enums used within DSS framework to refer to the clocks
to make them generic and related to functionality than value.
eg. DSS_CLK_TVFCK replaces DSS_CLK_54M,
dss_tv_fck replaces dss_54m_fck

This serves as the base for common hwmod DSS opt-clock roles across all OMAP
platforms, and increases extendability.

In addition, since ick doesn't exist on OMAP4, the last patch adds a dummy clk
for the same in clock44xx_data.c.

===
Note: This is interim change set to enable DSS on OMAP2/3/4 platforms; there is 
an
ongoing design discussion for de-centralizing the DSS clock framework handling
in favour of using pm_runtime APIs directly in each DSS IP.

Once a consensus is reached on that, much of this code will become cleaner, as
each DSS IP block handles its own clocks using the common clocks framework.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init
(This patch is required for OMAP bootup w/ 20110115 linux-next)
+
DSS hwmod patch series: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42914.html

changes since v1:
added dummy clk patch for OMAP4.
--- 

Archit Taneja (2):
  OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS
driver
  OMAP2PLUS: DSS2: Generalize external clock names in struct dss of
    dss.c

Sumit Semwal (2):
  OMAP2PLUS: opt-clocks: align dss clock roles and names
  OMAP4: DSS2: clocks: Add ick as dummy clock

 arch/arm/mach-omap2/clock2420_data.c   |   10 ++-
 arch/arm/mach-omap2/clock2430_data.c   |   10 ++-
 arch/arm/mach-omap2/clock3xxx_data.c   |   22 +++--
 arch/arm/mach-omap2/clock44xx_data.c   |9 ++-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 drivers/video/omap2/dss/core.c |4 +-
 drivers/video/omap2/dss/dispc.c|   10 +-
 drivers/video/omap2/dss/dpi.c  |   16 ++--
 drivers/video/omap2/dss/dsi.c  |   18 ++--
 drivers/video/omap2/dss/dss.c  |  144 ++--
 drivers/video/omap2/dss/dss.h  |   10 +-
 drivers/video/omap2/dss/manager.c  |4 +-
 drivers/video/omap2/dss/overlay.c  |4 +-
 drivers/video/omap2/dss/rfbi.c |   10 +-
 drivers/video/omap2/dss/sdi.c  |8 +-
 drivers/video/omap2/dss/venc.c |8 +-
 16 files changed, 156 insertions(+), 133 deletions(-)

--
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


[PATCH v10 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from 
platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Reviewed-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dispc.c |   11 ---
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |   11 ---
 drivers/video/omap2/dss/rfbi.c  |   10 +++---
 drivers/video/omap2/dss/venc.c  |   11 ---
 5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1c22cf0..381942d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
 #include "dss_features.h"
 
 /* DISPC */
-#define DISPC_BASE 0x48050400
-
 #define DISPC_SZ_REGS  SZ_4K
 
 struct dispc_reg { u16 idx; };
@@ -3324,6 +3322,8 @@ int dispc_setup_plane(enum omap_plane plane,
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
u32 rev;
+   struct resource *dispc_mem;
+
dispc.pdev = pdev;
 
spin_lock_init(&dispc.irq_lock);
@@ -3335,7 +3335,12 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
 
INIT_WORK(&dispc.error_work, dispc_error_worker);
 
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+   if (!dispc_mem) {
+   DSSERR("can't get IORESOURCE_MEM DISPC\n");
+   return -EINVAL;
+   }
+   dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 39a1c04..cab08cb 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,8 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE   0x4804FC00
-
 struct dsi_reg { u16 idx; };
 
 #define DSI_REG(idx)   ((const struct dsi_reg) { idx })
@@ -3257,6 +3255,7 @@ static int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
+   struct resource *dsi_mem;
 
spin_lock_init(&dsi.errors_lock);
dsi.errors = 0;
@@ -3283,7 +3282,13 @@ static int dsi_init(struct platform_device *pdev)
dsi.te_timer.function = dsi_te_timeout;
dsi.te_timer.data = 0;
 #endif
-   dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+   dsi_mem = platform_get_resource(dsi.pdev, IORESOURCE_MEM, 0);
+   if (!dsi_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSI\n");
+   r = -EINVAL;
+   goto err0;
+   }
+   dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi.base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
@@ -3310,6 +3315,7 @@ err2:
iounmap(dsi.base);
 err1:
destroy_workqueue(dsi.workqueue);
+err0:
return r;
 }
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 8b7972e..4d7a816 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -34,8 +34,6 @@
 #include 
 #include "dss.h"
 
-#define DSS_BASE   0x4805
-
 #define DSS_SZ_REGSSZ_512
 
 struct dss_reg {
@@ -567,8 +565,15 @@ static int dss_init(bool skip_init)
 {
int r;
u32 rev;
+   struct resource *dss_mem;
 
-   dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
+   dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
+   if (!dss_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSS\n");
+   r = -EINVAL;
+   goto fail0;
+   }
+   dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 93b13c5..fc665a7 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,8 +36,6 @@
 #include 
 #include "dss.h"
 
-#define RFBI_BASE   0x48050800
-
 struct rfbi_reg { u16 idx; };
 
 #define RFBI_REG(idx)  ((const struct rfbi_reg) { idx })
@@ -1019,6 +1017,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
u32 rev;
u32 l;
+   struct resource *rfbi_mem;
 
rfbi.pdev = pdev;
 
@@ -1028,7 +1027,12 @@ static int omap_rfbihw_probe(struct platform_device 
*pdev)
atomic_set(&rfbi.cmd_fifo_full, 0

[PATCH v10 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

Reviewed-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 4d7a816..f9390b4 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -563,7 +563,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 static int dss_init(bool skip_init)
 {
-   int r;
+   int r, dss_irq;
u32 rev;
struct resource *dss_mem;
 
@@ -609,11 +609,18 @@ static int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
-   cpu_is_omap24xx()
-   ? dss_irq_handler_omap2
-   : dss_irq_handler_omap3,
-   0, "OMAP DSS", NULL);
+   dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss_irq < 0) {
+   DSSERR("omap2 dss: platform_get_irq failed\n");
+   r = -ENODEV;
+   goto fail1;
+   }
+
+   r = request_irq(dss_irq,
+   cpu_is_omap24xx()
+   ? dss_irq_handler_omap2
+   : dss_irq_handler_omap3,
+   0, "OMAP DSS", NULL);
 
if (r < 0) {
DSSERR("omap2 dss: request_irq failed\n");
@@ -641,7 +648,7 @@ static int dss_init(bool skip_init)
return 0;
 
 fail2:
-   free_irq(INT_24XX_DSS_IRQ, NULL);
+   free_irq(dss_irq, NULL);
 fail1:
iounmap(dss.base);
 fail0:
-- 
1.7.1

--
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


[PATCH v10 15/18] OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator 
is
needed by dpi_init() too. Board files are updated accordingly to add 2 
instances of
vdds_dsi regulator.

DSI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |1 +
 arch/arm/mach-omap2/board-devkit8000.c   |   10 ++--
 arch/arm/mach-omap2/board-igep0020.c |   10 ++--
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 ++--
 arch/arm/mach-omap2/board-omap3evm.c |   10 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |1 +
 arch/arm/mach-omap2/board-omap3stalker.c |   10 ++--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   10 ++--
 drivers/video/omap2/dss/core.c   |8 ++--
 drivers/video/omap2/dss/dsi.c|   64 -
 drivers/video/omap2/dss/dss.h|8 ++--
 11 files changed, 107 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e0d13ae..33ff4f6 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -533,6 +533,7 @@ static struct regulator_init_data sdp3430_vdac = {
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 331b94e..6cdedd9 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -273,8 +273,10 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
.setup  = devkit8000_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
@@ -315,8 +317,8 @@ static struct regulator_init_data devkit8000_vpll1 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &devkit8000_vpll1_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll1_supplies),
+   .consumer_supplies  = devkit8000_vpll1_supplies,
 };
 
 /* VAUX4 for ads7846 and nubs */
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index d79dcd5..dfbe3a1 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -485,8 +485,10 @@ static struct omap_dss_board_info igep2_dss_data = {
.default_device = &igep2_dvi_device,
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
@@ -499,8 +501,8 @@ static struct regulator_init_data igep2_vpll2 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &igep2_vpll2_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(igep2_vpll2_supplies),
+   .consumer_supplies  = igep2_vpll2_supplies,
 };
 
 static void __init igep2_display_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 4dd1475..caf6c8a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -231,8 +231,10 @@ static struct omap_dss_board_info beagle_dss_data = {
 static struct regulator_consumer_supply beagle_vdac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_

[PATCH v10 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init

2011-01-23 Thread Sumit Semwal
This patch replaces printk's in the init/probe functions to dev_dbg
for boot time optimization.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dispc.c |2 +-
 drivers/video/omap2/dss/dsi.c   |2 +-
 drivers/video/omap2/dss/rfbi.c  |2 +-
 drivers/video/omap2/dss/venc.c  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index abfed47..1c22cf0 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3350,7 +3350,7 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
dispc_save_context();
 
rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DISPC rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d854137..39a1c04 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3300,7 +3300,7 @@ static int dsi_init(struct platform_device *pdev)
enable_clocks(1);
 
rev = dsi_read_reg(DSI_REVISION);
-   printk(KERN_INFO "OMAP DSI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DSI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index a64e119..93b13c5 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1046,7 +1046,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_write_reg(RFBI_SYSCONFIG, l);
 
rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
rfbi_enable_clocks(0);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 935ae8e..3db9061 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -739,7 +739,7 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_enable_clocks(1);
 
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
-   printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
+   dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
 
venc_enable_clocks(0);
 
-- 
1.7.1

--
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


[PATCH v10 14/18] OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |2 +-
 arch/arm/mach-omap2/board-omap3evm.c |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +-
 drivers/video/omap2/dss/core.c   |   28 +--
 drivers/video/omap2/dss/dss.h|9 +-
 drivers/video/omap2/dss/venc.c   |  116 +-
 12 files changed, 93 insertions(+), 78 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d00f356..e0d13ae 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 1c36ec8..2e9265e 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -488,7 +488,7 @@ static struct regulator_consumer_supply cm_t35_vsim_supply 
= {
 };
 
 static struct regulator_consumer_supply cm_t35_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply cm_t35_vdvi_supply =
REGULATOR_SUPPLY("vdvi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 6a2eb49..331b94e 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index c0a5066..4dd1475 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -229,7 +229,7 @@ static struct omap_dss_board_info beagle_dss_data = {
 };
 
 static struct regulator_consumer_supply beagle_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply beagle_vdvi_supply =
REGULATOR_SUPPLY("vdds_dsi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 5f156fe..ec45575 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -493,7 +493,7 @@ static struct twl4030_codec_data omap3evm_codec_data = {
 };
 
 static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c 
b/arch/arm/mach-omap2/board-omap3pandora.c
index 613ab58..b44e604 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -342,7 +342,7 @@ static struct regulator_consumer_supply 
pandora_vmmc3_supply =
REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2");
 
 static struct regulator_consumer_supply pandora_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply pandora_vdds_supplies[] = {
R

[PATCH v10 11/18] OMAP2,3: DSS2: Move clocks from core driver to dss driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

All clock management is moved to dss platform driver. clk_get/put APIs use
dss device instead of core platform device.

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So the device name is changed from omap_display to omap_dss in 2420, 2430,
3xxx clock database files. Now the core driver "omap_display" only takes care
of panel registration with the custom bus.
core driver also uses the clk_enable() / clk_disable() APIs exposed by DSS for
clock management.
DSS driver would do clock management of clocks needed by DISPC, RFBI, DSI, VENC

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Acked-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 drivers/video/omap2/dss/core.c   |  343 +-
 drivers/video/omap2/dss/dss.c|  334 +-
 drivers/video/omap2/dss/dss.h|   13 +-
 6 files changed, 360 insertions(+), 360 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index b412958..d2abc2f 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_2d_fck",   &gfx_2d_fck,CK_242X),
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 039155e..663f298 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_ick",  &mdm_ick,   CK_243X),
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 8618262..5c97b93 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,13 +3357,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es1, 
CK_3430ES1),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es2, 
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-   CLK("omap_display", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("

[PATCH v10 12/18] OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for RFBI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

RFBI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |8 ++--
 drivers/video/omap2/dss/dss.h  |8 ++--
 drivers/video/omap2/dss/rfbi.c |  110 
 3 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bdb952f..d4b3da3 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -201,9 +201,9 @@ static int omap_dss_probe(struct platform_device *pdev)
/* keep clocks enabled to prevent context saves/restores during init */
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
 
-   r = rfbi_init();
+   r = rfbi_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize rfbi\n");
+   DSSERR("Failed to initialize rfbi platform driver\n");
goto err_rfbi;
}
 
@@ -285,7 +285,7 @@ err_venc:
 err_dispc:
dpi_exit();
 err_dpi:
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
 err_rfbi:
dss_uninit_platform_driver();
 err_dss:
@@ -303,7 +303,7 @@ static int omap_dss_remove(struct platform_device *pdev)
venc_exit();
dispc_exit();
dpi_exit();
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
dsi_exit();
sdi_exit();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index c535ee1..0ba4bdb 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -428,8 +428,8 @@ static inline void venc_exit(void)
 
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
-int rfbi_init(void);
-void rfbi_exit(void);
+int rfbi_init_platform_driver(void);
+void rfbi_uninit_platform_driver(void);
 void rfbi_dump_regs(struct seq_file *s);
 
 int rfbi_configure(int rfbi_module, int bpp, int lines);
@@ -440,11 +440,11 @@ void rfbi_set_timings(int rfbi_module, struct 
rfbi_timings *t);
 unsigned long rfbi_get_max_tx_rate(void);
 int rfbi_init_display(struct omap_dss_device *display);
 #else
-static inline int rfbi_init(void)
+static inline int rfbi_init_platform_driver(void)
 {
return 0;
 }
-static inline void rfbi_exit(void)
+static inline void rfbi_uninit_platform_driver(void)
 {
 }
 #endif
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 10a2ffe..a64e119 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -100,6 +100,7 @@ static int rfbi_convert_timings(struct rfbi_timings *t);
 static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
unsigned long   l4_khz;
@@ -957,50 +958,6 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
-{
-   u32 rev;
-   u32 l;
-
-   spin_lock_init(&rfbi.cmd_lock);
-
-   init_completion(&rfbi.cmd_done);
-   atomic_set(&rfbi.cmd_fifo_full, 0);
-   atomic_set(&rfbi.cmd_pending, 0);
-
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
-   if (!rfbi.base) {
-   DSSERR("can't ioremap RFBI\n");
-   return -ENOMEM;
-   }
-
-   rfbi_enable_clocks(1);
-
-   msleep(10);
-
-   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
-
-   /* Enable autoidle and smart-idle */
-   l = rfbi_read_reg(RFBI_SYSCONFIG);
-   l |= (1 << 0) | (2 << 3);
-   rfbi_write_reg(RFBI_SYSCONFIG, l);
-
-   rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   rfbi_enable_clocks(0);
-
-   return 0;
-}
-
-void rfbi_exit(void)
-{
-   DSSDBG("rfbi_exit\n");
-
-   iounmap(rfbi.base);
-}
-
 int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 {
int r;
@@ -1056,3 +1013,68 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
return 0;
 }
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   u32 l;
+
+   rfbi.pdev = pdev;
+
+   spin_lock_init(&rfbi.cmd_lock);
+
+   init_completion(&rfbi.cmd_done);
+   atomic_set(&rfbi.cmd_fifo_full, 0);
+   atomic_set(&rfbi.cmd_pending, 0);
+
+   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+ 

[PATCH v10 13/18] OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DISPC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DISPC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c  |8 ++--
 drivers/video/omap2/dss/dispc.c |  105 ---
 drivers/video/omap2/dss/dss.h   |4 +-
 3 files changed, 70 insertions(+), 47 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d4b3da3..5acb5e6 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -213,9 +213,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = dispc_init();
+   r = dispc_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize dispc\n");
+   DSSERR("Failed to initialize dispc platform driver\n");
goto err_dispc;
}
 
@@ -281,7 +281,7 @@ err_dsi:
 err_sdi:
venc_exit();
 err_venc:
-   dispc_exit();
+   dispc_uninit_platform_driver();
 err_dispc:
dpi_exit();
 err_dpi:
@@ -301,7 +301,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs();
 
venc_exit();
-   dispc_exit();
+   dispc_uninit_platform_driver();
dpi_exit();
rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9f8c69f..abfed47 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -178,6 +178,7 @@ struct dispc_irq_stats {
 };
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
u32 fifo_size[3];
@@ -3269,47 +3270,6 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
-{
-   u32 rev;
-
-   spin_lock_init(&dispc.irq_lock);
-
-#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
-   spin_lock_init(&dispc.irq_stats_lock);
-   dispc.irq_stats.last_reset = jiffies;
-#endif
-
-   INIT_WORK(&dispc.error_work, dispc_error_worker);
-
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
-   if (!dispc.base) {
-   DSSERR("can't ioremap DISPC\n");
-   return -ENOMEM;
-   }
-
-   enable_clocks(1);
-
-   _omap_dispc_initial_config();
-
-   _omap_dispc_initialize_irq();
-
-   dispc_save_context();
-
-   rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   enable_clocks(0);
-
-   return 0;
-}
-
-void dispc_exit(void)
-{
-   iounmap(dispc.base);
-}
-
 int dispc_enable_plane(enum omap_plane plane, bool enable)
 {
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -3359,3 +3319,66 @@ int dispc_setup_plane(enum omap_plane plane,
 
return r;
 }
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   dispc.pdev = pdev;
+
+   spin_lock_init(&dispc.irq_lock);
+
+#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
+   spin_lock_init(&dispc.irq_stats_lock);
+   dispc.irq_stats.last_reset = jiffies;
+#endif
+
+   INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   if (!dispc.base) {
+   DSSERR("can't ioremap DISPC\n");
+   return -ENOMEM;
+   }
+
+   enable_clocks(1);
+
+   _omap_dispc_initial_config();
+
+   _omap_dispc_initialize_irq();
+
+   dispc_save_context();
+
+   rev = dispc_read_reg(DISPC_REVISION);
+   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   enable_clocks(0);
+
+   return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+   iounmap(dispc.base);
+   return 0;
+}
+
+static struct platform_driver omap_dispchw_driver = {
+   .probe  = omap_dispchw_probe,
+   .remove = omap_dispchw_remove,
+   .driver = {
+   .name   = "omap_dispc",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dispc_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dispchw_driver);
+}
+
+void dispc_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dispchw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/v

[PATCH v10 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Looks up the hwmod database for each of the given DSS HW IP and builds
omap_device which inturn does the platform device register for each of DSS HW IP

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   50 +
 arch/arm/plat-omap/include/plat/display.h |5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 6e21cb8..5c0a78b 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 static struct platform_device omap_display_device = {
.name  = "omap_display",
@@ -32,10 +34,58 @@ static struct platform_device omap_display_device = {
},
 };
 
+static struct omap_device_pm_latency omap_dss_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   .flags  = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
 int __init omap_display_init(struct omap_dss_board_info
*board_data)
 {
int r = 0;
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   int i;
+   struct omap_display_platform_data pdata;
+
+   /*
+* omap: valid DSS hwmod names
+* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3: dss_dsi1
+*/
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
+   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   int oh_count;
+
+   memset(&pdata, 0, sizeof(pdata));
+
+   if (cpu_is_omap24xx())
+   oh_count = ARRAY_SIZE(oh_name) - 1;
+   /* last hwmod dev in oh_name is not available for omap2 */
+   else
+   oh_count = ARRAY_SIZE(oh_name);
+
+   pdata.board_data = board_data;
+   pdata.board_data->get_last_off_on_transaction_id = NULL;
+
+   for (i = 0; i < oh_count; i++) {
+   oh = omap_hwmod_lookup(oh_name[i]);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name[i]);
+   return -ENODEV;
+   }
+   od = omap_device_build(dev_name[i], -1, oh, &pdata,
+   sizeof(struct omap_display_platform_data),
+   omap_dss_latency,
+   ARRAY_SIZE(omap_dss_latency), 0);
+
+   if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+   oh_name[i]))
+   return -ENODEV;
+   }
omap_display_device.dev.platform_data = board_data;
 
r = platform_device_register(&omap_display_device);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 0f140ec..2fb057e 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -237,6 +237,11 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 }
 #endif
 
+struct omap_display_platform_data {
+   struct omap_dss_board_info *board_data;
+   /* TODO: Additional members to be added when PM is considered */
+};
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v10 10/18] OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver of DSS is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DSS platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   19 ++---
 drivers/video/omap2/dss/dss.c  |   55 ++-
 drivers/video/omap2/dss/dss.h  |4 +-
 3 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 1bbc004..1aace9e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -517,15 +517,9 @@ static int omap_dss_probe(struct platform_device *pdev)
core.ctx_id = dss_get_ctx_id();
DSSDBG("initial ctx id %u\n", core.ctx_id);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-   /* DISPC_CONTROL */
-   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-   skip_init = 1;
-#endif
-
-   r = dss_init(skip_init);
+   r = dss_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize DSS\n");
+   DSSERR("Failed to initialize DSS platform driver\n");
goto err_dss;
}
 
@@ -553,6 +547,11 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_venc;
}
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
if (cpu_is_omap34xx()) {
r = sdi_init(skip_init);
if (r) {
@@ -610,7 +609,7 @@ err_dispc:
 err_dpi:
rfbi_exit();
 err_rfbi:
-   dss_exit();
+   dss_uninit_platform_driver();
 err_dss:
dss_clk_disable_all_no_ctx();
dss_put_clocks();
@@ -635,7 +634,7 @@ static int omap_dss_remove(struct platform_device *pdev)
sdi_exit();
}
 
-   dss_exit();
+   dss_uninit_platform_driver();
 
/*
 * As part of hwmod changes, DSS is not the only controller of dss
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 77c3621..d130f04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -59,6 +59,7 @@ struct dss_reg {
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
struct clk  *dpll4_m4_ck;
@@ -549,7 +550,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
 }
 
-int dss_init(bool skip_init)
+static int dss_init(bool skip_init)
 {
int r;
u32 rev;
@@ -629,7 +630,7 @@ fail0:
return r;
 }
 
-void dss_exit(void)
+static void dss_exit(void)
 {
if (cpu_is_omap34xx())
clk_put(dss.dpll4_m4_ck);
@@ -639,3 +640,53 @@ void dss_exit(void)
iounmap(dss.base);
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+   int r;
+   int skip_init = 0;
+
+   dss.pdev = pdev;
+
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
+
+   r = dss_init(skip_init);
+   if (r) {
+   DSSERR("Failed to initialize DSS\n");
+   goto err_dss;
+   }
+
+err_dss:
+
+   return r;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+   dss_exit();
+
+   return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+   .probe  = omap_dsshw_probe,
+   .remove = omap_dsshw_remove,
+   .driver = {
+   .name   = "omap_dss",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dss_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dsshw_driver);
+}
+
+void dss_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dsshw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b394951..37c4544 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -214,8 +214,8 @@ void dss_overlay_setup_l4_manager(struct 
omap_overlay_manager *mgr);
 void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
 
 /* DSS */
-int dss_init(bool skip_init);
-void dss_exit(void);
+int dss_init_platform_driver(void);
+void dss_uninit_platform_driver(void);
 
 void dss_save_context(void);
 void dss_restore_context(void);
-- 
1.7.1

--
To unsubscribe f

[PATCH v10 08/18] OMAP2,3: DSS2: board files: replace platform_device_register with omap_display_init()

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

This patch updated board files to replace platform_device_register or
platform_add_devices of DSS with omap_display_init(). This moves away
registration of DSS from board files into a common place.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   14 +-
 arch/arm/mach-omap2/board-am3517evm.c|   16 +---
 arch/arm/mach-omap2/board-cm-t35.c   |   10 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   10 +-
 arch/arm/mach-omap2/board-igep0020.c |   10 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 +-
 arch/arm/mach-omap2/board-omap3evm.c |   14 +-
 arch/arm/mach-omap2/board-omap3pandora.c |   10 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   10 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +--
 arch/arm/mach-omap2/board-zoom-display.c |   15 +--
 11 files changed, 11 insertions(+), 123 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d99902c..d00f356 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,21 +307,9 @@ static struct omap_dss_board_info sdp3430_dss_data = {
.default_device = &sdp3430_lcd_device,
 };
 
-static struct platform_device sdp3430_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &sdp3430_dss_data,
-   },
-};
-
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct platform_device *sdp3430_devices[] __initdata = {
-   &sdp3430_dss_device,
-};
-
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
 
@@ -796,7 +784,7 @@ static void __init omap_3430sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3430_i2c_init();
-   platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
+   omap_display_init(&sdp3430_dss_data);
if (omap_rev() > OMAP3430_REV_ES1_0)
ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
else
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6bb5f53..548f524 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -378,24 +378,12 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
.default_device = &am3517_evm_lcd_device,
 };
 
-static struct platform_device am3517_evm_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data  = &am3517_evm_dss_data,
-   },
-};
-
 /*
  * Board initialization
  */
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
 };
 
-static struct platform_device *am3517_evm_devices[] __initdata = {
-   &am3517_evm_dss_device,
-};
-
 static void __init am3517_evm_init_irq(void)
 {
omap_board_config = am3517_evm_config;
@@ -495,9 +483,7 @@ static void __init am3517_evm_init(void)
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 
am3517_evm_i2c_init();
-   platform_add_devices(am3517_evm_devices,
-   ARRAY_SIZE(am3517_evm_devices));
-
+   omap_display_init(&am3517_evm_dss_data);
omap_serial_init();
 
/* Configure GPIO for EHCI port */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 22322d1..1c36ec8 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
.default_device = &cm_t35_dvi_device,
 };
 
-static struct platform_device cm_t35_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &cm_t35_dss_data,
-   },
-};
-
 static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,/* 0: slave, 1: master */
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void)
msleep(50);
gpio_set_value(lcd_en_gpio, 1);
 
-   err = platform_device_register(&cm_t35_dss_device);
+   err = omap_display_init(&cm_t35_dss_data);
if (err) {
pr_err("CM-T35: failed to register DSS device\n");
goto err_dev_reg;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index ca8e1b1..6a2eb49 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devk

[PATCH v10 06/18] OMAP2,3 DSS2 Use Regulator init with driver name

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Use driver name in regulator inits needed for display instead of using device
structure name.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   11 +++
 arch/arm/mach-omap2/board-cm-t35.c   |   12 
 arch/arm/mach-omap2/board-igep0020.c |6 ++
 arch/arm/mach-omap2/board-omap3evm.c |6 ++
 arch/arm/mach-omap2/board-omap3stalker.c |   12 
 5 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 6f4e7cf..d99902c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -315,10 +315,8 @@ static struct platform_device sdp3430_dss_device = {
},
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &sdp3430_dss_device.dev,
-};
+static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_dss_device,
@@ -546,10 +544,7 @@ static struct regulator_init_data sdp3430_vdac = {
 
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   {
-   .supply = "vdds_dsi",
-   .dev= &sdp3430_dss_device.dev,
-   }
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 79f87ec..22322d1 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -495,15 +495,11 @@ static struct regulator_consumer_supply 
cm_t35_vsim_supply = {
.supply = "vmmc_aux",
 };
 
-static struct regulator_consumer_supply cm_t35_vdac_supply = {
-   .supply = "vdda_dac",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct regulator_consumer_supply cm_t35_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdvi_supply =
+   REGULATOR_SUPPLY("vdvi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data cm_t35_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 23abfa3..238c69e 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -493,10 +493,8 @@ static struct platform_device igep2_dss_device = {
},
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply = {
-   .supply = "vdds_dsi",
-   .dev= &igep2_dss_device.dev,
-};
+static struct regulator_consumer_supply igep2_vpll2_supply =
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 4ad3c4d..32ac816 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -500,10 +500,8 @@ static struct twl4030_codec_data omap3evm_codec_data = {
.audio = &omap3evm_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_evm_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index 51c010c..7b675cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -448,10 +448,8 @@ static struct twl4030_codec_data omap3stalker_codec_data = 
{
.audio  = &omap3stalker_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_stalker_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving

[PATCH v10 07/18] OMAP2,3: DSS2: Create new file display.c for central dss driver registration.

2011-01-23 Thread Sumit Semwal
A new file display.c is introduced for display driver init, which adds a 
function
omap_display_init to do the DSS driver registration. This is the first step in 
moving
away registration of DSS from board files into a common place.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/Makefile  |3 ++
 arch/arm/mach-omap2/display.c |   46 +
 arch/arm/plat-omap/include/plat/display.h |   11 +++
 3 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b0..2e81173 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -242,3 +242,6 @@ obj-y   += $(smc91x-m) 
$(smc91x-y)
 
 smsc911x-$(CONFIG_SMSC911X):= gpmc-smsc911x.o
 obj-y  += $(smsc911x-m) $(smsc911x-y)
+
+disp-$(CONFIG_OMAP2_DSS)   := display.o
+obj-y  += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 000..6e21cb8
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,46 @@
+/*
+ * OMAP2plus display device setup / initialization.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Senthilvadivu Guruswamy
+ * Sumit Semwal
+ *
+ * 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 "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static struct platform_device omap_display_device = {
+   .name  = "omap_display",
+   .id= -1,
+   .dev= {
+   .platform_data = NULL,
+   },
+};
+
+int __init omap_display_init(struct omap_dss_board_info
+   *board_data)
+{
+   int r = 0;
+   omap_display_device.dev.platform_data = board_data;
+
+   r = platform_device_register(&omap_display_device);
+   if (r < 0)
+   printk(KERN_ERR "Unable to register OMAP-Display device\n");
+
+   return r;
+}
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 537f4e4..0f140ec 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define DISPC_IRQ_FRAMEDONE(1 << 0)
@@ -226,6 +227,16 @@ struct omap_dss_board_info {
struct omap_dss_device *default_device;
 };
 
+#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
+/* Init with the board info */
+extern int omap_display_init(struct omap_dss_board_info *board_data);
+#else
+static inline int omap_display_init(struct omap_dss_board_info *board_data)
+{
+   return 0;
+}
+#endif
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v10 04/18] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for Display Sub System applicable for OMAP3430 and
OMAP36xx.  DSS is also considered as an IP as DISPC, RFBI and named as dss_core.
For all the IP modules in DSS, same clock is needed for enabling. Hwmod sees
DSS IPs as independent IPs, so same clock has to be repeated for .main_clk in
each IP.

This patch defines separate hwmod databases for OMAP3430ES1 and (OMAP3430ES2 and
OMAP36xx) as OMAP3430ES1 does not have IDLEST bit to poll on for dss IP, and 
also
the firewall regions are different between 3430es1 and later.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  433 
 arch/arm/plat-omap/include/plat/l3_3xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h  |   10 +
 3 files changed, 463 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..713165d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
 static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
+static struct omap_hwmod omap3430es1_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
+static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
+static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
+static struct omap_hwmod omap3xxx_dss_venc_hwmod;
 static struct omap_hwmod omap3xxx_i2c1_hwmod;
 static struct omap_hwmod omap3xxx_i2c2_hwmod;
 static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -84,6 +91,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = 
{
&omap3xxx_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
+   .master = &omap3xxx_dss_core_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP3_L3_CORE_FW_INIT_ID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
&omap3xxx_l3_main__l4_core,
@@ -664,6 +684,410 @@ static struct omap_hwmod_class i2c_class = {
.sysc = &i2c_sysc,
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap3xxx_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+   { .name = "dsi1", .dma_req = 74 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
+   &omap3xxx_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3430es1_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
+   .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3xxx_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   

[PATCH v10 05/18] OMAP2,3 DSS2 Change driver name to omap_display

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Change the driver name from omapdss to omap_display as the driver takes care of
the display devices ie number of panels, type of panels available in the
platform.  Change the device name in the board files and 2420,2430,3xxx clock
files from omapdss to omap_display to match the driver name.

Signed-off-by: Sumit Semwal 
Acked-by: Paul Walmsley 
for: The clkdev changes in clock2420_data.c, clock2430_data.c, clock3xxx_data.c

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-am3517evm.c|2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |6 +++---
 arch/arm/mach-omap2/board-igep0020.c |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |6 +++---
 arch/arm/mach-omap2/board-omap3evm.c |4 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |8 
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 ++--
 arch/arm/mach-omap2/board-rx51-video.c   |2 +-
 arch/arm/mach-omap2/board-zoom-display.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |4 ++--
 arch/arm/mach-omap2/clock2420_data.c |8 
 arch/arm/mach-omap2/clock2430_data.c |8 
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 drivers/video/omap2/dss/core.c   |2 +-
 17 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef..6f4e7cf 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct platform_device sdp3430_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &sdp3430_dss_data,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 10d60b7..6bb5f53 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -379,7 +379,7 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
 };
 
 static struct platform_device am3517_evm_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data  = &am3517_evm_dss_data,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index dac1416..79f87ec 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -402,7 +402,7 @@ static struct omap_dss_board_info cm_t35_dss_data = {
 };
 
 static struct platform_device cm_t35_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &cm_t35_dss_data,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 00bb1fc..ca8e1b1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct platform_device devkit8000_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &devkit8000_dss_data,
@@ -207,7 +207,7 @@ static struct platform_device devkit8000_dss_device = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
@@ -282,7 +282,7 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omapdss");
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 3be85a1..23abfa3 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -486,7 +486,7 @@ static struct omap_dss_board_info igep2_dss_data = {
 };
 
 static struct platform_device igep2_dss_device = {
-   .name   =

[PATCH v10 02/18] OMAP2420: hwmod data: add DSS DISPC RFBI VENC

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2420 Display Sub System,. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |  311 +++-
 arch/arm/plat-omap/include/plat/l3_2xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h  |   24 +++
 3 files changed, 354 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..21014de 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -18,7 +18,8 @@
 #include 
 #include 
 #include 
-
+#include 
+#include 
 #include "omap_hwmod_common_data.h"
 
 #include "cm-regbits-24xx.h"
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2420_mpu_hwmod;
 static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
+static struct omap_hwmod omap2420_dss_core_hwmod;
+static struct omap_hwmod omap2420_dss_dispc_hwmod;
+static struct omap_hwmod omap2420_dss_rfbi_hwmod;
+static struct omap_hwmod omap2420_dss_venc_hwmod;
 static struct omap_hwmod omap2420_wd_timer2_hwmod;
 static struct omap_hwmod omap2420_gpio1_hwmod;
 static struct omap_hwmod omap2420_gpio2_hwmod;
@@ -64,6 +69,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = 
{
&omap2420_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
+   .master = &omap2420_dss_core_hwmod,
+   .slave  = &omap2420_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
&omap2420_l3_main__l4_core,
@@ -470,6 +488,291 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2420_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
+   &omap2420_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
+   .master = &omap2420_l4_core_hwmod,
+   .slave  = &omap2420_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2420_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2420_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
+   &omap2420_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2420_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2420_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2420_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2420_dss_irqs),
+   .sdma_reqs  = omap2420_dss_sdma_chs,
+   .sdma_reqs_cnt 

[PATCH v10 03/18] OMAP2430: hwmod data: add DSS DISPC RFBI VENC

2011-01-23 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2430 Display Sub System. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |  284 
 1 files changed, 284 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..1ef3f3f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "omap_hwmod_common_data.h"
 
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
 static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
+static struct omap_hwmod omap2430_dss_core_hwmod;
+static struct omap_hwmod omap2430_dss_dispc_hwmod;
+static struct omap_hwmod omap2430_dss_rfbi_hwmod;
+static struct omap_hwmod omap2430_dss_venc_hwmod;
 static struct omap_hwmod omap2430_wd_timer2_hwmod;
 static struct omap_hwmod omap2430_gpio1_hwmod;
 static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -65,6 +70,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = 
{
&omap2430_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
+   .master = &omap2430_dss_core_hwmod,
+   .slave  = &omap2430_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
&omap2430_l3_main__l4_core,
@@ -469,6 +487,266 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2430_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2430_dss_irqs[] = {
+   { .irq = 25 },
+};
+static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
+   &omap2430_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
+   .master = &omap2430_l4_core_hwmod,
+   .slave  = &omap2430_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2430_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2430_dss_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
+   &omap2430_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2430_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2430_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2430_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2430_dss_irqs),
+   .sdma_reqs  = omap2430_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2430_dss_sdma_chs),
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_DSS1_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap

[PATCH v10 01/18] OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove

2011-01-23 Thread Sumit Semwal
As part of omap hwmod changes, DSS will not be the only controller of its
clocks. hwmod initialization also enables the interface clocks, and
manages them.
So, when DSS is built as a module, omap_dss_remove doesn't try to disable
all clocks that have a higher usecount.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   46 ++-
 1 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 8e89f60..ee56859 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -623,7 +623,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 {
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
int i;
-   int c;
 
dss_uninitialize_debugfs();
 
@@ -638,44 +637,13 @@ static int omap_dss_remove(struct platform_device *pdev)
 
dss_exit();
 
-   /* these should be removed at some point */
-   c = core.dss_ick->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_ick usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_ick);
-   }
-
-   c = core.dss1_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss1_fck);
-   }
-
-   c = core.dss2_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss2_fck);
-   }
-
-   c = core.dss_54m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_54m_fck);
-   }
-
-   if (core.dss_96m_fck) {
-   c = core.dss_96m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
-   c);
-   while (c-- > 0)
-   clk_disable(core.dss_96m_fck);
-   }
-   }
+   /*
+* As part of hwmod changes, DSS is not the only controller of dss
+* clocks; hwmod framework itself will also enable clocks during hwmod
+* init for dss, and autoidle is set in h/w for DSS. Hence, there's no
+* need to disable clocks if their usecounts > 1.
+*/
+   WARN_ON(core.num_clks_enabled > 0);
 
dss_put_clocks();
 
-- 
1.7.1

--
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


[PATCH v10 00/18] OMAP2,3: hwmod DSS Adaptation

2011-01-23 Thread Sumit Semwal
.
2) Usage of regulators by different drivers are implemented.
For Eg: Regulator used by VENC is moved to venc driver.  But vdda_dac would be 
needed by DPI and DSI as well.
4) OMAP2420 and OMAP2430 hwmod database are generated in this v1.
5) Module support for omapdss driver can continue as the DSS HW IP specific 
platform
drivers are decoupled from omapdss driver.
6) Following review comments incorporated:
Changed the hwmod device name from "dss" to "dss_dss"
Changed name of core driver from "omapdss" to "omap_display" as it 
deals with panels.
Fixed comments on return values from platform_get_resource/irq 
functions.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init

(This patch is required for OMAP bootup w/ 20110115 linux-next)



Senthilvadivu Guruswamy (15):
  OMAP2420: hwmod data: add DSS DISPC RFBI VENC
  OMAP2430: hwmod data: add DSS DISPC RFBI VENC
  OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
  OMAP2,3 DSS2 Change driver name to omap_display
  OMAP2,3 DSS2 Use Regulator init with driver name
  OMAP2,3: DSS2: board files: replace platform_device_register with
omap_display_init()
  OMAP2,3: DSS2: Build omap_device for each DSS HWIP
  OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Move clocks from core driver to dss driver
  OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to
driver
  OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Use platform device to get baseaddr
  OMAP2,3: DSS2: Get DSS IRQ from platform device

Sumit Semwal (3):
  OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove
  OMAP2,3: DSS2: Create new file display.c for central dss driver
registration.
  OMAP2,3: DSS2: replace printk with dev_dbg in init

 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-3430sdp.c  |   26 +--
 arch/arm/mach-omap2/board-am3517evm.c|   16 +-
 arch/arm/mach-omap2/board-cm-t35.c   |   22 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   22 +-
 arch/arm/mach-omap2/board-igep0020.c |   20 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   22 +-
 arch/arm/mach-omap2/board-omap3evm.c |   30 +--
 arch/arm/mach-omap2/board-omap3pandora.c |   17 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   26 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +-
 arch/arm/mach-omap2/board-zoom-display.c |   15 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |   12 +-
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 arch/arm/mach-omap2/display.c|   96 ++
 arch/arm/mach-omap2/omap_hwmod_2420_data.c   |  311 ++-
 arch/arm/mach-omap2/omap_hwmod_2430_data.c   |  284 
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |  433 +
 arch/arm/plat-omap/include/plat/display.h|   16 +
 arch/arm/plat-omap/include/plat/l3_2xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l3_3xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h|   24 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h|   10 +
 drivers/video/omap2/dss/core.c   |  448 ++
 drivers/video/omap2/dss/dispc.c  |  114 ---
 drivers/video/omap2/dss/dsi.c|   78 -
 drivers/video/omap2/dss/dss.c|  419 +++-
 drivers/video/omap2/dss/dss.h|   46 ++--
 drivers/video/omap2/dss/rfbi.c   |  118 ---
 drivers/video/omap2/dss/venc.c   |  125 +---
 33 files changed, 2055 insertions(+), 787 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

--
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


[PATCH v9 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

Reviewed-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dss.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 4d7a816..22690e9 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -563,7 +563,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 static int dss_init(bool skip_init)
 {
-   int r;
+   int r, dss_irq;
u32 rev;
struct resource *dss_mem;
 
@@ -609,15 +609,18 @@ static int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
+   dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss_irq != -ENXIO) {
+   r = request_irq(dss_irq,
cpu_is_omap24xx()
? dss_irq_handler_omap2
: dss_irq_handler_omap3,
0, "OMAP DSS", NULL);
 
-   if (r < 0) {
-   DSSERR("omap2 dss: request_irq failed\n");
-   goto fail1;
+   if (r < 0) {
+   DSSERR("omap2 dss: request_irq failed\n");
+   goto fail1;
+   }
}
 
if (cpu_is_omap34xx()) {
-- 
1.7.1

--
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


[PATCH v9 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from 
platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Reviewed-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dispc.c |   11 ---
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |   11 ---
 drivers/video/omap2/dss/rfbi.c  |   10 +++---
 drivers/video/omap2/dss/venc.c  |   11 ---
 5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1c22cf0..381942d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
 #include "dss_features.h"
 
 /* DISPC */
-#define DISPC_BASE 0x48050400
-
 #define DISPC_SZ_REGS  SZ_4K
 
 struct dispc_reg { u16 idx; };
@@ -3324,6 +3322,8 @@ int dispc_setup_plane(enum omap_plane plane,
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
u32 rev;
+   struct resource *dispc_mem;
+
dispc.pdev = pdev;
 
spin_lock_init(&dispc.irq_lock);
@@ -3335,7 +3335,12 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
 
INIT_WORK(&dispc.error_work, dispc_error_worker);
 
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+   if (!dispc_mem) {
+   DSSERR("can't get IORESOURCE_MEM DISPC\n");
+   return -EINVAL;
+   }
+   dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 39a1c04..cab08cb 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,8 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE   0x4804FC00
-
 struct dsi_reg { u16 idx; };
 
 #define DSI_REG(idx)   ((const struct dsi_reg) { idx })
@@ -3257,6 +3255,7 @@ static int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
+   struct resource *dsi_mem;
 
spin_lock_init(&dsi.errors_lock);
dsi.errors = 0;
@@ -3283,7 +3282,13 @@ static int dsi_init(struct platform_device *pdev)
dsi.te_timer.function = dsi_te_timeout;
dsi.te_timer.data = 0;
 #endif
-   dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+   dsi_mem = platform_get_resource(dsi.pdev, IORESOURCE_MEM, 0);
+   if (!dsi_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSI\n");
+   r = -EINVAL;
+   goto err0;
+   }
+   dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi.base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
@@ -3310,6 +3315,7 @@ err2:
iounmap(dsi.base);
 err1:
destroy_workqueue(dsi.workqueue);
+err0:
return r;
 }
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 8b7972e..4d7a816 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -34,8 +34,6 @@
 #include 
 #include "dss.h"
 
-#define DSS_BASE   0x4805
-
 #define DSS_SZ_REGSSZ_512
 
 struct dss_reg {
@@ -567,8 +565,15 @@ static int dss_init(bool skip_init)
 {
int r;
u32 rev;
+   struct resource *dss_mem;
 
-   dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
+   dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
+   if (!dss_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSS\n");
+   r = -EINVAL;
+   goto fail0;
+   }
+   dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 93b13c5..fc665a7 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,8 +36,6 @@
 #include 
 #include "dss.h"
 
-#define RFBI_BASE   0x48050800
-
 struct rfbi_reg { u16 idx; };
 
 #define RFBI_REG(idx)  ((const struct rfbi_reg) { idx })
@@ -1019,6 +1017,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
u32 rev;
u32 l;
+   struct resource *rfbi_mem;
 
rfbi.pdev = pdev;
 
@@ -1028,7 +1027,12 @@ static int omap_rfbihw_probe(struct platform_device 
*pdev)
atomic_set(&rfbi.cmd_fifo_full, 0

[PATCH v9 15/18] OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator 
is
needed by dpi_init() too. Board files are updated accordingly to add 2 
instances of
vdds_dsi regulator.

DSI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |1 +
 arch/arm/mach-omap2/board-devkit8000.c   |   10 ++--
 arch/arm/mach-omap2/board-igep0020.c |   10 ++--
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 ++--
 arch/arm/mach-omap2/board-omap3evm.c |   10 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |1 +
 arch/arm/mach-omap2/board-omap3stalker.c |   10 ++--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   10 ++--
 drivers/video/omap2/dss/core.c   |8 ++--
 drivers/video/omap2/dss/dsi.c|   64 -
 drivers/video/omap2/dss/dss.h|8 ++--
 11 files changed, 107 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e0d13ae..33ff4f6 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -533,6 +533,7 @@ static struct regulator_init_data sdp3430_vdac = {
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 331b94e..6cdedd9 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -273,8 +273,10 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
.setup  = devkit8000_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
@@ -315,8 +317,8 @@ static struct regulator_init_data devkit8000_vpll1 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &devkit8000_vpll1_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll1_supplies),
+   .consumer_supplies  = devkit8000_vpll1_supplies,
 };
 
 /* VAUX4 for ads7846 and nubs */
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index d79dcd5..dfbe3a1 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -485,8 +485,10 @@ static struct omap_dss_board_info igep2_dss_data = {
.default_device = &igep2_dvi_device,
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
@@ -499,8 +501,8 @@ static struct regulator_init_data igep2_vpll2 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &igep2_vpll2_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(igep2_vpll2_supplies),
+   .consumer_supplies  = igep2_vpll2_supplies,
 };
 
 static void __init igep2_display_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 4dd1475..caf6c8a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -231,8 +231,10 @@ static struct omap_dss_board_info beagle_dss_data = {
 static struct regulator_consumer_supply beagle_vdac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_

[PATCH v9 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init

2011-01-22 Thread Sumit Semwal
This patch replaces printk's in the init/probe functions to dev_dbg
for boot time optimization.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dispc.c |2 +-
 drivers/video/omap2/dss/dsi.c   |2 +-
 drivers/video/omap2/dss/rfbi.c  |2 +-
 drivers/video/omap2/dss/venc.c  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index abfed47..1c22cf0 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3350,7 +3350,7 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
dispc_save_context();
 
rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DISPC rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d854137..39a1c04 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3300,7 +3300,7 @@ static int dsi_init(struct platform_device *pdev)
enable_clocks(1);
 
rev = dsi_read_reg(DSI_REVISION);
-   printk(KERN_INFO "OMAP DSI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DSI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index a64e119..93b13c5 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1046,7 +1046,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_write_reg(RFBI_SYSCONFIG, l);
 
rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
rfbi_enable_clocks(0);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 935ae8e..3db9061 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -739,7 +739,7 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_enable_clocks(1);
 
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
-   printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
+   dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
 
venc_enable_clocks(0);
 
-- 
1.7.1

--
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


[PATCH v9 14/18] OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |2 +-
 arch/arm/mach-omap2/board-omap3evm.c |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +-
 drivers/video/omap2/dss/core.c   |   28 +--
 drivers/video/omap2/dss/dss.h|9 +-
 drivers/video/omap2/dss/venc.c   |  116 +-
 12 files changed, 93 insertions(+), 78 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d00f356..e0d13ae 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 1c36ec8..2e9265e 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -488,7 +488,7 @@ static struct regulator_consumer_supply cm_t35_vsim_supply 
= {
 };
 
 static struct regulator_consumer_supply cm_t35_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply cm_t35_vdvi_supply =
REGULATOR_SUPPLY("vdvi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 6a2eb49..331b94e 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index c0a5066..4dd1475 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -229,7 +229,7 @@ static struct omap_dss_board_info beagle_dss_data = {
 };
 
 static struct regulator_consumer_supply beagle_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply beagle_vdvi_supply =
REGULATOR_SUPPLY("vdds_dsi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 5f156fe..ec45575 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -493,7 +493,7 @@ static struct twl4030_codec_data omap3evm_codec_data = {
 };
 
 static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c 
b/arch/arm/mach-omap2/board-omap3pandora.c
index 613ab58..b44e604 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -342,7 +342,7 @@ static struct regulator_consumer_supply 
pandora_vmmc3_supply =
REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2");
 
 static struct regulator_consumer_supply pandora_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply pandora_vdds_supplies[] = {
R

[PATCH v9 13/18] OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DISPC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DISPC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c  |8 ++--
 drivers/video/omap2/dss/dispc.c |  105 ---
 drivers/video/omap2/dss/dss.h   |4 +-
 3 files changed, 70 insertions(+), 47 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d4b3da3..5acb5e6 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -213,9 +213,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = dispc_init();
+   r = dispc_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize dispc\n");
+   DSSERR("Failed to initialize dispc platform driver\n");
goto err_dispc;
}
 
@@ -281,7 +281,7 @@ err_dsi:
 err_sdi:
venc_exit();
 err_venc:
-   dispc_exit();
+   dispc_uninit_platform_driver();
 err_dispc:
dpi_exit();
 err_dpi:
@@ -301,7 +301,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs();
 
venc_exit();
-   dispc_exit();
+   dispc_uninit_platform_driver();
dpi_exit();
rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9f8c69f..abfed47 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -178,6 +178,7 @@ struct dispc_irq_stats {
 };
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
u32 fifo_size[3];
@@ -3269,47 +3270,6 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
-{
-   u32 rev;
-
-   spin_lock_init(&dispc.irq_lock);
-
-#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
-   spin_lock_init(&dispc.irq_stats_lock);
-   dispc.irq_stats.last_reset = jiffies;
-#endif
-
-   INIT_WORK(&dispc.error_work, dispc_error_worker);
-
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
-   if (!dispc.base) {
-   DSSERR("can't ioremap DISPC\n");
-   return -ENOMEM;
-   }
-
-   enable_clocks(1);
-
-   _omap_dispc_initial_config();
-
-   _omap_dispc_initialize_irq();
-
-   dispc_save_context();
-
-   rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   enable_clocks(0);
-
-   return 0;
-}
-
-void dispc_exit(void)
-{
-   iounmap(dispc.base);
-}
-
 int dispc_enable_plane(enum omap_plane plane, bool enable)
 {
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -3359,3 +3319,66 @@ int dispc_setup_plane(enum omap_plane plane,
 
return r;
 }
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   dispc.pdev = pdev;
+
+   spin_lock_init(&dispc.irq_lock);
+
+#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
+   spin_lock_init(&dispc.irq_stats_lock);
+   dispc.irq_stats.last_reset = jiffies;
+#endif
+
+   INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   if (!dispc.base) {
+   DSSERR("can't ioremap DISPC\n");
+   return -ENOMEM;
+   }
+
+   enable_clocks(1);
+
+   _omap_dispc_initial_config();
+
+   _omap_dispc_initialize_irq();
+
+   dispc_save_context();
+
+   rev = dispc_read_reg(DISPC_REVISION);
+   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   enable_clocks(0);
+
+   return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+   iounmap(dispc.base);
+   return 0;
+}
+
+static struct platform_driver omap_dispchw_driver = {
+   .probe  = omap_dispchw_probe,
+   .remove = omap_dispchw_remove,
+   .driver = {
+   .name   = "omap_dispc",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dispc_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dispchw_driver);
+}
+
+void dispc_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dispchw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/v

[PATCH v9 12/18] OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for RFBI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

RFBI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |8 ++--
 drivers/video/omap2/dss/dss.h  |8 ++--
 drivers/video/omap2/dss/rfbi.c |  110 
 3 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bdb952f..d4b3da3 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -201,9 +201,9 @@ static int omap_dss_probe(struct platform_device *pdev)
/* keep clocks enabled to prevent context saves/restores during init */
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
 
-   r = rfbi_init();
+   r = rfbi_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize rfbi\n");
+   DSSERR("Failed to initialize rfbi platform driver\n");
goto err_rfbi;
}
 
@@ -285,7 +285,7 @@ err_venc:
 err_dispc:
dpi_exit();
 err_dpi:
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
 err_rfbi:
dss_uninit_platform_driver();
 err_dss:
@@ -303,7 +303,7 @@ static int omap_dss_remove(struct platform_device *pdev)
venc_exit();
dispc_exit();
dpi_exit();
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
dsi_exit();
sdi_exit();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index c535ee1..0ba4bdb 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -428,8 +428,8 @@ static inline void venc_exit(void)
 
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
-int rfbi_init(void);
-void rfbi_exit(void);
+int rfbi_init_platform_driver(void);
+void rfbi_uninit_platform_driver(void);
 void rfbi_dump_regs(struct seq_file *s);
 
 int rfbi_configure(int rfbi_module, int bpp, int lines);
@@ -440,11 +440,11 @@ void rfbi_set_timings(int rfbi_module, struct 
rfbi_timings *t);
 unsigned long rfbi_get_max_tx_rate(void);
 int rfbi_init_display(struct omap_dss_device *display);
 #else
-static inline int rfbi_init(void)
+static inline int rfbi_init_platform_driver(void)
 {
return 0;
 }
-static inline void rfbi_exit(void)
+static inline void rfbi_uninit_platform_driver(void)
 {
 }
 #endif
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 10a2ffe..a64e119 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -100,6 +100,7 @@ static int rfbi_convert_timings(struct rfbi_timings *t);
 static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
unsigned long   l4_khz;
@@ -957,50 +958,6 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
-{
-   u32 rev;
-   u32 l;
-
-   spin_lock_init(&rfbi.cmd_lock);
-
-   init_completion(&rfbi.cmd_done);
-   atomic_set(&rfbi.cmd_fifo_full, 0);
-   atomic_set(&rfbi.cmd_pending, 0);
-
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
-   if (!rfbi.base) {
-   DSSERR("can't ioremap RFBI\n");
-   return -ENOMEM;
-   }
-
-   rfbi_enable_clocks(1);
-
-   msleep(10);
-
-   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
-
-   /* Enable autoidle and smart-idle */
-   l = rfbi_read_reg(RFBI_SYSCONFIG);
-   l |= (1 << 0) | (2 << 3);
-   rfbi_write_reg(RFBI_SYSCONFIG, l);
-
-   rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   rfbi_enable_clocks(0);
-
-   return 0;
-}
-
-void rfbi_exit(void)
-{
-   DSSDBG("rfbi_exit\n");
-
-   iounmap(rfbi.base);
-}
-
 int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 {
int r;
@@ -1056,3 +1013,68 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
return 0;
 }
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   u32 l;
+
+   rfbi.pdev = pdev;
+
+   spin_lock_init(&rfbi.cmd_lock);
+
+   init_completion(&rfbi.cmd_done);
+   atomic_set(&rfbi.cmd_fifo_full, 0);
+   atomic_set(&rfbi.cmd_pending, 0);
+
+   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+ 

[PATCH v9 11/18] OMAP2,3: DSS2: Move clocks from core driver to dss driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

All clock management is moved to dss platform driver. clk_get/put APIs use
dss device instead of core platform device.

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So the device name is changed from omap_display to omap_dss in 2420, 2430,
3xxx clock database files. Now the core driver "omap_display" only takes care
of panel registration with the custom bus.
core driver also uses the clk_enable() / clk_disable() APIs exposed by DSS for
clock management.
DSS driver would do clock management of clocks needed by DISPC, RFBI, DSI, VENC

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Acked-by: Paul Walmsley 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 drivers/video/omap2/dss/core.c   |  343 +-
 drivers/video/omap2/dss/dss.c|  334 +-
 drivers/video/omap2/dss/dss.h|   13 +-
 6 files changed, 360 insertions(+), 360 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index b412958..d2abc2f 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_2d_fck",   &gfx_2d_fck,CK_242X),
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 039155e..663f298 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_ick",  &mdm_ick,   CK_243X),
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 8618262..5c97b93 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,13 +3357,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es1, 
CK_3430ES1),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es2, 
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-   CLK("omap_display", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("

[PATCH v9 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Looks up the hwmod database for each of the given DSS HW IP and builds
omap_device which inturn does the platform device register for each of DSS HW IP

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   50 +
 arch/arm/plat-omap/include/plat/display.h |5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 6e21cb8..5c0a78b 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 static struct platform_device omap_display_device = {
.name  = "omap_display",
@@ -32,10 +34,58 @@ static struct platform_device omap_display_device = {
},
 };
 
+static struct omap_device_pm_latency omap_dss_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   .flags  = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
 int __init omap_display_init(struct omap_dss_board_info
*board_data)
 {
int r = 0;
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   int i;
+   struct omap_display_platform_data pdata;
+
+   /*
+* omap: valid DSS hwmod names
+* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3: dss_dsi1
+*/
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
+   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   int oh_count;
+
+   memset(&pdata, 0, sizeof(pdata));
+
+   if (cpu_is_omap24xx())
+   oh_count = ARRAY_SIZE(oh_name) - 1;
+   /* last hwmod dev in oh_name is not available for omap2 */
+   else
+   oh_count = ARRAY_SIZE(oh_name);
+
+   pdata.board_data = board_data;
+   pdata.board_data->get_last_off_on_transaction_id = NULL;
+
+   for (i = 0; i < oh_count; i++) {
+   oh = omap_hwmod_lookup(oh_name[i]);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name[i]);
+   return -ENODEV;
+   }
+   od = omap_device_build(dev_name[i], -1, oh, &pdata,
+   sizeof(struct omap_display_platform_data),
+   omap_dss_latency,
+   ARRAY_SIZE(omap_dss_latency), 0);
+
+   if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+   oh_name[i]))
+   return -ENODEV;
+   }
omap_display_device.dev.platform_data = board_data;
 
r = platform_device_register(&omap_display_device);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 0f140ec..2fb057e 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -237,6 +237,11 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 }
 #endif
 
+struct omap_display_platform_data {
+   struct omap_dss_board_info *board_data;
+   /* TODO: Additional members to be added when PM is considered */
+};
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v9 10/18] OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver of DSS is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DSS platform driver is registered from inside omap_dss_probe, in the order 
desired.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   19 ++---
 drivers/video/omap2/dss/dss.c  |   55 ++-
 drivers/video/omap2/dss/dss.h  |4 +-
 3 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 1bbc004..1aace9e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -517,15 +517,9 @@ static int omap_dss_probe(struct platform_device *pdev)
core.ctx_id = dss_get_ctx_id();
DSSDBG("initial ctx id %u\n", core.ctx_id);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-   /* DISPC_CONTROL */
-   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-   skip_init = 1;
-#endif
-
-   r = dss_init(skip_init);
+   r = dss_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize DSS\n");
+   DSSERR("Failed to initialize DSS platform driver\n");
goto err_dss;
}
 
@@ -553,6 +547,11 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_venc;
}
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
if (cpu_is_omap34xx()) {
r = sdi_init(skip_init);
if (r) {
@@ -610,7 +609,7 @@ err_dispc:
 err_dpi:
rfbi_exit();
 err_rfbi:
-   dss_exit();
+   dss_uninit_platform_driver();
 err_dss:
dss_clk_disable_all_no_ctx();
dss_put_clocks();
@@ -635,7 +634,7 @@ static int omap_dss_remove(struct platform_device *pdev)
sdi_exit();
}
 
-   dss_exit();
+   dss_uninit_platform_driver();
 
/*
 * As part of hwmod changes, DSS is not the only controller of dss
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 77c3621..d130f04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -59,6 +59,7 @@ struct dss_reg {
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
struct clk  *dpll4_m4_ck;
@@ -549,7 +550,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
 }
 
-int dss_init(bool skip_init)
+static int dss_init(bool skip_init)
 {
int r;
u32 rev;
@@ -629,7 +630,7 @@ fail0:
return r;
 }
 
-void dss_exit(void)
+static void dss_exit(void)
 {
if (cpu_is_omap34xx())
clk_put(dss.dpll4_m4_ck);
@@ -639,3 +640,53 @@ void dss_exit(void)
iounmap(dss.base);
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+   int r;
+   int skip_init = 0;
+
+   dss.pdev = pdev;
+
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
+
+   r = dss_init(skip_init);
+   if (r) {
+   DSSERR("Failed to initialize DSS\n");
+   goto err_dss;
+   }
+
+err_dss:
+
+   return r;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+   dss_exit();
+
+   return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+   .probe  = omap_dsshw_probe,
+   .remove = omap_dsshw_remove,
+   .driver = {
+   .name   = "omap_dss",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dss_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dsshw_driver);
+}
+
+void dss_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dsshw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b394951..37c4544 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -214,8 +214,8 @@ void dss_overlay_setup_l4_manager(struct 
omap_overlay_manager *mgr);
 void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
 
 /* DSS */
-int dss_init(bool skip_init);
-void dss_exit(void);
+int dss_init_platform_driver(void);
+void dss_uninit_platform_driver(void);
 
 void dss_save_context(void);
 void dss_restore_context(void);
-- 
1.7.1

--
To unsubscribe f

[PATCH v9 08/18] OMAP2,3: DSS2: board files: replace platform_device_register with omap_display_init()

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

This patch updated board files to replace platform_device_register or
platform_add_devices of DSS with omap_display_init(). This moves away
registration of DSS from board files into a common place.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   14 +-
 arch/arm/mach-omap2/board-am3517evm.c|   16 +---
 arch/arm/mach-omap2/board-cm-t35.c   |   10 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   10 +-
 arch/arm/mach-omap2/board-igep0020.c |   10 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 +-
 arch/arm/mach-omap2/board-omap3evm.c |   14 +-
 arch/arm/mach-omap2/board-omap3pandora.c |   10 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   10 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +--
 arch/arm/mach-omap2/board-zoom-display.c |   15 +--
 11 files changed, 11 insertions(+), 123 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d99902c..d00f356 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,21 +307,9 @@ static struct omap_dss_board_info sdp3430_dss_data = {
.default_device = &sdp3430_lcd_device,
 };
 
-static struct platform_device sdp3430_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &sdp3430_dss_data,
-   },
-};
-
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct platform_device *sdp3430_devices[] __initdata = {
-   &sdp3430_dss_device,
-};
-
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
 
@@ -796,7 +784,7 @@ static void __init omap_3430sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3430_i2c_init();
-   platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
+   omap_display_init(&sdp3430_dss_data);
if (omap_rev() > OMAP3430_REV_ES1_0)
ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
else
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6bb5f53..548f524 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -378,24 +378,12 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
.default_device = &am3517_evm_lcd_device,
 };
 
-static struct platform_device am3517_evm_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data  = &am3517_evm_dss_data,
-   },
-};
-
 /*
  * Board initialization
  */
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
 };
 
-static struct platform_device *am3517_evm_devices[] __initdata = {
-   &am3517_evm_dss_device,
-};
-
 static void __init am3517_evm_init_irq(void)
 {
omap_board_config = am3517_evm_config;
@@ -495,9 +483,7 @@ static void __init am3517_evm_init(void)
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 
am3517_evm_i2c_init();
-   platform_add_devices(am3517_evm_devices,
-   ARRAY_SIZE(am3517_evm_devices));
-
+   omap_display_init(&am3517_evm_dss_data);
omap_serial_init();
 
/* Configure GPIO for EHCI port */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 22322d1..1c36ec8 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
.default_device = &cm_t35_dvi_device,
 };
 
-static struct platform_device cm_t35_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &cm_t35_dss_data,
-   },
-};
-
 static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,/* 0: slave, 1: master */
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void)
msleep(50);
gpio_set_value(lcd_en_gpio, 1);
 
-   err = platform_device_register(&cm_t35_dss_device);
+   err = omap_display_init(&cm_t35_dss_data);
if (err) {
pr_err("CM-T35: failed to register DSS device\n");
goto err_dev_reg;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index ca8e1b1..6a2eb49 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devk

[PATCH v9 07/18] OMAP2,3: DSS2: Create new file display.c for central dss driver registration.

2011-01-22 Thread Sumit Semwal
A new file display.c is introduced for display driver init, which adds a 
function
omap_display_init to do the DSS driver registration. This is the first step in 
moving
away registration of DSS from board files into a common place.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/Makefile  |3 ++
 arch/arm/mach-omap2/display.c |   46 +
 arch/arm/plat-omap/include/plat/display.h |   11 +++
 3 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b0..2e81173 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -242,3 +242,6 @@ obj-y   += $(smc91x-m) 
$(smc91x-y)
 
 smsc911x-$(CONFIG_SMSC911X):= gpmc-smsc911x.o
 obj-y  += $(smsc911x-m) $(smsc911x-y)
+
+disp-$(CONFIG_OMAP2_DSS)   := display.o
+obj-y  += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 000..6e21cb8
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,46 @@
+/*
+ * OMAP2plus display device setup / initialization.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Senthilvadivu Guruswamy
+ * Sumit Semwal
+ *
+ * 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 "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static struct platform_device omap_display_device = {
+   .name  = "omap_display",
+   .id= -1,
+   .dev= {
+   .platform_data = NULL,
+   },
+};
+
+int __init omap_display_init(struct omap_dss_board_info
+   *board_data)
+{
+   int r = 0;
+   omap_display_device.dev.platform_data = board_data;
+
+   r = platform_device_register(&omap_display_device);
+   if (r < 0)
+   printk(KERN_ERR "Unable to register OMAP-Display device\n");
+
+   return r;
+}
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 537f4e4..0f140ec 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define DISPC_IRQ_FRAMEDONE(1 << 0)
@@ -226,6 +227,16 @@ struct omap_dss_board_info {
struct omap_dss_device *default_device;
 };
 
+#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
+/* Init with the board info */
+extern int omap_display_init(struct omap_dss_board_info *board_data);
+#else
+static inline int omap_display_init(struct omap_dss_board_info *board_data)
+{
+   return 0;
+}
+#endif
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v9 06/18] OMAP2,3 DSS2 Use Regulator init with driver name

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Use driver name in regulator inits needed for display instead of using device
structure name.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   11 +++
 arch/arm/mach-omap2/board-cm-t35.c   |   12 
 arch/arm/mach-omap2/board-igep0020.c |6 ++
 arch/arm/mach-omap2/board-omap3evm.c |6 ++
 arch/arm/mach-omap2/board-omap3stalker.c |   12 
 5 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 6f4e7cf..d99902c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -315,10 +315,8 @@ static struct platform_device sdp3430_dss_device = {
},
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &sdp3430_dss_device.dev,
-};
+static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_dss_device,
@@ -546,10 +544,7 @@ static struct regulator_init_data sdp3430_vdac = {
 
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   {
-   .supply = "vdds_dsi",
-   .dev= &sdp3430_dss_device.dev,
-   }
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 79f87ec..22322d1 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -495,15 +495,11 @@ static struct regulator_consumer_supply 
cm_t35_vsim_supply = {
.supply = "vmmc_aux",
 };
 
-static struct regulator_consumer_supply cm_t35_vdac_supply = {
-   .supply = "vdda_dac",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct regulator_consumer_supply cm_t35_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdvi_supply =
+   REGULATOR_SUPPLY("vdvi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data cm_t35_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 23abfa3..238c69e 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -493,10 +493,8 @@ static struct platform_device igep2_dss_device = {
},
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply = {
-   .supply = "vdds_dsi",
-   .dev= &igep2_dss_device.dev,
-};
+static struct regulator_consumer_supply igep2_vpll2_supply =
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 4ad3c4d..32ac816 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -500,10 +500,8 @@ static struct twl4030_codec_data omap3evm_codec_data = {
.audio = &omap3evm_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_evm_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index 51c010c..7b675cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -448,10 +448,8 @@ static struct twl4030_codec_data omap3stalker_codec_data = 
{
.audio  = &omap3stalker_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_stalker_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving

[PATCH v9 05/18] OMAP2,3 DSS2 Change driver name to omap_display

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Change the driver name from omapdss to omap_display as the driver takes care of
the display devices ie number of panels, type of panels available in the
platform.  Change the device name in the board files and 2420,2430,3xxx clock
files from omapdss to omap_display to match the driver name.

Signed-off-by: Sumit Semwal 
Acked-by: Paul Walmsley 
for: The clkdev changes in clock2420_data.c, clock2430_data.c, clock3xxx_data.c

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-am3517evm.c|2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |6 +++---
 arch/arm/mach-omap2/board-igep0020.c |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |6 +++---
 arch/arm/mach-omap2/board-omap3evm.c |4 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |8 
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 ++--
 arch/arm/mach-omap2/board-rx51-video.c   |2 +-
 arch/arm/mach-omap2/board-zoom-display.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |4 ++--
 arch/arm/mach-omap2/clock2420_data.c |8 
 arch/arm/mach-omap2/clock2430_data.c |8 
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 drivers/video/omap2/dss/core.c   |2 +-
 17 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef..6f4e7cf 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct platform_device sdp3430_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &sdp3430_dss_data,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 10d60b7..6bb5f53 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -379,7 +379,7 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
 };
 
 static struct platform_device am3517_evm_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data  = &am3517_evm_dss_data,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index dac1416..79f87ec 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -402,7 +402,7 @@ static struct omap_dss_board_info cm_t35_dss_data = {
 };
 
 static struct platform_device cm_t35_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &cm_t35_dss_data,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 00bb1fc..ca8e1b1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct platform_device devkit8000_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &devkit8000_dss_data,
@@ -207,7 +207,7 @@ static struct platform_device devkit8000_dss_device = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
@@ -282,7 +282,7 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omapdss");
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 3be85a1..23abfa3 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -486,7 +486,7 @@ static struct omap_dss_board_info igep2_dss_data = {
 };
 
 static struct platform_device igep2_dss_device = {
-   .name   =

[PATCH v9 04/18] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for Display Sub System applicable for OMAP3430 and
OMAP36xx.  DSS is also considered as an IP as DISPC, RFBI and named as dss_core.
For all the IP modules in DSS, same clock is needed for enabling. Hwmod sees
DSS IPs as independent IPs, so same clock has to be repeated for .main_clk in
each IP.

This patch defines separate hwmod databases for OMAP3430ES1 and (OMAP3430ES2 and
OMAP36xx) as OMAP3430ES1 does not have IDLEST bit to poll on for dss IP, and 
also
the firewall regions are different between 3430es1 and later.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  433 
 arch/arm/plat-omap/include/plat/l3_3xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h  |   10 +
 3 files changed, 463 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..713165d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
 static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
+static struct omap_hwmod omap3430es1_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
+static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
+static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
+static struct omap_hwmod omap3xxx_dss_venc_hwmod;
 static struct omap_hwmod omap3xxx_i2c1_hwmod;
 static struct omap_hwmod omap3xxx_i2c2_hwmod;
 static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -84,6 +91,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = 
{
&omap3xxx_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
+   .master = &omap3xxx_dss_core_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP3_L3_CORE_FW_INIT_ID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
&omap3xxx_l3_main__l4_core,
@@ -664,6 +684,410 @@ static struct omap_hwmod_class i2c_class = {
.sysc = &i2c_sysc,
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap3xxx_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+   { .name = "dsi1", .dma_req = 74 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
+   &omap3xxx_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3430es1_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
+   .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3xxx_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   

[PATCH v9 03/18] OMAP2430: hwmod data: add DSS DISPC RFBI VENC

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2430 Display Sub System. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |  284 
 1 files changed, 284 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..1ef3f3f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "omap_hwmod_common_data.h"
 
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
 static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
+static struct omap_hwmod omap2430_dss_core_hwmod;
+static struct omap_hwmod omap2430_dss_dispc_hwmod;
+static struct omap_hwmod omap2430_dss_rfbi_hwmod;
+static struct omap_hwmod omap2430_dss_venc_hwmod;
 static struct omap_hwmod omap2430_wd_timer2_hwmod;
 static struct omap_hwmod omap2430_gpio1_hwmod;
 static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -65,6 +70,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = 
{
&omap2430_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
+   .master = &omap2430_dss_core_hwmod,
+   .slave  = &omap2430_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
&omap2430_l3_main__l4_core,
@@ -469,6 +487,266 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2430_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2430_dss_irqs[] = {
+   { .irq = 25 },
+};
+static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
+   &omap2430_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
+   .master = &omap2430_l4_core_hwmod,
+   .slave  = &omap2430_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2430_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2430_dss_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
+   &omap2430_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2430_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2430_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2430_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2430_dss_irqs),
+   .sdma_reqs  = omap2430_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2430_dss_sdma_chs),
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_DSS1_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap

[PATCH v9 02/18] OMAP2420: hwmod data: add DSS DISPC RFBI VENC

2011-01-22 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2420 Display Sub System,. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |  311 +++-
 arch/arm/plat-omap/include/plat/l3_2xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h  |   24 +++
 3 files changed, 354 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..21014de 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -18,7 +18,8 @@
 #include 
 #include 
 #include 
-
+#include 
+#include 
 #include "omap_hwmod_common_data.h"
 
 #include "cm-regbits-24xx.h"
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2420_mpu_hwmod;
 static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
+static struct omap_hwmod omap2420_dss_core_hwmod;
+static struct omap_hwmod omap2420_dss_dispc_hwmod;
+static struct omap_hwmod omap2420_dss_rfbi_hwmod;
+static struct omap_hwmod omap2420_dss_venc_hwmod;
 static struct omap_hwmod omap2420_wd_timer2_hwmod;
 static struct omap_hwmod omap2420_gpio1_hwmod;
 static struct omap_hwmod omap2420_gpio2_hwmod;
@@ -64,6 +69,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = 
{
&omap2420_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
+   .master = &omap2420_dss_core_hwmod,
+   .slave  = &omap2420_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
&omap2420_l3_main__l4_core,
@@ -470,6 +488,291 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2420_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
+   &omap2420_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
+   .master = &omap2420_l4_core_hwmod,
+   .slave  = &omap2420_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2420_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2420_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
+   &omap2420_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2420_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2420_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2420_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2420_dss_irqs),
+   .sdma_reqs  = omap2420_dss_sdma_chs,
+   .sdma_reqs_cnt 

[PATCH v9 01/18] OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove

2011-01-22 Thread Sumit Semwal
As part of omap hwmod changes, DSS will not be the only controller of its
clocks. hwmod initialization also enables the interface clocks, and
manages them.
So, when DSS is built as a module, omap_dss_remove doesn't try to disable
all clocks that have a higher usecount.

Reviewed-by: Kevin Hilman 
Tested-by: Kevin Hilman 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   46 ++-
 1 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 8e89f60..ee56859 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -623,7 +623,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 {
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
int i;
-   int c;
 
dss_uninitialize_debugfs();
 
@@ -638,44 +637,13 @@ static int omap_dss_remove(struct platform_device *pdev)
 
dss_exit();
 
-   /* these should be removed at some point */
-   c = core.dss_ick->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_ick usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_ick);
-   }
-
-   c = core.dss1_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss1_fck);
-   }
-
-   c = core.dss2_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss2_fck);
-   }
-
-   c = core.dss_54m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_54m_fck);
-   }
-
-   if (core.dss_96m_fck) {
-   c = core.dss_96m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
-   c);
-   while (c-- > 0)
-   clk_disable(core.dss_96m_fck);
-   }
-   }
+   /*
+* As part of hwmod changes, DSS is not the only controller of dss
+* clocks; hwmod framework itself will also enable clocks during hwmod
+* init for dss, and autoidle is set in h/w for DSS. Hence, there's no
+* need to disable clocks if their usecounts > 1.
+*/
+   WARN_ON(core.num_clks_enabled > 0);
 
dss_put_clocks();
 
-- 
1.7.1

--
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


[PATCH v9 00/18] OMAP2,3: hwmod DSS Adaptation

2011-01-22 Thread Sumit Semwal
AP2430 hwmod database are generated in this v1.
5) Module support for omapdss driver can continue as the DSS HW IP specific 
platform
drivers are decoupled from omapdss driver.
6) Following review comments incorporated:
Changed the hwmod device name from "dss" to "dss_dss"
Changed name of core driver from "omapdss" to "omap_display" as it 
deals with panels.
Fixed comments on return values from platform_get_resource/irq 
functions.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init

(This patch is required for OMAP bootup w/ 20110115 linux-next)



Senthilvadivu Guruswamy (15):
  OMAP2420: hwmod data: add DSS DISPC RFBI VENC
  OMAP2430: hwmod data: add DSS DISPC RFBI VENC
  OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
  OMAP2,3 DSS2 Change driver name to omap_display
  OMAP2,3 DSS2 Use Regulator init with driver name
  OMAP2,3: DSS2: board files: replace platform_device_register with
omap_display_init()
  OMAP2,3: DSS2: Build omap_device for each DSS HWIP
  OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Move clocks from core driver to dss driver
  OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to
driver
  OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Use platform device to get baseaddr
  OMAP2,3: DSS2: Get DSS IRQ from platform device

Sumit Semwal (3):
  OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove
  OMAP2,3: DSS2: Create new file display.c for central dss driver
registration.
  OMAP2,3: DSS2: replace printk with dev_dbg in init

 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-3430sdp.c  |   26 +--
 arch/arm/mach-omap2/board-am3517evm.c|   16 +-
 arch/arm/mach-omap2/board-cm-t35.c   |   22 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   22 +-
 arch/arm/mach-omap2/board-igep0020.c |   20 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   22 +-
 arch/arm/mach-omap2/board-omap3evm.c |   30 +--
 arch/arm/mach-omap2/board-omap3pandora.c |   17 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   26 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +-
 arch/arm/mach-omap2/board-zoom-display.c |   15 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |   12 +-
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 arch/arm/mach-omap2/display.c|   96 ++
 arch/arm/mach-omap2/omap_hwmod_2420_data.c   |  311 ++-
 arch/arm/mach-omap2/omap_hwmod_2430_data.c   |  284 
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |  433 +
 arch/arm/plat-omap/include/plat/display.h|   16 +
 arch/arm/plat-omap/include/plat/l3_2xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l3_3xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h|   24 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h|   10 +
 drivers/video/omap2/dss/core.c   |  448 ++
 drivers/video/omap2/dss/dispc.c  |  114 ---
 drivers/video/omap2/dss/dsi.c|   78 -
 drivers/video/omap2/dss/dss.c|  411 +++-
 drivers/video/omap2/dss/dss.h|   46 ++--
 drivers/video/omap2/dss/rfbi.c   |  118 ---
 drivers/video/omap2/dss/venc.c   |  125 +---
 33 files changed, 2049 insertions(+), 785 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

--
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


[PATCH v8 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from 
platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Signed-off-by: Sumit Semwal 
Reviewed-by: Paul Walmsley 
Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dispc.c |   11 ---
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |   11 ---
 drivers/video/omap2/dss/rfbi.c  |   10 +++---
 drivers/video/omap2/dss/venc.c  |   11 ---
 5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1c22cf0..381942d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
 #include "dss_features.h"
 
 /* DISPC */
-#define DISPC_BASE 0x48050400
-
 #define DISPC_SZ_REGS  SZ_4K
 
 struct dispc_reg { u16 idx; };
@@ -3324,6 +3322,8 @@ int dispc_setup_plane(enum omap_plane plane,
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
u32 rev;
+   struct resource *dispc_mem;
+
dispc.pdev = pdev;
 
spin_lock_init(&dispc.irq_lock);
@@ -3335,7 +3335,12 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
 
INIT_WORK(&dispc.error_work, dispc_error_worker);
 
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+   if (!dispc_mem) {
+   DSSERR("can't get IORESOURCE_MEM DISPC\n");
+   return -EINVAL;
+   }
+   dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 39a1c04..cab08cb 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,8 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE   0x4804FC00
-
 struct dsi_reg { u16 idx; };
 
 #define DSI_REG(idx)   ((const struct dsi_reg) { idx })
@@ -3257,6 +3255,7 @@ static int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
+   struct resource *dsi_mem;
 
spin_lock_init(&dsi.errors_lock);
dsi.errors = 0;
@@ -3283,7 +3282,13 @@ static int dsi_init(struct platform_device *pdev)
dsi.te_timer.function = dsi_te_timeout;
dsi.te_timer.data = 0;
 #endif
-   dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+   dsi_mem = platform_get_resource(dsi.pdev, IORESOURCE_MEM, 0);
+   if (!dsi_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSI\n");
+   r = -EINVAL;
+   goto err0;
+   }
+   dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi.base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
@@ -3310,6 +3315,7 @@ err2:
iounmap(dsi.base);
 err1:
destroy_workqueue(dsi.workqueue);
+err0:
return r;
 }
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 8b7972e..4d7a816 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -34,8 +34,6 @@
 #include 
 #include "dss.h"
 
-#define DSS_BASE   0x4805
-
 #define DSS_SZ_REGSSZ_512
 
 struct dss_reg {
@@ -567,8 +565,15 @@ static int dss_init(bool skip_init)
 {
int r;
u32 rev;
+   struct resource *dss_mem;
 
-   dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
+   dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
+   if (!dss_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSS\n");
+   r = -EINVAL;
+   goto fail0;
+   }
+   dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 93b13c5..fc665a7 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,8 +36,6 @@
 #include 
 #include "dss.h"
 
-#define RFBI_BASE   0x48050800
-
 struct rfbi_reg { u16 idx; };
 
 #define RFBI_REG(idx)  ((const struct rfbi_reg) { idx })
@@ -1019,6 +1017,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
u32 rev;
u32 l;
+   struct resource *rfbi_mem;
 
rfbi.pdev = pdev;
 
@@ -1028,7 +1027,12 @@ static int omap_rfbihw_probe(struct platform_device 
*pdev)
atomic_set(&rfbi.cmd_fifo_full, 0);
atomic_set(&rfbi.cmd_pending

[PATCH v8 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
Reviewed-by: Paul Walmsley 
---
 drivers/video/omap2/dss/dss.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 4d7a816..22690e9 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -563,7 +563,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 static int dss_init(bool skip_init)
 {
-   int r;
+   int r, dss_irq;
u32 rev;
struct resource *dss_mem;
 
@@ -609,15 +609,18 @@ static int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
+   dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss_irq != -ENXIO) {
+   r = request_irq(dss_irq,
cpu_is_omap24xx()
? dss_irq_handler_omap2
: dss_irq_handler_omap3,
0, "OMAP DSS", NULL);
 
-   if (r < 0) {
-   DSSERR("omap2 dss: request_irq failed\n");
-   goto fail1;
+   if (r < 0) {
+   DSSERR("omap2 dss: request_irq failed\n");
+   goto fail1;
+   }
}
 
if (cpu_is_omap34xx()) {
-- 
1.7.1

--
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


[PATCH v8 14/18] OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |2 +-
 arch/arm/mach-omap2/board-omap3evm.c |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +-
 drivers/video/omap2/dss/core.c   |   28 +--
 drivers/video/omap2/dss/dss.h|9 +-
 drivers/video/omap2/dss/venc.c   |  116 +-
 12 files changed, 93 insertions(+), 78 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d00f356..e0d13ae 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 1c36ec8..2e9265e 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -488,7 +488,7 @@ static struct regulator_consumer_supply cm_t35_vsim_supply 
= {
 };
 
 static struct regulator_consumer_supply cm_t35_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply cm_t35_vdvi_supply =
REGULATOR_SUPPLY("vdvi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 6a2eb49..331b94e 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index c0a5066..4dd1475 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -229,7 +229,7 @@ static struct omap_dss_board_info beagle_dss_data = {
 };
 
 static struct regulator_consumer_supply beagle_vdac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply beagle_vdvi_supply =
REGULATOR_SUPPLY("vdds_dsi", "omap_display");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 5f156fe..ec45575 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -493,7 +493,7 @@ static struct twl4030_codec_data omap3evm_codec_data = {
 };
 
 static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c 
b/arch/arm/mach-omap2/board-omap3pandora.c
index 613ab58..b44e604 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -342,7 +342,7 @@ static struct regulator_consumer_supply 
pandora_vmmc3_supply =
REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2");
 
 static struct regulator_consumer_supply pandora_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct regulator_consumer_supply pandora_vdds_supplies[] = {
REGULATOR_SUPPLY("vdds_sdi", "omap_display"

[PATCH v8 15/18] OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator 
is
needed by dpi_init() too. Board files are updated accordingly to add 2 
instances of
vdds_dsi regulator.

DSI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |1 +
 arch/arm/mach-omap2/board-devkit8000.c   |   10 ++--
 arch/arm/mach-omap2/board-igep0020.c |   10 ++--
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 ++--
 arch/arm/mach-omap2/board-omap3evm.c |   10 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |1 +
 arch/arm/mach-omap2/board-omap3stalker.c |   10 ++--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   10 ++--
 drivers/video/omap2/dss/core.c   |8 ++--
 drivers/video/omap2/dss/dsi.c|   64 -
 drivers/video/omap2/dss/dss.h|8 ++--
 11 files changed, 107 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e0d13ae..33ff4f6 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -533,6 +533,7 @@ static struct regulator_init_data sdp3430_vdac = {
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 331b94e..6cdedd9 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -273,8 +273,10 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
.setup  = devkit8000_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
@@ -315,8 +317,8 @@ static struct regulator_init_data devkit8000_vpll1 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &devkit8000_vpll1_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll1_supplies),
+   .consumer_supplies  = devkit8000_vpll1_supplies,
 };
 
 /* VAUX4 for ads7846 and nubs */
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index d79dcd5..dfbe3a1 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -485,8 +485,10 @@ static struct omap_dss_board_info igep2_dss_data = {
.default_device = &igep2_dvi_device,
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
+static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
@@ -499,8 +501,8 @@ static struct regulator_init_data igep2_vpll2 = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = &igep2_vpll2_supply,
+   .num_consumer_supplies  = ARRAY_SIZE(igep2_vpll2_supplies),
+   .consumer_supplies  = igep2_vpll2_supplies,
 };
 
 static void __init igep2_display_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 4dd1475..caf6c8a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -231,8 +231,10 @@ static struct omap_dss_board_info beagle_dss_data = {
 static struct regulator_consumer_supply beagle_vdac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
-static struct regulator_consumer_supply b

[PATCH v8 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init

2011-01-21 Thread Sumit Semwal
This patch replaces printk's in the init/probe functions to dev_dbg
for boot time optimization.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dispc.c |2 +-
 drivers/video/omap2/dss/dsi.c   |2 +-
 drivers/video/omap2/dss/rfbi.c  |2 +-
 drivers/video/omap2/dss/venc.c  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index abfed47..1c22cf0 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3350,7 +3350,7 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
dispc_save_context();
 
rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DISPC rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d854137..39a1c04 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3300,7 +3300,7 @@ static int dsi_init(struct platform_device *pdev)
enable_clocks(1);
 
rev = dsi_read_reg(DSI_REVISION);
-   printk(KERN_INFO "OMAP DSI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DSI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index a64e119..93b13c5 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1046,7 +1046,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_write_reg(RFBI_SYSCONFIG, l);
 
rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
rfbi_enable_clocks(0);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 935ae8e..3db9061 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -739,7 +739,7 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_enable_clocks(1);
 
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
-   printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
+   dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
 
venc_enable_clocks(0);
 
-- 
1.7.1

--
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


[PATCH v8 11/18] OMAP2,3: DSS2: Move clocks from core driver to dss driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

All clock management is moved to dss platform driver. clk_get/put APIs use
dss device instead of core platform device.

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So the device name is changed from omap_display to omap_dss in 2420, 2430,
3xxx clock database files. Now the core driver "omap_display" only takes care
of panel registration with the custom bus.
core driver also uses the clk_enable() / clk_disable() APIs exposed by DSS for
clock management.
DSS driver would do clock management of clocks needed by DISPC, RFBI, DSI, VENC

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Signed-off-by: Senthilvadivu Guruswamy 
Acked-by: Paul Walmsley 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 drivers/video/omap2/dss/core.c   |  343 +-
 drivers/video/omap2/dss/dss.c|  334 +-
 drivers/video/omap2/dss/dss.h|   13 +-
 6 files changed, 360 insertions(+), 360 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index b412958..d2abc2f 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_2d_fck",   &gfx_2d_fck,CK_242X),
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 039155e..663f298 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_ick",  &mdm_ick,   CK_243X),
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 8618262..5c97b93 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,13 +3357,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es1, 
CK_3430ES1),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es2, 
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-   CLK("omap_display", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("omap_display", "video_fck", 

[PATCH v8 12/18] OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for RFBI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

RFBI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |8 ++--
 drivers/video/omap2/dss/dss.h  |8 ++--
 drivers/video/omap2/dss/rfbi.c |  110 
 3 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bdb952f..d4b3da3 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -201,9 +201,9 @@ static int omap_dss_probe(struct platform_device *pdev)
/* keep clocks enabled to prevent context saves/restores during init */
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
 
-   r = rfbi_init();
+   r = rfbi_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize rfbi\n");
+   DSSERR("Failed to initialize rfbi platform driver\n");
goto err_rfbi;
}
 
@@ -285,7 +285,7 @@ err_venc:
 err_dispc:
dpi_exit();
 err_dpi:
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
 err_rfbi:
dss_uninit_platform_driver();
 err_dss:
@@ -303,7 +303,7 @@ static int omap_dss_remove(struct platform_device *pdev)
venc_exit();
dispc_exit();
dpi_exit();
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
dsi_exit();
sdi_exit();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index c535ee1..0ba4bdb 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -428,8 +428,8 @@ static inline void venc_exit(void)
 
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
-int rfbi_init(void);
-void rfbi_exit(void);
+int rfbi_init_platform_driver(void);
+void rfbi_uninit_platform_driver(void);
 void rfbi_dump_regs(struct seq_file *s);
 
 int rfbi_configure(int rfbi_module, int bpp, int lines);
@@ -440,11 +440,11 @@ void rfbi_set_timings(int rfbi_module, struct 
rfbi_timings *t);
 unsigned long rfbi_get_max_tx_rate(void);
 int rfbi_init_display(struct omap_dss_device *display);
 #else
-static inline int rfbi_init(void)
+static inline int rfbi_init_platform_driver(void)
 {
return 0;
 }
-static inline void rfbi_exit(void)
+static inline void rfbi_uninit_platform_driver(void)
 {
 }
 #endif
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 10a2ffe..a64e119 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -100,6 +100,7 @@ static int rfbi_convert_timings(struct rfbi_timings *t);
 static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
unsigned long   l4_khz;
@@ -957,50 +958,6 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
-{
-   u32 rev;
-   u32 l;
-
-   spin_lock_init(&rfbi.cmd_lock);
-
-   init_completion(&rfbi.cmd_done);
-   atomic_set(&rfbi.cmd_fifo_full, 0);
-   atomic_set(&rfbi.cmd_pending, 0);
-
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
-   if (!rfbi.base) {
-   DSSERR("can't ioremap RFBI\n");
-   return -ENOMEM;
-   }
-
-   rfbi_enable_clocks(1);
-
-   msleep(10);
-
-   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
-
-   /* Enable autoidle and smart-idle */
-   l = rfbi_read_reg(RFBI_SYSCONFIG);
-   l |= (1 << 0) | (2 << 3);
-   rfbi_write_reg(RFBI_SYSCONFIG, l);
-
-   rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   rfbi_enable_clocks(0);
-
-   return 0;
-}
-
-void rfbi_exit(void)
-{
-   DSSDBG("rfbi_exit\n");
-
-   iounmap(rfbi.base);
-}
-
 int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 {
int r;
@@ -1056,3 +1013,68 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
return 0;
 }
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   u32 l;
+
+   rfbi.pdev = pdev;
+
+   spin_lock_init(&rfbi.cmd_lock);
+
+   init_completion(&rfbi.cmd_done);
+   atomic_set(&rfbi.cmd_fifo_full, 0);
+   atomic_set(&rfbi.cmd_pending, 0);
+
+   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+   if (!rfbi.base) {
+   DSSERR("can't 

[PATCH v8 13/18] OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DISPC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DISPC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c  |8 ++--
 drivers/video/omap2/dss/dispc.c |  105 ---
 drivers/video/omap2/dss/dss.h   |4 +-
 3 files changed, 70 insertions(+), 47 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d4b3da3..5acb5e6 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -213,9 +213,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = dispc_init();
+   r = dispc_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize dispc\n");
+   DSSERR("Failed to initialize dispc platform driver\n");
goto err_dispc;
}
 
@@ -281,7 +281,7 @@ err_dsi:
 err_sdi:
venc_exit();
 err_venc:
-   dispc_exit();
+   dispc_uninit_platform_driver();
 err_dispc:
dpi_exit();
 err_dpi:
@@ -301,7 +301,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs();
 
venc_exit();
-   dispc_exit();
+   dispc_uninit_platform_driver();
dpi_exit();
rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9f8c69f..abfed47 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -178,6 +178,7 @@ struct dispc_irq_stats {
 };
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
u32 fifo_size[3];
@@ -3269,47 +3270,6 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
-{
-   u32 rev;
-
-   spin_lock_init(&dispc.irq_lock);
-
-#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
-   spin_lock_init(&dispc.irq_stats_lock);
-   dispc.irq_stats.last_reset = jiffies;
-#endif
-
-   INIT_WORK(&dispc.error_work, dispc_error_worker);
-
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
-   if (!dispc.base) {
-   DSSERR("can't ioremap DISPC\n");
-   return -ENOMEM;
-   }
-
-   enable_clocks(1);
-
-   _omap_dispc_initial_config();
-
-   _omap_dispc_initialize_irq();
-
-   dispc_save_context();
-
-   rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   enable_clocks(0);
-
-   return 0;
-}
-
-void dispc_exit(void)
-{
-   iounmap(dispc.base);
-}
-
 int dispc_enable_plane(enum omap_plane plane, bool enable)
 {
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -3359,3 +3319,66 @@ int dispc_setup_plane(enum omap_plane plane,
 
return r;
 }
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   dispc.pdev = pdev;
+
+   spin_lock_init(&dispc.irq_lock);
+
+#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
+   spin_lock_init(&dispc.irq_stats_lock);
+   dispc.irq_stats.last_reset = jiffies;
+#endif
+
+   INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   if (!dispc.base) {
+   DSSERR("can't ioremap DISPC\n");
+   return -ENOMEM;
+   }
+
+   enable_clocks(1);
+
+   _omap_dispc_initial_config();
+
+   _omap_dispc_initialize_irq();
+
+   dispc_save_context();
+
+   rev = dispc_read_reg(DISPC_REVISION);
+   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   enable_clocks(0);
+
+   return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+   iounmap(dispc.base);
+   return 0;
+}
+
+static struct platform_driver omap_dispchw_driver = {
+   .probe  = omap_dispchw_probe,
+   .remove = omap_dispchw_remove,
+   .driver = {
+   .name   = "omap_dispc",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dispc_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dispchw_driver);
+}
+
+void dispc_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dispchw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0ba4bdb..f4835c8 1006

[PATCH v8 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Looks up the hwmod database for each of the given DSS HW IP and builds
omap_device which inturn does the platform device register for each of DSS HW IP

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   50 +
 arch/arm/plat-omap/include/plat/display.h |5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 6e21cb8..5c0a78b 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 static struct platform_device omap_display_device = {
.name  = "omap_display",
@@ -32,10 +34,58 @@ static struct platform_device omap_display_device = {
},
 };
 
+static struct omap_device_pm_latency omap_dss_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   .flags  = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
 int __init omap_display_init(struct omap_dss_board_info
*board_data)
 {
int r = 0;
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   int i;
+   struct omap_display_platform_data pdata;
+
+   /*
+* omap: valid DSS hwmod names
+* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3: dss_dsi1
+*/
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
+   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   int oh_count;
+
+   memset(&pdata, 0, sizeof(pdata));
+
+   if (cpu_is_omap24xx())
+   oh_count = ARRAY_SIZE(oh_name) - 1;
+   /* last hwmod dev in oh_name is not available for omap2 */
+   else
+   oh_count = ARRAY_SIZE(oh_name);
+
+   pdata.board_data = board_data;
+   pdata.board_data->get_last_off_on_transaction_id = NULL;
+
+   for (i = 0; i < oh_count; i++) {
+   oh = omap_hwmod_lookup(oh_name[i]);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name[i]);
+   return -ENODEV;
+   }
+   od = omap_device_build(dev_name[i], -1, oh, &pdata,
+   sizeof(struct omap_display_platform_data),
+   omap_dss_latency,
+   ARRAY_SIZE(omap_dss_latency), 0);
+
+   if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+   oh_name[i]))
+   return -ENODEV;
+   }
omap_display_device.dev.platform_data = board_data;
 
r = platform_device_register(&omap_display_device);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 0f140ec..2fb057e 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -237,6 +237,11 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 }
 #endif
 
+struct omap_display_platform_data {
+   struct omap_dss_board_info *board_data;
+   /* TODO: Additional members to be added when PM is considered */
+};
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v8 10/18] OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver of DSS is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DSS platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   19 ++---
 drivers/video/omap2/dss/dss.c  |   55 ++-
 drivers/video/omap2/dss/dss.h  |4 +-
 3 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 1bbc004..1aace9e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -517,15 +517,9 @@ static int omap_dss_probe(struct platform_device *pdev)
core.ctx_id = dss_get_ctx_id();
DSSDBG("initial ctx id %u\n", core.ctx_id);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-   /* DISPC_CONTROL */
-   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-   skip_init = 1;
-#endif
-
-   r = dss_init(skip_init);
+   r = dss_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize DSS\n");
+   DSSERR("Failed to initialize DSS platform driver\n");
goto err_dss;
}
 
@@ -553,6 +547,11 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_venc;
}
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
if (cpu_is_omap34xx()) {
r = sdi_init(skip_init);
if (r) {
@@ -610,7 +609,7 @@ err_dispc:
 err_dpi:
rfbi_exit();
 err_rfbi:
-   dss_exit();
+   dss_uninit_platform_driver();
 err_dss:
dss_clk_disable_all_no_ctx();
dss_put_clocks();
@@ -635,7 +634,7 @@ static int omap_dss_remove(struct platform_device *pdev)
sdi_exit();
}
 
-   dss_exit();
+   dss_uninit_platform_driver();
 
/*
 * As part of hwmod changes, DSS is not the only controller of dss
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 77c3621..d130f04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -59,6 +59,7 @@ struct dss_reg {
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
struct clk  *dpll4_m4_ck;
@@ -549,7 +550,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
 }
 
-int dss_init(bool skip_init)
+static int dss_init(bool skip_init)
 {
int r;
u32 rev;
@@ -629,7 +630,7 @@ fail0:
return r;
 }
 
-void dss_exit(void)
+static void dss_exit(void)
 {
if (cpu_is_omap34xx())
clk_put(dss.dpll4_m4_ck);
@@ -639,3 +640,53 @@ void dss_exit(void)
iounmap(dss.base);
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+   int r;
+   int skip_init = 0;
+
+   dss.pdev = pdev;
+
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
+
+   r = dss_init(skip_init);
+   if (r) {
+   DSSERR("Failed to initialize DSS\n");
+   goto err_dss;
+   }
+
+err_dss:
+
+   return r;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+   dss_exit();
+
+   return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+   .probe  = omap_dsshw_probe,
+   .remove = omap_dsshw_remove,
+   .driver = {
+   .name   = "omap_dss",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dss_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dsshw_driver);
+}
+
+void dss_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dsshw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b394951..37c4544 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -214,8 +214,8 @@ void dss_overlay_setup_l4_manager(struct 
omap_overlay_manager *mgr);
 void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
 
 /* DSS */
-int dss_init(bool skip_init);
-void dss_exit(void);
+int dss_init_platform_driver(void);
+void dss_uninit_platform_driver(void);
 
 void dss_save_context(void);
 void dss_restore_context(void);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux

[PATCH v8 08/18] OMAP2,3: DSS2: board files: replace platform_device_register with omap_display_init()

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

This patch updated board files to replace platform_device_register or
platform_add_devices of DSS with omap_display_init(). This moves away
registration of DSS from board files into a common place.

Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   14 +-
 arch/arm/mach-omap2/board-am3517evm.c|   16 +---
 arch/arm/mach-omap2/board-cm-t35.c   |   10 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   10 +-
 arch/arm/mach-omap2/board-igep0020.c |   10 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   10 +-
 arch/arm/mach-omap2/board-omap3evm.c |   14 +-
 arch/arm/mach-omap2/board-omap3pandora.c |   10 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   10 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +--
 arch/arm/mach-omap2/board-zoom-display.c |   15 +--
 11 files changed, 11 insertions(+), 123 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d99902c..d00f356 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,21 +307,9 @@ static struct omap_dss_board_info sdp3430_dss_data = {
.default_device = &sdp3430_lcd_device,
 };
 
-static struct platform_device sdp3430_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &sdp3430_dss_data,
-   },
-};
-
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct platform_device *sdp3430_devices[] __initdata = {
-   &sdp3430_dss_device,
-};
-
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
 
@@ -796,7 +784,7 @@ static void __init omap_3430sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3430_i2c_init();
-   platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
+   omap_display_init(&sdp3430_dss_data);
if (omap_rev() > OMAP3430_REV_ES1_0)
ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
else
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6bb5f53..548f524 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -378,24 +378,12 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
.default_device = &am3517_evm_lcd_device,
 };
 
-static struct platform_device am3517_evm_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data  = &am3517_evm_dss_data,
-   },
-};
-
 /*
  * Board initialization
  */
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
 };
 
-static struct platform_device *am3517_evm_devices[] __initdata = {
-   &am3517_evm_dss_device,
-};
-
 static void __init am3517_evm_init_irq(void)
 {
omap_board_config = am3517_evm_config;
@@ -495,9 +483,7 @@ static void __init am3517_evm_init(void)
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 
am3517_evm_i2c_init();
-   platform_add_devices(am3517_evm_devices,
-   ARRAY_SIZE(am3517_evm_devices));
-
+   omap_display_init(&am3517_evm_dss_data);
omap_serial_init();
 
/* Configure GPIO for EHCI port */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 22322d1..1c36ec8 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
.default_device = &cm_t35_dvi_device,
 };
 
-static struct platform_device cm_t35_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &cm_t35_dss_data,
-   },
-};
-
 static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,/* 0: slave, 1: master */
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void)
msleep(50);
gpio_set_value(lcd_en_gpio, 1);
 
-   err = platform_device_register(&cm_t35_dss_device);
+   err = omap_display_init(&cm_t35_dss_data);
if (err) {
pr_err("CM-T35: failed to register DSS device\n");
goto err_dev_reg;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index ca8e1b1..6a2eb49 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -198,14 +198,6 @@ static struct omap_dss_board_info

[PATCH v8 06/18] OMAP2,3 DSS2 Use Regulator init with driver name

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Use driver name in regulator inits needed for display instead of using device
structure name.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   11 +++
 arch/arm/mach-omap2/board-cm-t35.c   |   12 
 arch/arm/mach-omap2/board-igep0020.c |6 ++
 arch/arm/mach-omap2/board-omap3evm.c |6 ++
 arch/arm/mach-omap2/board-omap3stalker.c |   12 
 5 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 6f4e7cf..d99902c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -315,10 +315,8 @@ static struct platform_device sdp3430_dss_device = {
},
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &sdp3430_dss_device.dev,
-};
+static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_dss_device,
@@ -546,10 +544,7 @@ static struct regulator_init_data sdp3430_vdac = {
 
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   {
-   .supply = "vdds_dsi",
-   .dev= &sdp3430_dss_device.dev,
-   }
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 79f87ec..22322d1 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -495,15 +495,11 @@ static struct regulator_consumer_supply 
cm_t35_vsim_supply = {
.supply = "vmmc_aux",
 };
 
-static struct regulator_consumer_supply cm_t35_vdac_supply = {
-   .supply = "vdda_dac",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct regulator_consumer_supply cm_t35_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdvi_supply =
+   REGULATOR_SUPPLY("vdvi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data cm_t35_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 23abfa3..238c69e 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -493,10 +493,8 @@ static struct platform_device igep2_dss_device = {
},
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply = {
-   .supply = "vdds_dsi",
-   .dev= &igep2_dss_device.dev,
-};
+static struct regulator_consumer_supply igep2_vpll2_supply =
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 4ad3c4d..32ac816 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -500,10 +500,8 @@ static struct twl4030_codec_data omap3evm_codec_data = {
.audio = &omap3evm_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_evm_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index 51c010c..7b675cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -448,10 +448,8 @@ static struct twl4030_codec_data omap3stalker_codec_data = 
{
.audio  = &omap3stalker_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_stalker_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_st

[PATCH v8 07/18] OMAP2,3: DSS2: Create new file display.c for central dss driver registration.

2011-01-21 Thread Sumit Semwal
A new file display.c is introduced for display driver init, which adds a 
function
omap_display_init to do the DSS driver registration. This is the first step in 
moving
away registration of DSS from board files into a common place.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/Makefile  |3 ++
 arch/arm/mach-omap2/display.c |   46 +
 arch/arm/plat-omap/include/plat/display.h |   11 +++
 3 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b0..2e81173 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -242,3 +242,6 @@ obj-y   += $(smc91x-m) 
$(smc91x-y)
 
 smsc911x-$(CONFIG_SMSC911X):= gpmc-smsc911x.o
 obj-y  += $(smsc911x-m) $(smsc911x-y)
+
+disp-$(CONFIG_OMAP2_DSS)   := display.o
+obj-y  += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 000..6e21cb8
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,46 @@
+/*
+ * OMAP2plus display device setup / initialization.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Senthilvadivu Guruswamy
+ * Sumit Semwal
+ *
+ * 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 "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static struct platform_device omap_display_device = {
+   .name  = "omap_display",
+   .id= -1,
+   .dev= {
+   .platform_data = NULL,
+   },
+};
+
+int __init omap_display_init(struct omap_dss_board_info
+   *board_data)
+{
+   int r = 0;
+   omap_display_device.dev.platform_data = board_data;
+
+   r = platform_device_register(&omap_display_device);
+   if (r < 0)
+   printk(KERN_ERR "Unable to register OMAP-Display device\n");
+
+   return r;
+}
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 537f4e4..0f140ec 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define DISPC_IRQ_FRAMEDONE(1 << 0)
@@ -226,6 +227,16 @@ struct omap_dss_board_info {
struct omap_dss_device *default_device;
 };
 
+#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
+/* Init with the board info */
+extern int omap_display_init(struct omap_dss_board_info *board_data);
+#else
+static inline int omap_display_init(struct omap_dss_board_info *board_data)
+{
+   return 0;
+}
+#endif
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.1

--
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


[PATCH v8 04/18] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for Display Sub System applicable for OMAP3430 and
OMAP36xx.  DSS is also considered as an IP as DISPC, RFBI and named as dss_core.
For all the IP modules in DSS, same clock is needed for enabling. Hwmod sees
DSS IPs as independent IPs, so same clock has to be repeated for .main_clk in
each IP.

This patch defines separate hwmod databases for OMAP3430ES1 and (OMAP3430ES2 and
OMAP36xx) as OMAP3430ES1 does not have IDLEST bit to poll on for dss IP, and 
also
the firewall regions are different between 3430es1 and later.

Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  433 
 arch/arm/plat-omap/include/plat/l3_3xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h  |   10 +
 3 files changed, 463 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..713165d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
 static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
+static struct omap_hwmod omap3430es1_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_core_hwmod;
+static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
+static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
+static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
+static struct omap_hwmod omap3xxx_dss_venc_hwmod;
 static struct omap_hwmod omap3xxx_i2c1_hwmod;
 static struct omap_hwmod omap3xxx_i2c2_hwmod;
 static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -84,6 +91,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = 
{
&omap3xxx_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
+   .master = &omap3xxx_dss_core_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP3_L3_CORE_FW_INIT_ID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
&omap3xxx_l3_main__l4_core,
@@ -664,6 +684,410 @@ static struct omap_hwmod_class i2c_class = {
.sysc = &i2c_sysc,
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap3xxx_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+   { .name = "dsi1", .dma_req = 74 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
+   &omap3xxx_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3430es1_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
+   .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3xxx_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_dss_addrs),
+ 

[PATCH v8 05/18] OMAP2,3 DSS2 Change driver name to omap_display

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Change the driver name from omapdss to omap_display as the driver takes care of
the display devices ie number of panels, type of panels available in the
platform.  Change the device name in the board files and 2420,2430,3xxx clock
files from omapdss to omap_display to match the driver name.

Signed-off-by: Sumit Semwal 
Acked-by: Paul Walmsley 
for: The clkdev changes in clock2420_data.c, clock2430_data.c, clock3xxx_data.c

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-am3517evm.c|2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |6 +++---
 arch/arm/mach-omap2/board-igep0020.c |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |6 +++---
 arch/arm/mach-omap2/board-omap3evm.c |4 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |8 
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 ++--
 arch/arm/mach-omap2/board-rx51-video.c   |2 +-
 arch/arm/mach-omap2/board-zoom-display.c |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |4 ++--
 arch/arm/mach-omap2/clock2420_data.c |8 
 arch/arm/mach-omap2/clock2430_data.c |8 
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 drivers/video/omap2/dss/core.c   |2 +-
 17 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef..6f4e7cf 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct platform_device sdp3430_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &sdp3430_dss_data,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 10d60b7..6bb5f53 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -379,7 +379,7 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
 };
 
 static struct platform_device am3517_evm_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data  = &am3517_evm_dss_data,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index dac1416..79f87ec 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -402,7 +402,7 @@ static struct omap_dss_board_info cm_t35_dss_data = {
 };
 
 static struct platform_device cm_t35_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &cm_t35_dss_data,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 00bb1fc..ca8e1b1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -199,7 +199,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct platform_device devkit8000_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &devkit8000_dss_data,
@@ -207,7 +207,7 @@ static struct platform_device devkit8000_dss_device = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
@@ -282,7 +282,7 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omapdss");
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 3be85a1..23abfa3 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -486,7 +486,7 @@ static struct omap_dss_board_info igep2_dss_data = {
 };
 
 static struct platform_device igep2_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_displa

[PATCH v8 02/18] OMAP2420: hwmod data: add DSS DISPC RFBI VENC

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2420 Display Sub System,. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |  311 +++-
 arch/arm/plat-omap/include/plat/l3_2xxx.h  |   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h  |   24 +++
 3 files changed, 354 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..21014de 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -18,7 +18,8 @@
 #include 
 #include 
 #include 
-
+#include 
+#include 
 #include "omap_hwmod_common_data.h"
 
 #include "cm-regbits-24xx.h"
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2420_mpu_hwmod;
 static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
+static struct omap_hwmod omap2420_dss_core_hwmod;
+static struct omap_hwmod omap2420_dss_dispc_hwmod;
+static struct omap_hwmod omap2420_dss_rfbi_hwmod;
+static struct omap_hwmod omap2420_dss_venc_hwmod;
 static struct omap_hwmod omap2420_wd_timer2_hwmod;
 static struct omap_hwmod omap2420_gpio1_hwmod;
 static struct omap_hwmod omap2420_gpio2_hwmod;
@@ -64,6 +69,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = 
{
&omap2420_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
+   .master = &omap2420_dss_core_hwmod,
+   .slave  = &omap2420_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
&omap2420_l3_main__l4_core,
@@ -470,6 +488,291 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2420_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
+   &omap2420_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
+   .master = &omap2420_l4_core_hwmod,
+   .slave  = &omap2420_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2420_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2420_dss_addrs),
+   .fw = {
+   .omap2 = {
+   .l4_fw_region  = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
+   .flags  = OMAP_FIREWALL_L4,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
+   &omap2420_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2420_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2420_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2420_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2420_dss_irqs),
+   .sdma_reqs  = omap2420_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2420_dss_sdma_chs),
+   .prcm   = {
+   

[PATCH v8 03/18] OMAP2430: hwmod data: add DSS DISPC RFBI VENC

2011-01-21 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2430 Display Sub System. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_core.

Acked-by: Benoit Cousson 
Signed-off-by: Sumit Semwal 
Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |  284 
 1 files changed, 284 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..1ef3f3f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "omap_hwmod_common_data.h"
 
@@ -38,6 +39,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
 static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
+static struct omap_hwmod omap2430_dss_core_hwmod;
+static struct omap_hwmod omap2430_dss_dispc_hwmod;
+static struct omap_hwmod omap2430_dss_rfbi_hwmod;
+static struct omap_hwmod omap2430_dss_venc_hwmod;
 static struct omap_hwmod omap2430_wd_timer2_hwmod;
 static struct omap_hwmod omap2430_gpio1_hwmod;
 static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -65,6 +70,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = 
{
&omap2430_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
+   .master = &omap2430_dss_core_hwmod,
+   .slave  = &omap2430_l3_main_hwmod,
+   .fw = {
+   .omap2 = {
+   .l3_perm_bit  = OMAP2_L3_CORE_FW_CONNID_DSS,
+   .flags  = OMAP_FIREWALL_L3,
+   }
+   },
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
&omap2430_l3_main__l4_core,
@@ -469,6 +487,266 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2430_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2430_dss_irqs[] = {
+   { .irq = 25 },
+};
+static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
+   &omap2430_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
+   .master = &omap2430_l4_core_hwmod,
+   .slave  = &omap2430_dss_core_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2430_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2430_dss_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
+   &omap2430_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2430_dss_core_hwmod = {
+   .name   = "dss_core",
+   .class  = &omap2430_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2430_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2430_dss_irqs),
+   .sdma_reqs  = omap2430_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2430_dss_sdma_chs),
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_DSS1_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap2430_dss_slaves,
+   .slaves_cnt =

[PATCH v8 00/18] OMAP2,3: hwmod DSS Adaptation

2011-01-21 Thread Sumit Semwal
pdss driver can continue as the DSS HW IP specific 
platform
drivers are decoupled from omapdss driver.
6) Following review comments incorporated:
Changed the hwmod device name from "dss" to "dss_dss"
Changed name of core driver from "omapdss" to "omap_display" as it 
deals with panels.
Fixed comments on return values from platform_get_resource/irq 
functions.

Patch Base:
===
Patch-set rebased and tested w/ Zoom3 (OMAP3630) on top of:
url = git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
branch "master"
commit  e8883f8057c0f7c9950fa9f20568f37bfa62f34a
Description: Add linux-next specific files for 20110115
+
Patch mentioned in 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42384.html
[PATCH] OMAP: counter_32k: init clocksource as part of machine timer init

(This patch is required for OMAP bootup w/ 20110115 linux-next)


Senthilvadivu Guruswamy (15):
  OMAP2420: hwmod data: add DSS DISPC RFBI VENC
  OMAP2430: hwmod data: add DSS DISPC RFBI VENC
  OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
  OMAP2,3 DSS2 Change driver name to omap_display
  OMAP2,3 DSS2 Use Regulator init with driver name
  OMAP2,3: DSS2: board files: replace platform_device_register with
omap_display_init()
  OMAP2,3: DSS2: Build omap_device for each DSS HWIP
  OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Move clocks from core driver to dss driver
  OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to
driver
  OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver
  OMAP2,3: DSS2: Use platform device to get baseaddr
  OMAP2,3: DSS2: Get DSS IRQ from platform device

Sumit Semwal (3):
  OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove
  OMAP2,3: DSS2: Create new file display.c for central dss driver
registration.
  OMAP2,3: DSS2: replace printk with dev_dbg in init

 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-3430sdp.c  |   26 +--
 arch/arm/mach-omap2/board-am3517evm.c|   16 +-
 arch/arm/mach-omap2/board-cm-t35.c   |   22 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   22 +-
 arch/arm/mach-omap2/board-igep0020.c |   20 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   22 +-
 arch/arm/mach-omap2/board-omap3evm.c |   30 +--
 arch/arm/mach-omap2/board-omap3pandora.c |   17 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   26 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 +-
 arch/arm/mach-omap2/board-rx51-video.c   |   15 +-
 arch/arm/mach-omap2/board-zoom-display.c |   15 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |   12 +-
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 arch/arm/mach-omap2/display.c|   96 ++
 arch/arm/mach-omap2/omap_hwmod_2420_data.c   |  311 ++-
 arch/arm/mach-omap2/omap_hwmod_2430_data.c   |  284 
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |  433 +
 arch/arm/plat-omap/include/plat/display.h|   16 +
 arch/arm/plat-omap/include/plat/l3_2xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l3_3xxx.h|   20 ++
 arch/arm/plat-omap/include/plat/l4_2xxx.h|   24 ++
 arch/arm/plat-omap/include/plat/l4_3xxx.h|   10 +
 drivers/video/omap2/dss/core.c   |  448 ++
 drivers/video/omap2/dss/dispc.c  |  114 ---
 drivers/video/omap2/dss/dsi.c|   78 -
 drivers/video/omap2/dss/dss.c|  411 +++-
 drivers/video/omap2/dss/dss.h|   46 ++--
 drivers/video/omap2/dss/rfbi.c   |  118 ---
 drivers/video/omap2/dss/venc.c   |  125 +---
 33 files changed, 2049 insertions(+), 785 deletions(-)
 create mode 100644 arch/arm/mach-omap2/display.c
 create mode 100644 arch/arm/plat-omap/include/plat/l3_2xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l3_3xxx.h
 create mode 100644 arch/arm/plat-omap/include/plat/l4_2xxx.h

--
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


[PATCH v8 01/18] OMAP2,3: DSS2: remove forced clk-disable from omap_dss_remove

2011-01-21 Thread Sumit Semwal
As part of omap hwmod changes, DSS will not be the only controller of its
clocks. hwmod initialization also enables the interface clocks, and
manages them.
So, when DSS is built as a module, omap_dss_remove doesn't try to disable
all clocks that have a higher usecount.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   46 ++-
 1 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 8e89f60..ee56859 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -623,7 +623,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 {
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
int i;
-   int c;
 
dss_uninitialize_debugfs();
 
@@ -638,44 +637,13 @@ static int omap_dss_remove(struct platform_device *pdev)
 
dss_exit();
 
-   /* these should be removed at some point */
-   c = core.dss_ick->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_ick usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_ick);
-   }
-
-   c = core.dss1_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss1_fck);
-   }
-
-   c = core.dss2_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss2_fck);
-   }
-
-   c = core.dss_54m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
-   while (c-- > 0)
-   clk_disable(core.dss_54m_fck);
-   }
-
-   if (core.dss_96m_fck) {
-   c = core.dss_96m_fck->usecount;
-   if (c > 0) {
-   DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
-   c);
-   while (c-- > 0)
-   clk_disable(core.dss_96m_fck);
-   }
-   }
+   /*
+* As part of hwmod changes, DSS is not the only controller of dss
+* clocks; hwmod framework itself will also enable clocks during hwmod
+* init for dss, and autoidle is set in h/w for DSS. Hence, there's no
+* need to disable clocks if their usecounts > 1.
+*/
+   WARN_ON(core.num_clks_enabled > 0);
 
dss_put_clocks();
 
-- 
1.7.1

--
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


[PATCH v7 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
Reviewed-by: Paul Walmsley 
---
 drivers/video/omap2/dss/dss.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 4d7a816..22690e9 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -563,7 +563,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 static int dss_init(bool skip_init)
 {
-   int r;
+   int r, dss_irq;
u32 rev;
struct resource *dss_mem;
 
@@ -609,15 +609,18 @@ static int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
+   dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss_irq != -ENXIO) {
+   r = request_irq(dss_irq,
cpu_is_omap24xx()
? dss_irq_handler_omap2
: dss_irq_handler_omap3,
0, "OMAP DSS", NULL);
 
-   if (r < 0) {
-   DSSERR("omap2 dss: request_irq failed\n");
-   goto fail1;
+   if (r < 0) {
+   DSSERR("omap2 dss: request_irq failed\n");
+   goto fail1;
+   }
}
 
if (cpu_is_omap34xx()) {
-- 
1.7.0.4

--
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


[PATCH v7 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from 
platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Signed-off-by: Sumit Semwal 
Reviewed-by: Paul Walmsley 
Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dispc.c |   11 ---
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |   11 ---
 drivers/video/omap2/dss/rfbi.c  |   10 +++---
 drivers/video/omap2/dss/venc.c  |   11 ---
 5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1c22cf0..381942d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
 #include "dss_features.h"
 
 /* DISPC */
-#define DISPC_BASE 0x48050400
-
 #define DISPC_SZ_REGS  SZ_4K
 
 struct dispc_reg { u16 idx; };
@@ -3324,6 +3322,8 @@ int dispc_setup_plane(enum omap_plane plane,
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
u32 rev;
+   struct resource *dispc_mem;
+
dispc.pdev = pdev;
 
spin_lock_init(&dispc.irq_lock);
@@ -3335,7 +3335,12 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
 
INIT_WORK(&dispc.error_work, dispc_error_worker);
 
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+   if (!dispc_mem) {
+   DSSERR("can't get IORESOURCE_MEM DISPC\n");
+   return -EINVAL;
+   }
+   dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 39a1c04..cab08cb 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,8 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE   0x4804FC00
-
 struct dsi_reg { u16 idx; };
 
 #define DSI_REG(idx)   ((const struct dsi_reg) { idx })
@@ -3257,6 +3255,7 @@ static int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
+   struct resource *dsi_mem;
 
spin_lock_init(&dsi.errors_lock);
dsi.errors = 0;
@@ -3283,7 +3282,13 @@ static int dsi_init(struct platform_device *pdev)
dsi.te_timer.function = dsi_te_timeout;
dsi.te_timer.data = 0;
 #endif
-   dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+   dsi_mem = platform_get_resource(dsi.pdev, IORESOURCE_MEM, 0);
+   if (!dsi_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSI\n");
+   r = -EINVAL;
+   goto err0;
+   }
+   dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi.base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
@@ -3310,6 +3315,7 @@ err2:
iounmap(dsi.base);
 err1:
destroy_workqueue(dsi.workqueue);
+err0:
return r;
 }
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 8b7972e..4d7a816 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -34,8 +34,6 @@
 #include 
 #include "dss.h"
 
-#define DSS_BASE   0x4805
-
 #define DSS_SZ_REGSSZ_512
 
 struct dss_reg {
@@ -567,8 +565,15 @@ static int dss_init(bool skip_init)
 {
int r;
u32 rev;
+   struct resource *dss_mem;
 
-   dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
+   dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
+   if (!dss_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSS\n");
+   r = -EINVAL;
+   goto fail0;
+   }
+   dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 93b13c5..fc665a7 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,8 +36,6 @@
 #include 
 #include "dss.h"
 
-#define RFBI_BASE   0x48050800
-
 struct rfbi_reg { u16 idx; };
 
 #define RFBI_REG(idx)  ((const struct rfbi_reg) { idx })
@@ -1019,6 +1017,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
u32 rev;
u32 l;
+   struct resource *rfbi_mem;
 
rfbi.pdev = pdev;
 
@@ -1028,7 +1027,12 @@ static int omap_rfbihw_probe(struct platform_device 
*pdev)
atomic_set(&rfbi.cmd_fifo_full, 0);
atomic_set(&rfbi.cmd_pending

[PATCH v7 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init

2011-01-16 Thread Sumit Semwal
This patch replaces printk's in the init/probe functions to dev_dbg
for boot time optimization.

Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/dispc.c |2 +-
 drivers/video/omap2/dss/dsi.c   |2 +-
 drivers/video/omap2/dss/rfbi.c  |2 +-
 drivers/video/omap2/dss/venc.c  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index abfed47..1c22cf0 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3350,7 +3350,7 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
dispc_save_context();
 
rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DISPC rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d854137..39a1c04 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3300,7 +3300,7 @@ static int dsi_init(struct platform_device *pdev)
enable_clocks(1);
 
rev = dsi_read_reg(DSI_REVISION);
-   printk(KERN_INFO "OMAP DSI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP DSI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
enable_clocks(0);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index a64e119..93b13c5 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1046,7 +1046,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_write_reg(RFBI_SYSCONFIG, l);
 
rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
+   dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n",
   FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
 
rfbi_enable_clocks(0);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 935ae8e..3db9061 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -739,7 +739,7 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_enable_clocks(1);
 
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
-   printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
+   dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
 
venc_enable_clocks(0);
 
-- 
1.7.0.4

--
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


[PATCH v7 15/18] OMAP2,3: DSS2: DSI: create platform_driver, move init,exit to driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c.

DSI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c |1 +
 drivers/video/omap2/dss/core.c  |8 ++--
 drivers/video/omap2/dss/dsi.c   |   64 +--
 drivers/video/omap2/dss/dss.h   |8 ++--
 4 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e0d13ae..33ff4f6 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -533,6 +533,7 @@ static struct regulator_init_data sdp3430_vdac = {
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 9852a70..85add9c 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -222,9 +222,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_sdi;
}
 
-   r = dsi_init(pdev);
+   r = dsi_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize DSI\n");
+   DSSERR("Failed to initialize DSI platform driver\n");
goto err_dsi;
}
}
@@ -259,7 +259,7 @@ err_register:
dss_uninitialize_debugfs();
 err_debugfs:
if (cpu_is_omap34xx())
-   dsi_exit();
+   dsi_uninit_platform_driver();
 err_dsi:
if (cpu_is_omap34xx())
sdi_exit();
@@ -290,7 +290,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dpi_exit();
rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
-   dsi_exit();
+   dsi_uninit_platform_driver();
sdi_exit();
}
 
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index ddf3a05..d854137 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -222,6 +222,7 @@ struct dsi_irq_stats {
 
 static struct
 {
+   struct platform_device *pdev;
void __iomem*base;
 
struct dsi_clock_info current_cinfo;
@@ -292,6 +293,20 @@ static inline u32 dsi_read_reg(const struct dsi_reg idx)
return __raw_readl(dsi.base + idx.idx);
 }
 
+static struct regulator *dsi_get_vdds_dsi(void)
+{
+   struct regulator *reg;
+
+   if (dsi.vdds_dsi_reg != NULL)
+   return dsi.vdds_dsi_reg;
+
+   reg = regulator_get(&dsi.pdev->dev, "vdds_dsi");
+   if (!IS_ERR(reg))
+   dsi.vdds_dsi_reg = reg;
+
+   return reg;
+}
+
 
 void dsi_save_context(void)
 {
@@ -3238,7 +3253,7 @@ void dsi_wait_dsi2_pll_active(void)
DSSERR("DSI2 PLL clock not active\n");
 }
 
-int dsi_init(struct platform_device *pdev)
+static int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
@@ -3275,7 +3290,7 @@ int dsi_init(struct platform_device *pdev)
goto err1;
}
 
-   dsi.vdds_dsi_reg = dss_get_vdds_dsi();
+   dsi.vdds_dsi_reg = dsi_get_vdds_dsi();
if (IS_ERR(dsi.vdds_dsi_reg)) {
DSSERR("can't get VDDS_DSI regulator\n");
r = PTR_ERR(dsi.vdds_dsi_reg);
@@ -3298,8 +3313,13 @@ err1:
return r;
 }
 
-void dsi_exit(void)
+static void dsi_exit(void)
 {
+   if (dsi.vdds_dsi_reg != NULL) {
+   regulator_put(dsi.vdds_dsi_reg);
+   dsi.vdds_dsi_reg = NULL;
+   }
+
iounmap(dsi.base);
 
destroy_workqueue(dsi.workqueue);
@@ -3307,3 +3327,41 @@ void dsi_exit(void)
DSSDBG("omap_dsi_exit\n");
 }
 
+/* DSI1 HW IP initialisation */
+static int omap_dsi1hw_probe(struct platform_device *pdev)
+{
+   int r;
+   dsi.pdev = pdev;
+   r = dsi_init(pdev);
+   if (r) {
+   DSSERR("Failed to initialize DSI\n");
+   goto err_dsi;
+   }
+err_dsi:
+   return r;
+}
+
+static int omap_dsi1hw_remove(struct platform_device *pdev)
+{
+   dsi_exit();
+   return 0;
+}
+
+static struct platform_driver omap_dsi1hw_driver = {
+   .probe  = omap_dsi1hw_probe,
+   .remove = om

[PATCH v7 13/18] OMAP2,3: DSS2: DISPC: create platform_driver, move init,exit to driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DISPC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DISPC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c  |8 ++--
 drivers/video/omap2/dss/dispc.c |  105 ---
 drivers/video/omap2/dss/dss.h   |4 +-
 3 files changed, 70 insertions(+), 47 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d4b3da3..5acb5e6 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -213,9 +213,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = dispc_init();
+   r = dispc_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize dispc\n");
+   DSSERR("Failed to initialize dispc platform driver\n");
goto err_dispc;
}
 
@@ -281,7 +281,7 @@ err_dsi:
 err_sdi:
venc_exit();
 err_venc:
-   dispc_exit();
+   dispc_uninit_platform_driver();
 err_dispc:
dpi_exit();
 err_dpi:
@@ -301,7 +301,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs();
 
venc_exit();
-   dispc_exit();
+   dispc_uninit_platform_driver();
dpi_exit();
rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9f8c69f..abfed47 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -178,6 +178,7 @@ struct dispc_irq_stats {
 };
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
u32 fifo_size[3];
@@ -3269,47 +3270,6 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
-{
-   u32 rev;
-
-   spin_lock_init(&dispc.irq_lock);
-
-#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
-   spin_lock_init(&dispc.irq_stats_lock);
-   dispc.irq_stats.last_reset = jiffies;
-#endif
-
-   INIT_WORK(&dispc.error_work, dispc_error_worker);
-
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
-   if (!dispc.base) {
-   DSSERR("can't ioremap DISPC\n");
-   return -ENOMEM;
-   }
-
-   enable_clocks(1);
-
-   _omap_dispc_initial_config();
-
-   _omap_dispc_initialize_irq();
-
-   dispc_save_context();
-
-   rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   enable_clocks(0);
-
-   return 0;
-}
-
-void dispc_exit(void)
-{
-   iounmap(dispc.base);
-}
-
 int dispc_enable_plane(enum omap_plane plane, bool enable)
 {
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -3359,3 +3319,66 @@ int dispc_setup_plane(enum omap_plane plane,
 
return r;
 }
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   dispc.pdev = pdev;
+
+   spin_lock_init(&dispc.irq_lock);
+
+#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
+   spin_lock_init(&dispc.irq_stats_lock);
+   dispc.irq_stats.last_reset = jiffies;
+#endif
+
+   INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   if (!dispc.base) {
+   DSSERR("can't ioremap DISPC\n");
+   return -ENOMEM;
+   }
+
+   enable_clocks(1);
+
+   _omap_dispc_initial_config();
+
+   _omap_dispc_initialize_irq();
+
+   dispc_save_context();
+
+   rev = dispc_read_reg(DISPC_REVISION);
+   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   enable_clocks(0);
+
+   return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+   iounmap(dispc.base);
+   return 0;
+}
+
+static struct platform_driver omap_dispchw_driver = {
+   .probe  = omap_dispchw_probe,
+   .remove = omap_dispchw_remove,
+   .driver = {
+   .name   = "omap_dispc",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dispc_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dispchw_driver);
+}
+
+void dispc_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dispchw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0ba4bdb..f4835c8 1006

[PATCH v7 14/18] OMAP2,3: DSS2: VENC: create platform_driver, move init,exit to driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/board-3430sdp.c |2 +-
 drivers/video/omap2/dss/core.c  |   28 +---
 drivers/video/omap2/dss/dss.h   |9 +--
 drivers/video/omap2/dss/venc.c  |  116 +++
 4 files changed, 85 insertions(+), 70 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index d00f356..e0d13ae 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -308,7 +308,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5acb5e6..9852a70 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -43,7 +43,6 @@ static struct {
 
struct regulator *vdds_dsi_reg;
struct regulator *vdds_sdi_reg;
-   struct regulator *vdda_dac_reg;
 } core;
 
 static char *def_disp_name;
@@ -85,20 +84,6 @@ struct regulator *dss_get_vdds_sdi(void)
return reg;
 }
 
-struct regulator *dss_get_vdda_dac(void)
-{
-   struct regulator *reg;
-
-   if (core.vdda_dac_reg != NULL)
-   return core.vdda_dac_reg;
-
-   reg = regulator_get(&core.pdev->dev, "vdda_dac");
-   if (!IS_ERR(reg))
-   core.vdda_dac_reg = reg;
-
-   return reg;
-}
-
 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
 static int dss_debug_show(struct seq_file *s, void *unused)
 {
@@ -219,9 +204,9 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dispc;
}
 
-   r = venc_init(pdev);
+   r = venc_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize venc\n");
+   DSSERR("Failed to initialize venc platform driver\n");
goto err_venc;
}
 
@@ -279,7 +264,7 @@ err_dsi:
if (cpu_is_omap34xx())
sdi_exit();
 err_sdi:
-   venc_exit();
+   venc_uninit_platform_driver();
 err_venc:
dispc_uninit_platform_driver();
 err_dispc:
@@ -300,7 +285,7 @@ static int omap_dss_remove(struct platform_device *pdev)
 
dss_uninitialize_debugfs();
 
-   venc_exit();
+   venc_uninit_platform_driver();
dispc_uninit_platform_driver();
dpi_exit();
rfbi_uninit_platform_driver();
@@ -597,11 +582,6 @@ static void __exit omap_dss_exit(void)
core.vdds_sdi_reg = NULL;
}
 
-   if (core.vdda_dac_reg != NULL) {
-   regulator_put(core.vdda_dac_reg);
-   core.vdda_dac_reg = NULL;
-   }
-
platform_driver_unregister(&omap_dss_driver);
 
omap_dss_bus_unregister();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index f4835c8..9313851 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -172,7 +172,6 @@ struct platform_device;
 struct bus_type *dss_get_bus(void);
 struct regulator *dss_get_vdds_dsi(void);
 struct regulator *dss_get_vdds_sdi(void);
-struct regulator *dss_get_vdda_dac(void);
 
 /* display */
 int dss_suspend_all_devices(void);
@@ -412,16 +411,16 @@ int dispc_get_clock_div(enum omap_channel channel,
 
 /* VENC */
 #ifdef CONFIG_OMAP2_DSS_VENC
-int venc_init(struct platform_device *pdev);
-void venc_exit(void);
+int venc_init_platform_driver(void);
+void venc_uninit_platform_driver(void);
 void venc_dump_regs(struct seq_file *s);
 int venc_init_display(struct omap_dss_device *display);
 #else
-static inline int venc_init(struct platform_device *pdev)
+static inline int venc_init_platform_driver(void)
 {
return 0;
 }
-static inline void venc_exit(void)
+static inline void venc_uninit_platform_driver(void)
 {
 }
 #endif
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index eff3505..935ae8e 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -289,6 +289,7 @@ const struct omap_video_timings omap_dss_ntsc_timings = {
 EXPORT_SYMBOL(omap_dss_ntsc_timings);
 
 static struct {
+   struct platform_device *pdev;
void __iomem *base;
struct mutex venc

[PATCH v7 12/18] OMAP2,3: DSS2: RFBI: create platform_driver, move init,exit to driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for RFBI is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

RFBI platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |8 ++--
 drivers/video/omap2/dss/dss.h  |8 ++--
 drivers/video/omap2/dss/rfbi.c |  110 
 3 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bdb952f..d4b3da3 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -201,9 +201,9 @@ static int omap_dss_probe(struct platform_device *pdev)
/* keep clocks enabled to prevent context saves/restores during init */
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
 
-   r = rfbi_init();
+   r = rfbi_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize rfbi\n");
+   DSSERR("Failed to initialize rfbi platform driver\n");
goto err_rfbi;
}
 
@@ -285,7 +285,7 @@ err_venc:
 err_dispc:
dpi_exit();
 err_dpi:
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
 err_rfbi:
dss_uninit_platform_driver();
 err_dss:
@@ -303,7 +303,7 @@ static int omap_dss_remove(struct platform_device *pdev)
venc_exit();
dispc_exit();
dpi_exit();
-   rfbi_exit();
+   rfbi_uninit_platform_driver();
if (cpu_is_omap34xx()) {
dsi_exit();
sdi_exit();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index c535ee1..0ba4bdb 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -428,8 +428,8 @@ static inline void venc_exit(void)
 
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
-int rfbi_init(void);
-void rfbi_exit(void);
+int rfbi_init_platform_driver(void);
+void rfbi_uninit_platform_driver(void);
 void rfbi_dump_regs(struct seq_file *s);
 
 int rfbi_configure(int rfbi_module, int bpp, int lines);
@@ -440,11 +440,11 @@ void rfbi_set_timings(int rfbi_module, struct 
rfbi_timings *t);
 unsigned long rfbi_get_max_tx_rate(void);
 int rfbi_init_display(struct omap_dss_device *display);
 #else
-static inline int rfbi_init(void)
+static inline int rfbi_init_platform_driver(void)
 {
return 0;
 }
-static inline void rfbi_exit(void)
+static inline void rfbi_uninit_platform_driver(void)
 {
 }
 #endif
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 10a2ffe..a64e119 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -100,6 +100,7 @@ static int rfbi_convert_timings(struct rfbi_timings *t);
 static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
unsigned long   l4_khz;
@@ -957,50 +958,6 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
-{
-   u32 rev;
-   u32 l;
-
-   spin_lock_init(&rfbi.cmd_lock);
-
-   init_completion(&rfbi.cmd_done);
-   atomic_set(&rfbi.cmd_fifo_full, 0);
-   atomic_set(&rfbi.cmd_pending, 0);
-
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
-   if (!rfbi.base) {
-   DSSERR("can't ioremap RFBI\n");
-   return -ENOMEM;
-   }
-
-   rfbi_enable_clocks(1);
-
-   msleep(10);
-
-   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
-
-   /* Enable autoidle and smart-idle */
-   l = rfbi_read_reg(RFBI_SYSCONFIG);
-   l |= (1 << 0) | (2 << 3);
-   rfbi_write_reg(RFBI_SYSCONFIG, l);
-
-   rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   rfbi_enable_clocks(0);
-
-   return 0;
-}
-
-void rfbi_exit(void)
-{
-   DSSDBG("rfbi_exit\n");
-
-   iounmap(rfbi.base);
-}
-
 int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 {
int r;
@@ -1056,3 +1013,68 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
return 0;
 }
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+   u32 rev;
+   u32 l;
+
+   rfbi.pdev = pdev;
+
+   spin_lock_init(&rfbi.cmd_lock);
+
+   init_completion(&rfbi.cmd_done);
+   atomic_set(&rfbi.cmd_fifo_full, 0);
+   atomic_set(&rfbi.cmd_pending, 0);
+
+   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+   if (!rfbi.base) {
+   DSSERR("can't 

[PATCH v7 11/18] OMAP2,3: DSS2: Move clocks from core driver to dss driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

All clock management is moved to dss platform driver. clk_get/put APIs use
dss device instead of core platform device.

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So the device name is changed from omap_display to omap_dss in 2420, 2430,
3xxx clock database files. Now the core driver "omap_display" only takes care
of panel registration with the custom bus.
core driver also uses the clk_enable() / clk_disable() APIs exposed by DSS for
clock management.
DSS driver would do clock management of clocks needed by DISPC, RFBI, DSI, VENC

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Signed-off-by: Senthilvadivu Guruswamy 
Acked-by: Paul Walmsley 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 drivers/video/omap2/dss/core.c   |  343 +-
 drivers/video/omap2/dss/dss.c|  334 +-
 drivers/video/omap2/dss/dss.h|   13 +-
 6 files changed, 360 insertions(+), 360 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index b412958..d2abc2f 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_2d_fck",   &gfx_2d_fck,CK_242X),
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 039155e..663f298 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_ick",  &mdm_ick,   CK_243X),
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 8618262..5c97b93 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3357,13 +3357,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es1, 
CK_3430ES1),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es2, 
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-   CLK("omap_display", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("omap_display", "video_fck", 

[PATCH v7 10/18] OMAP2,3: DSS2: DSS: create platform_driver, move init,exit to driver

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver of DSS is created and init exit methods are moved from 
core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DSS platform driver is registered from inside omap_dss_probe, in the order 
desired.

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 drivers/video/omap2/dss/core.c |   19 ++---
 drivers/video/omap2/dss/dss.c  |   55 ++-
 drivers/video/omap2/dss/dss.h  |4 +-
 3 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 1bbc004..1aace9e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -517,15 +517,9 @@ static int omap_dss_probe(struct platform_device *pdev)
core.ctx_id = dss_get_ctx_id();
DSSDBG("initial ctx id %u\n", core.ctx_id);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-   /* DISPC_CONTROL */
-   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-   skip_init = 1;
-#endif
-
-   r = dss_init(skip_init);
+   r = dss_init_platform_driver();
if (r) {
-   DSSERR("Failed to initialize DSS\n");
+   DSSERR("Failed to initialize DSS platform driver\n");
goto err_dss;
}
 
@@ -553,6 +547,11 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_venc;
}
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
if (cpu_is_omap34xx()) {
r = sdi_init(skip_init);
if (r) {
@@ -610,7 +609,7 @@ err_dispc:
 err_dpi:
rfbi_exit();
 err_rfbi:
-   dss_exit();
+   dss_uninit_platform_driver();
 err_dss:
dss_clk_disable_all_no_ctx();
dss_put_clocks();
@@ -635,7 +634,7 @@ static int omap_dss_remove(struct platform_device *pdev)
sdi_exit();
}
 
-   dss_exit();
+   dss_uninit_platform_driver();
 
/*
 * As part of hwmod changes, DSS is not the only controller of dss
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 77c3621..d130f04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -59,6 +59,7 @@ struct dss_reg {
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
struct clk  *dpll4_m4_ck;
@@ -549,7 +550,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
 }
 
-int dss_init(bool skip_init)
+static int dss_init(bool skip_init)
 {
int r;
u32 rev;
@@ -629,7 +630,7 @@ fail0:
return r;
 }
 
-void dss_exit(void)
+static void dss_exit(void)
 {
if (cpu_is_omap34xx())
clk_put(dss.dpll4_m4_ck);
@@ -639,3 +640,53 @@ void dss_exit(void)
iounmap(dss.base);
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+   int r;
+   int skip_init = 0;
+
+   dss.pdev = pdev;
+
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
+
+   r = dss_init(skip_init);
+   if (r) {
+   DSSERR("Failed to initialize DSS\n");
+   goto err_dss;
+   }
+
+err_dss:
+
+   return r;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+   dss_exit();
+
+   return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+   .probe  = omap_dsshw_probe,
+   .remove = omap_dsshw_remove,
+   .driver = {
+   .name   = "omap_dss",
+   .owner  = THIS_MODULE,
+   },
+};
+
+int dss_init_platform_driver(void)
+{
+   return platform_driver_register(&omap_dsshw_driver);
+}
+
+void dss_uninit_platform_driver(void)
+{
+   return platform_driver_unregister(&omap_dsshw_driver);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b394951..37c4544 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -214,8 +214,8 @@ void dss_overlay_setup_l4_manager(struct 
omap_overlay_manager *mgr);
 void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
 
 /* DSS */
-int dss_init(bool skip_init);
-void dss_exit(void);
+int dss_init_platform_driver(void);
+void dss_uninit_platform_driver(void);
 
 void dss_save_context(void);
 void dss_restore_context(void);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux

[PATCH v7 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-16 Thread Sumit Semwal
From: Senthilvadivu Guruswamy 

Looks up the hwmod database for each of the given DSS HW IP and builds
omap_device which inturn does the platform device register for each of DSS HW IP

Signed-off-by: Senthilvadivu Guruswamy 
Signed-off-by: Sumit Semwal 
---
 arch/arm/mach-omap2/display.c |   50 +
 arch/arm/plat-omap/include/plat/display.h |5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 6e21cb8..5c0a78b 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 static struct platform_device omap_display_device = {
.name  = "omap_display",
@@ -32,10 +34,58 @@ static struct platform_device omap_display_device = {
},
 };
 
+static struct omap_device_pm_latency omap_dss_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   .flags  = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
 int __init omap_display_init(struct omap_dss_board_info
*board_data)
 {
int r = 0;
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   int i;
+   struct omap_display_platform_data pdata;
+
+   /*
+* omap: valid DSS hwmod names
+* omap2,3: dss_core, dss_dispc, dss_rfbi, dss_venc
+* omap3: dss_dsi1
+*/
+   char *oh_name[] = {"dss_core", "dss_dispc", "dss_rfbi", "dss_venc", 
"dss_dsi1"};
+   char *dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi", 
"omap_venc", "omap_dsi1" };
+   int oh_count;
+
+   memset(&pdata, 0, sizeof(pdata));
+
+   if (cpu_is_omap24xx())
+   oh_count = ARRAY_SIZE(oh_name) - 1;
+   /* last hwmod dev in oh_name is not available for omap2 */
+   else
+   oh_count = ARRAY_SIZE(oh_name);
+
+   pdata.board_data = board_data;
+   pdata.board_data->get_last_off_on_transaction_id = NULL;
+
+   for (i = 0; i < oh_count; i++) {
+   oh = omap_hwmod_lookup(oh_name[i]);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name[i]);
+   return -ENODEV;
+   }
+   od = omap_device_build(dev_name[i], -1, oh, &pdata,
+   sizeof(struct omap_display_platform_data),
+   omap_dss_latency,
+   ARRAY_SIZE(omap_dss_latency), 0);
+
+   if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+   oh_name[i]))
+   return -ENODEV;
+   }
omap_display_device.dev.platform_data = board_data;
 
r = platform_device_register(&omap_display_device);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 0f140ec..2fb057e 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -237,6 +237,11 @@ static inline int omap_display_init(struct 
omap_dss_board_info *board_data)
 }
 #endif
 
+struct omap_display_platform_data {
+   struct omap_dss_board_info *board_data;
+   /* TODO: Additional members to be added when PM is considered */
+};
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.7.0.4

--
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


  1   2   >