All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/20] HWMOD Adaptation for DSS
@ 2010-08-23 15:57 Guruswamy Senthilvadivu
  2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
                   ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Patch Base:
===========
url = git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
branch "pm-wip/hwmods-omap4"
Commit id: f6f7f1103b80b4dc0ace8a0314d95d1b1ebca726 
Description:  Merge branch 'pm-wip/hwmods' into pm-wip/hwmods-omap4-base
----------------------------------------------------------------------------

RFC focus on the proposed design of the HWMOD adaptation to the current DSS
driver.  DSS, DISPC, DSI, RFBI, VENC are made as platform drivers each 
corresponding to the HWMOD class in the HWMOD database.

No Hardcoding of silicon data:
HWMOD database abstracts the SOC data like base addr, irq numbers and are
implemented in this patch series.

Continue to have custom bus for display panels:
"omapdss" driver continues to be a platform driver that registers the custom
bus.  It also continues to register the display panels(omap_dss_device) on the
board to the panel drivers (omap_dss_driver)
For Eg:  primary lcd device would be registered with lcd panel driver.
lcd panel driver if it is on a parallel interface would use library functions 
exported from dpi.o.  if it is on a dsi interface would use library functions
exported from dsi platform driver(dsi.o).

Clocks:
Handling of clocks in DSS only is one of the design approach, that does not
change the existing implementation.  If each of the DSS HW IPs had to handle
their own clocks, then corresponding clock changes are requested in the HWMOD 
database as well which is not the present scenario.
For Eg: VENC would need 54MCLK which is termed as dss_opt clocks as of now apart
for the dss main clocks.  Currently VENC driver needs to be aware of this and has to
use clk_get/put, clk_enable/disable, since VENC HWMOD is not aware of 54MCLK.


Current dss driver:
-------------------
1.  Omapdss platform driver
        - initialises necessary Ips dss, dispc.
        - also initialises Ips like sdi, dsi, venc, rfbi
        - creates a custom bus and registers the display devices/drivers
        connected on the board to the custom bus.

2.  Suspend/resume of omapdss
        - in turn sends suspend/resume calls for each of the display devices
        registered to it.

Proposed change:
----------------
Platform driver for each DSS HW IP in addition to the software "omapdss"
driver.

Omapdss platform driver
        - initialises necessary software libraries like dpi, sdi.
        - continues to have a custom bus and registers the display devices 
        and drivers connected on the board to the custom bus.
        - continues to handle suspend/resume of the display devices registered
        to the custom bus.

DSS platform driver
        - initialises DSS IP alone
	- Handles the clocks related to the DSS and other DSSHW IPs like RFBI,
	DSI, VENC, DISPC.  Previously this was a part of "omapdss" driver in core.c
	- Continues to handle the DSS IRQs.
	- No suspend/resume hooks.

DISPC platform driver
        - initialises DSS IP alone
	- Gets the required clock from DSS platform driver.
	- No suspend/resume hooks.
	- Continues to provide DISPC library functions.

DSI platform driver
        - initialises DSI IP alone
	- Gets the required clock from DSS platform driver.
	- No suspend/resume hooks.
	- Continues to provide DISPC library functions.

RFBI, VENC platform drivers
        - initialises DSI,VENC IPs
	- Gets the required clock from DSS platform driver.
	- No suspend/resume hooks.
	- Continues to provide DISPC library functions.

The patches are tested on OMAP3430 and 3630.

The below points are yet to be done, still the RFC is put out to start the
discussion on the design approach taken.

Yet to be implemented:
1) All the platform driver registration except DSS, are within the file core.c.
Registeration of these driver would go out of order when seperated to its own file.
Will test the implementation and send in the next version for review.
2) Usage of regulators by different drivers needs to implemented.
For Eg: Regulator used by VENC is moved to venc driver.  But vdda_dac would be 
needed by DPI and DSI as well.  Need to verify if a patch like this would work.
/* VPLL2 for digital video outputs */
static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
	REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+	REGULATOR_SUPPLY("vdds_dsi", "dss_dsi1"),
};
3) SYSCONFIG of each of the dss HW IP has to be removed from the driver.
HWMOD framework is supposed to take care of it.  This change would be done in 
the next version of the patch series.
4) OMAP2 HWMOD database is yet to be generated.
5) Number of DSS HW IPs in a silicon are hardcoded in devices.c.
It is not evident from HWMOD database.  Need to find a cleaner way to register for OMAP2,3,4.
6) Module support for omapdss driver as per current DSS2 design.


Senthilvadivu Guruswamy (20):
  DSS HWMOD database generation for OMAP3
  Move DSS driver register from board to mach_omap2
  Build omap_device for each DSS HW IP
  Create platform_driver for each DSS HW IP
  Move dss platform driver to dss.c
  DSS driver name change in clock database
  Move clock functions from core driver to dss driver
  Replace clk_enable/disable APIs with HWMOD APIs
  Move dss_init to dsshw_probe
  Move rfbi init to rfbi probe
  Move dispc init to dispc probe
  Move venc init to venc probe
  Move dsi init to dsi probe
  Pass platform_device argument to rfbi,dispc
  Use platform device to get DSS base addr
  Get DISPC base addr with platform device
  Get VENC base addr from platform device
  Get DSI base addr with platform device
  Get RFBI baseaddr with platform device
  Get DSS IRQ with platform device

 arch/arm/mach-omap2/board-3430sdp.c        |   25 +-
 arch/arm/mach-omap2/clock3xxx_data.c       |   14 +-
 arch/arm/mach-omap2/devices.c              |   78 ++++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  346 ++++++++++++++++
 arch/arm/plat-omap/include/plat/display.h  |   14 +
 drivers/video/omap2/dss/core.c             |  585 +++++++---------------------
 drivers/video/omap2/dss/dispc.c            |    7 +-
 drivers/video/omap2/dss/dsi.c              |    5 +-
 drivers/video/omap2/dss/dss.c              |  450 +++++++++++++++++++++-
 drivers/video/omap2/dss/dss.h              |   20 +-
 drivers/video/omap2/dss/rfbi.c             |    7 +-
 drivers/video/omap2/dss/venc.c             |   24 +-
 12 files changed, 1085 insertions(+), 490 deletions(-)



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

* [PATCH 01/20] DSS HWMOD database generation for OMAP3
  2010-08-23 15:57 [RFC PATCH 00/20] HWMOD Adaptation for DSS Guruswamy Senthilvadivu
@ 2010-08-23 15:57 ` Guruswamy Senthilvadivu
  2010-08-23 15:57   ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Guruswamy Senthilvadivu
  2010-08-26 23:30   ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Kevin Hilman
  2010-08-23 21:40 ` [RFC PATCH 00/20] HWMOD Adaptation for DSS Cousson, Benoit
  2010-08-26 23:57 ` Kevin Hilman
  2 siblings, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

OMAP3 HWMOD database for DSS is added and is applicable for 34xx and 36xx.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  346 ++++++++++++++++++++++++++++
 1 files changed, 346 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 5d8eb58..e736bb7 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -21,6 +21,7 @@
 #include "omap_hwmod_common_data.h"
 
 #include "prm-regbits-34xx.h"
+#include "cm-regbits-34xx.h"
 
 /*
  * OMAP3xxx hardware module integration data
@@ -31,6 +32,11 @@
  * elsewhere.
  */
 
+static struct omap_hwmod omap3xxx_dss_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_mpu_hwmod;
 static struct omap_hwmod omap3xxx_iva_hwmod;
 static struct omap_hwmod omap3xxx_l3_main_hwmod;
@@ -58,6 +64,14 @@ static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = {
 	.user	= OCP_USER_MPU,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
+	.master		= &omap3xxx_dss_hwmod,
+	.slave		= &omap3xxx_l3_main_hwmod,
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+
 /* Slave interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = {
 	&omap3xxx_mpu__l3_main,
@@ -197,6 +211,333 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
+	.rev_offs	= 0x0000,
+	.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	= 0x48050000,
+		.pa_end		= 0x480503FF,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_dss_hwmod,
+	.clk		= "dss_ick",
+	.addr		= omap3xxx_dss_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_dss_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = {
+	&omap3xxx_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+	{ .role = "tv_clk", .clk = "dss_tv_fck" },
+	{ .role = "dssclk", .clk = "dss_96m_fck" },
+	{ .role = "sys_clk", .clk = "dss2_alwon_fck" },
+};
+
+static struct omap_hwmod omap3xxx_dss_hwmod = {
+	.name		= "dss",
+	.class		= &omap3xxx_dss_hwmod_class,
+	.main_clk	= "dss1_alwon_fck", /* instead of dss_fck */
+	.mpu_irqs	= omap3xxx_dss_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_dss_irqs),
+	.sdma_reqs	= omap3xxx_dss_sdma_chs,
+	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_dss_sdma_chs),
+
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_DSS1_SHIFT,
+			.module_offs = OMAP3430_DSS_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+		},
+	},
+	.opt_clks	= dss_opt_clks,
+	.opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+	.slaves		= omap3xxx_dss_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_dss_slaves),
+	.masters	= omap3xxx_dss_masters,
+	.masters_cnt	= ARRAY_SIZE(omap3xxx_dss_masters),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * 'dispc' class
+ * display controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dispc_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
+			   SYSC_HAS_MIDLEMODE | SYSC_HAS_ENAWAKEUP |
+			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+			   MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_dispc_hwmod_class = {
+	.name = "dispc",
+	.sysc = &omap3xxx_dispc_sysc,
+};
+
+
+static struct omap_hwmod_addr_space omap3xxx_dss_dispc_addrs[] = {
+	{
+		.pa_start	= 0x48050400,
+		.pa_end		= 0x480507FF,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_core -> dss_dispc */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_dss_dispc_hwmod,
+	.clk		= "dss_ick",
+	.addr		= omap3xxx_dss_dispc_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_dss_dispc_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+/* dss_dispc slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_dispc_slaves[] = {
+	&omap3xxx_l4_core__dss_dispc,
+};
+
+static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
+	.name		= "dss_dispc",
+	.class		= &omap3xxx_dispc_hwmod_class,
+	.main_clk	= "dss1_alwon_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_DSS1_SHIFT,
+			.module_offs = OMAP3430_DSS_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_dss_dispc_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_dss_dispc_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * 'dsi' class
+ * display serial interface controller
+ */
+
+static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
+	.name = "dsi",
+};
+
+/* dss_dsi1 */
+
+static struct omap_hwmod_addr_space omap3xxx_dss_dsi1_addrs[] = {
+	{
+		.pa_start	= 0x4804FBFF ,
+		.pa_end		= 0x4804FFFF,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_core -> dss_dsi1 */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_dss_dsi1_hwmod,
+	.addr		= omap3xxx_dss_dsi1_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_dss_dsi1_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+
+/* dss_dsi1 slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_dsi1_slaves[] = {
+	&omap3xxx_l4_core__dss_dsi1,
+};
+
+static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
+	.name		= "dss_dsi1",
+	.class		= &omap3xxx_dsi_hwmod_class,
+	.main_clk	= "dss1_alwon_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_DSS1_SHIFT,
+			.module_offs = OMAP3430_DSS_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_dss_dsi1_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_dss_dsi1_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+/*
+ * 'rfbi' class
+ * remote frame buffer interface
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_rfbi_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
+			   SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_rfbi_hwmod_class = {
+	.name = "rfbi",
+	.sysc = &omap3xxx_rfbi_sysc,
+};
+
+
+static struct omap_hwmod_addr_space omap3xxx_dss_rfbi_addrs[] = {
+	{
+		.pa_start	= 0x48050800,
+		.pa_end		= 0x48050BFF,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_core -> dss_rfbi */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_rfbi = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_dss_rfbi_hwmod,
+	.clk		= "dss_ick",
+	.addr		= omap3xxx_dss_rfbi_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_dss_rfbi_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+
+/* dss_rfbi slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_rfbi_slaves[] = {
+	&omap3xxx_l4_core__dss_rfbi,
+};
+
+static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
+	.name		= "dss_rfbi",
+	.class		= &omap3xxx_rfbi_hwmod_class,
+	.main_clk	= "dss1_alwon_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_DSS1_SHIFT,
+			.module_offs = OMAP3430_DSS_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_dss_rfbi_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_dss_rfbi_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * 'venc' class
+ * video encoder
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_venc_sysc = {
+	.sysc_flags	= SYSS_MISSING,
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+};
+
+static struct omap_hwmod_class omap3xxx_venc_hwmod_class = {
+	.name = "venc",
+	.sysc = &omap3xxx_venc_sysc,
+};
+
+/* dss_venc */
+static struct omap_hwmod_addr_space omap3xxx_dss_venc_addrs[] = {
+	{
+		.pa_start	= 0x48050C00,
+		.pa_end		= 0x48050FFF,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_core -> dss_venc */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap3xxx_dss_venc_hwmod,
+	.clk		= "dss_tv_fck",
+	.addr		= omap3xxx_dss_venc_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_dss_venc_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+
+/* dss_venc slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_venc_slaves[] = {
+	&omap3xxx_l4_core__dss_venc,
+};
+
+static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
+	.name		= "dss_venc",
+	.class		= &omap3xxx_venc_hwmod_class,
+	.main_clk	= "dss1_alwon_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_DSS1_SHIFT,
+			.module_offs = OMAP3430_DSS_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_dss_venc_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_dss_venc_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l3_main_hwmod,
 	&omap3xxx_l4_core_hwmod,
@@ -204,6 +545,11 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l4_wkup_hwmod,
 	&omap3xxx_mpu_hwmod,
 	&omap3xxx_iva_hwmod,
+	&omap3xxx_dss_hwmod,
+	&omap3xxx_dss_dispc_hwmod,
+	&omap3xxx_dss_dsi1_hwmod,
+	&omap3xxx_dss_rfbi_hwmod,
+	&omap3xxx_dss_venc_hwmod,
 	NULL,
 };
 
-- 
1.6.3.3


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

* [PATCH 02/20] Move DSS driver register from board to mach_omap2
  2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
@ 2010-08-23 15:57   ` Guruswamy Senthilvadivu
  2010-08-23 15:57     ` [PATCH 03/20] Build omap_device for each DSS HW IP Guruswamy Senthilvadivu
  2010-08-25  8:31     ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Tomi Valkeinen
  2010-08-26 23:30   ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Kevin Hilman
  1 sibling, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Move the DSS driver register from board file to devices.c.
Regulator initialisation done with driver name instead of the device name.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 arch/arm/mach-omap2/board-3430sdp.c       |   25 +++-------------------
 arch/arm/mach-omap2/devices.c             |   32 +++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/display.h |    4 +++
 drivers/video/omap2/dss/core.c            |    2 +
 4 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 67b95b5..9b721a4 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -301,22 +301,8 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 	.default_device	= &sdp3430_lcd_device,
 };
 
-static struct platform_device sdp3430_dss_device = {
-	.name		= "omapdss",
-	.id		= -1,
-	.dev		= {
-		.platform_data = &sdp3430_dss_data,
-	},
-};
-
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-	.supply		= "vdda_dac",
-	.dev		= &sdp3430_dss_device.dev,
-};
-
-static struct platform_device *sdp3430_devices[] __initdata = {
-	&sdp3430_dss_device,
-};
+static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
+	REGULATOR_SUPPLY("vdda_dac", "omapdss");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
@@ -540,10 +526,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", "omapdss"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
@@ -797,7 +780,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/devices.c b/arch/arm/mach-omap2/devices.c
index 2dbb265..523ce27 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,6 +28,7 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/display.h>
 
 #include "mux.h"
 
@@ -813,6 +814,37 @@ static inline void omap_hdq_init(void) {}
 #endif
 
 /*---------------------------------------------------------------------------*/
+#ifdef CONFIG_OMAP2_DSS
+
+static struct platform_device omap_display_device = {
+	.name          = "omapdss",
+	.id            = -1,
+	.dev            = {
+		.platform_data = NULL,
+	},
+};
+
+void __init omap_display_init(struct omap_dss_board_info
+					*board_data)
+{
+
+	omap_display_device.dev.platform_data = board_data;
+
+	if (platform_device_register(&omap_display_device) < 0)
+		printk(KERN_ERR "Unable to register OMAP-Display device\n");
+
+
+	return ;
+}
+
+#else
+void __init omap_display_init(struct omap_dss_board_info *board_data)
+{
+}
+#endif
+
+
+/*---------------------------------------------------------------------------*/
 
 #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
 	defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 1c529ce..f5da4ae 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
 #include <linux/list.h>
 #include <linux/kobject.h>
 #include <linux/device.h>
+#include <linux/platform_device.h>
 #include <asm/atomic.h>
 
 #define DISPC_IRQ_FRAMEDONE		(1 << 0)
@@ -251,6 +252,9 @@ struct omap_dss_board_info {
 	struct omap_dss_device *default_device;
 };
 
+/* Init with the board info */
+extern void omap_display_init(struct omap_dss_board_info *board_data);
+
 struct omap_video_timings {
 	/* Unit: pixels */
 	u16 x_res;
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index b3a498f..bcbb077 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -52,6 +52,7 @@ static struct {
 	struct regulator *vdds_dsi_reg;
 	struct regulator *vdds_sdi_reg;
 	struct regulator *vdda_dac_reg;
+	struct omap_dss_board_info *pdata;
 } core;
 
 static void dss_clk_enable_all_no_ctx(void);
@@ -501,6 +502,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 	int i;
 
 	core.pdev = pdev;
+	core.pdata = pdev->dev.platform_data;
 
 	dss_init_overlay_managers(pdev);
 	dss_init_overlays(pdev);
-- 
1.6.3.3


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

* [PATCH 03/20] Build omap_device for each DSS HW IP
  2010-08-23 15:57   ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Guruswamy Senthilvadivu
@ 2010-08-23 15:57     ` Guruswamy Senthilvadivu
  2010-08-23 15:57       ` [PATCH 04/20] Create platform_driver " Guruswamy Senthilvadivu
  2010-08-26 23:33       ` [PATCH 03/20] Build omap_device " Kevin Hilman
  2010-08-25  8:31     ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Tomi Valkeinen
  1 sibling, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

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 <svadivu@ti.com>
---
 arch/arm/mach-omap2/devices.c             |   46 +++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/display.h |   10 ++++++
 2 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 523ce27..8faac13 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -29,6 +29,8 @@
 #include <plat/mmc.h>
 #include <plat/dma.h>
 #include <plat/display.h>
+#include <plat/omap_device.h>
+#include <plat/omap_hwmod.h>
 
 #include "mux.h"
 
@@ -824,9 +826,53 @@ 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,
+       },
+};
+
 void __init omap_display_init(struct omap_dss_board_info
 					*board_data)
 {
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+	int l, i;
+	struct omap_display_platform_data pdata;
+	char oh_name[5][MAX_OMAP_DSS_HWMOD_NAME_LEN] = {
+			"dss",
+			"dss_dispc",
+			"dss_dsi1",
+			"dss_rfbi",
+			"dss_venc"
+			};
+
+	for (i = 0; i < 5; i++) {
+		l = snprintf(oh_name[i], MAX_OMAP_DSS_HWMOD_NAME_LEN,
+				 oh_name[i]);
+		WARN(l >= MAX_OMAP_DSS_HWMOD_NAME_LEN,
+			"String buffer overflow in DSS device setup\n");
+
+		oh = omap_hwmod_lookup(oh_name[i]);
+		if (!oh) {
+			pr_err("Could not look up %s\n", oh_name[i]);
+			return ;
+		}
+		strcpy(pdata.name, oh_name[i]);
+		pdata.board_data		=       board_data;
+		pdata.board_data->get_last_off_on_transaction_id = NULL;
+		pdata.device_enable    =       omap_device_enable;
+		pdata.device_idle      =       omap_device_idle;
+		pdata.device_shutdown  =       omap_device_shutdown;
+		od = omap_device_build(oh_name[i], -1, oh, &pdata,
+				sizeof(struct omap_display_platform_data),
+				omap_dss_latency,
+				ARRAY_SIZE(omap_dss_latency), 0);
+
+		WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+				oh_name[i]);
+	}
 
 	omap_display_device.dev.platform_data = board_data;
 
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index f5da4ae..996964a 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -26,6 +26,8 @@
 #include <linux/platform_device.h>
 #include <asm/atomic.h>
 
+#define MAX_OMAP_DSS_HWMOD_NAME_LEN 16
+
 #define DISPC_IRQ_FRAMEDONE		(1 << 0)
 #define DISPC_IRQ_VSYNC			(1 << 1)
 #define DISPC_IRQ_EVSYNC_EVEN		(1 << 2)
@@ -255,6 +257,14 @@ struct omap_dss_board_info {
 /* Init with the board info */
 extern void omap_display_init(struct omap_dss_board_info *board_data);
 
+struct omap_display_platform_data{
+	char name[MAX_OMAP_DSS_HWMOD_NAME_LEN];
+	struct omap_dss_board_info *board_data;
+	int (*device_enable)(struct platform_device *pdev);
+	int (*device_shutdown)(struct platform_device *pdev);
+	int (*device_idle)(struct platform_device *pdev);
+};
+
 struct omap_video_timings {
 	/* Unit: pixels */
 	u16 x_res;
-- 
1.6.3.3


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

* [PATCH 04/20] Create platform_driver for each DSS HW IP
  2010-08-23 15:57     ` [PATCH 03/20] Build omap_device for each DSS HW IP Guruswamy Senthilvadivu
@ 2010-08-23 15:57       ` Guruswamy Senthilvadivu
  2010-08-23 15:57         ` [PATCH 05/20] Move dss platform driver to dss.c Guruswamy Senthilvadivu
  2010-08-26 23:52         ` [PATCH 04/20] Create platform_driver for each DSS HW IP Kevin Hilman
  2010-08-26 23:33       ` [PATCH 03/20] Build omap_device " Kevin Hilman
  1 sibling, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Platform driver of DSS HW IP are to be registered in sequence before
the omapdss platform driver is registered.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |  121 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bcbb077..3b6a309 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -707,6 +707,62 @@ static int omap_dss_resume(struct platform_device *pdev)
 	return dss_resume_all_devices();
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+/* DSI1 HW IP initialisation */
+static int omap_dsi1hw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_dsi1hw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_rfbihw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+/* VENC HW IP initialisation */
+static int omap_venchw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_venchw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+
 static struct platform_driver omap_dss_driver = {
 	.probe          = omap_dss_probe,
 	.remove         = omap_dss_remove,
@@ -719,6 +775,66 @@ static struct platform_driver omap_dss_driver = {
 	},
 };
 
+static struct platform_driver omap_dsshw_driver = {
+	.probe          = omap_dsshw_probe,
+	.remove         = omap_dsshw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss",
+		.owner  = THIS_MODULE,
+	},
+};
+
+static struct platform_driver omap_dispchw_driver = {
+	.probe          = omap_dispchw_probe,
+	.remove         = omap_dispchw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss_dispc",
+		.owner  = THIS_MODULE,
+	},
+};
+
+static struct platform_driver omap_dsi1hw_driver = {
+	.probe          = omap_dsi1hw_probe,
+	.remove         = omap_dsi1hw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss_dsi1",
+		.owner  = THIS_MODULE,
+	},
+};
+
+static struct platform_driver omap_rfbihw_driver = {
+	.probe          = omap_rfbihw_probe,
+	.remove         = omap_rfbihw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss_rfbi",
+		.owner  = THIS_MODULE,
+	},
+};
+
+static struct platform_driver omap_venchw_driver = {
+	.probe          = omap_venchw_probe,
+	.remove         = omap_venchw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss_venc",
+		.owner  = THIS_MODULE,
+	},
+};
+
 /* BUS */
 static int dss_bus_match(struct device *dev, struct device_driver *driver)
 {
@@ -984,6 +1100,11 @@ static int __init omap_dss_init(void)
 
 static int __init omap_dss_init2(void)
 {
+	platform_driver_register(&omap_dsshw_driver);
+	platform_driver_register(&omap_dispchw_driver);
+	platform_driver_register(&omap_dsi1hw_driver);
+	platform_driver_register(&omap_rfbihw_driver);
+	platform_driver_register(&omap_venchw_driver);
 	return platform_driver_register(&omap_dss_driver);
 }
 
-- 
1.6.3.3


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

* [PATCH 05/20] Move dss platform driver to dss.c
  2010-08-23 15:57       ` [PATCH 04/20] Create platform_driver " Guruswamy Senthilvadivu
@ 2010-08-23 15:57         ` Guruswamy Senthilvadivu
  2010-08-23 15:57           ` [PATCH 06/20] DSS driver name change in clock database Guruswamy Senthilvadivu
  2010-08-25  8:49           ` [PATCH 05/20] Move dss platform driver to dss.c Tomi Valkeinen
  2010-08-26 23:52         ` [PATCH 04/20] Create platform_driver for each DSS HW IP Kevin Hilman
  1 sibling, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

dsshw_probe and remove functions are moved to dss.c
To maintain the order of init, through the dsshw_probe, omap_dss_init2
is made as device_init_call_sync.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |   26 +-------------------------
 drivers/video/omap2/dss/dss.c  |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 3b6a309..f01e8e6 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -707,17 +707,6 @@ static int omap_dss_resume(struct platform_device *pdev)
 	return dss_resume_all_devices();
 }
 
-/* DSS HW IP initialisation */
-static int omap_dsshw_probe(struct platform_device *pdev)
-{
-	return 0;
-}
-
-static int omap_dsshw_remove(struct platform_device *pdev)
-{
-	return 0;
-}
-
 /* DISPC HW IP initialisation */
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
@@ -775,18 +764,6 @@ static struct platform_driver omap_dss_driver = {
 	},
 };
 
-static struct platform_driver omap_dsshw_driver = {
-	.probe          = omap_dsshw_probe,
-	.remove         = omap_dsshw_remove,
-	.shutdown	= NULL,
-	.suspend	= NULL,
-	.resume		= NULL,
-	.driver         = {
-		.name   = "dss",
-		.owner  = THIS_MODULE,
-	},
-};
-
 static struct platform_driver omap_dispchw_driver = {
 	.probe          = omap_dispchw_probe,
 	.remove         = omap_dispchw_remove,
@@ -1100,7 +1077,6 @@ static int __init omap_dss_init(void)
 
 static int __init omap_dss_init2(void)
 {
-	platform_driver_register(&omap_dsshw_driver);
 	platform_driver_register(&omap_dispchw_driver);
 	platform_driver_register(&omap_dsi1hw_driver);
 	platform_driver_register(&omap_rfbihw_driver);
@@ -1109,7 +1085,7 @@ static int __init omap_dss_init2(void)
 }
 
 core_initcall(omap_dss_init);
-device_initcall(omap_dss_init2);
+device_initcall_sync(omap_dss_init2);
 #endif
 
 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 24b1825..5f91e37 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -122,6 +122,29 @@ void dss_restore_context(void)
 #undef SR
 #undef RR
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+	.probe          = omap_dsshw_probe,
+	.remove         = omap_dsshw_remove,
+	.shutdown	= NULL,
+	.suspend	= NULL,
+	.resume		= NULL,
+	.driver         = {
+		.name   = "dss",
+		.owner  = THIS_MODULE,
+	},
+};
+
 void dss_sdi_init(u8 datapairs)
 {
 	u32 l;
@@ -633,3 +656,9 @@ void dss_exit(void)
 	iounmap(dss.base);
 }
 
+static int __init omap_dss_init1(void)
+{
+	return platform_driver_register(&omap_dsshw_driver);
+}
+
+device_initcall(omap_dss_init1);
-- 
1.6.3.3


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

* [PATCH 06/20] DSS driver name change in clock database
  2010-08-23 15:57         ` [PATCH 05/20] Move dss platform driver to dss.c Guruswamy Senthilvadivu
@ 2010-08-23 15:57           ` Guruswamy Senthilvadivu
  2010-08-23 15:57             ` [PATCH 07/20] Move clock functions from core driver to dss driver Guruswamy Senthilvadivu
  2010-08-25  8:49           ` [PATCH 05/20] Move dss platform driver to dss.c Tomi Valkeinen
  1 sibling, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Change the dss driver name from omapdss to dss in clock
database against the dss related clocks

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 138646d..980daf8 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3320,13 +3320,13 @@ static struct omap_clk omap3xxx_clks[] = {
 	CLK("omap_rng",	"ick",		&rng_ick,	CK_343X),
 	CLK(NULL,	"sha11_ick",	&sha11_ick,	CK_343X),
 	CLK(NULL,	"des1_ick",	&des1_ick,	CK_343X),
-	CLK("omapdss",	"dss1_fck",	&dss1_alwon_fck_3430es1, CK_3430ES1),
-	CLK("omapdss",	"dss1_fck",	&dss1_alwon_fck_3430es2, CK_3430ES2 | CK_AM35XX),
-	CLK("omapdss",	"tv_fck",	&dss_tv_fck,	CK_3XXX),
-	CLK("omapdss",	"video_fck",	&dss_96m_fck,	CK_3XXX),
-	CLK("omapdss",	"dss2_fck",	&dss2_alwon_fck, CK_3XXX),
-	CLK("omapdss",	"ick",		&dss_ick_3430es1,	CK_3430ES1),
-	CLK("omapdss",	"ick",		&dss_ick_3430es2,	CK_3430ES2 | CK_AM35XX),
+	CLK("dss",	"dss1_fck",	&dss1_alwon_fck_3430es1, CK_3430ES1),
+	CLK("dss",	"dss1_fck",	&dss1_alwon_fck_3430es2, CK_3430ES2 | CK_AM35XX),
+	CLK("dss",	"tv_fck",	&dss_tv_fck,	CK_3XXX),
+	CLK("dss",	"video_fck",	&dss_96m_fck,	CK_3XXX),
+	CLK("dss",	"dss2_fck",	&dss2_alwon_fck, CK_3XXX),
+	CLK("dss",	"ick",		&dss_ick_3430es1,	CK_3430ES1),
+	CLK("dss",	"ick",		&dss_ick_3430es2,	CK_3430ES2 | CK_AM35XX),
 	CLK(NULL,	"cam_mclk",	&cam_mclk,	CK_343X),
 	CLK(NULL,	"cam_ick",	&cam_ick,	CK_343X),
 	CLK(NULL,	"csi2_96m_fck",	&csi2_96m_fck,	CK_343X),
-- 
1.6.3.3


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

* [PATCH 07/20] Move clock functions from core driver to dss driver
  2010-08-23 15:57           ` [PATCH 06/20] DSS driver name change in clock database Guruswamy Senthilvadivu
@ 2010-08-23 15:57             ` Guruswamy Senthilvadivu
  2010-08-23 15:57               ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

dss clocks are moved to dss platform driver.  clk_get/put
APIs use dss device instead of core platform device.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |  372 +--------------------------------------
 drivers/video/omap2/dss/dss.c  |  378 +++++++++++++++++++++++++++++++++++++++-
 drivers/video/omap2/dss/dss.h  |   14 +-
 3 files changed, 392 insertions(+), 372 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index f01e8e6..24b93d5 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -34,20 +34,12 @@
 #include <linux/regulator/consumer.h>
 
 #include <plat/display.h>
-#include <plat/clock.h>
+
 
 #include "dss.h"
 
 static struct {
 	struct platform_device *pdev;
-	int		ctx_id;
-
-	struct clk      *dss_ick;
-	struct clk	*dss1_fck;
-	struct clk	*dss2_fck;
-	struct clk      *dss_54m_fck;
-	struct clk	*dss_96m_fck;
-	unsigned	num_clks_enabled;
 
 	struct regulator *vdds_dsi_reg;
 	struct regulator *vdds_sdi_reg;
@@ -55,10 +47,6 @@ static struct {
 	struct omap_dss_board_info *pdata;
 } core;
 
-static void dss_clk_enable_all_no_ctx(void);
-static void dss_clk_disable_all_no_ctx(void);
-static void dss_clk_enable_no_ctx(enum dss_clock clks);
-static void dss_clk_disable_no_ctx(enum dss_clock clks);
 
 static char *def_disp_name;
 module_param_named(def_disp, def_disp_name, charp, 0);
@@ -69,296 +57,8 @@ unsigned int dss_debug;
 module_param_named(debug, dss_debug, bool, 0644);
 #endif
 
-/* CONTEXT */
-static int dss_get_ctx_id(void)
-{
-	struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
-	int r;
-
-	if (!pdata->get_last_off_on_transaction_id)
-		return 0;
-	r = pdata->get_last_off_on_transaction_id(&core.pdev->dev);
-	if (r < 0) {
-		dev_err(&core.pdev->dev, "getting transaction ID failed, "
-				"will force context restore\n");
-		r = -1;
-	}
-	return r;
-}
-
-int dss_need_ctx_restore(void)
-{
-	int id = dss_get_ctx_id();
-
-	if (id < 0 || id != core.ctx_id) {
-		DSSDBG("ctx id %d -> id %d\n",
-				core.ctx_id, id);
-		core.ctx_id = id;
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-static void save_all_ctx(void)
-{
-	DSSDBG("save context\n");
-
-	dss_clk_enable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
-
-	dss_save_context();
-	dispc_save_context();
-#ifdef CONFIG_OMAP2_DSS_DSI
-	dsi_save_context();
-#endif
-
-	dss_clk_disable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
-}
-
-static void restore_all_ctx(void)
-{
-	DSSDBG("restore context\n");
-
-	dss_clk_enable_all_no_ctx();
-
-	dss_restore_context();
-	dispc_restore_context();
-#ifdef CONFIG_OMAP2_DSS_DSI
-	dsi_restore_context();
-#endif
-
-	dss_clk_disable_all_no_ctx();
-}
-
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
-/* CLOCKS */
-static void core_dump_clocks(struct seq_file *s)
-{
-	int i;
-	struct clk *clocks[5] = {
-		core.dss_ick,
-		core.dss1_fck,
-		core.dss2_fck,
-		core.dss_54m_fck,
-		core.dss_96m_fck
-	};
-
-	seq_printf(s, "- CORE -\n");
-
-	seq_printf(s, "internal clk count\t\t%u\n", core.num_clks_enabled);
-
-	for (i = 0; i < 5; i++) {
-		if (!clocks[i])
-			continue;
-		seq_printf(s, "%-15s\t%lu\t%d\n",
-				clocks[i]->name,
-				clk_get_rate(clocks[i]),
-				clocks[i]->usecount);
-	}
-}
-#endif /* defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) */
-
-static int dss_get_clock(struct clk **clock, const char *clk_name)
-{
-	struct clk *clk;
-
-	clk = clk_get(&core.pdev->dev, clk_name);
-
-	if (IS_ERR(clk)) {
-		DSSERR("can't get clock %s", clk_name);
-		return PTR_ERR(clk);
-	}
-
-	*clock = clk;
-
-	DSSDBG("clk %s, rate %ld\n", clk_name, clk_get_rate(clk));
 
-	return 0;
-}
-
-static int dss_get_clocks(void)
-{
-	int r;
-
-	core.dss_ick = NULL;
-	core.dss1_fck = NULL;
-	core.dss2_fck = NULL;
-	core.dss_54m_fck = NULL;
-	core.dss_96m_fck = NULL;
-
-	r = dss_get_clock(&core.dss_ick, "ick");
-	if (r)
-		goto err;
 
-	r = dss_get_clock(&core.dss1_fck, "dss1_fck");
-	if (r)
-		goto err;
-
-	r = dss_get_clock(&core.dss2_fck, "dss2_fck");
-	if (r)
-		goto err;
-
-	r = dss_get_clock(&core.dss_54m_fck, "tv_fck");
-	if (r)
-		goto err;
-
-	r = dss_get_clock(&core.dss_96m_fck, "video_fck");
-	if (r)
-		goto err;
-
-	return 0;
-
-err:
-	if (core.dss_ick)
-		clk_put(core.dss_ick);
-	if (core.dss1_fck)
-		clk_put(core.dss1_fck);
-	if (core.dss2_fck)
-		clk_put(core.dss2_fck);
-	if (core.dss_54m_fck)
-		clk_put(core.dss_54m_fck);
-	if (core.dss_96m_fck)
-		clk_put(core.dss_96m_fck);
-
-	return r;
-}
-
-static void dss_put_clocks(void)
-{
-	if (core.dss_96m_fck)
-		clk_put(core.dss_96m_fck);
-	clk_put(core.dss_54m_fck);
-	clk_put(core.dss1_fck);
-	clk_put(core.dss2_fck);
-	clk_put(core.dss_ick);
-}
-
-unsigned long dss_clk_get_rate(enum dss_clock clk)
-{
-	switch (clk) {
-	case DSS_CLK_ICK:
-		return clk_get_rate(core.dss_ick);
-	case DSS_CLK_FCK1:
-		return clk_get_rate(core.dss1_fck);
-	case DSS_CLK_FCK2:
-		return clk_get_rate(core.dss2_fck);
-	case DSS_CLK_54M:
-		return clk_get_rate(core.dss_54m_fck);
-	case DSS_CLK_96M:
-		return clk_get_rate(core.dss_96m_fck);
-	}
-
-	BUG();
-	return 0;
-}
-
-static unsigned count_clk_bits(enum dss_clock clks)
-{
-	unsigned num_clks = 0;
-
-	if (clks & DSS_CLK_ICK)
-		++num_clks;
-	if (clks & DSS_CLK_FCK1)
-		++num_clks;
-	if (clks & DSS_CLK_FCK2)
-		++num_clks;
-	if (clks & DSS_CLK_54M)
-		++num_clks;
-	if (clks & DSS_CLK_96M)
-		++num_clks;
-
-	return num_clks;
-}
-
-static void dss_clk_enable_no_ctx(enum dss_clock clks)
-{
-	unsigned num_clks = count_clk_bits(clks);
-
-	if (clks & DSS_CLK_ICK)
-		clk_enable(core.dss_ick);
-	if (clks & DSS_CLK_FCK1)
-		clk_enable(core.dss1_fck);
-	if (clks & DSS_CLK_FCK2)
-		clk_enable(core.dss2_fck);
-	if (clks & DSS_CLK_54M)
-		clk_enable(core.dss_54m_fck);
-	if (clks & DSS_CLK_96M)
-		clk_enable(core.dss_96m_fck);
-
-	core.num_clks_enabled += num_clks;
-}
-
-void dss_clk_enable(enum dss_clock clks)
-{
-	bool check_ctx = core.num_clks_enabled == 0;
-
-	dss_clk_enable_no_ctx(clks);
-
-	if (check_ctx && cpu_is_omap34xx() && dss_need_ctx_restore())
-		restore_all_ctx();
-}
-
-static void dss_clk_disable_no_ctx(enum dss_clock clks)
-{
-	unsigned num_clks = count_clk_bits(clks);
-
-	if (clks & DSS_CLK_ICK)
-		clk_disable(core.dss_ick);
-	if (clks & DSS_CLK_FCK1)
-		clk_disable(core.dss1_fck);
-	if (clks & DSS_CLK_FCK2)
-		clk_disable(core.dss2_fck);
-	if (clks & DSS_CLK_54M)
-		clk_disable(core.dss_54m_fck);
-	if (clks & DSS_CLK_96M)
-		clk_disable(core.dss_96m_fck);
-
-	core.num_clks_enabled -= num_clks;
-}
-
-void dss_clk_disable(enum dss_clock clks)
-{
-	if (cpu_is_omap34xx()) {
-		unsigned num_clks = count_clk_bits(clks);
-
-		BUG_ON(core.num_clks_enabled < num_clks);
-
-		if (core.num_clks_enabled == num_clks)
-			save_all_ctx();
-	}
-
-	dss_clk_disable_no_ctx(clks);
-}
-
-static void dss_clk_enable_all_no_ctx(void)
-{
-	enum dss_clock clks;
-
-	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
-	if (cpu_is_omap34xx())
-		clks |= DSS_CLK_96M;
-	dss_clk_enable_no_ctx(clks);
-}
-
-static void dss_clk_disable_all_no_ctx(void)
-{
-	enum dss_clock clks;
-
-	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
-	if (cpu_is_omap34xx())
-		clks |= DSS_CLK_96M;
-	dss_clk_disable_no_ctx(clks);
-}
-
-static void dss_clk_disable_all(void)
-{
-	enum dss_clock clks;
-
-	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
-	if (cpu_is_omap34xx())
-		clks |= DSS_CLK_96M;
-	dss_clk_disable(clks);
-}
 
 /* REGULATORS */
 
@@ -404,18 +104,8 @@ struct regulator *dss_get_vdda_dac(void)
 	return reg;
 }
 
-/* DEBUGFS */
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
-static void dss_debug_dump_clocks(struct seq_file *s)
-{
-	core_dump_clocks(s);
-	dss_dump_clocks(s);
-	dispc_dump_clocks(s);
-#ifdef CONFIG_OMAP2_DSS_DSI
-	dsi_dump_clocks(s);
-#endif
-}
 
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
 static int dss_debug_show(struct seq_file *s, void *unused)
 {
 	void (*func)(struct seq_file *) = s->private;
@@ -507,14 +197,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 	dss_init_overlay_managers(pdev);
 	dss_init_overlays(pdev);
 
-	r = dss_get_clocks();
-	if (r)
-		goto err_clocks;
-
-	dss_clk_enable_all_no_ctx();
-
-	core.ctx_id = dss_get_ctx_id();
-	DSSDBG("initial ctx id %u\n", core.ctx_id);
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
 #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
 	/* DISPC_CONTROL */
@@ -588,7 +271,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 			pdata->default_device = dssdev;
 	}
 
-	dss_clk_disable_all();
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
 	return 0;
 
@@ -611,9 +294,7 @@ err_dpi:
 err_rfbi:
 	dss_exit();
 err_dss:
-	dss_clk_disable_all_no_ctx();
-	dss_put_clocks();
-err_clocks:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
 	return r;
 }
@@ -622,7 +303,7 @@ 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();
 
@@ -637,47 +318,6 @@ 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);
-		}
-	}
-
-	dss_put_clocks();
-
 	dss_uninit_overlays(pdev);
 	dss_uninit_overlay_managers(pdev);
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 5f91e37..15d0399 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -31,6 +31,7 @@
 #include <linux/clk.h>
 
 #include <plat/display.h>
+#include <plat/clock.h>
 #include "dss.h"
 
 #define DSS_BASE			0x48050000
@@ -59,9 +60,18 @@ 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;
+	int		ctx_id;
 
 	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;
+	unsigned	num_clks_enabled;
 
 	unsigned long	cache_req_pck;
 	unsigned long	cache_prate;
@@ -74,6 +84,11 @@ static struct {
 	u32		ctx[DSS_SZ_REGS / sizeof(u32)];
 } dss;
 
+static void dss_clk_enable_all_no_ctx(void);
+static void dss_clk_disable_all_no_ctx(void);
+static void dss_clk_enable_no_ctx(enum dss_clock clks);
+static void dss_clk_disable_no_ctx(enum dss_clock clks);
+
 static int _omap_dss_wait_reset(void);
 
 static inline void dss_write_reg(const struct dss_reg idx, u32 val)
@@ -122,14 +137,375 @@ void dss_restore_context(void)
 #undef SR
 #undef RR
 
+/* CONTEXT */
+static int dss_get_ctx_id(void)
+{
+	struct omap_display_platform_data *pdata = dss.pdev->dev.platform_data;
+	int r;
+
+	if (!pdata->board_data->get_last_off_on_transaction_id)
+		return 0;
+	r = pdata->board_data->get_last_off_on_transaction_id(&dss.pdev->dev);
+	if (r < 0) {
+		dev_err(&dss.pdev->dev, "getting transaction ID failed, "
+				"will force context restore\n");
+		r = -1;
+	}
+	return r;
+}
+
+int dss_need_ctx_restore(void)
+{
+	int id = dss_get_ctx_id();
+
+	if (id < 0 || id != dss.ctx_id) {
+		DSSDBG("ctx id %d -> id %d\n",
+				dss.ctx_id, id);
+		dss.ctx_id = id;
+		return 1;
+	} else {
+		return 0;
+	}
+}
+
+static void save_all_ctx(void)
+{
+	DSSDBG("save context\n");
+
+	dss_clk_enable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+	dss_save_context();
+	dispc_save_context();
+#ifdef CONFIG_OMAP2_DSS_DSI
+	dsi_save_context();
+#endif
+
+	dss_clk_disable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
+}
+
+static void restore_all_ctx(void)
+{
+	DSSDBG("restore context\n");
+
+	dss_clk_enable_all_no_ctx();
+
+	dss_restore_context();
+	dispc_restore_context();
+#ifdef CONFIG_OMAP2_DSS_DSI
+	dsi_restore_context();
+#endif
+
+	dss_clk_disable_all_no_ctx();
+}
+
+static int dss_get_clock(struct clk **clock, const char *clk_name)
+{
+	struct clk *clk;
+
+	clk = clk_get(&dss.pdev->dev, clk_name);
+
+	if (IS_ERR(clk)) {
+		DSSERR("can't get clock %s", clk_name);
+		return PTR_ERR(clk);
+	}
+
+	*clock = clk;
+
+	DSSDBG("clk %s, rate %ld\n", clk_name, clk_get_rate(clk));
+
+	return 0;
+}
+
+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;
+
+	r = dss_get_clock(&dss.dss_ick, "ick");
+	if (r)
+		goto err;
+
+	r = dss_get_clock(&dss.dss1_fck, "dss1_fck");
+	if (r)
+		goto err;
+
+	r = dss_get_clock(&dss.dss2_fck, "dss2_fck");
+	if (r)
+		goto err;
+
+	r = dss_get_clock(&dss.dss_54m_fck, "tv_fck");
+	if (r)
+		goto err;
+
+	r = dss_get_clock(&dss.dss_96m_fck, "video_fck");
+	if (r)
+		goto err;
+
+	return 0;
+
+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);
+
+	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);
+	clk_put(dss.dss_ick);
+}
+
+unsigned long dss_clk_get_rate(enum dss_clock clk)
+{
+	switch (clk) {
+	case DSS_CLK_ICK:
+		return clk_get_rate(dss.dss_ick);
+	case DSS_CLK_FCK1:
+		return clk_get_rate(dss.dss1_fck);
+	case DSS_CLK_FCK2:
+		return clk_get_rate(dss.dss2_fck);
+	case DSS_CLK_54M:
+		return clk_get_rate(dss.dss_54m_fck);
+	case DSS_CLK_96M:
+		return clk_get_rate(dss.dss_96m_fck);
+	}
+
+	BUG();
+	return 0;
+}
+
+static unsigned count_clk_bits(enum dss_clock clks)
+{
+	unsigned num_clks = 0;
+
+	if (clks & DSS_CLK_ICK)
+		++num_clks;
+	if (clks & DSS_CLK_FCK1)
+		++num_clks;
+	if (clks & DSS_CLK_FCK2)
+		++num_clks;
+	if (clks & DSS_CLK_54M)
+		++num_clks;
+	if (clks & DSS_CLK_96M)
+		++num_clks;
+
+	return num_clks;
+}
+
+static void dss_clk_enable_no_ctx(enum dss_clock clks)
+{
+	unsigned num_clks = count_clk_bits(clks);
+
+	if (clks & DSS_CLK_ICK)
+		clk_enable(dss.dss_ick);
+	if (clks & DSS_CLK_FCK1)
+		clk_enable(dss.dss1_fck);
+	if (clks & DSS_CLK_FCK2)
+		clk_enable(dss.dss2_fck);
+	if (clks & DSS_CLK_54M)
+		clk_enable(dss.dss_54m_fck);
+	if (clks & DSS_CLK_96M)
+		clk_enable(dss.dss_96m_fck);
+
+	dss.num_clks_enabled += num_clks;
+}
+
+void dss_clk_enable(enum dss_clock clks)
+{
+	bool check_ctx = dss.num_clks_enabled == 0;
+
+	dss_clk_enable_no_ctx(clks);
+
+	if (check_ctx && cpu_is_omap34xx() && dss_need_ctx_restore())
+		restore_all_ctx();
+}
+
+static void dss_clk_disable_no_ctx(enum dss_clock clks)
+{
+	unsigned num_clks = count_clk_bits(clks);
+
+	if (clks & DSS_CLK_ICK)
+		clk_disable(dss.dss_ick);
+	if (clks & DSS_CLK_FCK1)
+		clk_disable(dss.dss1_fck);
+	if (clks & DSS_CLK_FCK2)
+		clk_disable(dss.dss2_fck);
+	if (clks & DSS_CLK_54M)
+		clk_disable(dss.dss_54m_fck);
+	if (clks & DSS_CLK_96M)
+		clk_disable(dss.dss_96m_fck);
+
+	dss.num_clks_enabled -= num_clks;
+}
+
+void dss_clk_disable(enum dss_clock clks)
+{
+	if (cpu_is_omap34xx()) {
+		unsigned num_clks = count_clk_bits(clks);
+
+		BUG_ON(dss.num_clks_enabled < num_clks);
+
+		if (dss.num_clks_enabled == num_clks)
+			save_all_ctx();
+	}
+
+	dss_clk_disable_no_ctx(clks);
+}
+
+static void dss_clk_enable_all_no_ctx(void)
+{
+	enum dss_clock clks;
+
+	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
+	if (cpu_is_omap34xx())
+		clks |= DSS_CLK_96M;
+	dss_clk_enable_no_ctx(clks);
+}
+
+static void dss_clk_disable_all_no_ctx(void)
+{
+	enum dss_clock clks;
+
+	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
+	if (cpu_is_omap34xx())
+		clks |= DSS_CLK_96M;
+	dss_clk_disable_no_ctx(clks);
+}
+
+static void dss_clk_disable_all(void)
+{
+	enum dss_clock clks;
+
+	clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
+	if (cpu_is_omap34xx())
+		clks |= DSS_CLK_96M;
+	dss_clk_disable(clks);
+}
+
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+/* CLOCKS */
+static void core_dump_clocks(struct seq_file *s)
+{
+	int i;
+	struct clk *clocks[5] = {
+		dss.dss_ick,
+		dss.dss1_fck,
+		dss.dss2_fck,
+		dss.dss_54m_fck,
+		dss.dss_96m_fck
+	};
+
+	seq_printf(s, "- CORE -\n");
+
+	seq_printf(s, "internal clk count\t\t%u\n", dss.num_clks_enabled);
+
+	for (i = 0; i < 5; i++) {
+		if (!clocks[i])
+			continue;
+		seq_printf(s, "%-15s\t%lu\t%d\n",
+				clocks[i]->name,
+				clk_get_rate(clocks[i]),
+				clocks[i]->usecount);
+	}
+}
+#endif /* defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) */
+
+/* DEBUGFS */
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+void dss_debug_dump_clocks(struct seq_file *s)
+{
+	core_dump_clocks(s);
+	dss_dump_clocks(s);
+	dispc_dump_clocks(s);
+#ifdef CONFIG_OMAP2_DSS_DSI
+	dsi_dump_clocks(s);
+#endif
+}
+#endif
+
 /* DSS HW IP initialisation */
 static int omap_dsshw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+
+	dss.pdev = pdev;
+
+	r = dss_get_clocks();
+	if (r)
+		goto err_clocks;
+
+	dss_clk_enable_all_no_ctx();
+
+	dss.ctx_id = dss_get_ctx_id();
+	DSSDBG("initial ctx id %u\n", dss.ctx_id);
+
+err_clocks:
+
+	return r;
 }
 
 static int omap_dsshw_remove(struct platform_device *pdev)
 {
+	int c;
+
+	/* these should be removed at some point */
+	c = dss.dss_ick->usecount;
+	if (c > 0) {
+		DSSERR("warning: dss_ick usecount %d, disabling\n", c);
+		while (c-- > 0)
+			clk_disable(dss.dss_ick);
+	}
+
+	c = dss.dss1_fck->usecount;
+	if (c > 0) {
+		DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
+		while (c-- > 0)
+			clk_disable(dss.dss1_fck);
+	}
+
+	c = dss.dss2_fck->usecount;
+	if (c > 0) {
+		DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
+		while (c-- > 0)
+			clk_disable(dss.dss2_fck);
+	}
+
+	c = dss.dss_54m_fck->usecount;
+	if (c > 0) {
+		DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
+		while (c-- > 0)
+			clk_disable(dss.dss_54m_fck);
+	}
+
+	if (dss.dss_96m_fck) {
+		c = dss.dss_96m_fck->usecount;
+		if (c > 0) {
+			DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
+					c);
+			while (c-- > 0)
+				clk_disable(dss.dss_96m_fck);
+		}
+	}
+
+	dss_put_clocks();
 	return 0;
 }
 
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 786f433..3f79292 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -169,11 +169,6 @@ struct seq_file;
 struct platform_device;
 
 /* core */
-void dss_clk_enable(enum dss_clock clks);
-void dss_clk_disable(enum dss_clock clks);
-unsigned long dss_clk_get_rate(enum dss_clock clk);
-int dss_need_ctx_restore(void);
-void dss_dump_clocks(struct seq_file *s);
 struct bus_type *dss_get_bus(void);
 struct regulator *dss_get_vdds_dsi(void);
 struct regulator *dss_get_vdds_sdi(void);
@@ -219,7 +214,16 @@ void dss_exit(void);
 void dss_save_context(void);
 void dss_restore_context(void);
 
+void dss_clk_enable(enum dss_clock clks);
+void dss_clk_disable(enum dss_clock clks);
+unsigned long dss_clk_get_rate(enum dss_clock clk);
+int dss_need_ctx_restore(void);
+void dss_dump_clocks(struct seq_file *s);
+
 void dss_dump_regs(struct seq_file *s);
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+void dss_debug_dump_clocks(struct seq_file *s);
+#endif
 
 void dss_sdi_init(u8 datapairs);
 int dss_sdi_enable(void);
-- 
1.6.3.3


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

* [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs
  2010-08-23 15:57             ` [PATCH 07/20] Move clock functions from core driver to dss driver Guruswamy Senthilvadivu
@ 2010-08-23 15:57               ` Guruswamy Senthilvadivu
  2010-08-23 15:57                 ` [PATCH 09/20] Move dss_init to dsshw_probe Guruswamy Senthilvadivu
  2010-08-26 23:37                 ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Kevin Hilman
  0 siblings, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

when DSS ICK, FCK are requested, dss HWMOD APIs are used for enable
and disable. The remaining clocks (dss opt clks in HWMOD database)
continue to use clk APIs, since HWMOD APIs are not fully available
for the dss opt clocks without the usage of clk framework.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/dss.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 15d0399..098ff96 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -61,6 +61,7 @@ struct dss_reg {
 
 static struct {
 	struct platform_device *pdev;
+	struct omap_display_platform_data *pdata;
 
 	void __iomem    *base;
 	int		ctx_id;
@@ -310,14 +311,26 @@ static unsigned count_clk_bits(enum dss_clock clks)
 	return num_clks;
 }
 
+static inline void enable_clocks(bool enable)
+ {
+	static int use_count;
+
+	use_count += enable ? 1 : -1;
+	if (use_count < 0)
+		use_count = 0;
+
+	if (enable && use_count == 1)
+		dss.pdata->device_enable(dss.pdev);
+	else if (!enable && use_count == 0)
+		dss.pdata->device_idle(dss.pdev);
+}
+
 static void dss_clk_enable_no_ctx(enum dss_clock clks)
 {
 	unsigned num_clks = count_clk_bits(clks);
 
-	if (clks & DSS_CLK_ICK)
-		clk_enable(dss.dss_ick);
-	if (clks & DSS_CLK_FCK1)
-		clk_enable(dss.dss1_fck);
+	if ((clks & DSS_CLK_ICK) || (clks & DSS_CLK_FCK1))
+		enable_clocks(1);
 	if (clks & DSS_CLK_FCK2)
 		clk_enable(dss.dss2_fck);
 	if (clks & DSS_CLK_54M)
@@ -342,10 +355,8 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
 {
 	unsigned num_clks = count_clk_bits(clks);
 
-	if (clks & DSS_CLK_ICK)
-		clk_disable(dss.dss_ick);
-	if (clks & DSS_CLK_FCK1)
-		clk_disable(dss.dss1_fck);
+	if ((clks & DSS_CLK_ICK) || (clks & DSS_CLK_FCK1))
+		enable_clocks(0);
 	if (clks & DSS_CLK_FCK2)
 		clk_disable(dss.dss2_fck);
 	if (clks & DSS_CLK_54M)
@@ -447,6 +458,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 	int r;
 
 	dss.pdev = pdev;
+	dss.pdata = dss.pdev->dev.platform_data;
 
 	r = dss_get_clocks();
 	if (r)
-- 
1.6.3.3


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

* [PATCH 09/20] Move dss_init to dsshw_probe
  2010-08-23 15:57               ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Guruswamy Senthilvadivu
@ 2010-08-23 15:57                 ` Guruswamy Senthilvadivu
  2010-08-23 15:57                   ` [PATCH 10/20] Move rfbi init to rfbi probe Guruswamy Senthilvadivu
  2010-08-26 23:37                 ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Kevin Hilman
  1 sibling, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Move dss_init and dss_exit from core driver to dss driver

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |   15 ---------------
 drivers/video/omap2/dss/dss.c  |   17 ++++++++++++++++-
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 24b93d5..90a8f77 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -199,18 +199,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 
 	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
-#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;
-	}
-
 	r = rfbi_init();
 	if (r) {
 		DSSERR("Failed to initialize rfbi\n");
@@ -292,8 +280,6 @@ err_dispc:
 err_dpi:
 	rfbi_exit();
 err_rfbi:
-	dss_exit();
-err_dss:
 	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
 	return r;
@@ -316,7 +302,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 		sdi_exit();
 	}
 
-	dss_exit();
 
 	dss_uninit_overlays(pdev);
 	dss_uninit_overlay_managers(pdev);
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 098ff96..cbad9ff 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -456,6 +456,7 @@ void dss_debug_dump_clocks(struct seq_file *s)
 static int omap_dsshw_probe(struct platform_device *pdev)
 {
 	int r;
+	int skip_init = 0;
 
 	dss.pdev = pdev;
 	dss.pdata = dss.pdev->dev.platform_data;
@@ -469,8 +470,20 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 	dss.ctx_id = dss_get_ctx_id();
 	DSSDBG("initial ctx id %u\n", dss.ctx_id);
 
-err_clocks:
+#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_clocks:
+err_dss:
 	return r;
 }
 
@@ -478,6 +491,8 @@ static int omap_dsshw_remove(struct platform_device *pdev)
 {
 	int c;
 
+	dss_exit();
+
 	/* these should be removed at some point */
 	c = dss.dss_ick->usecount;
 	if (c > 0) {
-- 
1.6.3.3


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

* [PATCH 10/20] Move rfbi init to rfbi probe
  2010-08-23 15:57                 ` [PATCH 09/20] Move dss_init to dsshw_probe Guruswamy Senthilvadivu
@ 2010-08-23 15:57                   ` Guruswamy Senthilvadivu
  2010-08-23 15:58                     ` [PATCH 11/20] Move dispc init to dispc probe Guruswamy Senthilvadivu
                                       ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:57 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

RFBI init and exit moved to rfbi probe and remove.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 90a8f77..5030a84 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -199,12 +199,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 
 	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
-	r = rfbi_init();
-	if (r) {
-		DSSERR("Failed to initialize rfbi\n");
-		goto err_rfbi;
-	}
-
 	r = dpi_init(pdev);
 	if (r) {
 		DSSERR("Failed to initialize dpi\n");
@@ -278,8 +272,6 @@ err_venc:
 err_dispc:
 	dpi_exit();
 err_dpi:
-	rfbi_exit();
-err_rfbi:
 	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
 	return r;
@@ -296,7 +288,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 	venc_exit();
 	dispc_exit();
 	dpi_exit();
-	rfbi_exit();
 	if (cpu_is_omap34xx()) {
 		dsi_exit();
 		sdi_exit();
@@ -357,11 +348,21 @@ static int omap_dsi1hw_remove(struct platform_device *pdev)
 /* RFBI HW IP initialisation */
 static int omap_rfbihw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	r = rfbi_init();
+	if (r) {
+		DSSERR("Failed to initialize rfbi\n");
+		goto err_rfbi;
+	}
+err_rfbi:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_rfbihw_remove(struct platform_device *pdev)
 {
+	rfbi_exit();
 	return 0;
 }
 
-- 
1.6.3.3


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

* [PATCH 11/20] Move dispc init to dispc probe
  2010-08-23 15:57                   ` [PATCH 10/20] Move rfbi init to rfbi probe Guruswamy Senthilvadivu
@ 2010-08-23 15:58                     ` Guruswamy Senthilvadivu
  2010-08-23 15:58                       ` [PATCH 12/20] Move venc init to venc probe Guruswamy Senthilvadivu
  2010-08-26 23:54                     ` [PATCH 10/20] Move rfbi init to rfbi probe Kevin Hilman
  2010-08-27 13:54                     ` Cousson, Benoit
  2 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DISPC init and exit moved to dispc probe and remove.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5030a84..a72d2fa 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -205,12 +205,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 		goto err_dpi;
 	}
 
-	r = dispc_init();
-	if (r) {
-		DSSERR("Failed to initialize dispc\n");
-		goto err_dispc;
-	}
-
 	r = venc_init(pdev);
 	if (r) {
 		DSSERR("Failed to initialize venc\n");
@@ -268,8 +262,6 @@ err_dsi:
 err_sdi:
 	venc_exit();
 err_venc:
-	dispc_exit();
-err_dispc:
 	dpi_exit();
 err_dpi:
 	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
@@ -286,7 +278,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 	dss_uninitialize_debugfs();
 
 	venc_exit();
-	dispc_exit();
 	dpi_exit();
 	if (cpu_is_omap34xx()) {
 		dsi_exit();
@@ -326,11 +317,21 @@ static int omap_dss_resume(struct platform_device *pdev)
 /* DISPC HW IP initialisation */
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	r = dispc_init();
+	if (r) {
+		DSSERR("Failed to initialize dispc\n");
+		goto err_dispc;
+	}
+err_dispc:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_dispchw_remove(struct platform_device *pdev)
 {
+	dispc_exit();
 	return 0;
 }
 
-- 
1.6.3.3


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

* [PATCH 12/20] Move venc init to venc probe
  2010-08-23 15:58                     ` [PATCH 11/20] Move dispc init to dispc probe Guruswamy Senthilvadivu
@ 2010-08-23 15:58                       ` Guruswamy Senthilvadivu
  2010-08-23 15:58                         ` [PATCH 13/20] Move dsi init to dsi probe Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

VENC init and exit moved to venc probe and remove.
regulator used by venc is moved to venc driver alone.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |    2 +-
 drivers/video/omap2/dss/core.c      |   40 +++++++++-------------------------
 drivers/video/omap2/dss/venc.c      |   19 ++++++++++++++++
 3 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 9b721a4..cb66d65 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -302,7 +302,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-	REGULATOR_SUPPLY("vdda_dac", "omapdss");
+	REGULATOR_SUPPLY("vdda_dac", "dss_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 a72d2fa..df0cfea 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;
 	struct omap_dss_board_info *pdata;
 } core;
 
@@ -90,19 +89,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)
@@ -205,12 +191,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 		goto err_dpi;
 	}
 
-	r = venc_init(pdev);
-	if (r) {
-		DSSERR("Failed to initialize venc\n");
-		goto err_venc;
-	}
-
 	if (cpu_is_omap34xx()) {
 		r = sdi_init(skip_init);
 		if (r) {
@@ -260,8 +240,6 @@ err_dsi:
 	if (cpu_is_omap34xx())
 		sdi_exit();
 err_sdi:
-	venc_exit();
-err_venc:
 	dpi_exit();
 err_dpi:
 	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
@@ -277,7 +255,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 
 	dss_uninitialize_debugfs();
 
-	venc_exit();
 	dpi_exit();
 	if (cpu_is_omap34xx()) {
 		dsi_exit();
@@ -370,11 +347,21 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
 /* VENC HW IP initialisation */
 static int omap_venchw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	r = venc_init(pdev);
+	if (r) {
+		DSSERR("Failed to initialize venc\n");
+		goto err_venc;
+	}
+err_venc:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_venchw_remove(struct platform_device *pdev)
 {
+	venc_exit();
 	return 0;
 }
 
@@ -684,11 +671,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/venc.c b/drivers/video/omap2/dss/venc.c
index eff3505..576f0df 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -293,6 +293,7 @@ static struct {
 	struct mutex venc_lock;
 	u32 wss_data;
 	struct regulator *vdda_dac_reg;
+	struct platform_device *pdev;
 } venc;
 
 static inline void venc_write_reg(int idx, u32 val)
@@ -641,7 +642,19 @@ static struct omap_dss_driver venc_driver = {
 };
 /* driver end */
 
+struct regulator *dss_get_vdda_dac(void)
+{
+	struct regulator *reg;
+
+	if (venc.vdda_dac_reg != NULL)
+		return venc.vdda_dac_reg;
+
+	reg = regulator_get(&venc.pdev->dev, "vdda_dac");
+	if (!IS_ERR(reg))
+		venc.vdda_dac_reg = reg;
 
+	return reg;
+}
 
 int venc_init(struct platform_device *pdev)
 {
@@ -649,6 +662,7 @@ int venc_init(struct platform_device *pdev)
 
 	mutex_init(&venc.venc_lock);
 
+	venc.pdev = pdev;
 	venc.wss_data = 0;
 
 	venc.base = ioremap(VENC_BASE, SZ_1K);
@@ -676,6 +690,11 @@ int venc_init(struct platform_device *pdev)
 
 void venc_exit(void)
 {
+	if (venc.vdda_dac_reg != NULL) {
+		regulator_put(venc.vdda_dac_reg);
+		venc.vdda_dac_reg = NULL;
+	}
+
 	omap_dss_unregister_driver(&venc_driver);
 
 	iounmap(venc.base);
-- 
1.6.3.3


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

* [PATCH 13/20] Move dsi init to dsi probe
  2010-08-23 15:58                       ` [PATCH 12/20] Move venc init to venc probe Guruswamy Senthilvadivu
@ 2010-08-23 15:58                         ` Guruswamy Senthilvadivu
  2010-08-23 15:58                           ` [PATCH 14/20] Pass platform_device argument to rfbi,dispc Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DSI init and exit moved to dsi probe and remove.
regulator in dsi could be taken care in board file as
"REGULATOR_SUPPLY("vdds_dsi", "dss_dsi1")," but not added as part
of this patch.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index df0cfea..ce1f83b 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -197,12 +197,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 			DSSERR("Failed to initialize SDI\n");
 			goto err_sdi;
 		}
-
-		r = dsi_init(pdev);
-		if (r) {
-			DSSERR("Failed to initialize DSI\n");
-			goto err_dsi;
-		}
 	}
 
 	r = dss_initialize_debugfs();
@@ -235,9 +229,6 @@ err_register:
 	dss_uninitialize_debugfs();
 err_debugfs:
 	if (cpu_is_omap34xx())
-		dsi_exit();
-err_dsi:
-	if (cpu_is_omap34xx())
 		sdi_exit();
 err_sdi:
 	dpi_exit();
@@ -257,7 +248,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 
 	dpi_exit();
 	if (cpu_is_omap34xx()) {
-		dsi_exit();
 		sdi_exit();
 	}
 
@@ -315,11 +305,24 @@ static int omap_dispchw_remove(struct platform_device *pdev)
 /* DSI1 HW IP initialisation */
 static int omap_dsi1hw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	if (cpu_is_omap34xx()) {
+		r = dsi_init(pdev);
+		if (r) {
+			DSSERR("Failed to initialize DSI\n");
+			goto err_dsi;
+		}
+	}
+err_dsi:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_dsi1hw_remove(struct platform_device *pdev)
 {
+	if (cpu_is_omap34xx())
+		dsi_exit();
 	return 0;
 }
 
-- 
1.6.3.3


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

* [PATCH 14/20] Pass platform_device argument to rfbi,dispc
  2010-08-23 15:58                         ` [PATCH 13/20] Move dsi init to dsi probe Guruswamy Senthilvadivu
@ 2010-08-23 15:58                           ` Guruswamy Senthilvadivu
  2010-08-23 15:58                             ` [PATCH 15/20] Use platform device to get DSS base addr Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

Add platform_device argument to rfbi_init and dispc_init
to pass the pdev to the driver.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/core.c  |    4 ++--
 drivers/video/omap2/dss/dispc.c |    2 +-
 drivers/video/omap2/dss/dss.h   |    6 +++---
 drivers/video/omap2/dss/rfbi.c  |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index ce1f83b..f6fdf6a 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -286,7 +286,7 @@ static int omap_dispchw_probe(struct platform_device *pdev)
 {
 	int r;
 	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
-	r = dispc_init();
+	r = dispc_init(pdev);
 	if (r) {
 		DSSERR("Failed to initialize dispc\n");
 		goto err_dispc;
@@ -331,7 +331,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
 	int r;
 	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
-	r = rfbi_init();
+	r = rfbi_init(pdev);
 	if (r) {
 		DSSERR("Failed to initialize rfbi\n");
 		goto err_rfbi;
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e777e35..ae18b5f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3091,7 +3091,7 @@ static void _omap_dispc_initial_config(void)
 	dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
+int dispc_init(struct platform_device *pdev)
 {
 	u32 rev;
 
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 3f79292..7f9cdf5 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -311,7 +311,7 @@ static inline void dpi_exit(void)
 #endif
 
 /* DISPC */
-int dispc_init(void);
+int dispc_init(struct platform_device *pdev);
 void dispc_exit(void);
 void dispc_dump_clocks(struct seq_file *s);
 void dispc_dump_irqs(struct seq_file *s);
@@ -413,7 +413,7 @@ static inline void venc_exit(void)
 
 /* RFBI */
 #ifdef CONFIG_OMAP2_DSS_RFBI
-int rfbi_init(void);
+int rfbi_init(struct platform_device *pdev);
 void rfbi_exit(void);
 void rfbi_dump_regs(struct seq_file *s);
 
@@ -425,7 +425,7 @@ 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(struct platform_device *pdev)
 {
 	return 0;
 }
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index cc23f53..fe4f423 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -957,7 +957,7 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
+int rfbi_init(struct platform_device *pdev)
 {
 	u32 rev;
 	u32 l;
-- 
1.6.3.3


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

* [PATCH 15/20] Use platform device to get DSS base addr
  2010-08-23 15:58                           ` [PATCH 14/20] Pass platform_device argument to rfbi,dispc Guruswamy Senthilvadivu
@ 2010-08-23 15:58                             ` Guruswamy Senthilvadivu
  2010-08-23 15:58                               ` [PATCH 16/20] Get DISPC base addr with platform device Guruswamy Senthilvadivu
  2010-08-23 21:43                               ` [PATCH 15/20] Use platform device to get DSS base addr Cousson, Benoit
  0 siblings, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DSS Base addr got form platform device. Hardcoding of base addr could be removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/dss.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index cbad9ff..21005c6 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -973,8 +973,10 @@ 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);
+	dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
 	if (!dss.base) {
 		DSSERR("can't ioremap DSS\n");
 		r = -ENOMEM;
-- 
1.6.3.3


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

* [PATCH 16/20] Get DISPC base addr with platform device
  2010-08-23 15:58                             ` [PATCH 15/20] Use platform device to get DSS base addr Guruswamy Senthilvadivu
@ 2010-08-23 15:58                               ` Guruswamy Senthilvadivu
  2010-08-23 15:58                                 ` [PATCH 17/20] Get VENC base addr from " Guruswamy Senthilvadivu
  2010-08-25 13:13                                 ` [PATCH 16/20] Get DISPC base addr " Tomi Valkeinen
  2010-08-23 21:43                               ` [PATCH 15/20] Use platform device to get DSS base addr Cousson, Benoit
  1 sibling, 2 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DISPC Base addr got from the platform device.  Hadrcoding of base
addr removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/dispc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ae18b5f..8a7a086 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -40,7 +40,6 @@
 #include "dss.h"
 
 /* DISPC */
-#define DISPC_BASE			0x48050400
 
 #define DISPC_SZ_REGS			SZ_1K
 
@@ -3094,6 +3093,7 @@ static void _omap_dispc_initial_config(void)
 int dispc_init(struct platform_device *pdev)
 {
 	u32 rev;
+	struct resource *dispc_mem;
 
 	spin_lock_init(&dispc.irq_lock);
 
@@ -3104,7 +3104,8 @@ int dispc_init(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(pdev, IORESOURCE_MEM, 0);
+	dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
 	if (!dispc.base) {
 		DSSERR("can't ioremap DISPC\n");
 		return -ENOMEM;
-- 
1.6.3.3


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

* [PATCH 17/20] Get VENC base addr from platform device
  2010-08-23 15:58                               ` [PATCH 16/20] Get DISPC base addr with platform device Guruswamy Senthilvadivu
@ 2010-08-23 15:58                                 ` Guruswamy Senthilvadivu
  2010-08-23 15:58                                   ` [PATCH 18/20] Get DSI base addr with " Guruswamy Senthilvadivu
  2010-08-25 13:13                                 ` [PATCH 16/20] Get DISPC base addr " Tomi Valkeinen
  1 sibling, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

VENC base addr got from platform device.  Hardcoding
of base addr removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/venc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 576f0df..e618b09 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -39,7 +39,6 @@
 
 #include "dss.h"
 
-#define VENC_BASE	0x48050C00
 
 /* Venc registers */
 #define VENC_REV_ID				0x00
@@ -659,13 +658,15 @@ struct regulator *dss_get_vdda_dac(void)
 int venc_init(struct platform_device *pdev)
 {
 	u8 rev_id;
+	struct resource *venc_mem;
 
 	mutex_init(&venc.venc_lock);
 
 	venc.pdev = pdev;
 	venc.wss_data = 0;
 
-	venc.base = ioremap(VENC_BASE, SZ_1K);
+	venc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	venc.base = ioremap(venc_mem->start, resource_size(venc_mem));
 	if (!venc.base) {
 		DSSERR("can't ioremap VENC\n");
 		return -ENOMEM;
-- 
1.6.3.3


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

* [PATCH 18/20] Get DSI base addr with platform device
  2010-08-23 15:58                                 ` [PATCH 17/20] Get VENC base addr from " Guruswamy Senthilvadivu
@ 2010-08-23 15:58                                   ` Guruswamy Senthilvadivu
  2010-08-23 15:58                                     ` [PATCH 19/20] Get RFBI baseaddr " Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DSI base addr got from platform device.  Hardcoding of
base addr removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/dsi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 3af207b..6f9739d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,7 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE		0x4804FC00
 
 struct dsi_reg { u16 idx; };
 
@@ -3278,6 +3277,7 @@ int dsi_init(struct platform_device *pdev)
 {
 	u32 rev;
 	int r;
+	struct resource *dsi_mem;
 
 	spin_lock_init(&dsi.errors_lock);
 	dsi.errors = 0;
@@ -3301,7 +3301,8 @@ 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(pdev, IORESOURCE_MEM, 0);
+	dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
 	if (!dsi.base) {
 		DSSERR("can't ioremap DSI\n");
 		r = -ENOMEM;
-- 
1.6.3.3


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

* [PATCH 19/20] Get RFBI baseaddr with platform device
  2010-08-23 15:58                                   ` [PATCH 18/20] Get DSI base addr with " Guruswamy Senthilvadivu
@ 2010-08-23 15:58                                     ` Guruswamy Senthilvadivu
  2010-08-23 15:58                                       ` [PATCH 20/20] Get DSS IRQ " Guruswamy Senthilvadivu
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

RFBI base addr got from platform device.  Hardcoding of
base addr removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/rfbi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index fe4f423..690f7bf 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,7 +36,6 @@
 #include <plat/display.h>
 #include "dss.h"
 
-#define RFBI_BASE               0x48050800
 
 struct rfbi_reg { u16 idx; };
 
@@ -961,6 +960,7 @@ int rfbi_init(struct platform_device *pdev)
 {
 	u32 rev;
 	u32 l;
+	struct resource *rfbi_mem;
 
 	spin_lock_init(&rfbi.cmd_lock);
 
@@ -968,7 +968,8 @@ int rfbi_init(struct platform_device *pdev)
 	atomic_set(&rfbi.cmd_fifo_full, 0);
 	atomic_set(&rfbi.cmd_pending, 0);
 
-	rfbi.base = ioremap(RFBI_BASE, SZ_256);
+	rfbi_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	rfbi.base = ioremap(rfbi_mem->start, resource_size(rfbi_mem));
 	if (!rfbi.base) {
 		DSSERR("can't ioremap RFBI\n");
 		return -ENOMEM;
-- 
1.6.3.3


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

* [PATCH 20/20] Get DSS IRQ with platform device
  2010-08-23 15:58                                     ` [PATCH 19/20] Get RFBI baseaddr " Guruswamy Senthilvadivu
@ 2010-08-23 15:58                                       ` Guruswamy Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy Senthilvadivu @ 2010-08-23 15:58 UTC (permalink / raw)
  To: linux-omap, tomi.valkeinen, paul, khilman; +Cc: Senthilvadivu Guruswamy

From: Senthilvadivu Guruswamy <svadivu@ti.com>

DSS IRQ got from platform device.  Hardcoding of baseaddr,
IRQ removed.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
---
 drivers/video/omap2/dss/dss.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 21005c6..a22ba65 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -34,7 +34,6 @@
 #include <plat/clock.h>
 #include "dss.h"
 
-#define DSS_BASE			0x48050000
 
 #define DSS_SZ_REGS			SZ_512
 
@@ -971,7 +970,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 int dss_init(bool skip_init)
 {
-	int r;
+	int r, dss_irq;
 	u32 rev;
 	struct resource *dss_mem;
 
@@ -1012,15 +1011,18 @@ 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) {
+		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.6.3.3


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

* Re: [RFC PATCH 00/20] HWMOD Adaptation for DSS
  2010-08-23 15:57 [RFC PATCH 00/20] HWMOD Adaptation for DSS Guruswamy Senthilvadivu
  2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
@ 2010-08-23 21:40 ` Cousson, Benoit
  2010-08-31 12:54   ` Guruswamy, Senthilvadivu
  2010-08-26 23:57 ` Kevin Hilman
  2 siblings, 1 reply; 46+ messages in thread
From: Cousson, Benoit @ 2010-08-23 21:40 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

On 8/23/2010 5:57 PM, Guruswamy, Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy<svadivu@ti.com>
>
> Patch Base:
> ===========
> url = git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
> branch "pm-wip/hwmods-omap4"
> Commit id: f6f7f1103b80b4dc0ace8a0314d95d1b1ebca726
> Description:  Merge branch 'pm-wip/hwmods' into pm-wip/hwmods-omap4-base
> ----------------------------------------------------------------------------
>
> RFC focus on the proposed design of the HWMOD adaptation to the current DSS
> driver.  DSS, DISPC, DSI, RFBI, VENC are made as platform drivers each
> corresponding to the HWMOD class in the HWMOD database.
>
> No Hardcoding of silicon data:
> HWMOD database abstracts the SOC data like base addr, irq numbers and are
> implemented in this patch series.
>
> Continue to have custom bus for display panels:
> "omapdss" driver continues to be a platform driver that registers the custom
> bus.  It also continues to register the display panels(omap_dss_device) on the
> board to the panel drivers (omap_dss_driver)
> For Eg:  primary lcd device would be registered with lcd panel driver.
> lcd panel driver if it is on a parallel interface would use library functions
> exported from dpi.o.  if it is on a dsi interface would use library functions
> exported from dsi platform driver(dsi.o).
>
> Clocks:
> Handling of clocks in DSS only is one of the design approach, that does not
> change the existing implementation.  If each of the DSS HW IPs had to handle
> their own clocks, then corresponding clock changes are requested in the HWMOD
> database as well which is not the present scenario.
> For Eg: VENC would need 54MCLK which is termed as dss_opt clocks as of now apart
> for the dss main clocks.  Currently VENC driver needs to be aware of this and has to
> use clk_get/put, clk_enable/disable, since VENC HWMOD is not aware of 54MCLK.
>
>
> Current dss driver:
> -------------------
> 1.  Omapdss platform driver
>          - initialises necessary Ips dss, dispc.
>          - also initialises Ips like sdi, dsi, venc, rfbi
>          - creates a custom bus and registers the display devices/drivers
>          connected on the board to the custom bus.
>
> 2.  Suspend/resume of omapdss
>          - in turn sends suspend/resume calls for each of the display devices
>          registered to it.
>
> Proposed change:
> ----------------
> Platform driver for each DSS HW IP in addition to the software "omapdss"
> driver.
>
> Omapdss platform driver
>          - initialises necessary software libraries like dpi, sdi.
>          - continues to have a custom bus and registers the display devices
>          and drivers connected on the board to the custom bus.
>          - continues to handle suspend/resume of the display devices registered
>          to the custom bus.
>
> DSS platform driver
>          - initialises DSS IP alone
> 	- Handles the clocks related to the DSS and other DSSHW IPs like RFBI,
> 	DSI, VENC, DISPC.  Previously this was a part of "omapdss" driver in core.c
> 	- Continues to handle the DSS IRQs.
> 	- No suspend/resume hooks.
>
> DISPC platform driver
>          - initialises DSS IP alone
> 	- Gets the required clock from DSS platform driver.
> 	- No suspend/resume hooks.
> 	- Continues to provide DISPC library functions.
>
> DSI platform driver
>          - initialises DSI IP alone
> 	- Gets the required clock from DSS platform driver.
> 	- No suspend/resume hooks.
> 	- Continues to provide DISPC library functions.
>
> RFBI, VENC platform drivers
>          - initialises DSI,VENC IPs
> 	- Gets the required clock from DSS platform driver.
> 	- No suspend/resume hooks.
> 	- Continues to provide DISPC library functions.
>
> The patches are tested on OMAP3430 and 3630.
>
> The below points are yet to be done, still the RFC is put out to start the
> discussion on the design approach taken.
>
> Yet to be implemented:
> 1) All the platform driver registration except DSS, are within the file core.c.
> Registeration of these driver would go out of order when seperated to its own file.
> Will test the implementation and send in the next version for review.
> 2) Usage of regulators by different drivers needs to implemented.
> For Eg: Regulator used by VENC is moved to venc driver.  But vdda_dac would be
> needed by DPI and DSI as well.  Need to verify if a patch like this would work.
> /* VPLL2 for digital video outputs */
> static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
> 	REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
> +	REGULATOR_SUPPLY("vdds_dsi", "dss_dsi1"),

You can add any consumer you want for a given regulator supply as soon 
as you have a valid dev or dev_name.

> };
> 3) SYSCONFIG of each of the dss HW IP has to be removed from the driver.
> HWMOD framework is supposed to take care of it.  This change would be done in
> the next version of the patch series.
> 4) OMAP2 HWMOD database is yet to be generated.
> 5) Number of DSS HW IPs in a silicon are hardcoded in devices.c.
> It is not evident from HWMOD database.  Need to find a cleaner way to register for OMAP2,3,4.

What does that mean exactly? Could you elaborate?

> 6) Module support for omapdss driver as per current DSS2 design.

What about the usage of clock framework, or the management of DSS 
features, we already discussed?
What about OMAP4?

Benoit

>
>
> Senthilvadivu Guruswamy (20):
>    DSS HWMOD database generation for OMAP3
>    Move DSS driver register from board to mach_omap2
>    Build omap_device for each DSS HW IP
>    Create platform_driver for each DSS HW IP
>    Move dss platform driver to dss.c
>    DSS driver name change in clock database
>    Move clock functions from core driver to dss driver
>    Replace clk_enable/disable APIs with HWMOD APIs
>    Move dss_init to dsshw_probe
>    Move rfbi init to rfbi probe
>    Move dispc init to dispc probe
>    Move venc init to venc probe
>    Move dsi init to dsi probe
>    Pass platform_device argument to rfbi,dispc
>    Use platform device to get DSS base addr
>    Get DISPC base addr with platform device
>    Get VENC base addr from platform device
>    Get DSI base addr with platform device
>    Get RFBI baseaddr with platform device
>    Get DSS IRQ with platform device
>
>   arch/arm/mach-omap2/board-3430sdp.c        |   25 +-
>   arch/arm/mach-omap2/clock3xxx_data.c       |   14 +-
>   arch/arm/mach-omap2/devices.c              |   78 ++++
>   arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  346 ++++++++++++++++
>   arch/arm/plat-omap/include/plat/display.h  |   14 +
>   drivers/video/omap2/dss/core.c             |  585 +++++++---------------------
>   drivers/video/omap2/dss/dispc.c            |    7 +-
>   drivers/video/omap2/dss/dsi.c              |    5 +-
>   drivers/video/omap2/dss/dss.c              |  450 +++++++++++++++++++++-
>   drivers/video/omap2/dss/dss.h              |   20 +-
>   drivers/video/omap2/dss/rfbi.c             |    7 +-
>   drivers/video/omap2/dss/venc.c             |   24 +-
>   12 files changed, 1085 insertions(+), 490 deletions(-)
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH 15/20] Use platform device to get DSS base addr
  2010-08-23 15:58                             ` [PATCH 15/20] Use platform device to get DSS base addr Guruswamy Senthilvadivu
  2010-08-23 15:58                               ` [PATCH 16/20] Get DISPC base addr with platform device Guruswamy Senthilvadivu
@ 2010-08-23 21:43                               ` Cousson, Benoit
  2010-08-31 12:55                                 ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Cousson, Benoit @ 2010-08-23 21:43 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

On 8/23/2010 5:58 PM, Guruswamy, Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy<svadivu@ti.com>
>
> DSS Base addr got form platform device. Hardcoding of base addr could be removed.
>
> Signed-off-by: Senthilvadivu Guruswamy<svadivu@ti.com>
> ---
>   drivers/video/omap2/dss/dss.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
> index cbad9ff..21005c6 100644
> --- a/drivers/video/omap2/dss/dss.c
> +++ b/drivers/video/omap2/dss/dss.c
> @@ -973,8 +973,10 @@ 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);

platform_get_resource can fail, so you have to check the returned value.
Please note that this comment applies as well to all the other patches 
from 16 to 19.

Benoit

> +	dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
>   	if (!dss.base) {
>   		DSSERR("can't ioremap DSS\n");
>   		r = -ENOMEM;


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

* Re: [PATCH 02/20] Move DSS driver register from board to mach_omap2
  2010-08-23 15:57   ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Guruswamy Senthilvadivu
  2010-08-23 15:57     ` [PATCH 03/20] Build omap_device for each DSS HW IP Guruswamy Senthilvadivu
@ 2010-08-25  8:31     ` Tomi Valkeinen
  2010-08-31  9:14       ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Tomi Valkeinen @ 2010-08-25  8:31 UTC (permalink / raw)
  To: ext Guruswamy Senthilvadivu; +Cc: linux-omap, paul, khilman

On Mon, 2010-08-23 at 17:57 +0200, ext Guruswamy Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy <svadivu@ti.com>
> 
> Move the DSS driver register from board file to devices.c.
> Regulator initialisation done with driver name instead of the device name.
> 
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> ---

>  
>  /*---------------------------------------------------------------------------*/
> +#ifdef CONFIG_OMAP2_DSS
> +
> +static struct platform_device omap_display_device = {
> +	.name          = "omapdss",
> +	.id            = -1,
> +	.dev            = {
> +		.platform_data = NULL,
> +	},
> +};

Could we call these "dss" instead of "display". Display sounds that it
could include panel.

> +
> +void __init omap_display_init(struct omap_dss_board_info
> +					*board_data)
> +{
> +
> +	omap_display_device.dev.platform_data = board_data;
> +
> +	if (platform_device_register(&omap_display_device) < 0)
> +		printk(KERN_ERR "Unable to register OMAP-Display device\n");
> +
> +
> +	return ;
> +}
> +
> +#else
> +void __init omap_display_init(struct omap_dss_board_info *board_data)
> +{
> +}
> +#endif
> +
> +
> +/*---------------------------------------------------------------------------*/
>  
>  #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
>  	defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
> diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
> index 1c529ce..f5da4ae 100644
> --- a/arch/arm/plat-omap/include/plat/display.h
> +++ b/arch/arm/plat-omap/include/plat/display.h
> @@ -23,6 +23,7 @@
>  #include <linux/list.h>
>  #include <linux/kobject.h>
>  #include <linux/device.h>
> +#include <linux/platform_device.h>
>  #include <asm/atomic.h>
>  
>  #define DISPC_IRQ_FRAMEDONE		(1 << 0)
> @@ -251,6 +252,9 @@ struct omap_dss_board_info {
>  	struct omap_dss_device *default_device;
>  };
>  
> +/* Init with the board info */
> +extern void omap_display_init(struct omap_dss_board_info *board_data);
> +
>  struct omap_video_timings {
>  	/* Unit: pixels */
>  	u16 x_res;
> diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
> index b3a498f..bcbb077 100644
> --- a/drivers/video/omap2/dss/core.c
> +++ b/drivers/video/omap2/dss/core.c
> @@ -52,6 +52,7 @@ static struct {
>  	struct regulator *vdds_dsi_reg;
>  	struct regulator *vdds_sdi_reg;
>  	struct regulator *vdda_dac_reg;
> +	struct omap_dss_board_info *pdata;
>  } core;
>  
>  static void dss_clk_enable_all_no_ctx(void);
> @@ -501,6 +502,7 @@ static int omap_dss_probe(struct platform_device *pdev)
>  	int i;
>  
>  	core.pdev = pdev;
> +	core.pdata = pdev->dev.platform_data;

Why is pdata stored? It is available through pdev anyway.

 Tomi



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

* Re: [PATCH 05/20] Move dss platform driver to dss.c
  2010-08-23 15:57         ` [PATCH 05/20] Move dss platform driver to dss.c Guruswamy Senthilvadivu
  2010-08-23 15:57           ` [PATCH 06/20] DSS driver name change in clock database Guruswamy Senthilvadivu
@ 2010-08-25  8:49           ` Tomi Valkeinen
  2010-08-31  9:13             ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Tomi Valkeinen @ 2010-08-25  8:49 UTC (permalink / raw)
  To: ext Guruswamy Senthilvadivu; +Cc: linux-omap, paul, khilman

On Mon, 2010-08-23 at 17:57 +0200, ext Guruswamy Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy <svadivu@ti.com>
> 
> dsshw_probe and remove functions are moved to dss.c
> To maintain the order of init, through the dsshw_probe, omap_dss_init2
> is made as device_init_call_sync.
> 
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>


Why is the omap_dsshw_driver moved to dss.c, but the hw_driver for other
blocks stay in core.c?

And generally about dss.c:

There are confusingly two things DSS may refer to: 1) the whole display
subsystem, including DSI/RFBI etc 2) the small main block inside DSS,
meaning the few DSS_* registers.

It would be good to have different names for those, but at the time
being they are both "DSS". In some patch I saw names like "dss_dispc".
Perhaps we could have "dss_dss" there too. Although it looks a bit
confusing too =).

dss.c is meant to handle the DSS_* registers, so it's about case 2.

And so it doesn't contain general DSS stuff, like clock allocation etc.,
those have been in core.c.

I'm not sure if this comment is valid for this patch, but at least
"[PATCH 07/20] Move clock functions from core driver to dss driver"
sounds like dss.c is used like case 1.

 Tomi



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

* Re: [PATCH 16/20] Get DISPC base addr with platform device
  2010-08-23 15:58                               ` [PATCH 16/20] Get DISPC base addr with platform device Guruswamy Senthilvadivu
  2010-08-23 15:58                                 ` [PATCH 17/20] Get VENC base addr from " Guruswamy Senthilvadivu
@ 2010-08-25 13:13                                 ` Tomi Valkeinen
  2010-08-31  9:14                                   ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Tomi Valkeinen @ 2010-08-25 13:13 UTC (permalink / raw)
  To: ext Guruswamy Senthilvadivu; +Cc: linux-omap, paul, khilman

On Mon, 2010-08-23 at 17:58 +0200, ext Guruswamy Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy <svadivu@ti.com>
> 
> DISPC Base addr got from the platform device.  Hadrcoding of base
> addr removed.
> 
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index ae18b5f..8a7a086 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -40,7 +40,6 @@
>  #include "dss.h"
>  
>  /* DISPC */
> -#define DISPC_BASE			0x48050400
>  
>  #define DISPC_SZ_REGS			SZ_1K

I guess *_SZ_REGS are not needed anymore for any of the blocks.

 Tomi



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

* Re: [PATCH 01/20] DSS HWMOD database generation for OMAP3
  2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
  2010-08-23 15:57   ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Guruswamy Senthilvadivu
@ 2010-08-26 23:30   ` Kevin Hilman
  2010-08-31 12:59     ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:30 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> From: Senthilvadivu Guruswamy <svadivu@ti.com>
>
> OMAP3 HWMOD database for DSS is added and is applicable for 34xx and 36xx.
>
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>

minor nit Re: $SUBJECT.  Please title the hwmod data patches using
something like this:

      OMAP3: hwmod data: add DSS, DISPC, DSI, RFBI, VENC

Kevin

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

* Re: [PATCH 03/20] Build omap_device for each DSS HW IP
  2010-08-23 15:57     ` [PATCH 03/20] Build omap_device for each DSS HW IP Guruswamy Senthilvadivu
  2010-08-23 15:57       ` [PATCH 04/20] Create platform_driver " Guruswamy Senthilvadivu
@ 2010-08-26 23:33       ` Kevin Hilman
  2010-08-31 13:01         ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:33 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> From: Senthilvadivu Guruswamy <svadivu@ti.com>
>
> 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 <svadivu@ti.com>

[...]

> +	for (i = 0; i < 5; i++) {
> +		l = snprintf(oh_name[i], MAX_OMAP_DSS_HWMOD_NAME_LEN,
> +				 oh_name[i]);
> +		WARN(l >= MAX_OMAP_DSS_HWMOD_NAME_LEN,
> +			"String buffer overflow in DSS device setup\n");
> +
> +		oh = omap_hwmod_lookup(oh_name[i]);
> +		if (!oh) {
> +			pr_err("Could not look up %s\n", oh_name[i]);
> +			return ;
> +		}
> +		strcpy(pdata.name, oh_name[i]);
> +		pdata.board_data		=       board_data;
> +		pdata.board_data->get_last_off_on_transaction_id = NULL;
> +		pdata.device_enable    =       omap_device_enable;
> +		pdata.device_idle      =       omap_device_idle;
> +		pdata.device_shutdown  =       omap_device_shutdown;

Please use runtime PM API in driver instead of calling these using pdata
function pointers.

Kevin

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

* Re: [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs
  2010-08-23 15:57               ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Guruswamy Senthilvadivu
  2010-08-23 15:57                 ` [PATCH 09/20] Move dss_init to dsshw_probe Guruswamy Senthilvadivu
@ 2010-08-26 23:37                 ` Kevin Hilman
  1 sibling, 0 replies; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:37 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> From: Senthilvadivu Guruswamy <svadivu@ti.com>
>
> when DSS ICK, FCK are requested, dss HWMOD APIs are used for enable
> and disable. The remaining clocks (dss opt clks in HWMOD database)
> continue to use clk APIs, since HWMOD APIs are not fully available
> for the dss opt clocks without the usage of clk framework.

The clocks that are managed by omap_device/omap_hwmod should be
controlled by using the runtime PM API, not by using pdata function
pointers.

Since the runtime PM core implements use-counting, you can probably get
rid of the use_count management too.

Kevin

> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> ---
>  drivers/video/omap2/dss/dss.c |   28 ++++++++++++++++++++--------
>  1 files changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
> index 15d0399..098ff96 100644
> --- a/drivers/video/omap2/dss/dss.c
> +++ b/drivers/video/omap2/dss/dss.c
> @@ -61,6 +61,7 @@ struct dss_reg {
>  
>  static struct {
>  	struct platform_device *pdev;
> +	struct omap_display_platform_data *pdata;
>  
>  	void __iomem    *base;
>  	int		ctx_id;
> @@ -310,14 +311,26 @@ static unsigned count_clk_bits(enum dss_clock clks)
>  	return num_clks;
>  }
>  
> +static inline void enable_clocks(bool enable)
> + {
> +	static int use_count;
> +
> +	use_count += enable ? 1 : -1;
> +	if (use_count < 0)
> +		use_count = 0;
> +
> +	if (enable && use_count == 1)
> +		dss.pdata->device_enable(dss.pdev);
> +	else if (!enable && use_count == 0)
> +		dss.pdata->device_idle(dss.pdev);
> +}
> +
>  static void dss_clk_enable_no_ctx(enum dss_clock clks)
>  {
>  	unsigned num_clks = count_clk_bits(clks);
>  
> -	if (clks & DSS_CLK_ICK)
> -		clk_enable(dss.dss_ick);
> -	if (clks & DSS_CLK_FCK1)
> -		clk_enable(dss.dss1_fck);
> +	if ((clks & DSS_CLK_ICK) || (clks & DSS_CLK_FCK1))
> +		enable_clocks(1);
>  	if (clks & DSS_CLK_FCK2)
>  		clk_enable(dss.dss2_fck);
>  	if (clks & DSS_CLK_54M)
> @@ -342,10 +355,8 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
>  {
>  	unsigned num_clks = count_clk_bits(clks);
>  
> -	if (clks & DSS_CLK_ICK)
> -		clk_disable(dss.dss_ick);
> -	if (clks & DSS_CLK_FCK1)
> -		clk_disable(dss.dss1_fck);
> +	if ((clks & DSS_CLK_ICK) || (clks & DSS_CLK_FCK1))
> +		enable_clocks(0);
>  	if (clks & DSS_CLK_FCK2)
>  		clk_disable(dss.dss2_fck);
>  	if (clks & DSS_CLK_54M)
> @@ -447,6 +458,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
>  	int r;
>  
>  	dss.pdev = pdev;
> +	dss.pdata = dss.pdev->dev.platform_data;
>  
>  	r = dss_get_clocks();
>  	if (r)

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

* Re: [PATCH 04/20] Create platform_driver for each DSS HW IP
  2010-08-23 15:57       ` [PATCH 04/20] Create platform_driver " Guruswamy Senthilvadivu
  2010-08-23 15:57         ` [PATCH 05/20] Move dss platform driver to dss.c Guruswamy Senthilvadivu
@ 2010-08-26 23:52         ` Kevin Hilman
  2010-08-31 13:03           ` Guruswamy, Senthilvadivu
  1 sibling, 1 reply; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:52 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> From: Senthilvadivu Guruswamy <svadivu@ti.com>
>
> Platform driver of DSS HW IP are to be registered in sequence before
> the omapdss platform driver is registered.
>
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> ---
>  drivers/video/omap2/dss/core.c |  121 ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 121 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
> index bcbb077..3b6a309 100644
> --- a/drivers/video/omap2/dss/core.c
> +++ b/drivers/video/omap2/dss/core.c
> @@ -707,6 +707,62 @@ static int omap_dss_resume(struct platform_device *pdev)
>  	return dss_resume_all_devices();
>  }
>  
> +/* DSS HW IP initialisation */
> +static int omap_dsshw_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int omap_dsshw_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}

It's not customary to create dummy, empty functions in one patch and
then fill them in later.  In this case, you create them here, move them
in PATCH 05/20, then fill them in later.

It would be easier to review if you created the platform_drivers when
needed.

Anyways, I'm not crazy about this approach, but Tomi can decide.


> +/* DISPC HW IP initialisation */
> +static int omap_dispchw_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int omap_dispchw_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +/* DSI1 HW IP initialisation */
> +static int omap_dsi1hw_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int omap_dsi1hw_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +/* RFBI HW IP initialisation */
> +static int omap_rfbihw_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int omap_rfbihw_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +/* VENC HW IP initialisation */
> +static int omap_venchw_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int omap_venchw_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +
>  static struct platform_driver omap_dss_driver = {
>  	.probe          = omap_dss_probe,
>  	.remove         = omap_dss_remove,
> @@ -719,6 +775,66 @@ static struct platform_driver omap_dss_driver = {
>  	},
>  };
>  
> +static struct platform_driver omap_dsshw_driver = {
> +	.probe          = omap_dsshw_probe,
> +	.remove         = omap_dsshw_remove,
> +	.shutdown	= NULL,
> +	.suspend	= NULL,
> +	.resume		= NULL,

Just leave them out if they're NULL since that is the default.

Kevin

> +	.driver         = {
> +		.name   = "dss",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
> +static struct platform_driver omap_dispchw_driver = {
> +	.probe          = omap_dispchw_probe,
> +	.remove         = omap_dispchw_remove,
> +	.shutdown	= NULL,
> +	.suspend	= NULL,
> +	.resume		= NULL,
> +	.driver         = {
> +		.name   = "dss_dispc",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
> +static struct platform_driver omap_dsi1hw_driver = {
> +	.probe          = omap_dsi1hw_probe,
> +	.remove         = omap_dsi1hw_remove,
> +	.shutdown	= NULL,
> +	.suspend	= NULL,
> +	.resume		= NULL,
> +	.driver         = {
> +		.name   = "dss_dsi1",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
> +static struct platform_driver omap_rfbihw_driver = {
> +	.probe          = omap_rfbihw_probe,
> +	.remove         = omap_rfbihw_remove,
> +	.shutdown	= NULL,
> +	.suspend	= NULL,
> +	.resume		= NULL,
> +	.driver         = {
> +		.name   = "dss_rfbi",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
> +static struct platform_driver omap_venchw_driver = {
> +	.probe          = omap_venchw_probe,
> +	.remove         = omap_venchw_remove,
> +	.shutdown	= NULL,
> +	.suspend	= NULL,
> +	.resume		= NULL,
> +	.driver         = {
> +		.name   = "dss_venc",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
>  /* BUS */
>  static int dss_bus_match(struct device *dev, struct device_driver *driver)
>  {
> @@ -984,6 +1100,11 @@ static int __init omap_dss_init(void)
>  
>  static int __init omap_dss_init2(void)
>  {
> +	platform_driver_register(&omap_dsshw_driver);
> +	platform_driver_register(&omap_dispchw_driver);
> +	platform_driver_register(&omap_dsi1hw_driver);
> +	platform_driver_register(&omap_rfbihw_driver);
> +	platform_driver_register(&omap_venchw_driver);
>  	return platform_driver_register(&omap_dss_driver);
>  }

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

* Re: [PATCH 10/20] Move rfbi init to rfbi probe
  2010-08-23 15:57                   ` [PATCH 10/20] Move rfbi init to rfbi probe Guruswamy Senthilvadivu
  2010-08-23 15:58                     ` [PATCH 11/20] Move dispc init to dispc probe Guruswamy Senthilvadivu
@ 2010-08-26 23:54                     ` Kevin Hilman
  2010-08-27 13:54                     ` Cousson, Benoit
  2 siblings, 0 replies; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:54 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> From: Senthilvadivu Guruswamy <svadivu@ti.com>
>
> RFBI init and exit moved to rfbi probe and remove.
>
> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>

[...]

> @@ -357,11 +348,21 @@ static int omap_dsi1hw_remove(struct platform_device *pdev)
>  /* RFBI HW IP initialisation */
>  static int omap_rfbihw_probe(struct platform_device *pdev)
>  {
> -	return 0;
> +	int r;

minor: missing blank line

> +	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> +	r = rfbi_init();
> +	if (r) {
> +		DSSERR("Failed to initialize rfbi\n");
> +		goto err_rfbi;
> +	}

here too

> +err_rfbi:
> +	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> +	return r;
>  }
>  
>  static int omap_rfbihw_remove(struct platform_device *pdev)
>  {
> +	rfbi_exit();
>  	return 0;
>  }

Kevin

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

* Re: [RFC PATCH 00/20] HWMOD Adaptation for DSS
  2010-08-23 15:57 [RFC PATCH 00/20] HWMOD Adaptation for DSS Guruswamy Senthilvadivu
  2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
  2010-08-23 21:40 ` [RFC PATCH 00/20] HWMOD Adaptation for DSS Cousson, Benoit
@ 2010-08-26 23:57 ` Kevin Hilman
  2010-08-31 13:03   ` Guruswamy, Senthilvadivu
  2 siblings, 1 reply; 46+ messages in thread
From: Kevin Hilman @ 2010-08-26 23:57 UTC (permalink / raw)
  To: Guruswamy Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

Guruswamy Senthilvadivu <svadivu@ti.com> writes:

> RFC focus on the proposed design of the HWMOD adaptation to the current DSS
> driver.  DSS, DISPC, DSI, RFBI, VENC are made as platform drivers each 
> corresponding to the HWMOD class in the HWMOD database.

Hi Senthi,

Nice job on this series.  I have a handful of small comments on the
individual patches, but I also wanted to say thanks for doing an
excellent job of breaking this up into small, self-contained patches.
It makes it so much easier to review small patches with well-written
changelogs.

Thanks!

Kevin

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

* Re: [PATCH 10/20] Move rfbi init to rfbi probe
  2010-08-23 15:57                   ` [PATCH 10/20] Move rfbi init to rfbi probe Guruswamy Senthilvadivu
  2010-08-23 15:58                     ` [PATCH 11/20] Move dispc init to dispc probe Guruswamy Senthilvadivu
  2010-08-26 23:54                     ` [PATCH 10/20] Move rfbi init to rfbi probe Kevin Hilman
@ 2010-08-27 13:54                     ` Cousson, Benoit
  2010-08-31 12:57                       ` Guruswamy, Senthilvadivu
  2 siblings, 1 reply; 46+ messages in thread
From: Cousson, Benoit @ 2010-08-27 13:54 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

On 8/23/2010 5:57 PM, Guruswamy, Senthilvadivu wrote:
> From: Senthilvadivu Guruswamy<svadivu@ti.com>
>
> RFBI init and exit moved to rfbi probe and remove.
>
> Signed-off-by: Senthilvadivu Guruswamy<svadivu@ti.com>
> ---
>   drivers/video/omap2/dss/core.c |   21 +++++++++++----------
>   1 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
> index 90a8f77..5030a84 100644
> --- a/drivers/video/omap2/dss/core.c
> +++ b/drivers/video/omap2/dss/core.c
> @@ -199,12 +199,6 @@ static int omap_dss_probe(struct platform_device *pdev)
>
>   	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>
> -	r = rfbi_init();
> -	if (r) {
> -		DSSERR("Failed to initialize rfbi\n");
> -		goto err_rfbi;
> -	}
> -
>   	r = dpi_init(pdev);
>   	if (r) {
>   		DSSERR("Failed to initialize dpi\n");
> @@ -278,8 +272,6 @@ err_venc:
>   err_dispc:
>   	dpi_exit();
>   err_dpi:
> -	rfbi_exit();
> -err_rfbi:
>   	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>
>   	return r;
> @@ -296,7 +288,6 @@ static int omap_dss_remove(struct platform_device *pdev)
>   	venc_exit();
>   	dispc_exit();
>   	dpi_exit();
> -	rfbi_exit();
>   	if (cpu_is_omap34xx()) {
>   		dsi_exit();
>   		sdi_exit();
> @@ -357,11 +348,21 @@ static int omap_dsi1hw_remove(struct platform_device *pdev)
>   /* RFBI HW IP initialisation */
>   static int omap_rfbihw_probe(struct platform_device *pdev)
>   {
> -	return 0;
> +	int r;
> +	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> +	r = rfbi_init();
> +	if (r) {
> +		DSSERR("Failed to initialize rfbi\n");
> +		goto err_rfbi;
> +	}
> +err_rfbi:
> +	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> +	return r;

There is probably something wrong in this sequence? The same thing is 
done whatever the return state (except the error log).
You should probably return 0 and not disable the clocks if the rfbi_init 
is successful.

Benoit

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

* RE: [PATCH 05/20] Move dss platform driver to dss.c
  2010-08-25  8:49           ` [PATCH 05/20] Move dss platform driver to dss.c Tomi Valkeinen
@ 2010-08-31  9:13             ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31  9:13 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] 
> Sent: Wednesday, August 25, 2010 2:20 PM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; paul@pwsan.com; Hilman, Kevin
> Subject: Re: [PATCH 05/20] Move dss platform driver to dss.c
> 
> On Mon, 2010-08-23 at 17:57 +0200, ext Guruswamy Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> > 
> > dsshw_probe and remove functions are moved to dss.c
> > To maintain the order of init, through the dsshw_probe, 
> omap_dss_init2
> > is made as device_init_call_sync.
> > 
> > Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> 
> 
> Why is the omap_dsshw_driver moved to dss.c, but the 
> hw_driver for other
> blocks stay in core.c?
> 
Ideally the plan is to move all the IP blocks to its corresponding files.
As I mentioned in the TODO list I will try to move dispc, venc, rfbi, dsi in the next versions.

> And generally about dss.c:
> 
> There are confusingly two things DSS may refer to: 1) the 
> whole display
> subsystem, including DSI/RFBI etc 2) the small main block inside DSS,
> meaning the few DSS_* registers.
> 
> It would be good to have different names for those, but at the time
> being they are both "DSS". In some patch I saw names like "dss_dispc".
> Perhaps we could have "dss_dss" there too. Although it looks a bit
> confusing too =).
> 
> dss.c is meant to handle the DSS_* registers, so it's about case 2.
> 
> And so it doesn't contain general DSS stuff, like clock 
> allocation etc.,
> those have been in core.c.
> 
> I'm not sure if this comment is valid for this patch, but at least
> "[PATCH 07/20] Move clock functions from core driver to dss driver"
> sounds like dss.c is used like case 1.
> 
Once opt clocks are available for each of the DSS IP blocks like venc,
Dsi also, then I should be able to move the clocks to the respective files
Leaving only dss related clocks in dss.c. 

So the aim is to maintain dss.c restricted to few DSS_* registers.


>  Tomi
> 
> 
> 

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

* RE: [PATCH 16/20] Get DISPC base addr with platform device
  2010-08-25 13:13                                 ` [PATCH 16/20] Get DISPC base addr " Tomi Valkeinen
@ 2010-08-31  9:14                                   ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31  9:14 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] 
> Sent: Wednesday, August 25, 2010 6:43 PM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; paul@pwsan.com; Hilman, Kevin
> Subject: Re: [PATCH 16/20] Get DISPC base addr with platform device
> 
> On Mon, 2010-08-23 at 17:58 +0200, ext Guruswamy Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> > 
> > DISPC Base addr got from the platform device.  Hadrcoding of base
> > addr removed.
> > 
> > Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> > ---
> >  drivers/video/omap2/dss/dispc.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/video/omap2/dss/dispc.c 
> b/drivers/video/omap2/dss/dispc.c
> > index ae18b5f..8a7a086 100644
> > --- a/drivers/video/omap2/dss/dispc.c
> > +++ b/drivers/video/omap2/dss/dispc.c
> > @@ -40,7 +40,6 @@
> >  #include "dss.h"
> >  
> >  /* DISPC */
> > -#define DISPC_BASE			0x48050400
> >  
> >  #define DISPC_SZ_REGS			SZ_1K
> 
> I guess *_SZ_REGS are not needed anymore for any of the blocks.
> 
Its still needed for the definition of array size used for save/restore,
Unless we go for pointers to do dynamic allocation of register size.

>  Tomi
> 
> 
> 

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

* RE: [PATCH 02/20] Move DSS driver register from board to mach_omap2
  2010-08-25  8:31     ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Tomi Valkeinen
@ 2010-08-31  9:14       ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31  9:14 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] 
> Sent: Wednesday, August 25, 2010 2:01 PM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; paul@pwsan.com; Hilman, Kevin
> Subject: Re: [PATCH 02/20] Move DSS driver register from 
> board to mach_omap2
> 
> On Mon, 2010-08-23 at 17:57 +0200, ext Guruswamy Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> > 
> > Move the DSS driver register from board file to devices.c.
> > Regulator initialisation done with driver name instead of 
> the device name.
> > 
> > Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> > ---
> 
> >  
> >  
> /*------------------------------------------------------------
> ---------------*/
> > +#ifdef CONFIG_OMAP2_DSS
> > +
> > +static struct platform_device omap_display_device = {
> > +	.name          = "omapdss",
> > +	.id            = -1,
> > +	.dev            = {
> > +		.platform_data = NULL,
> > +	},
> > +};
> 
> Could we call these "dss" instead of "display". Display sounds that it
> could include panel.
This includes panel data, as we assign board_data to the platform_data in the below function.
In fact we could even change the .name = "omapdisplay" instead of "omapdss".
> 
> > +
> > +void __init omap_display_init(struct omap_dss_board_info
> > +					*board_data)
> > +{
> > +
> > +	omap_display_device.dev.platform_data = board_data;
> > +
> > +	if (platform_device_register(&omap_display_device) < 0)
> > +		printk(KERN_ERR "Unable to register 
> OMAP-Display device\n");
> > +
> > +
> > +	return ;
> > +}
> > +
> > +#else
> > +void __init omap_display_init(struct omap_dss_board_info 
> *board_data)
> > +{
> > +}
> > +#endif
> > +
> > +
> > 
> +/*-----------------------------------------------------------
> ----------------*/
> >  
> >  #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
> >  	defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
> > diff --git a/arch/arm/plat-omap/include/plat/display.h 
> b/arch/arm/plat-omap/include/plat/display.h
> > index 1c529ce..f5da4ae 100644
> > --- a/arch/arm/plat-omap/include/plat/display.h
> > +++ b/arch/arm/plat-omap/include/plat/display.h
> > @@ -23,6 +23,7 @@
> >  #include <linux/list.h>
> >  #include <linux/kobject.h>
> >  #include <linux/device.h>
> > +#include <linux/platform_device.h>
> >  #include <asm/atomic.h>
> >  
> >  #define DISPC_IRQ_FRAMEDONE		(1 << 0)
> > @@ -251,6 +252,9 @@ struct omap_dss_board_info {
> >  	struct omap_dss_device *default_device;
> >  };
> >  
> > +/* Init with the board info */
> > +extern void omap_display_init(struct omap_dss_board_info 
> *board_data);
> > +
> >  struct omap_video_timings {
> >  	/* Unit: pixels */
> >  	u16 x_res;
> > diff --git a/drivers/video/omap2/dss/core.c 
> b/drivers/video/omap2/dss/core.c
> > index b3a498f..bcbb077 100644
> > --- a/drivers/video/omap2/dss/core.c
> > +++ b/drivers/video/omap2/dss/core.c
> > @@ -52,6 +52,7 @@ static struct {
> >  	struct regulator *vdds_dsi_reg;
> >  	struct regulator *vdds_sdi_reg;
> >  	struct regulator *vdda_dac_reg;
> > +	struct omap_dss_board_info *pdata;
> >  } core;
> >  
> >  static void dss_clk_enable_all_no_ctx(void);
> > @@ -501,6 +502,7 @@ static int omap_dss_probe(struct 
> platform_device *pdev)
> >  	int i;
> >  
> >  	core.pdev = pdev;
> > +	core.pdata = pdev->dev.platform_data;
> 
> Why is pdata stored? It is available through pdev anyway.
Yes, could be avoided.
> 
>  Tomi
> 
> 
> 

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

* RE: [RFC PATCH 00/20] HWMOD Adaptation for DSS
  2010-08-23 21:40 ` [RFC PATCH 00/20] HWMOD Adaptation for DSS Cousson, Benoit
@ 2010-08-31 12:54   ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 12:54 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Cousson, Benoit 
> Sent: Tuesday, August 24, 2010 3:10 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com; Hilman, Kevin
> Subject: Re: [RFC PATCH 00/20] HWMOD Adaptation for DSS
> 
> On 8/23/2010 5:57 PM, Guruswamy, Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy<svadivu@ti.com>
> >
[...]
> > 2) Usage of regulators by different drivers needs to implemented.
> > For Eg: Regulator used by VENC is moved to venc driver.  
> But vdda_dac would be
> > needed by DPI and DSI as well.  Need to verify if a patch 
> like this would work.
> > /* VPLL2 for digital video outputs */
> > static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
> > 	REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
> > +	REGULATOR_SUPPLY("vdds_dsi", "dss_dsi1"),
> 
> You can add any consumer you want for a given regulator 
> supply as soon 
> as you have a valid dev or dev_name.
[Senthil] Thanks.  I will try this out.
> 
> > };
> > 3) SYSCONFIG of each of the dss HW IP has to be removed 
> from the driver.
> > HWMOD framework is supposed to take care of it.  This 
> change would be done in
> > the next version of the patch series.
> > 4) OMAP2 HWMOD database is yet to be generated.
> > 5) Number of DSS HW IPs in a silicon are hardcoded in devices.c.
> > It is not evident from HWMOD database.  Need to find a 
> cleaner way to register for OMAP2,3,4.
> 
> What does that mean exactly? Could you elaborate?
[Senthil] From HWMOD database, it is not possible to find out how many of the 
DSS related HW Ips are present.  Say in OMAP3 one DSI is present and HDMI is not.
In OMAP4 2 DSI is present and HDMI is.
So in devices.c if I have to do a omaphwmod_lookup(), I have to hardcode the
lookup names for omap3 and omap4 explicitly.

> 
> > 6) Module support for omapdss driver as per current DSS2 design.
> 
> What about the usage of clock framework, or the management of DSS 
> features, we already discussed?
> What about OMAP4?
> 
[Senthil]  DSS internal clocks generated from internal DPLLs are to planned to be 
in separate patch series.  
The DSS_FEATURES like number of pipelines in omap3/omap4, tiler/vrfb support,
are being posted as separate patch series by Taneja Archit.
> Benoit
> 
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe 
> linux-omap" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

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

* RE: [PATCH 15/20] Use platform device to get DSS base addr
  2010-08-23 21:43                               ` [PATCH 15/20] Use platform device to get DSS base addr Cousson, Benoit
@ 2010-08-31 12:55                                 ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 12:55 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Cousson, Benoit 
> Sent: Tuesday, August 24, 2010 3:13 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com; Hilman, Kevin
> Subject: Re: [PATCH 15/20] Use platform device to get DSS base addr
> 
> On 8/23/2010 5:58 PM, Guruswamy, Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy<svadivu@ti.com>
> >
[...]
> > +	struct resource *dss_mem;
> >
> > -	dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
> > +	dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
> 
> platform_get_resource can fail, so you have to check the 
> returned value.
> Please note that this comment applies as well to all the 
> other patches 
> from 16 to 19.
> 
[Senthil]  Yes, I would incorporate in my next version.
> Benoit
> 
> > +	dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
> >   	if (!dss.base) {
> >   		DSSERR("can't ioremap DSS\n");
> >   		r = -ENOMEM;
> 
> 

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

* RE: [PATCH 10/20] Move rfbi init to rfbi probe
  2010-08-27 13:54                     ` Cousson, Benoit
@ 2010-08-31 12:57                       ` Guruswamy, Senthilvadivu
  2010-08-31 16:38                         ` Cousson, Benoit
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 12:57 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

 

> -----Original Message-----
> From: Cousson, Benoit 
> Sent: Friday, August 27, 2010 7:25 PM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com; Hilman, Kevin
> Subject: Re: [PATCH 10/20] Move rfbi init to rfbi probe
> 
> On 8/23/2010 5:57 PM, Guruswamy, Senthilvadivu wrote:
> > From: Senthilvadivu Guruswamy<svadivu@ti.com>
> >
[...]
> > @@ -199,12 +199,6 @@ static int omap_dss_probe(struct 
> platform_device *pdev)
> >
> >   	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> >
> > -	r = rfbi_init();
> > -	if (r) {
> > -		DSSERR("Failed to initialize rfbi\n");
> > -		goto err_rfbi;
> > -	}
> > -
> >   	r = dpi_init(pdev);
> >   	if (r) {
> >   		DSSERR("Failed to initialize dpi\n");
> > @@ -278,8 +272,6 @@ err_venc:
> >   err_dispc:
> >   	dpi_exit();
> >   err_dpi:
> > -	rfbi_exit();
> > -err_rfbi:
> >   	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> >
> >   	return r;
> > @@ -296,7 +288,6 @@ static int omap_dss_remove(struct 
> platform_device *pdev)
> >   	venc_exit();
> >   	dispc_exit();
> >   	dpi_exit();
> > -	rfbi_exit();
> >   	if (cpu_is_omap34xx()) {
> >   		dsi_exit();
> >   		sdi_exit();
> > @@ -357,11 +348,21 @@ static int omap_dsi1hw_remove(struct 
> platform_device *pdev)
> >   /* RFBI HW IP initialisation */
> >   static int omap_rfbihw_probe(struct platform_device *pdev)
> >   {
> > -	return 0;
> > +	int r;
> > +	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> > +	r = rfbi_init();
> > +	if (r) {
> > +		DSSERR("Failed to initialize rfbi\n");
> > +		goto err_rfbi;
> > +	}
> > +err_rfbi:
> > +	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
> > +	return r;
> 
> There is probably something wrong in this sequence? The same thing is 
> done whatever the return state (except the error log).
> You should probably return 0 and not disable the clocks if 
> the rfbi_init 
> is successful.
> 
[Senthil] I don't see any wrong in functionality, but creates confusion.
Let me init r =0.  dss_clk_disable has to be called at the end of probe
irrespective of error. I can remove err_rfbi: since no specific error handling is getting done now.

> Benoit
> 

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

* RE: [PATCH 01/20] DSS HWMOD database generation for OMAP3
  2010-08-26 23:30   ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Kevin Hilman
@ 2010-08-31 12:59     ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 12:59 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap, tomi.valkeinen, paul

 

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com] 
> Sent: Friday, August 27, 2010 5:01 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com
> Subject: Re: [PATCH 01/20] DSS HWMOD database generation for OMAP3
> 
> Guruswamy Senthilvadivu <svadivu@ti.com> writes:
> 
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> >
> > OMAP3 HWMOD database for DSS is added and is applicable for 
> 34xx and 36xx.
> >
> > Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> 
> minor nit Re: $SUBJECT.  Please title the hwmod data patches using
> something like this:
> 
>       OMAP3: hwmod data: add DSS, DISPC, DSI, RFBI, VENC
[Senthil]  Thanks, I would change it.
> 
> Kevin
> 

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

* RE: [PATCH 03/20] Build omap_device for each DSS HW IP
  2010-08-26 23:33       ` [PATCH 03/20] Build omap_device " Kevin Hilman
@ 2010-08-31 13:01         ` Guruswamy, Senthilvadivu
  2010-08-31 15:29           ` Kevin Hilman
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 13:01 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap, tomi.valkeinen, paul

 

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com] 
> Sent: Friday, August 27, 2010 5:03 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com
> Subject: Re: [PATCH 03/20] Build omap_device for each DSS HW IP
> 
> Guruswamy Senthilvadivu <svadivu@ti.com> writes:
> 
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> >
> > 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 <svadivu@ti.com>
> 
> [...]
> 
> > +	for (i = 0; i < 5; i++) {
> > +		l = snprintf(oh_name[i], MAX_OMAP_DSS_HWMOD_NAME_LEN,
> > +				 oh_name[i]);
> > +		WARN(l >= MAX_OMAP_DSS_HWMOD_NAME_LEN,
> > +			"String buffer overflow in DSS device setup\n");
> > +
> > +		oh = omap_hwmod_lookup(oh_name[i]);
> > +		if (!oh) {
> > +			pr_err("Could not look up %s\n", oh_name[i]);
> > +			return ;
> > +		}
> > +		strcpy(pdata.name, oh_name[i]);
> > +		pdata.board_data		=       board_data;
> > +		pdata.board_data->get_last_off_on_transaction_id = NULL;
> > +		pdata.device_enable    =       omap_device_enable;
> > +		pdata.device_idle      =       omap_device_idle;
> > +		pdata.device_shutdown  =       omap_device_shutdown;
> 
> Please use runtime PM API in driver instead of calling these 
> using pdata
> function pointers.
[Senthil] when I used pm_runtime API, the clocks were not getting enabled.
Probably the complete support is not yet in this pm branch.
Once available I would change to pm_runtime and discard the use_count variable too.
> 
> Kevin
> 

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

* RE: [PATCH 04/20] Create platform_driver for each DSS HW IP
  2010-08-26 23:52         ` [PATCH 04/20] Create platform_driver for each DSS HW IP Kevin Hilman
@ 2010-08-31 13:03           ` Guruswamy, Senthilvadivu
  2010-08-31 15:27             ` Kevin Hilman
  0 siblings, 1 reply; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 13:03 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap, tomi.valkeinen, paul

 

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com] 
> Sent: Friday, August 27, 2010 5:22 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com
> Subject: Re: [PATCH 04/20] Create platform_driver for each DSS HW IP
> 
> Guruswamy Senthilvadivu <svadivu@ti.com> writes:
> 
> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
> >
> > Platform driver of DSS HW IP are to be registered in sequence before
> > the omapdss platform driver is registered.
> >
> > Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
> > ---
> >  drivers/video/omap2/dss/core.c |  121 
> ++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 121 insertions(+), 0 deletions(-)
> >
> >  
> > +/* DSS HW IP initialisation */
> > +static int omap_dsshw_probe(struct platform_device *pdev)
> > +{
> > +	return 0;
> > +}
> > +
> > +static int omap_dsshw_remove(struct platform_device *pdev)
> > +{
> > +	return 0;
> > +}
> 
> It's not customary to create dummy, empty functions in one patch and
> then fill them in later.  In this case, you create them here, 
> move them
> in PATCH 05/20, then fill them in later.
> 
> It would be easier to review if you created the platform_drivers when
> needed.
> 
> Anyways, I'm not crazy about this approach, but Tomi can decide.
> 
[Senthil]  As I mentioned in my TODO list, I will try to move all the probe/remove to
the corresponding driver files as directly in my next version.
> 
> > +/* DISPC HW IP initialisation */
> > +static int omap_dispchw_probe(struct platform_device *pdev)
> > +{
> > +	return 0;
> > +}

> 

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

* RE: [RFC PATCH 00/20] HWMOD Adaptation for DSS
  2010-08-26 23:57 ` Kevin Hilman
@ 2010-08-31 13:03   ` Guruswamy, Senthilvadivu
  0 siblings, 0 replies; 46+ messages in thread
From: Guruswamy, Senthilvadivu @ 2010-08-31 13:03 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap, tomi.valkeinen, paul

 

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com] 
> Sent: Friday, August 27, 2010 5:28 AM
> To: Guruswamy, Senthilvadivu
> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com; 
> paul@pwsan.com
> Subject: Re: [RFC PATCH 00/20] HWMOD Adaptation for DSS
> 
> Guruswamy Senthilvadivu <svadivu@ti.com> writes:
> 
> > RFC focus on the proposed design of the HWMOD adaptation to 
> the current DSS
> > driver.  DSS, DISPC, DSI, RFBI, VENC are made as platform 
> drivers each 
> > corresponding to the HWMOD class in the HWMOD database.
> 
> Hi Senthi,
> 
> Nice job on this series.  I have a handful of small comments on the
> individual patches, but I also wanted to say thanks for doing an
> excellent job of breaking this up into small, self-contained patches.
> It makes it so much easier to review small patches with well-written
> changelogs.
[Senthil]  Thanks!
> 
> Thanks!
> 
> Kevin
> 

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

* Re: [PATCH 04/20] Create platform_driver for each DSS HW IP
  2010-08-31 13:03           ` Guruswamy, Senthilvadivu
@ 2010-08-31 15:27             ` Kevin Hilman
  0 siblings, 0 replies; 46+ messages in thread
From: Kevin Hilman @ 2010-08-31 15:27 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

"Guruswamy, Senthilvadivu" <svadivu@ti.com> writes:

[...]

>> > +/* DSS HW IP initialisation */
>> > +static int omap_dsshw_probe(struct platform_device *pdev)
>> > +{
>> > +	return 0;
>> > +}
>> > +
>> > +static int omap_dsshw_remove(struct platform_device *pdev)
>> > +{
>> > +	return 0;
>> > +}
>> 
>> It's not customary to create dummy, empty functions in one patch and
>> then fill them in later.  In this case, you create them here, 
>> move them
>> in PATCH 05/20, then fill them in later.
>> 
>> It would be easier to review if you created the platform_drivers when
>> needed.
>> 
>> Anyways, I'm not crazy about this approach, but Tomi can decide.
>> 
> [Senthil]  As I mentioned in my TODO list, I will try to move all the probe/remove to
> the corresponding driver files as directly in my next version.

Sorry, I missed that in your TODO list.

Thanks,

Kevin

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

* Re: [PATCH 03/20] Build omap_device for each DSS HW IP
  2010-08-31 13:01         ` Guruswamy, Senthilvadivu
@ 2010-08-31 15:29           ` Kevin Hilman
  0 siblings, 0 replies; 46+ messages in thread
From: Kevin Hilman @ 2010-08-31 15:29 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul

"Guruswamy, Senthilvadivu" <svadivu@ti.com> writes:

[...]

>> > From: Senthilvadivu Guruswamy <svadivu@ti.com>
>> >
>> > 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 <svadivu@ti.com>
>> 
>> [...]
>> 
>> > +	for (i = 0; i < 5; i++) {
>> > +		l = snprintf(oh_name[i], MAX_OMAP_DSS_HWMOD_NAME_LEN,
>> > +				 oh_name[i]);
>> > +		WARN(l >= MAX_OMAP_DSS_HWMOD_NAME_LEN,
>> > +			"String buffer overflow in DSS device setup\n");
>> > +
>> > +		oh = omap_hwmod_lookup(oh_name[i]);
>> > +		if (!oh) {
>> > +			pr_err("Could not look up %s\n", oh_name[i]);
>> > +			return ;
>> > +		}
>> > +		strcpy(pdata.name, oh_name[i]);
>> > +		pdata.board_data		=       board_data;
>> > +		pdata.board_data->get_last_off_on_transaction_id = NULL;
>> > +		pdata.device_enable    =       omap_device_enable;
>> > +		pdata.device_idle      =       omap_device_idle;
>> > +		pdata.device_shutdown  =       omap_device_shutdown;
>> 
>> Please use runtime PM API in driver instead of calling these using
>> pdata function pointers.
>
> [Senthil] when I used pm_runtime API, the clocks were not getting enabled.
> Probably the complete support is not yet in this pm branch.
> Once available I would change to pm_runtime and discard the use_count variable too.

Runtime PM is available and working in current pm-core branch
(a.k.a. pm-wip/hwmods-omap4) Several other hwmod conversions are using
that branch to get working runtime PM.

Rather than use the pdata-> methods, please debug why runtime PM isn't
working for your driver.

Thanks,

Kevin


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

* Re: [PATCH 10/20] Move rfbi init to rfbi probe
  2010-08-31 12:57                       ` Guruswamy, Senthilvadivu
@ 2010-08-31 16:38                         ` Cousson, Benoit
  0 siblings, 0 replies; 46+ messages in thread
From: Cousson, Benoit @ 2010-08-31 16:38 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap, tomi.valkeinen, paul, Hilman, Kevin

On 8/31/2010 2:57 PM, Guruswamy, Senthilvadivu wrote:
>
>
>> -----Original Message-----
>> From: Cousson, Benoit
>> Sent: Friday, August 27, 2010 7:25 PM
>> To: Guruswamy, Senthilvadivu
>> Cc: linux-omap@vger.kernel.org; tomi.valkeinen@nokia.com;
>> paul@pwsan.com; Hilman, Kevin
>> Subject: Re: [PATCH 10/20] Move rfbi init to rfbi probe
>>
>> On 8/23/2010 5:57 PM, Guruswamy, Senthilvadivu wrote:
>>> From: Senthilvadivu Guruswamy<svadivu@ti.com>
>>>
> [...]
>>> @@ -199,12 +199,6 @@ static int omap_dss_probe(struct
>> platform_device *pdev)
>>>
>>>    	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>>>
>>> -	r = rfbi_init();
>>> -	if (r) {
>>> -		DSSERR("Failed to initialize rfbi\n");
>>> -		goto err_rfbi;
>>> -	}
>>> -
>>>    	r = dpi_init(pdev);
>>>    	if (r) {
>>>    		DSSERR("Failed to initialize dpi\n");
>>> @@ -278,8 +272,6 @@ err_venc:
>>>    err_dispc:
>>>    	dpi_exit();
>>>    err_dpi:
>>> -	rfbi_exit();
>>> -err_rfbi:
>>>    	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>>>
>>>    	return r;
>>> @@ -296,7 +288,6 @@ static int omap_dss_remove(struct
>> platform_device *pdev)
>>>    	venc_exit();
>>>    	dispc_exit();
>>>    	dpi_exit();
>>> -	rfbi_exit();
>>>    	if (cpu_is_omap34xx()) {
>>>    		dsi_exit();
>>>    		sdi_exit();
>>> @@ -357,11 +348,21 @@ static int omap_dsi1hw_remove(struct
>> platform_device *pdev)
>>>    /* RFBI HW IP initialisation */
>>>    static int omap_rfbihw_probe(struct platform_device *pdev)
>>>    {
>>> -	return 0;
>>> +	int r;
>>> +	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>>> +	r = rfbi_init();
>>> +	if (r) {
>>> +		DSSERR("Failed to initialize rfbi\n");
>>> +		goto err_rfbi;
>>> +	}
>>> +err_rfbi:
>>> +	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
>>> +	return r;
>>
>> There is probably something wrong in this sequence? The same thing is
>> done whatever the return state (except the error log).
>> You should probably return 0 and not disable the clocks if
>> the rfbi_init
>> is successful.
>>
> [Senthil] I don't see any wrong in functionality, but creates confusion.
> Let me init r =0.  dss_clk_disable has to be called at the end of probe
> irrespective of error. I can remove err_rfbi: since no specific error handling is getting done now.

It is indeed very confusing, so in that case you can just remove the label.
You don't have to initialize r to zero, since you are always calling 
rfbi_init that will initialize it.

Benoit

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

end of thread, other threads:[~2010-08-31 16:38 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 15:57 [RFC PATCH 00/20] HWMOD Adaptation for DSS Guruswamy Senthilvadivu
2010-08-23 15:57 ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Guruswamy Senthilvadivu
2010-08-23 15:57   ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Guruswamy Senthilvadivu
2010-08-23 15:57     ` [PATCH 03/20] Build omap_device for each DSS HW IP Guruswamy Senthilvadivu
2010-08-23 15:57       ` [PATCH 04/20] Create platform_driver " Guruswamy Senthilvadivu
2010-08-23 15:57         ` [PATCH 05/20] Move dss platform driver to dss.c Guruswamy Senthilvadivu
2010-08-23 15:57           ` [PATCH 06/20] DSS driver name change in clock database Guruswamy Senthilvadivu
2010-08-23 15:57             ` [PATCH 07/20] Move clock functions from core driver to dss driver Guruswamy Senthilvadivu
2010-08-23 15:57               ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Guruswamy Senthilvadivu
2010-08-23 15:57                 ` [PATCH 09/20] Move dss_init to dsshw_probe Guruswamy Senthilvadivu
2010-08-23 15:57                   ` [PATCH 10/20] Move rfbi init to rfbi probe Guruswamy Senthilvadivu
2010-08-23 15:58                     ` [PATCH 11/20] Move dispc init to dispc probe Guruswamy Senthilvadivu
2010-08-23 15:58                       ` [PATCH 12/20] Move venc init to venc probe Guruswamy Senthilvadivu
2010-08-23 15:58                         ` [PATCH 13/20] Move dsi init to dsi probe Guruswamy Senthilvadivu
2010-08-23 15:58                           ` [PATCH 14/20] Pass platform_device argument to rfbi,dispc Guruswamy Senthilvadivu
2010-08-23 15:58                             ` [PATCH 15/20] Use platform device to get DSS base addr Guruswamy Senthilvadivu
2010-08-23 15:58                               ` [PATCH 16/20] Get DISPC base addr with platform device Guruswamy Senthilvadivu
2010-08-23 15:58                                 ` [PATCH 17/20] Get VENC base addr from " Guruswamy Senthilvadivu
2010-08-23 15:58                                   ` [PATCH 18/20] Get DSI base addr with " Guruswamy Senthilvadivu
2010-08-23 15:58                                     ` [PATCH 19/20] Get RFBI baseaddr " Guruswamy Senthilvadivu
2010-08-23 15:58                                       ` [PATCH 20/20] Get DSS IRQ " Guruswamy Senthilvadivu
2010-08-25 13:13                                 ` [PATCH 16/20] Get DISPC base addr " Tomi Valkeinen
2010-08-31  9:14                                   ` Guruswamy, Senthilvadivu
2010-08-23 21:43                               ` [PATCH 15/20] Use platform device to get DSS base addr Cousson, Benoit
2010-08-31 12:55                                 ` Guruswamy, Senthilvadivu
2010-08-26 23:54                     ` [PATCH 10/20] Move rfbi init to rfbi probe Kevin Hilman
2010-08-27 13:54                     ` Cousson, Benoit
2010-08-31 12:57                       ` Guruswamy, Senthilvadivu
2010-08-31 16:38                         ` Cousson, Benoit
2010-08-26 23:37                 ` [PATCH 08/20] Replace clk_enable/disable APIs with HWMOD APIs Kevin Hilman
2010-08-25  8:49           ` [PATCH 05/20] Move dss platform driver to dss.c Tomi Valkeinen
2010-08-31  9:13             ` Guruswamy, Senthilvadivu
2010-08-26 23:52         ` [PATCH 04/20] Create platform_driver for each DSS HW IP Kevin Hilman
2010-08-31 13:03           ` Guruswamy, Senthilvadivu
2010-08-31 15:27             ` Kevin Hilman
2010-08-26 23:33       ` [PATCH 03/20] Build omap_device " Kevin Hilman
2010-08-31 13:01         ` Guruswamy, Senthilvadivu
2010-08-31 15:29           ` Kevin Hilman
2010-08-25  8:31     ` [PATCH 02/20] Move DSS driver register from board to mach_omap2 Tomi Valkeinen
2010-08-31  9:14       ` Guruswamy, Senthilvadivu
2010-08-26 23:30   ` [PATCH 01/20] DSS HWMOD database generation for OMAP3 Kevin Hilman
2010-08-31 12:59     ` Guruswamy, Senthilvadivu
2010-08-23 21:40 ` [RFC PATCH 00/20] HWMOD Adaptation for DSS Cousson, Benoit
2010-08-31 12:54   ` Guruswamy, Senthilvadivu
2010-08-26 23:57 ` Kevin Hilman
2010-08-31 13:03   ` Guruswamy, Senthilvadivu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.