diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2014-03-10 06:52:56 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:57:56 -0400 |
commit | 16a37658d909957b8badc4dc835cdc808e2bd350 (patch) | |
tree | 90e7f1a5adf567f466a18f9ae4e213bf45252a96 | |
parent | 5cda98319acbcff011d8b2e20136f06703fcb923 (diff) |
ENGR00302472-5 video: mxc disp: Let encoder know fbi when enable/disable
This patch adds framebuffer info structure to the mxc display driver
enable/disable callback parameters so that the encoder drivers may
know the framebuffer information. In this way, the encoder drivers
which may deal with more than one framebuffer are able to figure out
the one it is handling. A real example is the LDB encoder, which may
deal with two standalone framebuffers at most.
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
-rw-r--r-- | drivers/video/mxc/mipi_dsi.c | 13 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_dispdrv.h | 4 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_hdmi.c | 6 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_ipuv3_fb.c | 4 |
4 files changed, 19 insertions, 8 deletions
diff --git a/drivers/video/mxc/mipi_dsi.c b/drivers/video/mxc/mipi_dsi.c index 53741c31e711..ca1b53f61b59 100644 --- a/drivers/video/mxc/mipi_dsi.c +++ b/drivers/video/mxc/mipi_dsi.c | |||
@@ -622,7 +622,8 @@ static int mipi_dsi_lcd_init(struct mipi_dsi_info *mipi_dsi, | |||
622 | return 0; | 622 | return 0; |
623 | } | 623 | } |
624 | 624 | ||
625 | int mipi_dsi_enable(struct mxc_dispdrv_handle *disp) | 625 | static int mipi_dsi_enable(struct mxc_dispdrv_handle *disp, |
626 | struct fb_info *fbi) | ||
626 | { | 627 | { |
627 | int err; | 628 | int err; |
628 | struct mipi_dsi_info *mipi_dsi = mxc_dispdrv_getdata(disp); | 629 | struct mipi_dsi_info *mipi_dsi = mxc_dispdrv_getdata(disp); |
@@ -652,6 +653,14 @@ int mipi_dsi_enable(struct mxc_dispdrv_handle *disp) | |||
652 | return 0; | 653 | return 0; |
653 | } | 654 | } |
654 | 655 | ||
656 | static void mipi_dsi_disable(struct mxc_dispdrv_handle *disp, | ||
657 | struct fb_info *fbi) | ||
658 | { | ||
659 | struct mipi_dsi_info *mipi_dsi = mxc_dispdrv_getdata(disp); | ||
660 | |||
661 | mipi_dsi_power_off(mipi_dsi->disp_mipi); | ||
662 | } | ||
663 | |||
655 | static int mipi_dsi_disp_init(struct mxc_dispdrv_handle *disp, | 664 | static int mipi_dsi_disp_init(struct mxc_dispdrv_handle *disp, |
656 | struct mxc_dispdrv_setting *setting) | 665 | struct mxc_dispdrv_setting *setting) |
657 | { | 666 | { |
@@ -696,7 +705,7 @@ static struct mxc_dispdrv_driver mipi_dsi_drv = { | |||
696 | .init = mipi_dsi_disp_init, | 705 | .init = mipi_dsi_disp_init, |
697 | .deinit = mipi_dsi_disp_deinit, | 706 | .deinit = mipi_dsi_disp_deinit, |
698 | .enable = mipi_dsi_enable, | 707 | .enable = mipi_dsi_enable, |
699 | .disable = mipi_dsi_power_off, | 708 | .disable = mipi_dsi_disable, |
700 | }; | 709 | }; |
701 | 710 | ||
702 | static int imx6q_mipi_dsi_get_mux(int dev_id, int disp_id) | 711 | static int imx6q_mipi_dsi_get_mux(int dev_id, int disp_id) |
diff --git a/drivers/video/mxc/mxc_dispdrv.h b/drivers/video/mxc/mxc_dispdrv.h index c2ee2ca0f01e..3be09353911b 100644 --- a/drivers/video/mxc/mxc_dispdrv.h +++ b/drivers/video/mxc/mxc_dispdrv.h | |||
@@ -37,9 +37,9 @@ struct mxc_dispdrv_driver { | |||
37 | int (*post_init) (struct mxc_dispdrv_handle *, int dev_id, int disp_id); | 37 | int (*post_init) (struct mxc_dispdrv_handle *, int dev_id, int disp_id); |
38 | void (*deinit) (struct mxc_dispdrv_handle *); | 38 | void (*deinit) (struct mxc_dispdrv_handle *); |
39 | /* display driver enable function for extension */ | 39 | /* display driver enable function for extension */ |
40 | int (*enable) (struct mxc_dispdrv_handle *); | 40 | int (*enable) (struct mxc_dispdrv_handle *, struct fb_info *); |
41 | /* display driver disable function, called at early part of fb_blank */ | 41 | /* display driver disable function, called at early part of fb_blank */ |
42 | void (*disable) (struct mxc_dispdrv_handle *); | 42 | void (*disable) (struct mxc_dispdrv_handle *, struct fb_info *); |
43 | /* display driver setup function, called at early part of fb_set_par */ | 43 | /* display driver setup function, called at early part of fb_set_par */ |
44 | int (*setup) (struct mxc_dispdrv_handle *, struct fb_info *fbi); | 44 | int (*setup) (struct mxc_dispdrv_handle *, struct fb_info *fbi); |
45 | }; | 45 | }; |
diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c index 2c072bdacda8..fa3ceda03556 100644 --- a/drivers/video/mxc/mxc_hdmi.c +++ b/drivers/video/mxc/mxc_hdmi.c | |||
@@ -1953,14 +1953,16 @@ static void mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi) | |||
1953 | dev_dbg(&hdmi->pdev->dev, "%s exit\n", __func__); | 1953 | dev_dbg(&hdmi->pdev->dev, "%s exit\n", __func__); |
1954 | } | 1954 | } |
1955 | 1955 | ||
1956 | static int mxc_hdmi_power_on(struct mxc_dispdrv_handle *disp) | 1956 | static int mxc_hdmi_power_on(struct mxc_dispdrv_handle *disp, |
1957 | struct fb_info *fbi) | ||
1957 | { | 1958 | { |
1958 | struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp); | 1959 | struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp); |
1959 | mxc_hdmi_phy_init(hdmi); | 1960 | mxc_hdmi_phy_init(hdmi); |
1960 | return 0; | 1961 | return 0; |
1961 | } | 1962 | } |
1962 | 1963 | ||
1963 | static void mxc_hdmi_power_off(struct mxc_dispdrv_handle *disp) | 1964 | static void mxc_hdmi_power_off(struct mxc_dispdrv_handle *disp, |
1965 | struct fb_info *fbi) | ||
1964 | { | 1966 | { |
1965 | struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp); | 1967 | struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp); |
1966 | mxc_hdmi_phy_disable(hdmi); | 1968 | mxc_hdmi_phy_disable(hdmi); |
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index 963a56a21bd4..b197be4ef878 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c | |||
@@ -655,7 +655,7 @@ static int mxcfb_set_par(struct fb_info *fbi) | |||
655 | ipu_enable_channel(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch); | 655 | ipu_enable_channel(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch); |
656 | 656 | ||
657 | if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->enable) { | 657 | if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->enable) { |
658 | retval = mxc_fbi->dispdrv->drv->enable(mxc_fbi->dispdrv); | 658 | retval = mxc_fbi->dispdrv->drv->enable(mxc_fbi->dispdrv, fbi); |
659 | if (retval < 0) { | 659 | if (retval < 0) { |
660 | dev_err(fbi->device, "enable error, dispdrv:%s.\n", | 660 | dev_err(fbi->device, "enable error, dispdrv:%s.\n", |
661 | mxc_fbi->dispdrv->drv->name); | 661 | mxc_fbi->dispdrv->drv->name); |
@@ -1380,7 +1380,7 @@ static int mxcfb_blank(int blank, struct fb_info *info) | |||
1380 | case FB_BLANK_HSYNC_SUSPEND: | 1380 | case FB_BLANK_HSYNC_SUSPEND: |
1381 | case FB_BLANK_NORMAL: | 1381 | case FB_BLANK_NORMAL: |
1382 | if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->disable) | 1382 | if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->disable) |
1383 | mxc_fbi->dispdrv->drv->disable(mxc_fbi->dispdrv); | 1383 | mxc_fbi->dispdrv->drv->disable(mxc_fbi->dispdrv, info); |
1384 | ipu_disable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch, true); | 1384 | ipu_disable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch, true); |
1385 | if (mxc_fbi->ipu_di >= 0) | 1385 | if (mxc_fbi->ipu_di >= 0) |
1386 | ipu_uninit_sync_panel(mxc_fbi->ipu, mxc_fbi->ipu_di); | 1386 | ipu_uninit_sync_panel(mxc_fbi->ipu, mxc_fbi->ipu_di); |