* [PATCH 00/13] OMAP DSS2 patches @ 2010-02-08 15:55 Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:55 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Here are some smallish patches for DSS2 for review. Some fixes, couple of new ioctls, and DSI changes. They can also be found from http://gitorious.org/linux-omap-dss2/linux master branch Aaro Koskinen (1): OMAP: DSS: Taal: fix error returns in taal_probe() Tomi Valkeinen (12): OMAP: DSS2: enable VDDS_DSI when using DPI OMAP: 3430SDP: remove vdvi regulator OMAP: DSS2: OMAPFB: implement OMAPFB_RESERVE_BUFFER OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO OMAP: DSS2: fix irq-stats compilation OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype OMAP: DSS2: improve DSS clk src selection OMAP: DSS2: DSI: add dsi_bus_is_locked() OMAP: DSS2: DSI: add helpers for DCS read/write OMAP: DSS2: DSI: export dsi_vc_enable_hs() OMAP: DSS2: DSI: configure all DSI VCs OMAP: DSS2: DSI: remove dsi_vc_print_status() arch/arm/mach-omap2/board-3430sdp.c | 4 - arch/arm/plat-omap/include/plat/display.h | 5 + .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 35 ------ drivers/video/omap2/displays/panel-taal.c | 4 +- drivers/video/omap2/dss/core.c | 70 ++++++++++- drivers/video/omap2/dss/dispc.c | 2 - drivers/video/omap2/dss/dpi.c | 59 +++++++-- drivers/video/omap2/dss/dsi.c | 129 +++++++++++--------- drivers/video/omap2/dss/dss.c | 42 +++++-- drivers/video/omap2/dss/dss.h | 19 +++- drivers/video/omap2/dss/venc.c | 4 +- drivers/video/omap2/omapfb/omapfb-ioctl.c | 71 +++++++++++ drivers/video/omap2/omapfb/omapfb-sysfs.c | 13 ++- drivers/video/omap2/omapfb/omapfb.h | 3 + include/linux/omapfb.h | 19 +++ 15 files changed, 347 insertions(+), 132 deletions(-) ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-08 15:55 [PATCH 00/13] OMAP DSS2 patches Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 02/13] OMAP: 3430SDP: remove vdvi regulator Tomi Valkeinen 2010-02-15 10:34 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Hiremath, Vaibhav 0 siblings, 2 replies; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen It looks like on OMAP3 some DSS pins need VDDS_DSI to function properly. This has not been confirmed from TI, but looking at figure 15-1 "Display subsystem highlight" from the TRM, some data pins come near the DSI and SDI blocks. This is not very hard evidence, but the fact remains that with the power on, pixels are ok, and with the power off, pixels are not ok. It may also be that VDDS_SDI is needed to power some pins, but as normally both VDDS_SDI and VDDS_DSI come from the same power source, this hasn't been shown. It seems that a single driver can only get a regulator once. This patch solves it by getting all the required regulators in one place, and from which the submodules then get the regulators they need. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/core.c | 66 +++++++++++++++++++++++++++++++++++++++- drivers/video/omap2/dss/dpi.c | 55 ++++++++++++++++++++++++++++----- drivers/video/omap2/dss/dsi.c | 4 +-- drivers/video/omap2/dss/dss.h | 5 ++- drivers/video/omap2/dss/venc.c | 4 +-- 5 files changed, 117 insertions(+), 17 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 82918ee..791e1cb 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -31,6 +31,7 @@ #include <linux/debugfs.h> #include <linux/io.h> #include <linux/device.h> +#include <linux/regulator/consumer.h> #include <plat/display.h> #include <plat/clock.h> @@ -47,6 +48,10 @@ static struct { 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); @@ -352,6 +357,50 @@ static void dss_clk_disable_all(void) dss_clk_disable(clks); } +/* REGULATORS */ + +struct regulator *dss_get_vdds_dsi(void) +{ + struct regulator *reg; + + if (core.vdds_dsi_reg != NULL) + return core.vdds_dsi_reg; + + reg = regulator_get(&core.pdev->dev, "vdds_dsi"); + if (!IS_ERR(reg)) + core.vdds_dsi_reg = reg; + + return reg; +} + +struct regulator *dss_get_vdds_sdi(void) +{ + struct regulator *reg; + + if (core.vdds_sdi_reg != NULL) + return core.vdds_sdi_reg; + + reg = regulator_get(&core.pdev->dev, "vdds_sdi"); + if (!IS_ERR(reg)) + core.vdds_sdi_reg = reg; + + 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; +} + /* DEBUGFS */ #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) static void dss_debug_dump_clocks(struct seq_file *s) @@ -473,7 +522,7 @@ static int omap_dss_probe(struct platform_device *pdev) } #endif - r = dpi_init(); + r = dpi_init(pdev); if (r) { DSSERR("Failed to initialize dpi\n"); goto fail0; @@ -901,6 +950,21 @@ static int __init omap_dss_init(void) static void __exit omap_dss_exit(void) { + if (core.vdds_dsi_reg != NULL) { + regulator_put(core.vdds_dsi_reg); + core.vdds_dsi_reg = NULL; + } + + if (core.vdds_sdi_reg != NULL) { + regulator_put(core.vdds_sdi_reg); + core.vdds_sdi_reg = NULL; + } + + if (core.vdda_dac_reg != NULL) { + regulator_put(core.vdda_dac_reg); + core.vdda_dac_reg = NULL; + } + platform_driver_unregister(&omap_dss_driver); omap_dss_bus_unregister(); diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 2d71031..69ce31a 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -25,7 +25,10 @@ #include <linux/kernel.h> #include <linux/clk.h> #include <linux/delay.h> +#include <linux/err.h> #include <linux/errno.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <plat/display.h> #include <plat/cpu.h> @@ -34,6 +37,7 @@ static struct { int update_enabled; + struct regulator *vdds_dsi_reg; } dpi; #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL @@ -166,21 +170,27 @@ static int dpi_display_enable(struct omap_dss_device *dssdev) goto err1; } + if (cpu_is_omap34xx()) { + r = regulator_enable(dpi.vdds_dsi_reg); + if (r) + goto err2; + } + dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); r = dpi_basic_init(dssdev); if (r) - goto err2; + goto err3; #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL dss_clk_enable(DSS_CLK_FCK2); r = dsi_pll_init(dssdev, 0, 1); if (r) - goto err3; + goto err4; #endif r = dpi_set_mode(dssdev); if (r) - goto err4; + goto err5; mdelay(2); @@ -188,22 +198,25 @@ static int dpi_display_enable(struct omap_dss_device *dssdev) r = dssdev->driver->enable(dssdev); if (r) - goto err5; + goto err6; dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; return 0; -err5: +err6: dispc_enable_lcd_out(0); -err4: +err5: #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL dsi_pll_uninit(); -err3: +err4: dss_clk_disable(DSS_CLK_FCK2); #endif -err2: +err3: dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); +err2: + if (cpu_is_omap34xx()) + regulator_disable(dpi.vdds_dsi_reg); err1: omap_dss_stop_device(dssdev); err0: @@ -232,6 +245,9 @@ static void dpi_display_disable(struct omap_dss_device *dssdev) dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); + if (cpu_is_omap34xx()) + regulator_disable(dpi.vdds_dsi_reg); + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; omap_dss_stop_device(dssdev); @@ -251,6 +267,9 @@ static int dpi_display_suspend(struct omap_dss_device *dssdev) dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); + if (cpu_is_omap34xx()) + regulator_disable(dpi.vdds_dsi_reg); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; return 0; @@ -258,11 +277,19 @@ static int dpi_display_suspend(struct omap_dss_device *dssdev) static int dpi_display_resume(struct omap_dss_device *dssdev) { + int r; + if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) return -EINVAL; DSSDBG("dpi_display_resume\n"); + if (cpu_is_omap34xx()) { + r = regulator_enable(dpi.vdds_dsi_reg); + if (r) + goto err0; + } + dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); dispc_enable_lcd_out(1); @@ -273,6 +300,8 @@ static int dpi_display_resume(struct omap_dss_device *dssdev) dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; return 0; +err0: + return r; } static void dpi_set_timings(struct omap_dss_device *dssdev, @@ -388,8 +417,16 @@ int dpi_init_display(struct omap_dss_device *dssdev) return 0; } -int dpi_init(void) +int dpi_init(struct platform_device *pdev) { + if (cpu_is_omap34xx()) { + dpi.vdds_dsi_reg = dss_get_vdds_dsi(); + if (IS_ERR(dpi.vdds_dsi_reg)) { + DSSERR("can't get VDDS_DSI regulator\n"); + return PTR_ERR(dpi.vdds_dsi_reg); + } + } + return 0; } diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 6122178..036f422 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -3799,7 +3799,7 @@ int dsi_init(struct platform_device *pdev) goto err1; } - dsi.vdds_dsi_reg = regulator_get(&pdev->dev, "vdds_dsi"); + dsi.vdds_dsi_reg = dss_get_vdds_dsi(); if (IS_ERR(dsi.vdds_dsi_reg)) { iounmap(dsi.base); DSSERR("can't get VDDS_DSI regulator\n"); @@ -3830,8 +3830,6 @@ void dsi_exit(void) { kthread_stop(dsi.thread); - regulator_put(dsi.vdds_dsi_reg); - iounmap(dsi.base); DSSDBG("omap_dsi_exit\n"); diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 2bcb124..41145af 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -169,6 +169,9 @@ 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); +struct regulator *dss_get_vdda_dac(void); /* display */ int dss_suspend_all_devices(void); @@ -261,7 +264,7 @@ void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, u32 *fifo_low, u32 *fifo_high); /* DPI */ -int dpi_init(void); +int dpi_init(struct platform_device *pdev); void dpi_exit(void); int dpi_init_display(struct omap_dss_device *dssdev); diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 749a5a0..44b4998 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -482,7 +482,7 @@ int venc_init(struct platform_device *pdev) return -ENOMEM; } - venc.vdda_dac_reg = regulator_get(&pdev->dev, "vdda_dac"); + venc.vdda_dac_reg = dss_get_vdda_dac(); if (IS_ERR(venc.vdda_dac_reg)) { iounmap(venc.base); DSSERR("can't get VDDA_DAC regulator\n"); @@ -503,8 +503,6 @@ void venc_exit(void) { omap_dss_unregister_driver(&venc_driver); - regulator_put(venc.vdda_dac_reg); - iounmap(venc.base); } -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 02/13] OMAP: 3430SDP: remove vdvi regulator 2010-02-08 15:56 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 03/13] OMAP: DSS: Taal: fix error returns in taal_probe() Tomi Valkeinen 2010-02-15 10:34 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Hiremath, Vaibhav 1 sibling, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen The regulator is now enabled by DSS driver, and thus the panel driver doesn't need to touch it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- arch/arm/mach-omap2/board-3430sdp.c | 4 -- .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 35 -------------------- 2 files changed, 0 insertions(+), 39 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index c90b0d0..964c390 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -520,10 +520,6 @@ static struct regulator_init_data sdp3430_vdac = { /* VPLL2 for digital video outputs */ static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = { { - .supply = "vdvi", - .dev = &sdp3430_lcd_device.dev, - }, - { .supply = "vdds_dsi", .dev = &sdp3430_dss_device.dev, } diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c index bbe880b..e207d66 100644 --- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c @@ -25,14 +25,6 @@ #include <plat/display.h> -struct sharp_data { - /* XXX This regulator should actually be in SDP board file, not here, - * as it doesn't actually power the LCD, but something else that - * affects the output to LCD (I think. Somebody clarify). It doesn't do - * harm here, as SDP is the only board using this currently */ - struct regulator *vdvi_reg; -}; - static struct omap_video_timings sharp_ls_timings = { .x_res = 480, .y_res = 640, @@ -50,48 +42,25 @@ static struct omap_video_timings sharp_ls_timings = { static int sharp_ls_panel_probe(struct omap_dss_device *dssdev) { - struct sharp_data *sd; - dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS; dssdev->panel.acb = 0x28; dssdev->panel.timings = sharp_ls_timings; - sd = kzalloc(sizeof(*sd), GFP_KERNEL); - if (!sd) - return -ENOMEM; - - dev_set_drvdata(&dssdev->dev, sd); - - sd->vdvi_reg = regulator_get(&dssdev->dev, "vdvi"); - if (IS_ERR(sd->vdvi_reg)) { - kfree(sd); - pr_err("failed to get VDVI regulator\n"); - return PTR_ERR(sd->vdvi_reg); - } - return 0; } static void sharp_ls_panel_remove(struct omap_dss_device *dssdev) { - struct sharp_data *sd = dev_get_drvdata(&dssdev->dev); - - regulator_put(sd->vdvi_reg); - - kfree(sd); } static int sharp_ls_panel_enable(struct omap_dss_device *dssdev) { - struct sharp_data *sd = dev_get_drvdata(&dssdev->dev); int r = 0; /* wait couple of vsyncs until enabling the LCD */ msleep(50); - regulator_enable(sd->vdvi_reg); - if (dssdev->platform_enable) r = dssdev->platform_enable(dssdev); @@ -100,13 +69,9 @@ static int sharp_ls_panel_enable(struct omap_dss_device *dssdev) static void sharp_ls_panel_disable(struct omap_dss_device *dssdev) { - struct sharp_data *sd = dev_get_drvdata(&dssdev->dev); - if (dssdev->platform_disable) dssdev->platform_disable(dssdev); - regulator_disable(sd->vdvi_reg); - /* wait at least 5 vsyncs after disabling the LCD */ msleep(100); -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 03/13] OMAP: DSS: Taal: fix error returns in taal_probe() 2010-02-08 15:56 ` [PATCH 02/13] OMAP: 3430SDP: remove vdvi regulator Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 04/13] OMAP: DSS2: OMAPFB: implement OMAPFB_RESERVE_BUFFER Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Aaro Koskinen, Tomi Valkeinen From: Aaro Koskinen <aaro.koskinen@nokia.com> The workqueue creation error branch attempted to destroy a NULL wq, and, in turn, a failed registration does not destroy the newly created workqueue. The problem was reported by a static analysis tool. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/displays/panel-taal.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 1f01dfc..0aaaa8a 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -510,7 +510,7 @@ static int taal_probe(struct omap_dss_device *dssdev) if (td->esd_wq = NULL) { dev_err(&dssdev->dev, "can't create ESD workqueue\n"); r = -ENOMEM; - goto err2; + goto err1; } INIT_DELAYED_WORK_DEFERRABLE(&td->esd_work, taal_esd_work); @@ -528,7 +528,7 @@ static int taal_probe(struct omap_dss_device *dssdev) &taal_bl_ops); if (IS_ERR(bldev)) { r = PTR_ERR(bldev); - goto err1; + goto err2; } td->bldev = bldev; -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 04/13] OMAP: DSS2: OMAPFB: implement OMAPFB_RESERVE_BUFFER 2010-02-08 15:56 ` [PATCH 03/13] OMAP: DSS: Taal: fix error returns in taal_probe() Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 05/13] OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Currently applications can reserve fb memory with OMAPFB_SETUP_MEM ioctl, which takes the size in bytes as an argument. This falls apart when using VRFB, as the memory need for VRFB is not trivial This patch implements OMAPFB_RESERVE_BUFFER ioctl, which reserves memory just like SETUP_MEM, but takes width, height and bytes per pixel as arguments. This will let omapfb driver allocate the memory more intelligently. The "size" entry in sysfs now also supports writing the size in "width,height,bytespp" format. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/omapfb/omapfb-ioctl.c | 51 +++++++++++++++++++++++++++++ drivers/video/omap2/omapfb/omapfb-sysfs.c | 13 +++++++- include/linux/omapfb.h | 10 ++++++ 3 files changed, 73 insertions(+), 1 deletions(-) diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 4c4bafd..5562a76 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -155,6 +155,47 @@ static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) return 0; } +static int omapfb_reserve_buffer(struct fb_info *fbi, + struct omapfb_res_buf_info *bi) +{ + struct omapfb_info *ofbi = FB2OFB(fbi); + struct omapfb2_device *fbdev = ofbi->fbdev; + struct omapfb2_mem_region *rg; + int r, i; + size_t size; + unsigned w = bi->width; + unsigned h = bi->height; + + if (bi->type > OMAPFB_MEMTYPE_MAX) + return -EINVAL; + + if (ofbi->rotation_type = OMAP_DSS_ROT_VRFB) { + size = max(omap_vrfb_min_phys_size(w, h, bi->bytespp), + omap_vrfb_min_phys_size(h, w, bi->bytespp)); + } else { + size = w * h * bi->bytespp; + } + + size = PAGE_ALIGN(size); + + rg = &ofbi->region; + + for (i = 0; i < ofbi->num_overlays; i++) { + if (ofbi->overlays[i]->info.enabled) + return -EBUSY; + } + + if (rg->size != size || rg->type != bi->type) { + r = omapfb_realloc_fbmem(fbi, size, bi->type); + if (r) { + dev_err(fbdev->dev, "realloc fbmem failed\n"); + return r; + } + } + + return 0; +} + static int omapfb_update_window_nolock(struct fb_info *fbi, u32 x, u32 y, u32 w, u32 h) { @@ -476,6 +517,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) struct omapfb_plane_info plane_info; struct omapfb_caps caps; struct omapfb_mem_info mem_info; + struct omapfb_res_buf_info res_buf_info; struct omapfb_color_key color_key; struct omapfb_ovl_colormode ovl_colormode; enum omapfb_update_mode update_mode; @@ -572,6 +614,15 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) r = -EFAULT; break; + case OMAPFB_RESERVE_BUFFER: + DBG("ioctl RESERVE_BUFFER\n"); + if (copy_from_user(&p.res_buf_info, (void __user *)arg, + sizeof(p.res_buf_info))) + r = -EFAULT; + else + r = omapfb_reserve_buffer(fbi, &p.res_buf_info); + break; + case OMAPFB_GET_CAPS: DBG("ioctl GET_CAPS\n"); if (!display) { diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c index 62bb88f..9cd7957 100644 --- a/drivers/video/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c @@ -413,8 +413,19 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, unsigned long size; int r; int i; + unsigned w, h, bytespp; + + if (sscanf(buf, "%u,%u,%u", &w, &h, &bytespp) = 3) { + if (ofbi->rotation_type = OMAP_DSS_ROT_VRFB) + size = max(omap_vrfb_min_phys_size(w, h, bytespp), + omap_vrfb_min_phys_size(h, w, bytespp)); + else + size = w * h * bytespp; + } else { + size = simple_strtoul(buf, NULL, 0); + } - size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0)); + size = PAGE_ALIGN(size); lock_fb_info(fbi); diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index f46c40a..ef4c2cf 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -57,6 +57,7 @@ #define OMAPFB_WAITFORGO OMAP_IO(60) #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) +#define OMAPFB_RESERVE_BUFFER OMAP_IOW(63, struct omapfb_res_buf_info) #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 @@ -147,6 +148,15 @@ struct omapfb_mem_info { __u8 reserved[3]; }; +struct omapfb_res_buf_info { + __u16 width; + __u16 height; + __u8 bytespp; + __u8 type; + __u8 reserved[2]; + __u32 reserved2[6]; +}; + struct omapfb_caps { __u32 ctrl; __u32 plane_color; -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/13] OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO 2010-02-08 15:56 ` [PATCH 04/13] OMAP: DSS2: OMAPFB: implement OMAPFB_RESERVE_BUFFER Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 06/13] OMAP: DSS2: fix irq-stats compilation Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Previously the only place to get the size of the display was from the DSS's sysfs interface, making, for example, configuring overlays and doing updates on manual displays more difficult. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/omapfb/omapfb-ioctl.c | 20 ++++++++++++++++++++ include/linux/omapfb.h | 9 +++++++++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 5562a76..56e3ec2 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -525,6 +525,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) struct omapfb_memory_read memory_read; struct omapfb_vram_info vram_info; struct omapfb_tearsync_info tearsync_info; + struct omapfb_display_info display_info; } p; int r = 0; @@ -792,6 +793,25 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) break; } + case OMAPFB_GET_DISPLAY_INFO: { + DBG("ioctl GET_DISPLAY_INFO\n"); + + if (display = NULL) { + r = -ENODEV; + break; + } + + p.display_info.xres = display->panel.timings.x_res; + p.display_info.yres = display->panel.timings.y_res; + p.display_info.width = 0; + p.display_info.height = 0; + + if (copy_to_user((void __user *)arg, &p.display_info, + sizeof(p.display_info))) + r = -EFAULT; + break; + } + default: dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd); r = -EINVAL; diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index ef4c2cf..0381436 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -58,6 +58,7 @@ #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) #define OMAPFB_RESERVE_BUFFER OMAP_IOW(63, struct omapfb_res_buf_info) +#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(64, struct omapfb_display_info) #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 @@ -216,6 +217,14 @@ struct omapfb_tearsync_info { __u16 reserved2; }; +struct omapfb_display_info { + __u16 xres; + __u16 yres; + __u32 width; /* phys width of the display in micrometers */ + __u32 height; /* phys height of the display in micrometers */ + __u32 reserved[5]; +}; + #ifdef __KERNEL__ #include <plat/board.h> -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/13] OMAP: DSS2: fix irq-stats compilation 2010-02-08 15:56 ` [PATCH 05/13] OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 07/13] OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Fix compilation of the CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS feature. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/core.c | 4 +++- drivers/video/omap2/dss/dispc.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 791e1cb..5939da9 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -446,10 +446,12 @@ static int dss_initialize_debugfs(void) debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, &dss_debug_dump_clocks, &dss_debug_fops); +#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS debugfs_create_file("dispc_irq", S_IRUGO, dss_debugfs_dir, &dispc_dump_irqs, &dss_debug_fops); +#endif -#ifdef CONFIG_OMAP2_DSS_DSI +#if defined(CONFIG_OMAP2_DSS_DSI) && defined(CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS) debugfs_create_file("dsi_irq", S_IRUGO, dss_debugfs_dir, &dsi_dump_irqs, &dss_debug_fops); #endif diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index de8bfba..7781c65 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -2301,8 +2301,6 @@ void dispc_dump_irqs(struct seq_file *s) PIS(WAKEUP); #undef PIS } -#else -void dispc_dump_irqs(struct seq_file *s) { } #endif void dispc_dump_regs(struct seq_file *s) -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/13] OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype 2010-02-08 15:56 ` [PATCH 06/13] OMAP: DSS2: fix irq-stats compilation Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 08/13] OMAP: DSS2: improve DSS clk src selection Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/omapfb/omapfb.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h index f7c9c73..4ae0b64 100644 --- a/drivers/video/omap2/omapfb/omapfb.h +++ b/drivers/video/omap2/omapfb/omapfb.h @@ -105,6 +105,9 @@ void omapfb_remove_sysfs(struct omapfb2_device *fbdev); int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg); +int omapfb_update_window(struct fb_info *fbi, + u32 x, u32 y, u32 w, u32 h); + int dss_mode_to_fb_mode(enum omap_color_mode dssmode, struct fb_var_screeninfo *var); -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 08/13] OMAP: DSS2: improve DSS clk src selection 2010-02-08 15:56 ` [PATCH 07/13] OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 09/13] OMAP: DSS2: DSI: add dsi_bus_is_locked() Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen dss_select_clk_source() was rather confusing. Selecting the source with enums is much clearer. The clk source selection is also stored into memory, so that we know what is the selected source, even when clocks are off. This is important during setup, as we need to what clocks to turn on before the clocks are turned on. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/dpi.c | 4 +- drivers/video/omap2/dss/dsi.c | 9 +++++-- drivers/video/omap2/dss/dss.c | 42 +++++++++++++++++++++++++++++++--------- drivers/video/omap2/dss/dss.h | 14 ++++++++++-- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 69ce31a..c5091ed 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -57,7 +57,7 @@ static int dpi_set_dsi_clk(bool is_tft, unsigned long pck_req, if (r) return r; - dss_select_clk_source(0, 1); + dss_select_dispc_clk_source(DSS_SRC_DSI1_PLL_FCLK); r = dispc_set_clock_div(&dispc_cinfo); if (r) @@ -238,7 +238,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev) dispc_enable_lcd_out(0); #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL - dss_select_clk_source(0, 0); + dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK); dsi_pll_uninit(); dss_clk_disable(DSS_CLK_FCK2); #endif diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 036f422..4fdb628 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -3203,7 +3203,8 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) if (r) goto err1; - dss_select_clk_source(true, true); + dss_select_dispc_clk_source(DSS_SRC_DSI1_PLL_FCLK); + dss_select_dsi_clk_source(DSS_SRC_DSI2_PLL_FCLK); DSSDBG("PLL OK\n"); @@ -3247,7 +3248,8 @@ err4: err3: dsi_complexio_uninit(); err2: - dss_select_clk_source(false, false); + dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK); + dss_select_dsi_clk_source(DSS_SRC_DSS1_ALWON_FCLK); err1: dsi_pll_uninit(); err0: @@ -3259,7 +3261,8 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev) if (dssdev->driver->disable) dssdev->driver->disable(dssdev); - dss_select_clk_source(false, false); + dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK); + dss_select_dsi_clk_source(DSS_SRC_DSS1_ALWON_FCLK); dsi_complexio_uninit(); dsi_pll_uninit(); } diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 0a26b7d..8254a42 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -68,6 +68,9 @@ static struct { struct dss_clock_info cache_dss_cinfo; struct dispc_clock_info cache_dispc_cinfo; + enum dss_clk_source dsi_clk_source; + enum dss_clk_source dispc_clk_source; + u32 ctx[DSS_SZ_REGS / sizeof(u32)]; } dss; @@ -247,23 +250,42 @@ void dss_dump_regs(struct seq_file *s) #undef DUMPREG } -void dss_select_clk_source(bool dsi, bool dispc) +void dss_select_dispc_clk_source(enum dss_clk_source clk_src) +{ + int b; + + BUG_ON(clk_src != DSS_SRC_DSI1_PLL_FCLK && + clk_src != DSS_SRC_DSS1_ALWON_FCLK); + + b = clk_src = DSS_SRC_DSS1_ALWON_FCLK ? 0 : 1; + + REG_FLD_MOD(DSS_CONTROL, b, 0, 0); /* DISPC_CLK_SWITCH */ + + dss.dispc_clk_source = clk_src; +} + +void dss_select_dsi_clk_source(enum dss_clk_source clk_src) { - u32 r; - r = dss_read_reg(DSS_CONTROL); - r = FLD_MOD(r, dsi, 1, 1); /* DSI_CLK_SWITCH */ - r = FLD_MOD(r, dispc, 0, 0); /* DISPC_CLK_SWITCH */ - dss_write_reg(DSS_CONTROL, r); + int b; + + BUG_ON(clk_src != DSS_SRC_DSI2_PLL_FCLK && + clk_src != DSS_SRC_DSS1_ALWON_FCLK); + + b = clk_src = DSS_SRC_DSS1_ALWON_FCLK ? 0 : 1; + + REG_FLD_MOD(DSS_CONTROL, b, 1, 1); /* DSI_CLK_SWITCH */ + + dss.dsi_clk_source = clk_src; } -int dss_get_dsi_clk_source(void) +enum dss_clk_source dss_get_dispc_clk_source(void) { - return FLD_GET(dss_read_reg(DSS_CONTROL), 1, 1); + return dss.dispc_clk_source; } -int dss_get_dispc_clk_source(void) +enum dss_clk_source dss_get_dsi_clk_source(void) { - return FLD_GET(dss_read_reg(DSS_CONTROL), 0, 0); + return dss.dsi_clk_source; } /* calculate clock rates using dividers in cinfo */ diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 41145af..3713dc6 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -119,6 +119,12 @@ enum dss_clock { DSS_CLK_96M = 1 << 4, }; +enum dss_clk_source { + DSS_SRC_DSI1_PLL_FCLK, + DSS_SRC_DSI2_PLL_FCLK, + DSS_SRC_DSS1_ALWON_FCLK, +}; + struct dss_clock_info { /* rates that we get with dividers below */ unsigned long fck; @@ -219,9 +225,11 @@ void dss_sdi_init(u8 datapairs); int dss_sdi_enable(void); void dss_sdi_disable(void); -void dss_select_clk_source(bool dsi, bool dispc); -int dss_get_dsi_clk_source(void); -int dss_get_dispc_clk_source(void); +void dss_select_dispc_clk_source(enum dss_clk_source clk_src); +void dss_select_dsi_clk_source(enum dss_clk_source clk_src); +enum dss_clk_source dss_get_dispc_clk_source(void); +enum dss_clk_source dss_get_dsi_clk_source(void); + void dss_set_venc_output(enum omap_dss_venc_type type); void dss_set_dac_pwrdn_bgz(bool enable); -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/13] OMAP: DSS2: DSI: add dsi_bus_is_locked() 2010-02-08 15:56 ` [PATCH 08/13] OMAP: DSS2: improve DSS clk src selection Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 10/13] OMAP: DSS2: DSI: add helpers for DCS read/write Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Helper function to clean up the checking of the bus lock. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/dsi.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 4fdb628..b389745 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -309,6 +309,11 @@ void dsi_bus_unlock(void) } EXPORT_SYMBOL(dsi_bus_unlock); +static bool dsi_bus_is_locked(void) +{ + return mutex_is_locked(&dsi.bus_lock); +} + static inline int wait_for_bit_change(const struct dsi_reg idx, int bitnum, int value) { @@ -1959,7 +1964,7 @@ static int dsi_vc_send_bta(int channel) (dsi.debug_write || dsi.debug_read)) DSSDBG("dsi_vc_send_bta %d\n", channel); - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) { /* RX_FIFO_NOT_EMPTY */ DSSERR("rx fifo not empty when sending BTA, dumping data:\n"); @@ -2010,7 +2015,7 @@ static inline void dsi_vc_write_long_header(int channel, u8 data_type, u32 val; u8 data_id; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); /*data_id = data_type | channel << 6; */ data_id = data_type | dsi.vc[channel].dest_per << 6; @@ -2105,7 +2110,7 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc) u32 r; u8 data_id; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (dsi.debug_write) DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n", @@ -2895,7 +2900,7 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev, int r = 0; int i; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (dsi.update_mode != mode) { dsi.update_mode = mode; -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 10/13] OMAP: DSS2: DSI: add helpers for DCS read/write 2010-02-08 15:56 ` [PATCH 09/13] OMAP: DSS2: DSI: add dsi_bus_is_locked() Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 11/13] OMAP: DSS2: DSI: export dsi_vc_enable_hs() Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Add helper functions for most common DCS read and write operations. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- arch/arm/plat-omap/include/plat/display.h | 3 ++ drivers/video/omap2/dss/dsi.c | 30 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index c66e464..47df5f6 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -233,8 +233,11 @@ int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, void dsi_bus_lock(void); void dsi_bus_unlock(void); int dsi_vc_dcs_write(int channel, u8 *data, int len); +int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd); +int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param); int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len); int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen); +int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data); int dsi_vc_set_max_rx_packet_size(int channel, u16 len); int dsi_vc_send_null(int channel); int dsi_vc_send_bta_sync(int channel); diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index b389745..e49f063 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -2176,6 +2176,21 @@ int dsi_vc_dcs_write(int channel, u8 *data, int len) } EXPORT_SYMBOL(dsi_vc_dcs_write); +int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd) +{ + return dsi_vc_dcs_write(channel, &dcs_cmd, 1); +} +EXPORT_SYMBOL(dsi_vc_dcs_write_0); + +int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param) +{ + u8 buf[2]; + buf[0] = dcs_cmd; + buf[1] = param; + return dsi_vc_dcs_write(channel, buf, 2); +} +EXPORT_SYMBOL(dsi_vc_dcs_write_1); + int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) { u32 val; @@ -2268,6 +2283,21 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) } EXPORT_SYMBOL(dsi_vc_dcs_read); +int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data) +{ + int r; + + r = dsi_vc_dcs_read(channel, dcs_cmd, data, 1); + + if (r < 0) + return r; + + if (r != 1) + return -EIO; + + return 0; +} +EXPORT_SYMBOL(dsi_vc_dcs_read_1); int dsi_vc_set_max_rx_packet_size(int channel, u16 len) { -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 11/13] OMAP: DSS2: DSI: export dsi_vc_enable_hs() 2010-02-08 15:56 ` [PATCH 10/13] OMAP: DSS2: DSI: add helpers for DCS read/write Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 12/13] OMAP: DSS2: DSI: configure all DSI VCs Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Rename and export dsi_vc_enable_hs() so that the display drivers can control the mode of the DSI link. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- arch/arm/plat-omap/include/plat/display.h | 2 ++ drivers/video/omap2/dss/dsi.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index 47df5f6..8c3688b 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -575,4 +575,6 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) +void omapdss_dsi_vc_enable_hs(int channel, bool enable); + #endif diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index e49f063..e003fe9 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -1864,10 +1864,12 @@ static void dsi_vc_config_vp(int channel) } -static void dsi_vc_enable_hs(int channel, bool enable) +void omapdss_dsi_vc_enable_hs(int channel, bool enable) { DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable); + WARN_ON(!dsi_bus_is_locked()); + dsi_vc_enable(channel, 0); dsi_if_enable(0); @@ -1878,6 +1880,7 @@ static void dsi_vc_enable_hs(int channel, bool enable) dsi_force_tx_stop_mode_io(); } +EXPORT_SYMBOL(omapdss_dsi_vc_enable_hs); static void dsi_vc_flush_long_data(int channel) { @@ -3275,7 +3278,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) } /* enable high-speed after initial config */ - dsi_vc_enable_hs(0, 1); + omapdss_dsi_vc_enable_hs(0, 1); return 0; err4: @@ -3688,7 +3691,7 @@ static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num) dsi_bus_lock(); /* run test first in low speed mode */ - dsi_vc_enable_hs(0, 0); + omapdss_dsi_vc_enable_hs(0, 0); if (dssdev->driver->run_test) { r = dssdev->driver->run_test(dssdev, test_num); @@ -3697,7 +3700,7 @@ static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num) } /* then in high speed */ - dsi_vc_enable_hs(0, 1); + omapdss_dsi_vc_enable_hs(0, 1); if (dssdev->driver->run_test) { r = dssdev->driver->run_test(dssdev, test_num); @@ -3706,7 +3709,7 @@ static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num) } end: - dsi_vc_enable_hs(0, 1); + omapdss_dsi_vc_enable_hs(0, 1); dsi_bus_unlock(); -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 12/13] OMAP: DSS2: DSI: configure all DSI VCs 2010-02-08 15:56 ` [PATCH 11/13] OMAP: DSS2: DSI: export dsi_vc_enable_hs() Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 13/13] OMAP: DSS2: DSI: remove dsi_vc_print_status() Tomi Valkeinen 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen Instead of configuring only VC0 to be usable, configure all four VCs similarly. This is needed to utilize the other VCs. Setting the FIFO sizes evenly for all VCs, regardless of how many VCs are actually used, is not optimal. However, this affects only cases when larger amounts of data are written or read via L4, meaning that normal use cases are not affected. At some point this could be optimized better to suit different use cases. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/dsi.c | 39 +++++++++++++++++---------------------- 1 files changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index e003fe9..131bd53 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -224,7 +224,6 @@ static struct enum dsi_vc_mode mode; struct omap_dss_device *dssdev; enum fifo_size fifo_size; - int dest_per; /* destination peripheral 0-3 */ } vc[4]; struct mutex lock; @@ -2020,8 +2019,7 @@ static inline void dsi_vc_write_long_header(int channel, u8 data_type, WARN_ON(!dsi_bus_is_locked()); - /*data_id = data_type | channel << 6; */ - data_id = data_type | dsi.vc[channel].dest_per << 6; + data_id = data_type | channel << 6; val = FLD_VAL(data_id, 7, 0) | FLD_VAL(len, 23, 8) | FLD_VAL(ecc, 31, 24); @@ -2127,7 +2125,7 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc) return -EINVAL; } - data_id = data_type | dsi.vc[channel].dest_per << 6; + data_id = data_type | channel << 6; r = (data_id << 0) | (data << 8) | (ecc << 24); @@ -2529,15 +2527,15 @@ static int dsi_proto_config(struct omap_dss_device *dssdev) u32 r; int buswidth = 0; - dsi_config_tx_fifo(DSI_FIFO_SIZE_128, - DSI_FIFO_SIZE_0, - DSI_FIFO_SIZE_0, - DSI_FIFO_SIZE_0); + dsi_config_tx_fifo(DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32); - dsi_config_rx_fifo(DSI_FIFO_SIZE_128, - DSI_FIFO_SIZE_0, - DSI_FIFO_SIZE_0, - DSI_FIFO_SIZE_0); + dsi_config_rx_fifo(DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32, + DSI_FIFO_SIZE_32); /* XXX what values for the timeouts? */ dsi_set_stop_state_counter(1000); @@ -2575,12 +2573,9 @@ static int dsi_proto_config(struct omap_dss_device *dssdev) dsi_write_reg(DSI_CTRL, r); dsi_vc_initial_config(0); - - /* set all vc targets to peripheral 0 */ - dsi.vc[0].dest_per = 0; - dsi.vc[1].dest_per = 0; - dsi.vc[2].dest_per = 0; - dsi.vc[3].dest_per = 0; + dsi_vc_initial_config(1); + dsi_vc_initial_config(2); + dsi_vc_initial_config(3); return 0; } @@ -2846,9 +2841,6 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, if (bytespf % packet_payload) total_len += (bytespf % packet_payload) + 1; - if (0) - dsi_vc_print_status(1); - l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */ dsi_write_reg(DSI_VC_TE(channel), l); @@ -3014,7 +3006,7 @@ static void dsi_handle_framedone(void) /* RX_FIFO_NOT_EMPTY */ if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) { DSSERR("Received error during frame transfer:\n"); - dsi_vc_flush_receive_data(0); + dsi_vc_flush_receive_data(channel); } #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC @@ -3268,6 +3260,9 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) /* enable interface */ dsi_vc_enable(0, 1); + dsi_vc_enable(1, 1); + dsi_vc_enable(2, 1); + dsi_vc_enable(3, 1); dsi_if_enable(1); dsi_force_tx_stop_mode_io(); -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 13/13] OMAP: DSS2: DSI: remove dsi_vc_print_status() 2010-02-08 15:56 ` [PATCH 12/13] OMAP: DSS2: DSI: configure all DSI VCs Tomi Valkeinen @ 2010-02-08 15:56 ` Tomi Valkeinen 0 siblings, 0 replies; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-08 15:56 UTC (permalink / raw) To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen It was not used. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/dss/dsi.c | 21 --------------------- 1 files changed, 0 insertions(+), 21 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 131bd53..4b85ed2 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -1760,24 +1760,6 @@ static int dsi_force_tx_stop_mode_io(void) return 0; } -static void dsi_vc_print_status(int channel) -{ - u32 r; - - r = dsi_read_reg(DSI_VC_CTRL(channel)); - DSSDBG("vc %d: TX_FIFO_NOT_EMPTY %d, BTA_EN %d, VC_BUSY %d, " - "TX_FIFO_FULL %d, RX_FIFO_NOT_EMPTY %d, ", - channel, - FLD_GET(r, 5, 5), - FLD_GET(r, 6, 6), - FLD_GET(r, 15, 15), - FLD_GET(r, 16, 16), - FLD_GET(r, 20, 20)); - - r = dsi_read_reg(DSI_TX_FIFO_VC_EMPTINESS); - DSSDBG("EMPTINESS %d\n", (r >> (8 * channel)) & 0xff); -} - static int dsi_vc_enable(int channel, bool enable) { if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO) @@ -2062,13 +2044,10 @@ static int dsi_vc_send_long(int channel, u8 data_type, u8 *data, u16 len, dsi_vc_write_long_header(channel, data_type, len, ecc); - /*dsi_vc_print_status(0); */ - p = data; for (i = 0; i < len >> 2; i++) { if (dsi.debug_write) DSSDBG("\tsending full packet %d\n", i); - /*dsi_vc_print_status(0); */ b1 = *p++; b2 = *p++; -- 1.6.5 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-08 15:56 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 02/13] OMAP: 3430SDP: remove vdvi regulator Tomi Valkeinen @ 2010-02-15 10:34 ` Hiremath, Vaibhav 2010-02-15 10:57 ` Tomi Valkeinen 1 sibling, 1 reply; 19+ messages in thread From: Hiremath, Vaibhav @ 2010-02-15 10:34 UTC (permalink / raw) To: Tomi Valkeinen, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org > -----Original Message----- > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > owner@vger.kernel.org] On Behalf Of Tomi Valkeinen > Sent: Monday, February 08, 2010 9:26 PM > To: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > Cc: Tomi Valkeinen > Subject: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI > > It looks like on OMAP3 some DSS pins need VDDS_DSI to function > properly. > > This has not been confirmed from TI, but looking at figure 15-1 > "Display > subsystem highlight" from the TRM, some data pins come near the DSI > and SDI > blocks. This is not very hard evidence, but the fact remains that > with the > power on, pixels are ok, and with the power off, pixels are not ok. > [Hiremath, Vaibhav] Tomi, sorry for delayed response. As usual stuck with some other issues. Below are some quick comments - I am not regulator expert, but as per my finding I believe it is nothing to do with pins position closure to each other. The actual root cause is TWL4030 Ownership bit. Please refer to the below mail-chain - http://marc.info/?l=linux-omap&m\x126045146600334&w=2 > It may also be that VDDS_SDI is needed to power some pins, but as > normally > both VDDS_SDI and VDDS_DSI come from the same power source, this > hasn't > been shown. > > It seems that a single driver can only get a regulator once. This > patch > solves it by getting all the required regulators in one place, and > from > which the submodules then get the regulators they need. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> > --- > drivers/video/omap2/dss/core.c | 66 > +++++++++++++++++++++++++++++++++++++++- > drivers/video/omap2/dss/dpi.c | 55 ++++++++++++++++++++++++++++- > ---- > drivers/video/omap2/dss/dsi.c | 4 +-- > drivers/video/omap2/dss/dss.h | 5 ++- > drivers/video/omap2/dss/venc.c | 4 +-- > 5 files changed, 117 insertions(+), 17 deletions(-) > > diff --git a/drivers/video/omap2/dss/core.c > b/drivers/video/omap2/dss/core.c > index 82918ee..791e1cb 100644 > --- a/drivers/video/omap2/dss/core.c > +++ b/drivers/video/omap2/dss/core.c > @@ -31,6 +31,7 @@ > #include <linux/debugfs.h> > #include <linux/io.h> > #include <linux/device.h> > +#include <linux/regulator/consumer.h> > > #include <plat/display.h> > #include <plat/clock.h> > @@ -47,6 +48,10 @@ static struct { > 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); > @@ -352,6 +357,50 @@ static void dss_clk_disable_all(void) > dss_clk_disable(clks); > } > > +/* REGULATORS */ > + > +struct regulator *dss_get_vdds_dsi(void) > +{ > + struct regulator *reg; > + > + if (core.vdds_dsi_reg != NULL) > + return core.vdds_dsi_reg; > + > + reg = regulator_get(&core.pdev->dev, "vdds_dsi"); > + if (!IS_ERR(reg)) > + core.vdds_dsi_reg = reg; > + > + return reg; > +} > + > +struct regulator *dss_get_vdds_sdi(void) > +{ > + struct regulator *reg; > + > + if (core.vdds_sdi_reg != NULL) > + return core.vdds_sdi_reg; > + > + reg = regulator_get(&core.pdev->dev, "vdds_sdi"); > + if (!IS_ERR(reg)) > + core.vdds_sdi_reg = reg; > + > + 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; > +} > + > /* DEBUGFS */ > #if defined(CONFIG_DEBUG_FS) && > defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) > static void dss_debug_dump_clocks(struct seq_file *s) > @@ -473,7 +522,7 @@ static int omap_dss_probe(struct platform_device > *pdev) > } > #endif > > - r = dpi_init(); > + r = dpi_init(pdev); > if (r) { > DSSERR("Failed to initialize dpi\n"); > goto fail0; > @@ -901,6 +950,21 @@ static int __init omap_dss_init(void) > > static void __exit omap_dss_exit(void) > { > + if (core.vdds_dsi_reg != NULL) { > + regulator_put(core.vdds_dsi_reg); > + core.vdds_dsi_reg = NULL; > + } > + > + if (core.vdds_sdi_reg != NULL) { > + regulator_put(core.vdds_sdi_reg); > + core.vdds_sdi_reg = NULL; > + } > + > + if (core.vdda_dac_reg != NULL) { > + regulator_put(core.vdda_dac_reg); > + core.vdda_dac_reg = NULL; > + } > + > platform_driver_unregister(&omap_dss_driver); > > omap_dss_bus_unregister(); > diff --git a/drivers/video/omap2/dss/dpi.c > b/drivers/video/omap2/dss/dpi.c > index 2d71031..69ce31a 100644 > --- a/drivers/video/omap2/dss/dpi.c > +++ b/drivers/video/omap2/dss/dpi.c > @@ -25,7 +25,10 @@ > #include <linux/kernel.h> > #include <linux/clk.h> > #include <linux/delay.h> > +#include <linux/err.h> > #include <linux/errno.h> > +#include <linux/platform_device.h> > +#include <linux/regulator/consumer.h> > > #include <plat/display.h> > #include <plat/cpu.h> > @@ -34,6 +37,7 @@ > > static struct { > int update_enabled; > + struct regulator *vdds_dsi_reg; > } dpi; > > #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL > @@ -166,21 +170,27 @@ static int dpi_display_enable(struct > omap_dss_device *dssdev) > goto err1; > } > > + if (cpu_is_omap34xx()) { > + r = regulator_enable(dpi.vdds_dsi_reg); > + if (r) > + goto err2; > + } > + > dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); > > r = dpi_basic_init(dssdev); > if (r) > - goto err2; > + goto err3; > > #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL > dss_clk_enable(DSS_CLK_FCK2); > r = dsi_pll_init(dssdev, 0, 1); > if (r) > - goto err3; > + goto err4; > #endif > r = dpi_set_mode(dssdev); > if (r) > - goto err4; > + goto err5; > > mdelay(2); > > @@ -188,22 +198,25 @@ static int dpi_display_enable(struct > omap_dss_device *dssdev) > > r = dssdev->driver->enable(dssdev); > if (r) > - goto err5; > + goto err6; > > dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; > > return 0; > > -err5: > +err6: > dispc_enable_lcd_out(0); > -err4: > +err5: > #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL > dsi_pll_uninit(); > -err3: > +err4: > dss_clk_disable(DSS_CLK_FCK2); > #endif > -err2: > +err3: > dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); > +err2: > + if (cpu_is_omap34xx()) > + regulator_disable(dpi.vdds_dsi_reg); > err1: > omap_dss_stop_device(dssdev); > err0: > @@ -232,6 +245,9 @@ static void dpi_display_disable(struct > omap_dss_device *dssdev) > > dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); > > + if (cpu_is_omap34xx()) > + regulator_disable(dpi.vdds_dsi_reg); > + > dssdev->state = OMAP_DSS_DISPLAY_DISABLED; > > omap_dss_stop_device(dssdev); > @@ -251,6 +267,9 @@ static int dpi_display_suspend(struct > omap_dss_device *dssdev) > > dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); > > + if (cpu_is_omap34xx()) > + regulator_disable(dpi.vdds_dsi_reg); > + > dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; > > return 0; > @@ -258,11 +277,19 @@ static int dpi_display_suspend(struct > omap_dss_device *dssdev) > > static int dpi_display_resume(struct omap_dss_device *dssdev) > { > + int r; > + > if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) > return -EINVAL; > > DSSDBG("dpi_display_resume\n"); > > + if (cpu_is_omap34xx()) { > + r = regulator_enable(dpi.vdds_dsi_reg); > + if (r) > + goto err0; > + } > + > dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); > > dispc_enable_lcd_out(1); > @@ -273,6 +300,8 @@ static int dpi_display_resume(struct > omap_dss_device *dssdev) > dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; > > return 0; > +err0: > + return r; [Hiremath, Vaibhav] if we initialize r = 0; and jump here in case of error, we can just use return r; Or return from there itself if (cpu_is_omap34xx()) { r = regulator_enable(dpi.vdds_dsi_reg); if (r) return r; Thanks, Vaibhav > } > > static void dpi_set_timings(struct omap_dss_device *dssdev, > @@ -388,8 +417,16 @@ int dpi_init_display(struct omap_dss_device > *dssdev) > return 0; > } > > -int dpi_init(void) > +int dpi_init(struct platform_device *pdev) > { > + if (cpu_is_omap34xx()) { > + dpi.vdds_dsi_reg = dss_get_vdds_dsi(); > + if (IS_ERR(dpi.vdds_dsi_reg)) { > + DSSERR("can't get VDDS_DSI regulator\n"); > + return PTR_ERR(dpi.vdds_dsi_reg); > + } > + } > + > return 0; > } > > diff --git a/drivers/video/omap2/dss/dsi.c > b/drivers/video/omap2/dss/dsi.c > index 6122178..036f422 100644 > --- a/drivers/video/omap2/dss/dsi.c > +++ b/drivers/video/omap2/dss/dsi.c > @@ -3799,7 +3799,7 @@ int dsi_init(struct platform_device *pdev) > goto err1; > } > > - dsi.vdds_dsi_reg = regulator_get(&pdev->dev, "vdds_dsi"); > + dsi.vdds_dsi_reg = dss_get_vdds_dsi(); > if (IS_ERR(dsi.vdds_dsi_reg)) { > iounmap(dsi.base); > DSSERR("can't get VDDS_DSI regulator\n"); > @@ -3830,8 +3830,6 @@ void dsi_exit(void) > { > kthread_stop(dsi.thread); > > - regulator_put(dsi.vdds_dsi_reg); > - > iounmap(dsi.base); > > DSSDBG("omap_dsi_exit\n"); > diff --git a/drivers/video/omap2/dss/dss.h > b/drivers/video/omap2/dss/dss.h > index 2bcb124..41145af 100644 > --- a/drivers/video/omap2/dss/dss.h > +++ b/drivers/video/omap2/dss/dss.h > @@ -169,6 +169,9 @@ 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); > +struct regulator *dss_get_vdda_dac(void); > > /* display */ > int dss_suspend_all_devices(void); > @@ -261,7 +264,7 @@ void dsi_get_overlay_fifo_thresholds(enum > omap_plane plane, > u32 *fifo_low, u32 *fifo_high); > > /* DPI */ > -int dpi_init(void); > +int dpi_init(struct platform_device *pdev); > void dpi_exit(void); > int dpi_init_display(struct omap_dss_device *dssdev); > > diff --git a/drivers/video/omap2/dss/venc.c > b/drivers/video/omap2/dss/venc.c > index 749a5a0..44b4998 100644 > --- a/drivers/video/omap2/dss/venc.c > +++ b/drivers/video/omap2/dss/venc.c > @@ -482,7 +482,7 @@ int venc_init(struct platform_device *pdev) > return -ENOMEM; > } > > - venc.vdda_dac_reg = regulator_get(&pdev->dev, "vdda_dac"); > + venc.vdda_dac_reg = dss_get_vdda_dac(); > if (IS_ERR(venc.vdda_dac_reg)) { > iounmap(venc.base); > DSSERR("can't get VDDA_DAC regulator\n"); > @@ -503,8 +503,6 @@ void venc_exit(void) > { > omap_dss_unregister_driver(&venc_driver); > > - regulator_put(venc.vdda_dac_reg); > - > iounmap(venc.base); > } > > -- > 1.6.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux- > omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-15 10:34 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Hiremath, Vaibhav @ 2010-02-15 10:57 ` Tomi Valkeinen 2010-02-15 12:23 ` Hiremath, Vaibhav 0 siblings, 1 reply; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-15 10:57 UTC (permalink / raw) To: ext Hiremath, Vaibhav Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org On Mon, 2010-02-15 at 11:22 +0100, ext Hiremath, Vaibhav wrote: > > -----Original Message----- > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > > owner@vger.kernel.org] On Behalf Of Tomi Valkeinen > > Sent: Monday, February 08, 2010 9:26 PM > > To: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > > Cc: Tomi Valkeinen > > Subject: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI > > > > It looks like on OMAP3 some DSS pins need VDDS_DSI to function > > properly. > > > > This has not been confirmed from TI, but looking at figure 15-1 > > "Display > > subsystem highlight" from the TRM, some data pins come near the DSI > > and SDI > > blocks. This is not very hard evidence, but the fact remains that > > with the > > power on, pixels are ok, and with the power off, pixels are not ok. > > > [Hiremath, Vaibhav] Tomi, sorry for delayed response. As usual stuck with some other issues. Below are some quick comments - > > I am not regulator expert, but as per my finding I believe it is nothing to do with pins position closure to each other. The actual root cause is TWL4030 Ownership bit. Please refer to the below mail-chain - > > http://marc.info/?l=linux-omap&m\x126045146600334&w=2 But why is there a dependency on a regulator, if it has nothing to do with the pins? Why is vdds_dsi/vdds_sdi needed to get all pixels through? Tomi ^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-15 10:57 ` Tomi Valkeinen @ 2010-02-15 12:23 ` Hiremath, Vaibhav 2010-02-15 12:32 ` Tomi Valkeinen 2010-02-15 14:02 ` Grazvydas Ignotas 0 siblings, 2 replies; 19+ messages in thread From: Hiremath, Vaibhav @ 2010-02-15 12:23 UTC (permalink / raw) To: Tomi Valkeinen; +Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org > -----Original Message----- > From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] > Sent: Monday, February 15, 2010 4:28 PM > To: Hiremath, Vaibhav > Cc: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > Subject: RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using > DPI > > On Mon, 2010-02-15 at 11:22 +0100, ext Hiremath, Vaibhav wrote: > > > -----Original Message----- > > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > > > owner@vger.kernel.org] On Behalf Of Tomi Valkeinen > > > Sent: Monday, February 08, 2010 9:26 PM > > > To: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > > > Cc: Tomi Valkeinen > > > Subject: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using > DPI > > > > > > It looks like on OMAP3 some DSS pins need VDDS_DSI to function > > > properly. > > > > > > This has not been confirmed from TI, but looking at figure 15-1 > > > "Display > > > subsystem highlight" from the TRM, some data pins come near the > DSI > > > and SDI > > > blocks. This is not very hard evidence, but the fact remains > that > > > with the > > > power on, pixels are ok, and with the power off, pixels are not > ok. > > > > > [Hiremath, Vaibhav] Tomi, sorry for delayed response. As usual > stuck with some other issues. Below are some quick comments - > > > > I am not regulator expert, but as per my finding I believe it is > nothing to do with pins position closure to each other. The actual > root cause is TWL4030 Ownership bit. Please refer to the below mail- > chain - > > > > http://marc.info/?l=linux-omap&m\x126045146600334&w=2 > > But why is there a dependency on a regulator, if it has nothing to > do > with the pins? Why is vdds_dsi/vdds_sdi needed to get all pixels > through? [Hiremath, Vaibhav] I am not sure, what role ownership bit is playing here. Thanks, Vaibhav > > Tomi > ^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-15 12:23 ` Hiremath, Vaibhav @ 2010-02-15 12:32 ` Tomi Valkeinen 2010-02-15 14:02 ` Grazvydas Ignotas 1 sibling, 0 replies; 19+ messages in thread From: Tomi Valkeinen @ 2010-02-15 12:32 UTC (permalink / raw) To: ext Hiremath, Vaibhav Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org On Mon, 2010-02-15 at 13:11 +0100, ext Hiremath, Vaibhav wrote: > > -----Original Message----- > > From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] > > Sent: Monday, February 15, 2010 4:28 PM > > To: Hiremath, Vaibhav > > Cc: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > > Subject: RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using > > DPI > > > > On Mon, 2010-02-15 at 11:22 +0100, ext Hiremath, Vaibhav wrote: > > > > -----Original Message----- > > > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > > > > owner@vger.kernel.org] On Behalf Of Tomi Valkeinen > > > > Sent: Monday, February 08, 2010 9:26 PM > > > > To: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org > > > > Cc: Tomi Valkeinen > > > > Subject: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using > > DPI > > > > > > > > It looks like on OMAP3 some DSS pins need VDDS_DSI to function > > > > properly. > > > > > > > > This has not been confirmed from TI, but looking at figure 15-1 > > > > "Display > > > > subsystem highlight" from the TRM, some data pins come near the > > DSI > > > > and SDI > > > > blocks. This is not very hard evidence, but the fact remains > > that > > > > with the > > > > power on, pixels are ok, and with the power off, pixels are not > > ok. > > > > > > > [Hiremath, Vaibhav] Tomi, sorry for delayed response. As usual > > stuck with some other issues. Below are some quick comments - > > > > > > I am not regulator expert, but as per my finding I believe it is > > nothing to do with pins position closure to each other. The actual > > root cause is TWL4030 Ownership bit. Please refer to the below mail- > > chain - > > > > > > http://marc.info/?l=linux-omap&m\x126045146600334&w=2 > > > > But why is there a dependency on a regulator, if it has nothing to > > do > > with the pins? Why is vdds_dsi/vdds_sdi needed to get all pixels > > through? > [Hiremath, Vaibhav] I am not sure, what role ownership bit is playing here. But it doesn't matter. If DSS does not need any regulators, it shouldn't matter how the TWL is configured. And if it does, and TWL config matters, then why does DSS need the regulators? Tomi ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI 2010-02-15 12:23 ` Hiremath, Vaibhav 2010-02-15 12:32 ` Tomi Valkeinen @ 2010-02-15 14:02 ` Grazvydas Ignotas 1 sibling, 0 replies; 19+ messages in thread From: Grazvydas Ignotas @ 2010-02-15 14:02 UTC (permalink / raw) To: Hiremath, Vaibhav Cc: Tomi Valkeinen, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org On Mon, Feb 15, 2010 at 2:11 PM, Hiremath, Vaibhav <hvaibhav@ti.com> wrote: >> -----Original Message----- >> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com] >> Sent: Monday, February 15, 2010 4:28 PM >> To: Hiremath, Vaibhav >> Cc: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org >> Subject: RE: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using >> DPI >> >> On Mon, 2010-02-15 at 11:22 +0100, ext Hiremath, Vaibhav wrote: >> > > -----Original Message----- >> > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- >> > > owner@vger.kernel.org] On Behalf Of Tomi Valkeinen >> > > Sent: Monday, February 08, 2010 9:26 PM >> > > To: linux-omap@vger.kernel.org; linux-fbdev@vger.kernel.org >> > > Cc: Tomi Valkeinen >> > > Subject: [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using >> DPI >> > > >> > > It looks like on OMAP3 some DSS pins need VDDS_DSI to function >> > > properly. >> > > >> > > This has not been confirmed from TI, but looking at figure 15-1 >> > > "Display >> > > subsystem highlight" from the TRM, some data pins come near the >> DSI >> > > and SDI >> > > blocks. This is not very hard evidence, but the fact remains >> that >> > > with the >> > > power on, pixels are ok, and with the power off, pixels are not >> ok. >> > > >> > [Hiremath, Vaibhav] Tomi, sorry for delayed response. As usual >> stuck with some other issues. Below are some quick comments - >> > >> > I am not regulator expert, but as per my finding I believe it is >> nothing to do with pins position closure to each other. The actual >> root cause is TWL4030 Ownership bit. Please refer to the below mail- >> chain - >> > >> > http://marc.info/?l=linux-omap&m\x126045146600334&w=2 >> >> But why is there a dependency on a regulator, if it has nothing to >> do >> with the pins? Why is vdds_dsi/vdds_sdi needed to get all pixels >> through? > [Hiremath, Vaibhav] I am not sure, what role ownership bit is playing here. It effectively enables or disables the regulator. > > Thanks, > Vaibhav > >> >> Tomi >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2010-02-15 14:02 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-08 15:55 [PATCH 00/13] OMAP DSS2 patches Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 02/13] OMAP: 3430SDP: remove vdvi regulator Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 03/13] OMAP: DSS: Taal: fix error returns in taal_probe() Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 04/13] OMAP: DSS2: OMAPFB: implement OMAPFB_RESERVE_BUFFER Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 05/13] OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 06/13] OMAP: DSS2: fix irq-stats compilation Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 07/13] OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 08/13] OMAP: DSS2: improve DSS clk src selection Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 09/13] OMAP: DSS2: DSI: add dsi_bus_is_locked() Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 10/13] OMAP: DSS2: DSI: add helpers for DCS read/write Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 11/13] OMAP: DSS2: DSI: export dsi_vc_enable_hs() Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 12/13] OMAP: DSS2: DSI: configure all DSI VCs Tomi Valkeinen 2010-02-08 15:56 ` [PATCH 13/13] OMAP: DSS2: DSI: remove dsi_vc_print_status() Tomi Valkeinen 2010-02-15 10:34 ` [PATCH 01/13] OMAP: DSS2: enable VDDS_DSI when using DPI Hiremath, Vaibhav 2010-02-15 10:57 ` Tomi Valkeinen 2010-02-15 12:23 ` Hiremath, Vaibhav 2010-02-15 12:32 ` Tomi Valkeinen 2010-02-15 14:02 ` Grazvydas Ignotas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).