OMAP2,3: hwmod DSS Adaptation
Subsystems (6)
v2 cover OMAP2,3: hwmod DSS Adaptation
From: Senthilvadivu Guruswamy <[email protected]>
Patch Base:
===========
url = git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch "master"
Commit id: 063d907edaf3fbf9776c189c3e02f2c7a129d18c
Description: Linux-omap rebuilt: Merged serial console fixes, cleanup
----------------------------------------------------------------------------
v2 of the DSS hwmod patch series focus on fixing the review comments. OMAP4 support will be posted after the acceptance of this basic change in the dss2 design.
This patch series decouples the "Clocks for DSS in hwmod adaptation" changes from this series. Another series would be posted which could be discussed w.r.t clocks in DSS across omap2,3.
Removing the SYSCONFIG settings from DSS driver would also be part of these clock changes series and not covered in this series as it depends on some of the omap_hwmod framework changes w.r.t opt clocks handling.
Summary of the hwmod DSS design:
================================
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 approaches, that does not change the existing implementation. If each of the DSS HW IPs had to handle their own clocks, then corresponding clock changes can be requested in the hwmod database as well which is not the current design/implementation. As stated, this would be handled in another series seperately.
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.
Modified 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.
Testing:
---------
The patches are tested on 2420-n800, 2430sdp, 3630zoom, 3430sdp. Complete bootup with penguins on panel is done on 3430sdp.
For the rest of the mentioned platforms, kernel is built with "OMAP2_DSS" and bootup is tested so that base address and clk_get calls are successful.
Changes since RFC:
-------------------
1) All the platform driver registration except DSS, were within the file core.c. Registeration of these driver got seperated to its own file.
2) Usage of regulators by different drivers are implemented.
For Eg: Regulator used by VENC is moved to venc driver. But vdda_dac would be needed by DPI and DSI as well.
4) OMAP2420 and OMAP2430 hwmod database are generated in this v1.
5) Module support for omapdss driver can continue as the DSS HW IP specific platform drivers are decoupled from omapdss driver.
6) Following review comments incorporated:
Changed the hwmod device name from "dss" to "dss_dss"
Changed name of core driver from "omapdss" to "omap_display" as it deals with panels. Fixed comments on return values from platform_get_resource/irq functions.
Changes since v1:
------------------
1.) Dynamically register for OMAP2,3 specific DSS HW IPs in devices.c
2.) Following review comments incorporated:
Updation of all the board files on l-o dss2 branch as per
http://www.mail-archive.com/[email protected]/msg36915.html
Comments incorporated in devices.c and display.h as per
http://www.mail-archive.com/[email protected]/msg36919.html
Comments incorporated in dispc.c, dss.c, dsi.c, venc.c, rfbi.c
so that platform_device is just above platform_driver registrations as per
http://www.mail-archive.com/[email protected]/msg36963.html
3.) Squashed some of the patches to one patch.
Senthilvadivu Guruswamy (17):
OMAP2420: hwmod data: add DSS DISPC RFBI VENC
OMAP2430: hwmod data: add DSS DISPC RFBI VENC
OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC OMAP2420,OMAP2430,OMAP3xx: change dss driver name in clock files OMAP2,3 DSS Driver register moved to mach_omap2 OMAP2,3 board files DSS Driver register moved to devices.c OMAP2,3: DSS: Build omap_device for each DSS HWIP OMAP2,3: DSS: Create platform_driver for each DSS HW IP OMAP2,3: DSS: Move clocks from core driver to dss driver OMAP2,3: DSS: Move dss_feature_init to dss
OMAP2,3: DSS: DSS Move init,exit to driver
OMAP2,3: DSS: RFBI Move init,exit to driver
OMAP2,3: DSS: DISPC Move init,exit to driver
OMAP2,3: DSS: VENC Move init,exit to driver
OMAP2,3: DSS: DSI Move init, exit to driver
OMAP2,3: DSS: Use platform device to get baseaddr OMAP2,3: DSS: Get DSS IRQ from platform device
arch/arm/mach-omap2/board-3430sdp.c | 26 +-- arch/arm/mach-omap2/board-am3517evm.c | 14 +- arch/arm/mach-omap2/board-cm-t35.c | 22 +- arch/arm/mach-omap2/board-devkit8000.c | 12 +- arch/arm/mach-omap2/board-igep0020.c | 20 +- arch/arm/mach-omap2/board-omap3beagle.c | 14 +- arch/arm/mach-omap2/board-omap3evm.c | 22 +- arch/arm/mach-omap2/board-omap3pandora.c | 16 +- arch/arm/mach-omap2/board-omap3stalker.c | 16 +- arch/arm/mach-omap2/board-rx51-peripherals.c | 9 +- arch/arm/mach-omap2/board-rx51-video.c | 15 +- arch/arm/mach-omap2/clock2420_data.c | 8 +- arch/arm/mach-omap2/clock2430_data.c | 8 +- arch/arm/mach-omap2/clock3xxx_data.c | 14 +- arch/arm/mach-omap2/devices.c | 82 +++++ arch/arm/mach-omap2/omap_hwmod_2420_data.c | 283 ++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_2430_data.c | 282 ++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 339 +++++++++++++++++++ arch/arm/plat-omap/include/plat/display.h | 10 + drivers/video/omap2/dss/core.c | 449 +------------------------- drivers/video/omap2/dss/dispc.c | 112 ++++--- drivers/video/omap2/dss/dsi.c | 67 ++++- drivers/video/omap2/dss/dss.c | 448 +++++++++++++++++++++++++- drivers/video/omap2/dss/dss.h | 15 +- drivers/video/omap2/dss/rfbi.c | 116 ++++--- drivers/video/omap2/dss/venc.c | 123 +++++--- 26 files changed, 1778 insertions(+), 764 deletions(-)
PATCH v2 1/17 OMAP2420: hwmod data: add DSS DISPC RFBI VENC
From: Senthilvadivu Guruswamy <[email protected]>
Database generated for OMAP2420 Display Sub System. Since dss is also considered as an IP as dispc,rfbi, name it as dss_dss.
--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 283 ++++++++++++++++++++++++++++ 1 files changed, 283 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +283 -0
@@ -37,6 +37,10 @@ static struct omap_hwmod omap2420_mpu_hwmod;static struct omap_hwmod omap2420_iva_hwmod;static struct omap_hwmod omap2420_l3_main_hwmod;static struct omap_hwmod omap2420_l4_core_hwmod; +static struct omap_hwmod omap2420_dss_dss_hwmod; +static struct omap_hwmod omap2420_dss_dispc_hwmod; +static struct omap_hwmod omap2420_dss_rfbi_hwmod; +static struct omap_hwmod omap2420_dss_venc_hwmod;static struct omap_hwmod omap2420_wd_timer2_hwmod;/* L3 -> L4_CORE interface */
@@ -58,6 +62,13 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = { &omap2420_mpu__l3_main, }; +/* DSS -> l3 */ +static struct omap_hwmod_ocp_if omap2420_dss__l3 = { + .master = &omap2420_dss_dss_hwmod, + .slave = &omap2420_l3_main_hwmod, + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; +/* Master interfaces on the L3 interconnect */ static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { &omap2420_l3_main__l4_core,
@@ -463,6 +474,272 @@ static struct omap_hwmod omap2420_uart3_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), }; +/* +* 'dss' class +* display sub-system +*/ + +static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = { + .rev_offs =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 omap2420_dss_hwmod_class = { + .name ="dss" , + .sysc = &omap2420_dss_sysc, +}; + +/* dss */ +static struct omap_hwmod_irq_info omap2420_dss_irqs[] = { + { .irq =25 }, +}; + +static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = { + { .name ="dispc" , .dma_req =5 }, +}; + +/* dss */ +/* dss master ports */ +static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = { + &omap2420_dss__l3, +}; + +static struct omap_hwmod_addr_space omap2420_dss_addrs[] = { + { + .pa_start =0x48050000 , + .pa_end =0x480503FF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss */ +static struct omap_hwmod_ocp_if omap2420_l4_core__dss = { + .master = &omap2420_l4_core_hwmod, + .slave = &omap2420_dss_dss_hwmod, + .clk ="dss_ick" , + .addr = omap2420_dss_addrs, + .addr_cnt =ARRAY_SIZE (omap2420_dss_addrs), + .user =OCP_USER_MPU , +}; + +/* dss slave ports */ +static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = { + &omap2420_l4_core__dss, +}; + +static struct omap_hwmod_opt_clk dss_opt_clks[] = { + { .role ="tv_clk" , .clk ="dss_54m_fck" }, + { .role ="sys_clk" , .clk ="dss2_fck" }, +}; + +static struct omap_hwmod omap2420_dss_dss_hwmod = { + .name ="dss_dss" , + .class = &omap2420_dss_hwmod_class, + .main_clk ="dss1_fck" ,/* instead of dss_fck */ + .mpu_irqs = omap2420_dss_irqs, + .mpu_irqs_cnt =ARRAY_SIZE (omap2420_dss_irqs), + .sdma_reqs = omap2420_dss_sdma_chs, + .sdma_reqs_cnt =ARRAY_SIZE (omap2420_dss_sdma_chs), + + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .opt_clks = dss_opt_clks, + .opt_clks_cnt =ARRAY_SIZE (dss_opt_clks), + .slaves = omap2420_dss_slaves, + .slaves_cnt =ARRAY_SIZE (omap2420_dss_slaves), + .masters = omap2420_dss_masters, + .masters_cnt =ARRAY_SIZE (omap2420_dss_masters), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2420 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'dispc' class +* display controller +*/ + +static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = { + .rev_offs =0x0000 , + .sysc_offs =0x0010 , + .syss_offs =0x0014 , + .sysc_flags = (SYSC_HAS_SIDLEMODE |SYSC_HAS_MIDLEMODE | +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 omap2420_dispc_hwmod_class = { + .name ="dispc" , + .sysc = &omap2420_dispc_sysc, +}; + +static struct omap_hwmod_addr_space omap2420_dss_dispc_addrs[] = { + { + .pa_start =0x48050400 , + .pa_end =0x480507FF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_dispc */ +static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = { + .master = &omap2420_l4_core_hwmod, + .slave = &omap2420_dss_dispc_hwmod, + .clk ="dss_ick" , + .addr = omap2420_dss_dispc_addrs, + .addr_cnt =ARRAY_SIZE (omap2420_dss_dispc_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_dispc slave ports */ +static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = { + &omap2420_l4_core__dss_dispc, +}; + +static struct omap_hwmod omap2420_dss_dispc_hwmod = { + .name ="dss_dispc" , + .class = &omap2420_dispc_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2420_dss_dispc_slaves, + .slaves_cnt =ARRAY_SIZE (omap2420_dss_dispc_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2420 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'rfbi' class +* remote frame buffer interface +*/ + +static struct omap_hwmod_class_sysconfig omap2420_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 omap2420_rfbi_hwmod_class = { + .name ="rfbi" , + .sysc = &omap2420_rfbi_sysc, +}; + +static struct omap_hwmod_addr_space omap2420_dss_rfbi_addrs[] = { + { + .pa_start =0x48050800 , + .pa_end =0x48050BFF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_rfbi */ +static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = { + .master = &omap2420_l4_core_hwmod, + .slave = &omap2420_dss_rfbi_hwmod, + .clk ="dss_ick" , + .addr = omap2420_dss_rfbi_addrs, + .addr_cnt =ARRAY_SIZE (omap2420_dss_rfbi_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_rfbi slave ports */ +static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = { + &omap2420_l4_core__dss_rfbi, +}; + +static struct omap_hwmod omap2420_dss_rfbi_hwmod = { + .name ="dss_rfbi" , + .class = &omap2420_rfbi_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2420_dss_rfbi_slaves, + .slaves_cnt =ARRAY_SIZE (omap2420_dss_rfbi_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2420 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'venc' class +* video encoder +*/ + +static struct omap_hwmod_class omap2420_venc_hwmod_class = { + .name ="venc" , +}; + +/* dss_venc */ +static struct omap_hwmod_addr_space omap2420_dss_venc_addrs[] = { + { + .pa_start =0x48050C00 , + .pa_end =0x48050FFF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_venc */ +static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { + .master = &omap2420_l4_core_hwmod, + .slave = &omap2420_dss_venc_hwmod, + .clk ="dss_54m_fck" , + .addr = omap2420_dss_venc_addrs, + .addr_cnt =ARRAY_SIZE (omap2420_dss_venc_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_venc slave ports */ +static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = { + &omap2420_l4_core__dss_venc, +}; + +static struct omap_hwmod omap2420_dss_venc_hwmod = { + .name ="dss_venc" , + .class = &omap2420_venc_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2420_dss_venc_slaves, + .slaves_cnt =ARRAY_SIZE (omap2420_dss_venc_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2420 ), + .flags =HWMOD_NO_IDLEST , +}; +/* I2C common */ static struct omap_hwmod_class_sysconfig i2c_sysc = { .rev_offs =0x00 ,
@@ -567,6 +844,12 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = { &omap2420_uart1_hwmod, &omap2420_uart2_hwmod, &omap2420_uart3_hwmod, +/* dss class */ + &omap2420_dss_dss_hwmod, + &omap2420_dss_dispc_hwmod, + &omap2420_dss_rfbi_hwmod, + &omap2420_dss_venc_hwmod, +/* i2c class */ &omap2420_i2c1_hwmod, &omap2420_i2c2_hwmod, NULL,
Signature · 1 line
1.6.3.3
RE: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENC
Tony,
Quoted 10 lines
-----Original Message-----
From: Guruswamy, Senthilvadivu
Sent: Monday, November 29, 2010 5:21 PM
To: [email protected]; [email protected]; [email protected]; Hiremath, Vaibhav; [email protected]
Cc: Guruswamy, Senthilvadivu
Subject: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENCFrom: Senthilvadivu Guruswamy <[email protected]>
Quoted 7 lines
Database generated for OMAP2420 Display Sub System. Since dss is also considered as an IP as dispc,rfbi, name it as
dss_dss.Signed-off-by Senthilvadivu Guruswamy <[email protected]>Acked-by Benoit Cousson <[email protected]>---
The first 4 patches are reviewed by Acked by Benoit.
These patches are also tested on 2420-N800, 2430SDP, 3430SDP as mentioned in cover letter.
Could you please let me know what is needed further to push this changes to l-o.
Regards,
Senthil
Quoted 2 lines
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 283++++++++++++++++++++++++++++
RE: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENC
In reply to Guruswamy SenthilvadivuKevin, Tony,
Gentle reminder.
Is there anything else pending on me to get these first 4 patches pulled in l-o?
Regards,
Senthil
Quoted 42 lines
-----Original Message-----
From: Guruswamy, Senthilvadivu
Sent: Monday, December 06, 2010 1:14 PM
To: '[email protected]'; Cousson, Benoit
Cc: Guruswamy, Senthilvadivu; [email protected]; [email protected]; [email protected]; Hiremath, Vaibhav; linux- [email protected]
Subject: RE: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENCTony,
Quoted 4 lines
-----Original Message-----
From: Guruswamy, Senthilvadivu
Sent: Monday, November 29, 2010 5:21 PM
To: [email protected]; [email protected];Quoted 6 lines
Hiremath, Vaibhav; [email protected]
Cc: Guruswamy, Senthilvadivu
Subject: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENCFrom: Senthilvadivu Guruswamy <[email protected]>
Quoted 7 lines
Database generated for OMAP2420 Display Sub System. Since dss is also considered as an IP as dispc,rfbi, name it as
dss_dss.Signed-off-by Senthilvadivu Guruswamy <[email protected]>Acked-by Benoit Cousson <[email protected]>---
The first 4 patches are reviewed by Acked by Benoit.
These patches are also tested on 2420-N800, 2430SDP, 3430SDP as mentioned in cover letter.Could you please let me know what is needed further to push this changes to l-o.
Regards,
SenthilQuoted 2 lines
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 283++++++++++++++++++++++++++++
A message that is not in the archive (sent off-list or not yet received): [email protected]
RE: [PATCH v2 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENC
Hi,
Quoted 3 lines · Senthilvadivu
Tomi,
[Senthil] I see in patch work that the whole of this series is delegated to you. Could you please act on this and let me know if there is anything pending from my side ?
I'll try to find time to look through the patch set this week.
Tomi
PATCH v2 2/17 OMAP2430: hwmod data: add DSS DISPC RFBI VENC
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Database generated for OMAP2430 Display Sub System. Since dss is also considered as an IP as dispc,rfbi, name it as dss_dss.
--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 282 ++++++++++++++++++++++++++++ 1 files changed, 282 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2430_data.c +282 -0
@@ -37,6 +37,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;static struct omap_hwmod omap2430_iva_hwmod;static struct omap_hwmod omap2430_l3_main_hwmod;static struct omap_hwmod omap2430_l4_core_hwmod; +static struct omap_hwmod omap2430_dss_dss_hwmod; +static struct omap_hwmod omap2430_dss_dispc_hwmod; +static struct omap_hwmod omap2430_dss_rfbi_hwmod; +static struct omap_hwmod omap2430_dss_venc_hwmod;static struct omap_hwmod omap2430_wd_timer2_hwmod;/* L3 -> L4_CORE interface */
@@ -58,6 +62,13 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = { &omap2430_mpu__l3_main, }; +/* DSS -> l3 */ +static struct omap_hwmod_ocp_if omap2430_dss__l3 = { + .master = &omap2430_dss_dss_hwmod, + .slave = &omap2430_l3_main_hwmod, + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; +/* Master interfaces on the L3 interconnect */ static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { &omap2430_l3_main__l4_core,
@@ -461,6 +472,271 @@ static struct omap_hwmod omap2430_uart3_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), }; +/* +* 'dss' class +* display sub-system +*/ + +static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = { + .rev_offs =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 omap2430_dss_hwmod_class = { + .name ="dss" , + .sysc = &omap2430_dss_sysc, +}; + +/* dss */ +static struct omap_hwmod_irq_info omap2430_dss_irqs[] = { + { .irq =25 }, +}; +static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = { + { .name ="dispc" , .dma_req =5 }, +}; + +/* dss */ +/* dss master ports */ +static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = { + &omap2430_dss__l3, +}; + +static struct omap_hwmod_addr_space omap2430_dss_addrs[] = { + { + .pa_start =0x48050000 , + .pa_end =0x480503FF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss */ +static struct omap_hwmod_ocp_if omap2430_l4_core__dss = { + .master = &omap2430_l4_core_hwmod, + .slave = &omap2430_dss_dss_hwmod, + .clk ="dss_ick" , + .addr = omap2430_dss_addrs, + .addr_cnt =ARRAY_SIZE (omap2430_dss_addrs), + .user =OCP_USER_MPU , +}; + +/* dss slave ports */ +static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = { + &omap2430_l4_core__dss, +}; + +static struct omap_hwmod_opt_clk dss_opt_clks[] = { + { .role ="tv_clk" , .clk ="dss_54m_fck" }, + { .role ="sys_clk" , .clk ="dss2_fck" }, +}; + +static struct omap_hwmod omap2430_dss_dss_hwmod = { + .name ="dss_dss" , + .class = &omap2430_dss_hwmod_class, + .main_clk ="dss1_fck" ,/* instead of dss_fck */ + .mpu_irqs = omap2430_dss_irqs, + .mpu_irqs_cnt =ARRAY_SIZE (omap2430_dss_irqs), + .sdma_reqs = omap2430_dss_sdma_chs, + .sdma_reqs_cnt =ARRAY_SIZE (omap2430_dss_sdma_chs), + + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .opt_clks = dss_opt_clks, + .opt_clks_cnt =ARRAY_SIZE (dss_opt_clks), + .slaves = omap2430_dss_slaves, + .slaves_cnt =ARRAY_SIZE (omap2430_dss_slaves), + .masters = omap2430_dss_masters, + .masters_cnt =ARRAY_SIZE (omap2430_dss_masters), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2430 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'dispc' class +* display controller +*/ + +static struct omap_hwmod_class_sysconfig omap2430_dispc_sysc = { + .rev_offs =0x0000 , + .sysc_offs =0x0010 , + .syss_offs =0x0014 , + .sysc_flags = (SYSC_HAS_SIDLEMODE |SYSC_HAS_MIDLEMODE | +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 omap2430_dispc_hwmod_class = { + .name ="dispc" , + .sysc = &omap2430_dispc_sysc, +}; + +static struct omap_hwmod_addr_space omap2430_dss_dispc_addrs[] = { + { + .pa_start =0x48050400 , + .pa_end =0x480507FF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_dispc */ +static struct omap_hwmod_ocp_if omap2430_l4_core__dss_dispc = { + .master = &omap2430_l4_core_hwmod, + .slave = &omap2430_dss_dispc_hwmod, + .clk ="dss_ick" , + .addr = omap2430_dss_dispc_addrs, + .addr_cnt =ARRAY_SIZE (omap2430_dss_dispc_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_dispc slave ports */ +static struct omap_hwmod_ocp_if *omap2430_dss_dispc_slaves[] = { + &omap2430_l4_core__dss_dispc, +}; + +static struct omap_hwmod omap2430_dss_dispc_hwmod = { + .name ="dss_dispc" , + .class = &omap2430_dispc_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2430_dss_dispc_slaves, + .slaves_cnt =ARRAY_SIZE (omap2430_dss_dispc_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2430 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'rfbi' class +* remote frame buffer interface +*/ + +static struct omap_hwmod_class_sysconfig omap2430_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 omap2430_rfbi_hwmod_class = { + .name ="rfbi" , + .sysc = &omap2430_rfbi_sysc, +}; + +static struct omap_hwmod_addr_space omap2430_dss_rfbi_addrs[] = { + { + .pa_start =0x48050800 , + .pa_end =0x48050BFF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_rfbi */ +static struct omap_hwmod_ocp_if omap2430_l4_core__dss_rfbi = { + .master = &omap2430_l4_core_hwmod, + .slave = &omap2430_dss_rfbi_hwmod, + .clk ="dss_ick" , + .addr = omap2430_dss_rfbi_addrs, + .addr_cnt =ARRAY_SIZE (omap2430_dss_rfbi_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_rfbi slave ports */ +static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = { + &omap2430_l4_core__dss_rfbi, +}; + +static struct omap_hwmod omap2430_dss_rfbi_hwmod = { + .name ="dss_rfbi" , + .class = &omap2430_rfbi_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2430_dss_rfbi_slaves, + .slaves_cnt =ARRAY_SIZE (omap2430_dss_rfbi_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2430 ), + .flags =HWMOD_NO_IDLEST , +}; + +/* +* 'venc' class +* video encoder +*/ + +static struct omap_hwmod_class omap2430_venc_hwmod_class = { + .name ="venc" , +}; + +/* dss_venc */ +static struct omap_hwmod_addr_space omap2430_dss_venc_addrs[] = { + { + .pa_start =0x48050C00 , + .pa_end =0x48050FFF , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_core -> dss_venc */ +static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { + .master = &omap2430_l4_core_hwmod, + .slave = &omap2430_dss_venc_hwmod, + .clk ="dss_54m_fck" , + .addr = omap2430_dss_venc_addrs, + .addr_cnt =ARRAY_SIZE (omap2430_dss_venc_addrs), + .user =OCP_USER_MPU , +}; + +/* dss_venc slave ports */ +static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = { + &omap2430_l4_core__dss_venc, +}; + +static struct omap_hwmod omap2430_dss_venc_hwmod = { + .name ="dss_venc" , + .class = &omap2430_venc_hwmod_class, + .main_clk ="dss1_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP24XX_EN_DSS1_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP24XX_ST_DSS_SHIFT , + }, + }, + .slaves = omap2430_dss_venc_slaves, + .slaves_cnt =ARRAY_SIZE (omap2430_dss_venc_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP2430 ), + .flags =HWMOD_NO_IDLEST , +}; +/* I2C common */ static struct omap_hwmod_class_sysconfig i2c_sysc = { .rev_offs =0x00 ,
@@ -579,6 +855,12 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { &omap2430_uart1_hwmod, &omap2430_uart2_hwmod, &omap2430_uart3_hwmod, +/* dss class */ + &omap2430_dss_dss_hwmod, + &omap2430_dss_dispc_hwmod, + &omap2430_dss_rfbi_hwmod, + &omap2430_dss_venc_hwmod, +/* i2c class */ &omap2430_i2c1_hwmod, &omap2430_i2c2_hwmod, NULL,
Signature · 1 line
1.6.3.3
PATCH v2 3/17 OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Database generated for Display Sub System applicable for OMAP3430-ES2 onwards and OMAP36xx.
dss is also considered as an IP as dispc,rfbi, and named as dss_dss. For all the IP modules in DSS, same clock is needed for enabling. hwmod sees as independent IPs, so same clock has to be repeated as .mainclk in each IP.
OMAP3430ES1 do not have IDLEST bit to poll on for dss IP. So this hwmod is not applicable for 3430ES1.
--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 339 ++++++++++++++++++++++++++++ 1 files changed, 339 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +339 -0
@@ -42,6 +42,11 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;static struct omap_hwmod omap3xxx_l4_core_hwmod;static struct omap_hwmod omap3xxx_l4_per_hwmod;static struct omap_hwmod omap3xxx_wd_timer2_hwmod; +static struct omap_hwmod omap3xxx_dss_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_i2c1_hwmod;static struct omap_hwmod omap3xxx_i2c2_hwmod;static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -72,6 +77,13 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = { &omap3xxx_mpu__l3_main, }; +/* DSS -> l3 */ +static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = { + .master = &omap3xxx_dss_dss_hwmod, + .slave = &omap3xxx_l3_main_hwmod, + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; +/* Master interfaces on the L3 interconnect */ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { &omap3xxx_l3_main__l4_core,
@@ -613,6 +625,326 @@ static struct omap_hwmod_class i2c_class = { .sysc = &i2c_sysc, }; +/* +* 'dss' class +* display sub-system +*/ + +static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = { + .rev_offs =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_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_dss_hwmod = { + .name ="dss_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_GE_OMAP3430ES2 | +CHIP_IS_OMAP3630ES1 |CHIP_GE_OMAP3630ES1_1 ), +}; + +/* +* '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_GE_OMAP3430ES2 | +CHIP_IS_OMAP3630ES1 |CHIP_GE_OMAP3630ES1_1 ), +}; + +/* +* '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 =0x4804FC00 , + .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_GE_OMAP3430ES2 | +CHIP_IS_OMAP3630ES1 |CHIP_GE_OMAP3630ES1_1 ), +}; +/* +* '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_GE_OMAP3430ES2 | +CHIP_IS_OMAP3630ES1 |CHIP_GE_OMAP3630ES1_1 ), +}; + +/* +* 'venc' class +* video encoder +*/ + +static struct omap_hwmod_class omap3xxx_venc_hwmod_class = { + .name ="venc" , +}; + +/* 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_GE_OMAP3430ES2 | +CHIP_IS_OMAP3630ES1 |CHIP_GE_OMAP3630ES1_1 ), +}; +/* I2C1 */ static struct omap_i2c_dev_attr i2c1_dev_attr = {
@@ -751,6 +1083,13 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_uart2_hwmod, &omap3xxx_uart3_hwmod, &omap3xxx_uart4_hwmod, +/* dss class */ + &omap3xxx_dss_dss_hwmod, + &omap3xxx_dss_dispc_hwmod, + &omap3xxx_dss_dsi1_hwmod, + &omap3xxx_dss_rfbi_hwmod, + &omap3xxx_dss_venc_hwmod, +/* i2c class */ &omap3xxx_i2c1_hwmod, &omap3xxx_i2c2_hwmod, &omap3xxx_i2c3_hwmod,
Signature · 1 line
1.6.3.3
Re: [PATCH v2 03/17] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
Hi,
Quoted 10 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Database generated for Display Sub System applicable for OMAP3430-ES2 onwards and OMAP36xx.
dss is also considered as an IP as dispc,rfbi, and named asdss_dss. For all the IP modules in DSS, same clock is needed for enabling. hwmod sees as independent IPs, so same clock has to be repeated as .mainclk in each IP.
OMAP3430ES1 do not have IDLEST bit to poll on for dss IP. So this hwmod is not applicable for 3430ES1.
I'm not so familiar with hwmods, so I cannot comment much on the first three patches in this series. I'll continue going through the latter patches.
One question though: what does the mainclk do? If it means "a clock which enables access to the registers", I'm not sure it's entirely correct. The DSS clocking can be changed to get the functional clock from DSI PLL.
Then a general comment about all the patches in the series: The commit descriptions do not seem to be of very high quality. They are short and poorly formatted. The descriptions are almost as important as the patch itself.
Here's a nice text about commit messages:
http://who-t.blogspot.com/2009/12/on-commit-messages.html
And some comments of my own:
- Use capital letters for DSS, DISPC, etc. when not spesifically referring to some variable or similar.
- Use space after comma.
- Wrap the lines consistently. Now it looks like the lines are wrapped at random points in some commits.
- Use an empty line between paragraphs
- While I understand that you (me neither) are not native english speaker, try to spend some time to be sure that there are no errors due to carelessness.
- Remember that the 00 patch is not saved in git, so it should only be an intro, and all the relevant information should be found in the actual commit messages.
Tomi
RE: [PATCH v2 03/17] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
Hi,
Quoted 13 lines · [email protected] wrote:
Hi,
Quoted 9 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Database generated for Display Sub System applicable for OMAP3430-ES2 onwards and OMAP36xx.
dss is also considered as an IP as dispc,rfbi, and named asdss_dss. For all the IP modules in DSS, same clock is needed for enabling. hwmod sees as independent IPs, so same clock has to be repeated as .mainclk in each IP. OMAP3430ES1 do not have IDLEST bit to poll on for dss IP. So this hwmod is not applicable for 3430ES1.
Quoted 8 lines
I'm not so familiar with hwmods, so I cannot comment much on the first three patches in this series. I'll continue going through the latter patches.
One question though: what does the mainclk do? If it means "a clock which enables access to the registers", I'm not sure it's entirely correct. The DSS clocking can be changed to get the functional clock from DSI PLL.
On OMAP4 there are MODULEMODE bits for DSS and other domains, these need to be enabled to use the module, I think that's what mainclk represents here.
You can have a look at the CM_DSS_DSS_CLKCTRL register in the OMAP4 TRM to get a better idea.
So, instead of explicitly enabling/disabling the interface clocks like we did for DSS in omap3, we just need to ensure that MODULEMODE bits are set, setting this will take care of enabling/gating interface clocks based on the state of the clock domain.
I think we consider the DSS1_ALWAYSON_FCK as the mainclk.
Others, please correct me if I am wrong.
Regards,
Archit
Quoted 24 lines
Then a general comment about all the patches in the series:
The commit descriptions do not seem to be of very high quality. They are short and poorly formatted. The descriptions are almost as important as the patch itself.Here's a nice text about commit messages:
http://who-t.blogspot.com/2009/12/on-commit-messages.htmlAnd some comments of my own:
- Use capital letters for DSS, DISPC, etc. when not spesifically referring to some variable or similar.
- Use space after comma.
- Wrap the lines consistently. Now it looks like the lines are wrapped at random points in some commits.
- Use an empty line between paragraphs
- While I understand that you (me neither) are not native english speaker, try to spend some time to be sure that there are no errors due to carelessness.
- Remember that the 00 patch is not saved in git, so it should only be an intro, and all the relevant information should be found in the actual commit messages.Tomi
RE: [PATCH v2 03/17] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC
Benoit,
Quoted 43 lines
-----Original Message-----
From: Taneja, Archit
Sent: Monday, December 20, 2010 10:14 PM
To: Tomi Valkeinen; Guruswamy, Senthilvadivu
Cc: [email protected]; [email protected]; Hiremath, Vaibhav; linux- [email protected]
Subject: RE: [PATCH v2 03/17] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENCHi,
Quoted 10 lines · [email protected] wrote:
Hi,
Quoted 7 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Database generated for Display Sub System applicable for OMAP3430-ES2 onwards and OMAP36xx.
dss is also considered as an IP as dispc,rfbi, and named asdss_dss. For all the IP modules in DSS, same clock is needed for enabling. hwmod sees as independent IPs, so same clock has to be repeated as.mainclk
Quoted 1 line
Quoted 1 line
in each IP. OMAP3430ES1 do not have IDLEST bit to poll on for dss IP.
So
Quoted 10 lines
Quoted 1 line
this hwmod is not applicable for 3430ES1.
I'm not so familiar with hwmods, so I cannot comment much on the first three patches in this series. I'll continue going through the latter patches.
One question though: what does the mainclk do? If it means "a clock which enables access to the registers", I'm not sure it's entirely correct. The DSS clocking can be changed to get the functional clock from DSI PLL.
On OMAP4 there are MODULEMODE bits for DSS and other domains, these need to be enabled to use the module, I think that's what mainclk represents here.
You can have a look at the
CM_DSS_DSS_CLKCTRLregister in the OMAP4 TRM to get a better idea.
Quoted 8 lines
So, instead of explicitly enabling/disabling the interface clocks like we did for DSS in omap3, we just need to ensure that MODULEMODE bits are set, setting this will take care of enabling/gating interface clocks based on the state of the clock domain.
I think we consider the
DSS1_ALWAYSON_FCKas the mainclk.Others, please correct me if I am wrong.
[Senthil] I too have the same understanding.
Its ensured that .main_clk should be with DSS1_ALWAYSON_FCK in the static database because it is necessary before switch to DSI PLL could happen.
The main point to consider from Tomi's query is that DSS functional clock could be changed dynamically to that of DSI PLL.
Can this change be accommodated dynamically in hwmod database so that further pm_runtime_get_sync/put_sync could address DSI PLL instead of DSS_FCK?
Benoit should be able to answer this query.
Quoted 28 lines
Regards,
ArchitQuoted 24 lines
Then a general comment about all the patches in the series:
The commit descriptions do not seem to be of very high quality. They are short and poorly formatted. The descriptions are almost as important as the patch itself.Here's a nice text about commit messages:
http://who-t.blogspot.com/2009/12/on-commit-messages.htmlAnd some comments of my own:
- Use capital letters for DSS, DISPC, etc. when not spesifically referring to some variable or similar.
- Use space after comma.
- Wrap the lines consistently. Now it looks like the lines are wrapped at random points in some commits.
- Use an empty line between paragraphs
- While I understand that you (me neither) are not native english speaker, try to spend some time to be sure that there are no errors due to carelessness.
- Remember that the 00 patch is not saved in git, so it should only be an intro, and all the relevant information should be found in the actual commit messages.Tomi
PATCH v2 4/17 OMAP2420,OMAP2430,OMAP3xx: change dss driver name in clock files
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
dss driver renamed to "omap_" is done to align all the omap device names with the same convention.
--- arch/arm/mach-omap2/clock2420_data.c | 8 ++++---- arch/arm/mach-omap2/clock2430_data.c | 8 ++++---- arch/arm/mach-omap2/clock3xxx_data.c | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/clock2420_data.c +4 -4
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {CLK (NULL ,"gfx_2d_fck" , &gfx_2d_fck,CK_242X ),CLK (NULL ,"gfx_ick" , &gfx_ick,CK_242X ),/* DSS domain clocks */ -CLK ("omapdss" ,"ick" , &dss_ick,CK_242X ), -CLK ("omapdss" ,"dss1_fck" , &dss1_fck,CK_242X ), -CLK ("omapdss" ,"dss2_fck" , &dss2_fck,CK_242X ), -CLK ("omapdss" ,"tv_fck" , &dss_54m_fck,CK_242X ), +CLK ("omap_dss" ,"ick" , &dss_ick,CK_242X ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_fck,CK_242X ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_fck,CK_242X ), +CLK ("omap_dss" ,"tv_fck" , &dss_54m_fck,CK_242X ),/* L3 domain clocks */ CLK (NULL ,"core_l3_ck" , &core_l3_ck,CK_242X ), CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X),
arch/arm/mach-omap2/clock2430_data.c +4 -4
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {CLK (NULL ,"mdm_ick" , &mdm_ick,CK_243X ),CLK (NULL ,"mdm_osc_ck" , &mdm_osc_ck,CK_243X ),/* DSS domain clocks */ -CLK ("omapdss" ,"ick" , &dss_ick,CK_243X ), -CLK ("omapdss" ,"dss1_fck" , &dss1_fck,CK_243X ), -CLK ("omapdss" ,"dss2_fck" , &dss2_fck,CK_243X ), -CLK ("omapdss" ,"tv_fck" , &dss_54m_fck,CK_243X ), +CLK ("omap_dss" ,"ick" , &dss_ick,CK_243X ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_fck,CK_243X ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_fck,CK_243X ), +CLK ("omap_dss" ,"tv_fck" , &dss_54m_fck,CK_243X ),/* L3 domain clocks */ CLK (NULL ,"core_l3_ck" , &core_l3_ck,CK_243X ), CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
arch/arm/mach-omap2/clock3xxx_data.c +7 -7
@@ -3347,13 +3347,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 ("omap_dss" ,"dss1_fck" , &dss1_alwon_fck_3430es1,CK_3430ES1 ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_alwon_fck_3430es2,CK_3430ES2 |CK_AM35XX ), +CLK ("omap_dss" ,"tv_fck" , &dss_tv_fck,CK_3XXX ), +CLK ("omap_dss" ,"video_fck" , &dss_96m_fck,CK_3XXX ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_alwon_fck,CK_3XXX ), +CLK ("omap_dss" ,"ick" , &dss_ick_3430es1,CK_3430ES1 ), +CLK ("omap_dss" ,"ick" , &dss_ick_3430es2,CK_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),
Signature · 1 line
1.6.3.3
Re: [PATCH v2 04/17] OMAP2420,OMAP2430,OMAP3xx: change dss driver name in clock files
Hi,
Quoted 4 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
dss driver renamed to "
omap_" is done to align all the omap device names with the same convention.
Does the driver work if you change the driver name from the clock files, but not from the driver itself? Remember that things have to work after each patch.
Tomi
Quoted 71 lines
Signed-off-by Senthilvadivu Guruswamy <[email protected]>Acked-by Benoit Cousson <[email protected]>--- arch/arm/mach-omap2/clock2420_data.c | 8 ++++---- arch/arm/mach-omap2/clock2430_data.c | 8 ++++---- arch/arm/mach-omap2/clock3xxx_data.c | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-)arch/arm/mach-omap2/clock2420_data.c +4
-4@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {CLK (NULL ,"gfx_2d_fck" , &gfx_2d_fck,CK_242X ),CLK (NULL ,"gfx_ick" , &gfx_ick,CK_242X ),/* DSS domain clocks */ -CLK ("omapdss" ,"ick" , &dss_ick,CK_242X ), -CLK ("omapdss" ,"dss1_fck" , &dss1_fck,CK_242X ), -CLK ("omapdss" ,"dss2_fck" , &dss2_fck,CK_242X ), -CLK ("omapdss" ,"tv_fck" , &dss_54m_fck,CK_242X ), +CLK ("omap_dss" ,"ick" , &dss_ick,CK_242X ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_fck,CK_242X ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_fck,CK_242X ), +CLK ("omap_dss" ,"tv_fck" , &dss_54m_fck,CK_242X ),/* L3 domain clocks */ CLK (NULL ,"core_l3_ck" , &core_l3_ck,CK_242X ), CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X),arch/arm/mach-omap2/clock2430_data.c +4
-4@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {CLK (NULL ,"mdm_ick" , &mdm_ick,CK_243X ),CLK (NULL ,"mdm_osc_ck" , &mdm_osc_ck,CK_243X ),/* DSS domain clocks */ -CLK ("omapdss" ,"ick" , &dss_ick,CK_243X ), -CLK ("omapdss" ,"dss1_fck" , &dss1_fck,CK_243X ), -CLK ("omapdss" ,"dss2_fck" , &dss2_fck,CK_243X ), -CLK ("omapdss" ,"tv_fck" , &dss_54m_fck,CK_243X ), +CLK ("omap_dss" ,"ick" , &dss_ick,CK_243X ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_fck,CK_243X ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_fck,CK_243X ), +CLK ("omap_dss" ,"tv_fck" , &dss_54m_fck,CK_243X ),/* L3 domain clocks */ CLK (NULL ,"core_l3_ck" , &core_l3_ck,CK_243X ), CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),arch/arm/mach-omap2/clock3xxx_data.c +7
-7@@ -3347,13 +3347,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 ("omap_dss" ,"dss1_fck" , &dss1_alwon_fck_3430es1,CK_3430ES1 ), +CLK ("omap_dss" ,"dss1_fck" , &dss1_alwon_fck_3430es2,CK_3430ES2 |CK_AM35XX ), +CLK ("omap_dss" ,"tv_fck" , &dss_tv_fck,CK_3XXX ), +CLK ("omap_dss" ,"video_fck" , &dss_96m_fck,CK_3XXX ), +CLK ("omap_dss" ,"dss2_fck" , &dss2_alwon_fck,CK_3XXX ), +CLK ("omap_dss" ,"ick" , &dss_ick_3430es1,CK_3430ES1 ), +CLK ("omap_dss" ,"ick" , &dss_ick_3430es2,CK_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),
RE: [PATCH v2 04/17] OMAP2420,OMAP2430,OMAP3xx: change dss driver name in clock files
Quoted 14 lines
-----Original Message-----
From: Tomi Valkeinen [mailto:[email protected]]
Sent: Tuesday, December 21, 2010 7:14 PM
To: Guruswamy, Senthilvadivu
Cc: [email protected]; [email protected]; Hiremath, Vaibhav; linux- [email protected]
Subject: Re: [PATCH v2 04/17] OMAP2420,OMAP2430,OMAP3xx: change dss driver name in clock filesHi,
On Mon, 2010-11-29 at 17:21 +0530, ext Guruswamy Senthilvadivu wrote:
Quoted 8 lines
Quoted 4 lines
From: Senthilvadivu Guruswamy <[email protected]>
dss driver renamed to "
omap_" is done to align all the omap device names with the same convention.Does the driver work if you change the driver name from the clock files, but not from the driver itself? Remember that things have to work after each patch.
[Senthil] Yes, it was surprising for me to that it worked. When I dig into the code, I found that it matches for dev->id and not dev->name. Yes, I have tested for bootup after each patch. No crashes observed. Errors like clk_get failed, can't get regulator would be given on some of the patches.
Quoted 2 lines
Tomi
PATCH v2 5/17 OMAP2,3 DSS Driver register moved to mach_omap2
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move DSS driver register from board file to devices.c Changed device name from omapdss to omap_display as the driver takes care of panel information.
--- arch/arm/mach-omap2/devices.c | 32 +++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/display.h | 4 +++ drivers/video/omap2/dss/core.c | 2 +- 3 files changed, 37 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +32 -0
@@ -28,6 +28,7 @@#include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/display.h> #include <plat/omap_hwmod.h> #include <plat/omap_device.h>
@@ -923,6 +924,37 @@ static inline void omap_hdq_init(void) {}#endif /*---------------------------------------------------------------------------*/ +#ifdef CONFIG_OMAP2_DSS + +static struct platform_device omap_display_device = { + .name ="omap_display" , + .id =-1 , + .dev = { + .platform_data =NULL , + }, +}; + +int __init omap_display_init (struct omap_dss_board_info + *board_data) +{ +int r =0 ; + omap_display_device.dev.platform_data = board_data; + + r =platform_device_register (&omap_display_device); +if (r <0 ) +printk (KERN_ERR "Unable to register OMAP-Display device\n" ); + +return r; +} + +#else +int __init omap_display_init (struct omap_dss_board_info *board_data) +{ +return 0 ; +} +#endif + +/*---------------------------------------------------------------------------*/ #if defined(CONFIG_VIDEO_OMAP2_VOUT ) || \ defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE )
arch/arm/plat-omap/include/plat/display.h +4 -0
@@ -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)
@@ -220,6 +221,9 @@ struct omap_dss_board_info {struct omap_dss_device *default_device; }; +/* Init with the board info */ +extern int omap_display_init (struct omap_dss_board_info *board_data); +struct omap_video_timings {/* Unit: pixels */ u16 x_res;
drivers/video/omap2/dss/core.c +1 -1
@@ -715,7 +715,7 @@ static struct platform_driver omap_dss_driver = { .suspend = omap_dss_suspend, .resume = omap_dss_resume, .driver = { - .name = "omapdss", + .name = "omap_display", .owner = THIS_MODULE, }, };
Signature · 1 line
1.6.3.3
Re: [PATCH v2 05/17] OMAP2,3 DSS Driver register moved to mach_omap2
Quoted 5 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Move DSS driver register from board file to
devices.cChanged device name from omapdss toomap_displayas the driver takes care of panel information.
Here you do two separate things, adding the omap_display_init() and changing the driver name. The latter should be in the previous patch, I suppose.
Tomi
Quoted 92 lines
Signed-off-by Senthilvadivu Guruswamy <[email protected]>--- arch/arm/mach-omap2/devices.c | 32 +++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/display.h | 4 +++ drivers/video/omap2/dss/core.c | 2 +- 3 files changed, 37 insertions(+), 1 deletions(-)arch/arm/mach-omap2/devices.c +32
-0@@ -28,6 +28,7 @@#include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/display.h> #include <plat/omap_hwmod.h> #include <plat/omap_device.h> @@ -923,6 +924,37 @@ static inline void omap_hdq_init(void) {}#endif /*---------------------------------------------------------------------------*/ +#ifdef CONFIG_OMAP2_DSS + +static struct platform_device omap_display_device = { + .name ="omap_display" , + .id =-1 , + .dev = { + .platform_data =NULL , + }, +}; + +int __init omap_display_init (struct omap_dss_board_info + *board_data) +{ +int r =0 ; + omap_display_device.dev.platform_data = board_data; + + r =platform_device_register (&omap_display_device); +if (r <0 ) +printk (KERN_ERR "Unable to register OMAP-Display device\n" ); + +return r; +} + +#else +int __init omap_display_init (struct omap_dss_board_info *board_data) +{ +return 0 ; +} +#endif + +/*---------------------------------------------------------------------------*/ #if defined(CONFIG_VIDEO_OMAP2_VOUT ) || \ defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE )arch/arm/plat-omap/include/plat/display.h +4
-0@@ -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)@@ -220,6 +221,9 @@ struct omap_dss_board_info {struct omap_dss_device *default_device; }; +/* Init with the board info */ +extern int omap_display_init (struct omap_dss_board_info *board_data); +struct omap_video_timings {/* Unit: pixels */ u16 x_res;drivers/video/omap2/dss/core.c +1
-1@@ -715,7 +715,7 @@ static struct platform_driver omap_dss_driver = { .suspend = omap_dss_suspend, .resume = omap_dss_resume, .driver = { - .name = "omapdss", + .name = "omap_display", .owner = THIS_MODULE, }, };
RE: [PATCH v2 05/17] OMAP2,3 DSS Driver register moved to mach_omap2
Quoted 14 lines
-----Original Message-----
From: Tomi Valkeinen [mailto:[email protected]]
Sent: Tuesday, December 21, 2010 7:19 PM
To: Guruswamy, Senthilvadivu
Cc: [email protected]; [email protected]; Hiremath, Vaibhav; linux- [email protected]
Subject: Re: [PATCH v2 05/17] OMAP2,3 DSS Driver register moved tomach_omap2Quoted 2 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Quoted 7 lines
Quoted 3 lines
Move DSS driver register from board file to
devices.cChanged device name from omapdss toomap_displayas the driver takes care of panel information.Here you do two separate things, adding the
omap_display_init()and changing the driver name. The latter should be in the previous patch, I suppose.
[Senthil] Yes, I can change the driver name first and then omap_display_init() as 2 small patches. When I do this I have to do similarly for board files too. Then the board file related changes alone would be 3 separate patches - 1. driver name change, 2. omap_display_init, 3. Regulator initialization being done with driver name
If this is fine, then I can send v3 version of the patch set.
Quoted 3 lines
Tomi
RE: [PATCH v2 05/17] OMAP2,3 DSS Driver register moved to mach_omap2
Quoted 17 lines · Senthilvadivu
Quoted 17 lines
-----Original Message-----
From: Tomi Valkeinen [mailto:[email protected]]
Sent: Tuesday, December 21, 2010 7:19 PM
To: Guruswamy, Senthilvadivu
Cc: [email protected]; [email protected]; Hiremath, Vaibhav; linux- [email protected]
Subject: Re: [PATCH v2 05/17] OMAP2,3 DSS Driver register moved tomach_omap2Quoted 5 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Move DSS driver register from board file to
devices.cChanged device name from omapdss toomap_displayas the driver takes care of panel information.
Quoted 6 lines
Quoted 3 lines
Here you do two separate things, adding the
omap_display_init()and changing the driver name. The latter should be in the previous patch, I suppose.[Senthil] Yes, I can change the driver name first and then
omap_display_init()as 2 small patches. When I do this I have to do similarly for board files too. Then the board file related changes alone would be 3 separate patches - 1. driver name change, 2.omap_display_init, 3. Regulator initialization being done with driver nameIf this is fine, then I can send v3 version of the patch set.
Try to do one logical change in one patch, so for example when you change the driver name, change it in the clock files, board files and in the driver. That way the kernel stays whole after each patch.
Tomi
PATCH v2 6/17 OMAP2,3 board files DSS Driver register moved to devices.c
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move DSS driver register from board file to devices.c Regulator initialisation done with driver name instead of device structure name.
Changed driver name from omapdss to omap_display as the driver takes care of panel information.
Board files that have dss registeration are updated. 3430sdp, am3517evm, cm-t35, devkit8000, igep0020, omap3evm, omap3pandora, omap3stalker, rx-51
--- arch/arm/mach-omap2/board-3430sdp.c | 25 ++++--------------------- arch/arm/mach-omap2/board-am3517evm.c | 14 +------------- arch/arm/mach-omap2/board-cm-t35.c | 22 +++++----------------- arch/arm/mach-omap2/board-devkit8000.c | 12 ++---------- arch/arm/mach-omap2/board-igep0020.c | 20 +++----------------- arch/arm/mach-omap2/board-omap3beagle.c | 14 +++----------- arch/arm/mach-omap2/board-omap3evm.c | 22 ++++------------------ arch/arm/mach-omap2/board-omap3pandora.c | 16 ++++------------ arch/arm/mach-omap2/board-omap3stalker.c | 16 +++------------- arch/arm/mach-omap2/board-rx51-peripherals.c | 9 +-------- arch/arm/mach-omap2/board-rx51-video.c | 15 +-------------- 11 files changed, 31 insertions(+), 154 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +4 -21
@@ -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" ,"omap_display" );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" ,"omap_display" ), };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
arch/arm/mach-omap2/board-am3517evm.c +1 -13
@@ -367,23 +367,12 @@ static struct omap_dss_board_info am3517_evm_dss_data = { .default_device = &am3517_evm_lcd_device, }; -static struct platform_device am3517_evm_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &am3517_evm_dss_data, - }, -}; -/* * Board initialization */ static struct omap_board_config_kernel am3517_evm_config[]__initdata = { }; -static struct platform_device *am3517_evm_devices[]__initdata = { - &am3517_evm_dss_device, -};static void __init am3517_evm_init_irq (void ) {
@@ -487,8 +476,7 @@ static void __init am3517_evm_init(void)omap3_mux_init (board_mux,OMAP_PACKAGE_CBB );am3517_evm_i2c_init (); -platform_add_devices (am3517_evm_devices, -ARRAY_SIZE (am3517_evm_devices)); +omap_display_init (&am3517_evm_dss_data);omap_serial_init ();
arch/arm/mach-omap2/board-cm-t35.c +5 -17
@@ -390,14 +390,6 @@ static struct omap_dss_board_info cm_t35_dss_data = { .default_device = &cm_t35_dvi_device, }; -static struct platform_device cm_t35_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &cm_t35_dss_data, - }, -}; -static struct omap2_mcspi_device_config tdo24m_mcspi_config = { .turbo_mode =0 , .single_channel =1 ,/* 0: slave, 1: master */
@@ -457,7 +449,7 @@ static void __init cm_t35_init_display(void)msleep (50 );gpio_set_value (lcd_en_gpio,1 ); - err =platform_device_register (&cm_t35_dss_device); + err =omap_display_init (&cm_t35_dss_data);if (err) {pr_err ("CM-T35: failed to register DSS device\n" ); goto err_dev_reg;
@@ -484,15 +476,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { .supply = "vmmc_aux", }; -static struct regulator_consumer_supply cm_t35_vdac_supply = { - .supply ="vdda_dac" , - .dev = &cm_t35_dss_device.dev, -}; +static struct regulator_consumer_supply cm_t35_vdac_supply = +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" ); -static struct regulator_consumer_supply cm_t35_vdvi_supply = { - .supply ="vdvi" , - .dev = &cm_t35_dss_device.dev, -}; +static struct regulator_consumer_supply cm_t35_vdvi_supply = +REGULATOR_SUPPLY ("vdvi" ,"omap_display" );/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ static struct regulator_init_data cm_t35_vmmc1 = {
arch/arm/mach-omap2/board-devkit8000.c +2 -10
@@ -188,16 +188,8 @@ static struct omap_dss_board_info devkit8000_dss_data = { .default_device = &devkit8000_lcd_device, }; -static struct platform_device devkit8000_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &devkit8000_dss_data, - }, -}; -static struct regulator_consumer_supply devkit8000_vdda_dac_supply = -REGULATOR_SUPPLY ("vdda_dac" ,"omapdss" ); +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" );static uint32_t board_keymap[] = {KEY (0 ,0 ,KEY_1 ),
@@ -561,7 +553,6 @@ static void __init omap_dm9000_init(void) }static struct platform_device *devkit8000_devices[]__initdata = { - &devkit8000_dss_device, &leds_gpio, &keys_gpio, &omap_dm9000_dev,
@@ -783,6 +774,7 @@ static void __init devkit8000_init(void)platform_add_devices (devkit8000_devices,ARRAY_SIZE (devkit8000_devices)); +omap_display_init (&devkit8000_dss_data);spi_register_board_info (devkit8000_spi_board_info,ARRAY_SIZE (devkit8000_spi_board_info));
arch/arm/mach-omap2/board-igep0020.c +3 -17
@@ -441,18 +441,8 @@ static struct omap_dss_board_info igep2_dss_data = { .default_device = &igep2_dvi_device, }; -static struct platform_device igep2_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &igep2_dss_data, - }, -}; - -static struct regulator_consumer_supply igep2_vpll2_supply = { - .supply ="vdds_dsi" , - .dev = &igep2_dss_device.dev, -}; +static struct regulator_consumer_supply igep2_vpll2_supply = +REGULATOR_SUPPLY ("vdds_dsi" ,"omap_display" );static struct regulator_init_data igep2_vpll2 = { .constraints = {
@@ -476,10 +466,6 @@ static void __init igep2_display_init(void)pr_err ("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n" ); } -static struct platform_device *igep2_devices[]__initdata = { - &igep2_dss_device, -}; -static void __init igep2_init_irq (void ) {omap2_init_common_hw (m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
@@ -620,7 +606,7 @@ static void __init igep2_init(void)igep2_get_revision ();/* Register I2C busses and drivers */ igep2_i2c_init (); -platform_add_devices (igep2_devices,ARRAY_SIZE (igep2_devices)); +omap_display_init (&igep2_dss_data);omap_serial_init ();usb_musb_init (&musb_board_data);usb_ehci_init (&ehci_pdata);
arch/arm/mach-omap2/board-omap3beagle.c +3 -11
@@ -222,19 +222,11 @@ static struct omap_dss_board_info beagle_dss_data = { .default_device = &beagle_dvi_device, }; -static struct platform_device beagle_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &beagle_dss_data, - }, -}; -static struct regulator_consumer_supply beagle_vdac_supply = -REGULATOR_SUPPLY ("vdda_dac" ,"omapdss" ); +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" );static struct regulator_consumer_supply beagle_vdvi_supply = -REGULATOR_SUPPLY ("vdds_dsi" ,"omapdss" ); +REGULATOR_SUPPLY ("vdds_dsi" ,"omap_display" );static void __init beagle_display_init (void ) {
@@ -496,7 +488,6 @@ static void __init omap3_beagle_init_irq(void)static struct platform_device *omap3_beagle_devices[]__initdata = { &leds_gpio, &keys_gpio, - &beagle_dss_device, };static void __init omap3beagle_flash_init (void )
@@ -565,6 +556,7 @@ static void __init omap3_beagle_init(void)omap3_beagle_i2c_init ();platform_add_devices (omap3_beagle_devices,ARRAY_SIZE (omap3_beagle_devices)); +omap_display_init (&beagle_dss_data);omap_serial_init ();omap_mux_init_gpio (170 ,OMAP_PIN_INPUT );
arch/arm/mach-omap2/board-omap3evm.c +4 -18
@@ -322,14 +322,6 @@ static struct omap_dss_board_info omap3_evm_dss_data = { .default_device = &omap3_evm_lcd_device, }; -static struct platform_device omap3_evm_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &omap3_evm_dss_data, - }, -}; -static struct regulator_consumer_supply omap3evm_vmmc1_supply = { .supply ="vmmc" , };
@@ -494,10 +486,8 @@ static struct twl4030_codec_data omap3evm_codec_data = { .audio = &omap3evm_audio_data, }; -static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { - .supply ="vdda_dac" , - .dev = &omap3_evm_dss_device.dev, -}; +static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" );/* VDAC for DSS driving S-Video */ static struct regulator_init_data omap3_evm_vdac = {
@@ -516,7 +506,7 @@ static struct regulator_init_data omap3_evm_vdac = {/* VPLL2 for digital video outputs */ static struct regulator_consumer_supply omap3_evm_vpll2_supply = -REGULATOR_SUPPLY ("vdds_dsi" ,"omapdss" ); +REGULATOR_SUPPLY ("vdds_dsi" ,"omap_display" );static struct regulator_init_data omap3_evm_vpll2 = { .constraints = {
@@ -628,10 +618,6 @@ static void __init omap3_evm_init_irq(void)omap_gpio_init (); } -static struct platform_device *omap3_evm_devices[]__initdata = { - &omap3_evm_dss_device, -}; -static struct ehci_hcd_omap_platform_data ehci_pdata__initdata = { .port_mode[0 ] =EHCI_HCD_OMAP_MODE_UNKNOWN ,
@@ -671,7 +657,7 @@ static void __init omap3_evm_init(void)omap3_evm_i2c_init (); -platform_add_devices (omap3_evm_devices,ARRAY_SIZE (omap3_evm_devices)); +omap_display_init (&omap3_evm_dss_data);spi_register_board_info (omap3evm_spi_board_info,ARRAY_SIZE (omap3evm_spi_board_info));
arch/arm/mach-omap2/board-omap3pandora.c +4 -12
@@ -253,14 +253,6 @@ static struct omap_dss_board_info pandora_dss_data = { .default_device = &pandora_lcd_device, }; -static struct platform_device pandora_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &pandora_dss_data, - }, -}; -static void pandora_wl1251_init_card (struct mmc_card *card) {/*
@@ -350,11 +342,11 @@ static struct regulator_consumer_supply pandora_vmmc3_supply =REGULATOR_SUPPLY ("vmmc" ,"mmci-omap-hs.2" );static struct regulator_consumer_supply pandora_vdda_dac_supply = -REGULATOR_SUPPLY ("vdda_dac" ,"omapdss" ); +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" );static struct regulator_consumer_supply pandora_vdds_supplies[] = { -REGULATOR_SUPPLY ("vdds_sdi" ,"omapdss" ), -REGULATOR_SUPPLY ("vdds_dsi" ,"omapdss" ), +REGULATOR_SUPPLY ("vdds_sdi" ,"omap_display" ), +REGULATOR_SUPPLY ("vdds_dsi" ,"omap_display" ), }; static struct regulator_consumer_supply pandora_vcc_lcd_supply =
@@ -690,7 +682,6 @@ fail:static struct platform_device *omap3pandora_devices[]__initdata = { &pandora_leds_gpio, &pandora_keys_gpio, - &pandora_dss_device, &pandora_wl1251_data, &pandora_vwlan_device, };
@@ -728,6 +719,7 @@ static void __init omap3pandora_init(void)pandora_wl1251_init ();platform_add_devices (omap3pandora_devices,ARRAY_SIZE (omap3pandora_devices)); +omap_display_init (&pandora_dss_data);omap_serial_init ();spi_register_board_info (omap3pandora_spi_board_info,ARRAY_SIZE (omap3pandora_spi_board_info));
arch/arm/mach-omap2/board-omap3stalker.c +3 -13
@@ -229,14 +229,6 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { .default_device = &omap3_stalker_dvi_device, }; -static struct platform_device omap3_stalker_dss_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &omap3_stalker_dss_data, - }, -}; -static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { .supply ="vmmc" , };
@@ -437,10 +429,8 @@ static struct twl4030_codec_data omap3stalker_codec_data = { .audio = &omap3stalker_audio_data, }; -static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = { - .supply ="vdda_dac" , - .dev = &omap3_stalker_dss_device.dev, -}; +static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = +REGULATOR_SUPPLY ("vdda_dac" ,"omap_display" );/* VDAC for DSS driving S-Video */ static struct regulator_init_data omap3_stalker_vdac = {
@@ -593,7 +583,6 @@ static void __init omap3_stalker_init_irq(void) }static struct platform_device *omap3_stalker_devices[]__initdata = { - &omap3_stalker_dss_device, &keys_gpio, };
@@ -635,6 +624,7 @@ static void __init omap3_stalker_init(void)platform_add_devices (omap3_stalker_devices,ARRAY_SIZE (omap3_stalker_devices)); +omap_display_init (&omap3_stalker_dss_data);spi_register_board_info (omap3stalker_spi_board_info,ARRAY_SIZE (omap3stalker_spi_board_info));
arch/arm/mach-omap2/board-rx51-peripherals.c +1 -8
@@ -356,16 +356,9 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = { REGULATOR_SUPPLY("DVDD", "2-0018"), }; -#if defined(CONFIG_FB_OMAP2 ) || defined(CONFIG_FB_OMAP2_MODULE ) -extern struct platform_device rx51_display_device; -#endif - static struct regulator_consumer_supply rx51_vaux1_consumers[] = {#if defined(CONFIG_FB_OMAP2 ) || defined(CONFIG_FB_OMAP2_MODULE ) - { - .supply = "vdds_sdi", - .dev = &rx51_display_device.dev, - }, + REGULATOR_SUPPLY("vdds_sdi", "omap_display"),#endif };
arch/arm/mach-omap2/board-rx51-video.c +1 -14
@@ -59,18 +59,6 @@ static struct omap_dss_board_info rx51_dss_board_info = { .default_device = &rx51_lcd_device, }; -struct platform_device rx51_display_device = { - .name ="omapdss" , - .id =-1 , - .dev = { - .platform_data = &rx51_dss_board_info, - }, -}; - -static struct platform_device *rx51_video_devices[]__initdata = { - &rx51_display_device, -}; -static int __init rx51_video_init (void ) {if (!machine_is_nokia_rx51 ())
@@ -88,8 +76,7 @@ static int __init rx51_video_init(void)gpio_direction_output (RX51_LCD_RESET_GPIO ,1 ); -platform_add_devices (rx51_video_devices, -ARRAY_SIZE (rx51_video_devices)); +omap_display_init (&rx51_dss_board_info);return 0 ; }
Signature · 1 line
1.6.3.3
Re: [PATCH v2 06/17] OMAP2,3 board files DSS Driver register moved to devices.c
Hi,
Quoted 10 lines · ext Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy <[email protected]>
Move DSS driver register from board file to
devices.cRegulator initialisation done with driver name instead of device structure name.
Changed driver name from omapdss toomap_displayas the driver takes care of panel information.
Board files that have dss registeration are updated. 3430sdp, am3517evm, cm-t35, devkit8000, igep0020, omap3evm, omap3pandora, omap3stalker, rx-51
Here are also too many changes in one patch. Change the driver name first (could be done in the previous patches), then the regulator initialization, and then the omap_display_init() change.
Tomi
PATCH v2 7/17 OMAP2,3: DSS: Build omap_device for each DSS HWIP
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
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
--- arch/arm/mach-omap2/devices.c | 50 +++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/display.h | 6 +++ 2 files changed, 56 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/devices.c +50 -0
@@ -934,10 +934,60 @@ 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, + }, +}; +int __init omap_display_init (struct omap_dss_board_info *board_data) {int r =0 ; +struct omap_hwmod *oh; +struct omap_device *od; +int i; +struct omap_display_platform_data pdata; +char *omap2_oh_name[] = {"dss_dss" ,"dss_dispc" ,"dss_rfbi" , +"dss_venc" }; +char *omap3_oh_name[] = {"dss_dss" ,"dss_dispc" ,"dss_rfbi" , +"dss_venc" ,"dss_dsi1" }; +char *omap2_dev_name[] = {"omap_dss" ,"omap_dispc" ,"omap_rfbi" , +"omap_venc" }; +char *omap3_dev_name[] = {"omap_dss" ,"omap_dispc" ,"omap_rfbi" , +"omap_venc" ,"omap_dsi1" }; +char *(*oh_name)[]; +char *(*dev_name)[]; +int oh_count; + +if (cpu_is_omap24xx ()) { + oh_name = &omap2_oh_name; + dev_name = &omap2_dev_name; + oh_count =ARRAY_SIZE (omap2_oh_name); + }else { + oh_name = &omap3_oh_name; + dev_name = &omap3_dev_name; + oh_count =ARRAY_SIZE (omap3_oh_name); + } + + pdata.board_data = board_data; + pdata.board_data->get_last_off_on_transaction_id =NULL ; + +for (i =0 ; i < oh_count; i++) { + oh =omap_hwmod_lookup ((*oh_name)[i]); +if (!oh) { +pr_err ("Could not look up %s\n" , (*oh_name)[i]); +return r; + } + od =omap_device_build ((*dev_name)[i],-1 , oh, &pdata, +sizeof (struct omap_display_platform_data ), + omap_dss_latency, +ARRAY_SIZE (omap_dss_latency),0 ); + +WARN ((IS_ERR (od)),"Could not build omap_device for %s\n" , + (*oh_name)[i]); + } omap_display_device.dev.platform_data = board_data; r =platform_device_register (&omap_display_device);
arch/arm/plat-omap/include/plat/display.h +6 -0
@@ -26,6 +26,7 @@#include <linux/platform_device.h> #include <asm/atomic.h> +#define DISPC_IRQ_FRAMEDONE (1 << 0)#define DISPC_IRQ_VSYNC (1 << 1)#define DISPC_IRQ_EVSYNC_EVEN (1 << 2)
@@ -224,6 +225,11 @@ struct omap_dss_board_info {/* Init with the board info */ extern int omap_display_init (struct omap_dss_board_info *board_data); +struct omap_display_platform_data { +struct omap_dss_board_info *board_data; +/* TODO: Additional members to be added when PM is considered */ +}; +struct omap_video_timings {/* Unit: pixels */ u16 x_res;
Signature · 1 line
1.6.3.3
PATCH v2 8/17 OMAP2,3: DSS: Create platform_driver for each DSS HW IP
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Platform driver of dsshw has to be registered before of dispc, rfbi, dsi1, venc and omapdisplay driver should be after all the hw IPs. Sequence it with arch_initcall and device_initcall_sync
--- drivers/video/omap2/dss/core.c | 2 +- drivers/video/omap2/dss/dispc.c | 28 ++++++++++++++++++++++++++++ drivers/video/omap2/dss/dsi.c | 29 ++++++++++++++++++++++++++++- drivers/video/omap2/dss/dss.c | 27 +++++++++++++++++++++++++++ drivers/video/omap2/dss/rfbi.c | 28 ++++++++++++++++++++++++++++ drivers/video/omap2/dss/venc.c | 28 ++++++++++++++++++++++++++++ 6 files changed, 140 insertions(+), 2 deletions(-)
drivers/video/omap2/dss/core.c +1 -1
@@ -989,7 +989,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 <[email protected]>" );
drivers/video/omap2/dss/dispc.c +28 -0
@@ -3167,3 +3167,31 @@ int dispc_setup_plane(enum omap_plane plane,return r; } + +/* 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 ; +} + +static struct platform_driver omap_dispchw_driver = { + .probe = omap_dispchw_probe, + .remove = omap_dispchw_remove, + .driver = { + .name ="omap_dispc" , + .owner =THIS_MODULE , + }, +}; + +static int __init omap_dispc_init (void ) +{ +return platform_driver_register (&omap_dispchw_driver); +} + +device_initcall (omap_dispc_init); +
drivers/video/omap2/dss/dsi.c +28 -1
@@ -292,7 +292,6 @@ static inline u32 dsi_read_reg(const struct dsi_reg idx)return __raw_readl (dsi.base + idx.idx); } -void dsi_save_context (void ) { }
@@ -3304,3 +3303,31 @@ void dsi_exit(void)DSSDBG ("omap_dsi_exit\n" ); } +/* 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 ; +} + +static struct platform_driver omap_dsi1hw_driver = { + .probe = omap_dsi1hw_probe, + .remove = omap_dsi1hw_remove, + .driver = { + .name ="omap_dsi1" , + .owner =THIS_MODULE , + }, +}; + +static int __init omap_dsi1_init (void ) +{ +return platform_driver_register (&omap_dsi1hw_driver); +} + +device_initcall (omap_dsi1_init); + +
drivers/video/omap2/dss/dss.c +27 -0
@@ -639,3 +639,30 @@ void dss_exit(void)iounmap (dss.base); } +/* 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, + .driver = { + .name ="omap_dss" , + .owner =THIS_MODULE , + }, +}; + +static int __init omap_dss_init1 (void ) +{ +return platform_driver_register (&omap_dsshw_driver); +} + +arch_initcall (omap_dss_init1); +
drivers/video/omap2/dss/rfbi.c +28 -0
@@ -1054,3 +1054,31 @@ int rfbi_init_display(struct omap_dss_device *dssdev) dssdev->caps =OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE ;return 0 ; } + +/* RFBI HW IP initialisation */ +static int omap_rfbihw_probe (struct platform_device *pdev) +{ +return 0 ; +} + +static int omap_rfbihw_remove (struct platform_device *pdev) +{ +return 0 ; +} + +static struct platform_driver omap_rfbihw_driver = { + .probe = omap_rfbihw_probe, + .remove = omap_rfbihw_remove, + .driver = { + .name ="omap_rfbi" , + .owner =THIS_MODULE , + }, +}; + +static int __init omap_rfbi_init (void ) +{ +return platform_driver_register (&omap_rfbihw_driver); +} + +device_initcall (omap_rfbi_init); +
drivers/video/omap2/dss/venc.c +28 -0
@@ -740,3 +740,31 @@ void venc_dump_regs(struct seq_file *s)#undef DUMPREG } + +/* 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_venchw_driver = { + .probe = omap_venchw_probe, + .remove = omap_venchw_remove, + .driver = { + .name ="omap_venc" , + .owner =THIS_MODULE , + }, +}; + +static int __init omap_venc_init (void ) +{ +return platform_driver_register (&omap_venchw_driver); +} + +device_initcall (omap_venc_init); +
Signature · 1 line
1.6.3.3
PATCH v2 9/17 OMAP2,3: DSS: Move clocks from core driver to dss driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
clks are moved to dss platform driver. clk_get/put APIs use dss device instead of core platform device. It leaves the core driver "omap_display" to take care of panel registration with the custom bus. dss driver would take care of the clocks needed by DISPC,RFBI,DSI,VENC.
TODO: The clock content would be adapted to omap_hwmod in a seperate series.
--- drivers/video/omap2/dss/core.c | 372 +-------------------------------------- drivers/video/omap2/dss/dss.c | 380 +++++++++++++++++++++++++++++++++++++++- drivers/video/omap2/dss/dss.h | 14 +- 3 files changed, 390 insertions(+), 376 deletions(-)
drivers/video/omap2/dss/core.c +2 -370
@@ -34,32 +34,18 @@#include <linux/regulator/consumer.h> #include <plat/display.h> -#include <plat/clock.h> #include "dss.h" #include "dss_features.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;struct regulator *vdda_dac_reg; } 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 );MODULE_PARM_DESC (def_disp_name,"default display name" );
@@ -69,297 +55,6 @@ 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 */ struct regulator *dss_get_vdds_dsi (void )
@@ -404,18 +99,7 @@ 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 -} -static int dss_debug_show (struct seq_file *s,void *unused) {void (*func)(struct seq_file *) = s->private;
@@ -508,14 +192,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 */
@@ -589,7 +266,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 ;
@@ -612,9 +289,6 @@ err_dpi: err_rfbi:dss_exit (); err_dss: -dss_clk_disable_all_no_ctx (); -dss_put_clocks (); -err_clocks:return r; }
@@ -623,7 +297,6 @@ static int omap_dss_remove(struct platform_device *pdev) {struct omap_dss_board_info *pdata = pdev->dev.platform_data;int i; -int c;dss_uninitialize_debugfs ();
@@ -638,47 +311,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);
drivers/video/omap2/dss/dss.c +379 -1
415 lines not on this page · raw message
drivers/video/omap2/dss/dss.h +9 -5
@@ -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,8 +214,17 @@ 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 );
Signature · 1 line
1.6.3.3
PATCH v2 10/17 OMAP2,3: DSS: Move dss_feature_init to dss
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move dss_feature_init call from core to dss as it involves HW related configuration.
--- drivers/video/omap2/dss/core.c | 2 -- drivers/video/omap2/dss/dss.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/video/omap2/dss/core.c +0 -2
@@ -187,8 +187,6 @@ static int omap_dss_probe(struct platform_device *pdev) core.pdev = pdev; -dss_features_init (); -dss_init_overlay_managers (pdev);dss_init_overlays (pdev);
drivers/video/omap2/dss/dss.c +3 -0
@@ -33,6 +33,7 @@#include <plat/display.h> #include <plat/clock.h> #include "dss.h" +#include "dss_features.h" #define DSS_BASE 0x48050000
@@ -966,6 +967,8 @@ static int omap_dsshw_probe(struct platform_device *pdev) dss.pdev = pdev; +dss_features_init (); + r =dss_get_clocks ();if (r) goto err_clocks;
Signature · 1 line
1.6.3.3
PATCH v2 11/17 OMAP2,3: DSS: DSS Move init,exit to driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move init exit methods to its driver probe remove. pdev member has to be maintained by its own drivers.
--- drivers/video/omap2/dss/core.c | 16 ---------------- drivers/video/omap2/dss/dss.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-)
drivers/video/omap2/dss/core.c +0 -16
@@ -192,18 +192,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" );
@@ -285,8 +273,6 @@ err_dispc: err_dpi:rfbi_exit (); err_rfbi: -dss_exit (); -err_dss:return r; }
@@ -307,8 +293,6 @@ static int omap_dss_remove(struct platform_device *pdev)sdi_exit (); } -dss_exit (); -dss_uninit_overlays (pdev);dss_uninit_overlay_managers (pdev);
drivers/video/omap2/dss/dss.c +16 -0
@@ -964,6 +964,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;
@@ -978,6 +979,19 @@ 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); +#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT +/* DISPC_CONTROL */ +if (omap_readl (0x48050440 ) &1 )/* LCD enabled? */ + skip_init =1 ; +#endif + + r =dss_init (skip_init); +if (r) { +DSSERR ("Failed to initialize DSS\n" ); + goto err_dss; + } + +err_dss:dss_clk_disable_all_no_ctx (); err_clocks:
@@ -988,6 +1002,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 ) {
Signature · 1 line
1.6.3.3
PATCH v2 12/17 OMAP2,3: DSS: RFBI Move init,exit to driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move init exit methods to its driver probe,remove. pdev member has to be maintained by its own drivers. Replace printk with dev_dbg for boot time optimize
--- drivers/video/omap2/dss/core.c | 9 ---- drivers/video/omap2/dss/rfbi.c | 80 ++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 53 deletions(-)
drivers/video/omap2/dss/core.c +0 -9
@@ -192,12 +192,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" );
@@ -271,8 +265,6 @@ err_venc: err_dispc:dpi_exit (); err_dpi: -rfbi_exit (); -err_rfbi:return r; }
@@ -287,7 +279,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 ();
drivers/video/omap2/dss/rfbi.c +36 -44
103 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v2 13/17 OMAP2,3: DSS: DISPC Move init,exit to driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move init exit methods to its driver probe,remove. pdev member has to be maintained by its own drivers. Replace printk with dev_dbg for boot time optimize
--- drivers/video/omap2/dss/core.c | 9 ----- drivers/video/omap2/dss/dispc.c | 75 +++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 50 deletions(-)
drivers/video/omap2/dss/core.c +0 -9
@@ -198,12 +198,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" );
@@ -261,8 +255,6 @@ err_dsi: err_sdi:venc_exit (); err_venc: -dispc_exit (); -err_dispc:dpi_exit (); err_dpi:
@@ -277,7 +269,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 ();
drivers/video/omap2/dss/dispc.c +34 -41
98 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v2 14/17 OMAP2,3: DSS: VENC Move init,exit to driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move init exit methods to its driver probe, remove. pdev member has to be maintained by its own drivers. regulator has to be privately handled in each driver. Replace printk to dev_dbg for boot time optimize.
--- arch/arm/mach-omap2/board-3430sdp.c | 2 +- drivers/video/omap2/dss/core.c | 29 ----------- drivers/video/omap2/dss/dss.h | 1 - drivers/video/omap2/dss/venc.c | 88 ++++++++++++++++++---------------- 4 files changed, 48 insertions(+), 72 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +1 -1
@@ -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" ,"omap_display" ); +REGULATOR_SUPPLY ("vdda_dac" ,"omap_venc" );static struct omap_board_config_kernel sdp3430_config[]__initdata = { };
drivers/video/omap2/dss/core.c +0 -29
@@ -43,7 +43,6 @@ static struct {struct regulator *vdds_dsi_reg;struct regulator *vdds_sdi_reg; -struct regulator *vdda_dac_reg; } core;static char *def_disp_name;
@@ -85,20 +84,6 @@ struct regulator *dss_get_vdds_sdi(void)return reg; } -struct regulator *dss_get_vdda_dac (void ) -{ -struct regulator *reg; - -if (core.vdda_dac_reg !=NULL ) -return core.vdda_dac_reg; - - reg =regulator_get (&core.pdev->dev,"vdda_dac" ); -if (!IS_ERR (reg)) - core.vdda_dac_reg = reg; - -return reg; -} -#if defined(CONFIG_DEBUG_FS ) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT )static int dss_debug_show (struct seq_file *s,void *unused) {
@@ -198,12 +183,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) {
@@ -253,8 +232,6 @@ err_dsi:if (cpu_is_omap34xx ())sdi_exit (); err_sdi: -venc_exit (); -err_venc:dpi_exit (); err_dpi:
@@ -268,7 +245,6 @@ static int omap_dss_remove(struct platform_device *pdev)dss_uninitialize_debugfs (); -venc_exit ();dpi_exit ();if (cpu_is_omap34xx ()) {dsi_exit ();
@@ -561,11 +537,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 ();
drivers/video/omap2/dss/dss.h +0 -1
@@ -172,7 +172,6 @@ struct platform_device;struct bus_type *dss_get_bus (void );struct regulator *dss_get_vdds_dsi (void );struct regulator *dss_get_vdds_sdi (void ); -struct regulator *dss_get_vdda_dac (void );/* display */ int dss_suspend_all_devices (void );
drivers/video/omap2/dss/venc.c +47 -41
116 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v2 15/17 OMAP2,3: DSS: DSI Move init, exit to driver
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
Move init exit methods to its driver probe, remove. pdev member has to be maintained by its own drivers. regulator has to be privately handled in each driver.
--- arch/arm/mach-omap2/board-3430sdp.c | 1 + drivers/video/omap2/dss/core.c | 8 -------- drivers/video/omap2/dss/dsi.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +1 -0
@@ -527,6 +527,7 @@ static struct regulator_init_data sdp3430_vdac = {/* VPLL2 for digital video outputs */ static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {REGULATOR_SUPPLY ("vdds_dsi" ,"omap_display" ), +REGULATOR_SUPPLY ("vdds_dsi" ,"omap_dsi1" ), };static struct regulator_init_data sdp3430_vpll2 = {
drivers/video/omap2/dss/core.c +0 -8
@@ -190,11 +190,6 @@ static int omap_dss_probe(struct platform_device *pdev) goto err_sdi; } - r =dsi_init (pdev); -if (r) { -DSSERR ("Failed to initialize DSI\n" ); - goto err_dsi; - } } r =dss_initialize_debugfs ();
@@ -227,9 +222,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 ();
drivers/video/omap2/dss/dsi.c +26 -2
@@ -222,6 +222,7 @@ struct dsi_irq_stats { static struct { + struct platform_device *pdev; void __iomem *base; struct dsi_clock_info current_cinfo;
@@ -3271,7 +3272,7 @@ int dsi_init(struct platform_device *pdev) goto err1; } - dsi.vdds_dsi_reg =dss_get_vdds_dsi (); + dsi.vdds_dsi_reg =dsi_get_vdds_dsi ();if (IS_ERR (dsi.vdds_dsi_reg)) {DSSERR ("can't get VDDS_DSI regulator\n" ); r =PTR_ERR (dsi.vdds_dsi_reg);
@@ -3306,11 +3307,20 @@ void dsi_exit(void)/* DSI1 HW IP initialisation */ static int omap_dsi1hw_probe (struct platform_device *pdev) { -return 0 ; +int r; + dsi.pdev = pdev; + r =dsi_init (pdev); +if (r) { +DSSERR ("Failed to initialize DSI\n" ); + goto err_dsi; + } +err_dsi: +return r; }static int omap_dsi1hw_remove (struct platform_device *pdev) { +dsi_exit ();return 0 ; }
@@ -3330,4 +3340,18 @@ static int __init omap_dsi1_init(void)device_initcall (omap_dsi1_init); +static struct regulator *dsi_get_vdds_dsi (void ) +{ +struct regulator *reg; + +if (dsi.vdds_dsi_reg !=NULL ) +return dsi.vdds_dsi_reg; + + reg =regulator_get (&dsi.pdev->dev,"vdds_dsi" ); +if (!IS_ERR (reg)) + dsi.vdds_dsi_reg = reg; + +return reg; +} +
Signature · 1 line
1.6.3.3
PATCH v2 16/17 OMAP2,3: DSS: Use platform device to get baseaddr
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
DSS, DISPC, DSI, RFBI, VENC baseaddr got from platform_device. Hardcoding of base addr could be removed.
--- drivers/video/omap2/dss/dispc.c | 11 ++++++++--- drivers/video/omap2/dss/dsi.c | 12 +++++++++--- drivers/video/omap2/dss/dss.c | 11 ++++++++--- drivers/video/omap2/dss/rfbi.c | 10 +++++++--- drivers/video/omap2/dss/venc.c | 11 ++++++++--- 5 files changed, 40 insertions(+), 15 deletions(-)
drivers/video/omap2/dss/dispc.c +8 -3
@@ -42,8 +42,6 @@#include "dss_features.h" /* DISPC */ -#define DISPC_BASE 0x48050400 -#define DISPC_SZ_REGS SZ_1Kstruct dispc_reg {u16 idx; };
@@ -3132,6 +3130,8 @@ int dispc_setup_plane(enum omap_plane plane,static int omap_dispchw_probe (struct platform_device *pdev) {u32 rev; +struct resource *dispc_mem; + dispc.pdev = pdev;spin_lock_init (&dispc.irq_lock);
@@ -3143,7 +3143,12 @@ static int omap_dispchw_probe(struct platform_device *pdev)INIT_WORK (&dispc.error_work, dispc_error_worker); - dispc.base =ioremap (DISPC_BASE ,DISPC_SZ_REGS ); + dispc_mem =platform_get_resource (dispc.pdev,IORESOURCE_MEM ,0 ); +if (!dispc_mem) { +DSSERR ("can't get IORESOURCE_MEM DISPC\n" ); +return -EINVAL ; + } + dispc.base =ioremap (dispc_mem->start,resource_size (dispc_mem));if (!dispc.base) {DSSERR ("can't ioremap DISPC\n" );return -ENOMEM ;
drivers/video/omap2/dss/dsi.c +9 -3
@@ -42,8 +42,6 @@/*#define VERBOSE_IRQ*/ #define DSI_CATCH_MISSING_TE -#define DSI_BASE 0x4804FC00 -struct dsi_reg {u16 idx; };#define DSI_REG (idx) ((const struct dsi_reg) { idx })
@@ -3239,6 +3237,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 ;
@@ -3265,7 +3264,13 @@ int dsi_init(struct platform_device *pdev) dsi.te_timer.function = dsi_te_timeout; dsi.te_timer.data =0 ;#endif - dsi.base =ioremap (DSI_BASE ,DSI_SZ_REGS ); + dsi_mem =platform_get_resource (dsi.pdev,IORESOURCE_MEM ,0 ); +if (!dsi_mem) { +DSSERR ("can't get IORESOURCE_MEM DSI\n" ); + r = -EINVAL ; + goto err0; + } + dsi.base =ioremap (dsi_mem->start,resource_size (dsi_mem));if (!dsi.base) {DSSERR ("can't ioremap DSI\n" ); r = -ENOMEM ;
@@ -3292,6 +3297,7 @@ err2:iounmap (dsi.base); err1:destroy_workqueue (dsi.workqueue); +err0:return r; }
drivers/video/omap2/dss/dss.c +8 -3
@@ -35,8 +35,6 @@#include "dss.h" #include "dss_features.h" -#define DSS_BASE 0x48050000 -#define DSS_SZ_REGS SZ_512struct dss_reg {
@@ -569,8 +567,15 @@ int dss_init(bool skip_init) {int r;u32 rev; +struct resource *dss_mem; - dss.base =ioremap (DSS_BASE ,DSS_SZ_REGS ); + dss_mem =platform_get_resource (dss.pdev,IORESOURCE_MEM ,0 ); +if (!dss_mem) { +DSSERR ("can't get IORESOURCE_MEM DSS\n" ); + r = -EINVAL ; + goto fail0; + } + dss.base =ioremap (dss_mem->start,resource_size (dss_mem));if (!dss.base) {DSSERR ("can't ioremap DSS\n" ); r = -ENOMEM ;
drivers/video/omap2/dss/rfbi.c +7 -3
@@ -36,8 +36,6 @@#include <plat/display.h> #include "dss.h" -#define RFBI_BASE 0x48050800 -struct rfbi_reg {u16 idx; };#define RFBI_REG (idx) ((const struct rfbi_reg) { idx })
@@ -1017,6 +1015,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev) {u32 rev;u32 l; +struct resource *rfbi_mem; rfbi.pdev = pdev;
@@ -1026,7 +1025,12 @@ static int omap_rfbihw_probe(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 (rfbi.pdev,IORESOURCE_MEM ,0 ); +if (!rfbi_mem) { +DSSERR ("can't get IORESOURCE_MEM RFBI\n" ); +return -EINVAL ; + } + rfbi.base =ioremap (rfbi_mem->start,resource_size (rfbi_mem));if (!rfbi.base) {DSSERR ("can't ioremap RFBI\n" );return -ENOMEM ;
drivers/video/omap2/dss/venc.c +8 -3
@@ -39,8 +39,6 @@#include "dss.h" -#define VENC_BASE 0x48050C00 -/* Venc registers */ #define VENC_REV_ID 0x00#define VENC_STATUS 0x04
@@ -717,13 +715,20 @@ void venc_dump_regs(struct seq_file *s)static int omap_venchw_probe (struct platform_device *pdev) {u8 rev_id; +struct resource *venc_mem; + venc.pdev = pdev;mutex_init (&venc.venc_lock); venc.wss_data =0 ; - venc.base =ioremap (VENC_BASE ,SZ_1K ); + venc_mem =platform_get_resource (venc.pdev,IORESOURCE_MEM ,0 ); +if (!venc_mem) { +DSSERR ("can't get IORESOURCE_MEM VENC\n" ); +return -EINVAL ; + } + venc.base =ioremap (venc_mem->start,resource_size (venc_mem));if (!venc.base) {DSSERR ("can't ioremap VENC\n" );return -ENOMEM ;
Signature · 1 line
1.6.3.3
PATCH v2 17/17 OMAP2,3: DSS: Get DSS IRQ from platform device
In reply to Guruswamy SenthilvadivuFrom: Senthilvadivu Guruswamy <[email protected]>
DSS IRQ got from platform device.
--- drivers/video/omap2/dss/dss.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/video/omap2/dss/dss.c +8 -5
@@ -565,7 +565,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;
@@ -611,15 +611,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 != -ENXIO ) { + r =request_irq (dss_irq,cpu_is_omap24xx () ? dss_irq_handler_omap2 : dss_irq_handler_omap3,0 ,"OMAP DSS" ,NULL ); -if (r <0 ) { -DSSERR ("omap2 dss: request_irq failed\n" ); - goto fail1; +if (r <0 ) { +DSSERR ("omap2 dss: request_irq failed\n" ); + goto fail1; + } }if (cpu_is_omap34xx ()) {
Signature · 1 line
1.6.3.3