forked from luck/tmp_suning_uos_patched
OMAPDSS: outputs: Create and register output instances
Add output structs to output driver's private data. Register output instances by having an init function in the probes of the platform device drivers for different outputs. The *_init_output for each output registers the output and fill up the output's plaform device, type and id fields. The *_uninit_output functions unregister the output. In the probe of each interface driver, the output entities are initialized before the *_probe_pdata() functions intentionally. This is done to ensure that the output entity is prepared before the panels connected to the output are registered. We need the output entities to be ready because OMAPDSS will try to make connections between overlays, managers, outputs and devices during the panel's probe. Signed-off-by: Archit Taneja <archit@ti.com>
This commit is contained in:
parent
484dc404d2
commit
81b87f515f
@ -44,6 +44,8 @@ static struct {
|
||||
struct omap_video_timings timings;
|
||||
struct dss_lcd_mgr_config mgr_config;
|
||||
int data_lines;
|
||||
|
||||
struct omap_dss_output output;
|
||||
} dpi;
|
||||
|
||||
static struct platform_device *dpi_get_dsidev(enum omap_dss_clk_source clk)
|
||||
@ -436,10 +438,30 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init dpi_init_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &dpi.output;
|
||||
|
||||
out->pdev = pdev;
|
||||
out->id = OMAP_DSS_OUTPUT_DPI;
|
||||
out->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit dpi_uninit_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &dpi.output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
static int __init omap_dpi_probe(struct platform_device *pdev)
|
||||
{
|
||||
mutex_init(&dpi.lock);
|
||||
|
||||
dpi_init_output(pdev);
|
||||
|
||||
dpi_probe_pdata(pdev);
|
||||
|
||||
return 0;
|
||||
@ -449,6 +471,8 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
|
||||
{
|
||||
dss_unregister_child_devices(&pdev->dev);
|
||||
|
||||
dpi_uninit_output(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -336,6 +336,8 @@ struct dsi_data {
|
||||
enum omap_dss_dsi_pixel_format pix_fmt;
|
||||
enum omap_dss_dsi_mode mode;
|
||||
struct omap_dss_dsi_videomode_timings vm_timings;
|
||||
|
||||
struct omap_dss_output output;
|
||||
};
|
||||
|
||||
struct dsi_packet_sent_handler_data {
|
||||
@ -5156,6 +5158,28 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init dsi_init_output(struct platform_device *dsidev)
|
||||
{
|
||||
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
|
||||
struct omap_dss_output *out = &dsi->output;
|
||||
|
||||
out->pdev = dsidev;
|
||||
out->id = dsi->module_id == 0 ?
|
||||
OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
|
||||
|
||||
out->type = OMAP_DISPLAY_TYPE_DSI;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit dsi_uninit_output(struct platform_device *dsidev)
|
||||
{
|
||||
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
|
||||
struct omap_dss_output *out = &dsi->output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
/* DSI1 HW IP initialisation */
|
||||
static int __init omap_dsihw_probe(struct platform_device *dsidev)
|
||||
{
|
||||
@ -5250,6 +5274,8 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
|
||||
else
|
||||
dsi->num_lanes_supported = 3;
|
||||
|
||||
dsi_init_output(dsidev);
|
||||
|
||||
dsi_probe_pdata(dsidev);
|
||||
|
||||
dsi_runtime_put(dsidev);
|
||||
@ -5281,6 +5307,8 @@ static int __exit omap_dsihw_remove(struct platform_device *dsidev)
|
||||
|
||||
dss_unregister_child_devices(&dsidev->dev);
|
||||
|
||||
dsi_uninit_output(dsidev);
|
||||
|
||||
pm_runtime_disable(&dsidev->dev);
|
||||
|
||||
dsi_put_clocks(dsidev);
|
||||
|
@ -68,6 +68,8 @@ static struct {
|
||||
int ct_cp_hpd_gpio;
|
||||
int ls_oe_gpio;
|
||||
int hpd_gpio;
|
||||
|
||||
struct omap_dss_output output;
|
||||
} hdmi;
|
||||
|
||||
/*
|
||||
@ -970,6 +972,24 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init hdmi_init_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &hdmi.output;
|
||||
|
||||
out->pdev = pdev;
|
||||
out->id = OMAP_DSS_OUTPUT_HDMI;
|
||||
out->type = OMAP_DISPLAY_TYPE_HDMI;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit hdmi_uninit_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &hdmi.output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
/* HDMI HW IP initialisation */
|
||||
static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
|
||||
{
|
||||
@ -1013,6 +1033,8 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
|
||||
|
||||
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
|
||||
|
||||
hdmi_init_output(pdev);
|
||||
|
||||
hdmi_probe_pdata(pdev);
|
||||
|
||||
return 0;
|
||||
@ -1033,6 +1055,8 @@ static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
|
||||
|
||||
hdmi_panel_exit();
|
||||
|
||||
hdmi_uninit_output(pdev);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
hdmi_put_clocks();
|
||||
|
@ -116,6 +116,8 @@ static struct {
|
||||
int pixel_size;
|
||||
int data_lines;
|
||||
struct rfbi_timings intf_timings;
|
||||
|
||||
struct omap_dss_output output;
|
||||
} rfbi;
|
||||
|
||||
static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val)
|
||||
@ -1002,6 +1004,24 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init rfbi_init_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &rfbi.output;
|
||||
|
||||
out->pdev = pdev;
|
||||
out->id = OMAP_DSS_OUTPUT_DBI;
|
||||
out->type = OMAP_DISPLAY_TYPE_DBI;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit rfbi_uninit_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &rfbi.output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
/* RFBI HW IP initialisation */
|
||||
static int __init omap_rfbihw_probe(struct platform_device *pdev)
|
||||
{
|
||||
@ -1053,6 +1073,8 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev)
|
||||
|
||||
dss_debugfs_create_file("rfbi", rfbi_dump_regs);
|
||||
|
||||
rfbi_init_output(pdev);
|
||||
|
||||
rfbi_probe_pdata(pdev);
|
||||
|
||||
return 0;
|
||||
@ -1065,7 +1087,11 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev)
|
||||
static int __exit omap_rfbihw_remove(struct platform_device *pdev)
|
||||
{
|
||||
dss_unregister_child_devices(&pdev->dev);
|
||||
|
||||
rfbi_uninit_output(pdev);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,8 @@ static struct {
|
||||
struct dss_lcd_mgr_config mgr_config;
|
||||
struct omap_video_timings timings;
|
||||
int datapairs;
|
||||
|
||||
struct omap_dss_output output;
|
||||
} sdi;
|
||||
|
||||
static void sdi_config_lcd_manager(struct omap_dss_device *dssdev)
|
||||
@ -255,8 +257,28 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init sdi_init_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &sdi.output;
|
||||
|
||||
out->pdev = pdev;
|
||||
out->id = OMAP_DSS_OUTPUT_SDI;
|
||||
out->type = OMAP_DISPLAY_TYPE_SDI;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit sdi_uninit_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &sdi.output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
static int __init omap_sdi_probe(struct platform_device *pdev)
|
||||
{
|
||||
sdi_init_output(pdev);
|
||||
|
||||
sdi_probe_pdata(pdev);
|
||||
|
||||
return 0;
|
||||
@ -266,6 +288,8 @@ static int __exit omap_sdi_remove(struct platform_device *pdev)
|
||||
{
|
||||
dss_unregister_child_devices(&pdev->dev);
|
||||
|
||||
sdi_uninit_output(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -303,6 +303,8 @@ static struct {
|
||||
struct omap_video_timings timings;
|
||||
enum omap_dss_venc_type type;
|
||||
bool invert_polarity;
|
||||
|
||||
struct omap_dss_output output;
|
||||
} venc;
|
||||
|
||||
static inline void venc_write_reg(int idx, u32 val)
|
||||
@ -797,6 +799,24 @@ static void __init venc_probe_pdata(struct platform_device *vencdev)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init venc_init_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &venc.output;
|
||||
|
||||
out->pdev = pdev;
|
||||
out->id = OMAP_DSS_OUTPUT_VENC;
|
||||
out->type = OMAP_DISPLAY_TYPE_VENC;
|
||||
|
||||
dss_register_output(out);
|
||||
}
|
||||
|
||||
static void __exit venc_uninit_output(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_dss_output *out = &venc.output;
|
||||
|
||||
dss_unregister_output(out);
|
||||
}
|
||||
|
||||
/* VENC HW IP initialisation */
|
||||
static int __init omap_venchw_probe(struct platform_device *pdev)
|
||||
{
|
||||
@ -844,6 +864,8 @@ static int __init omap_venchw_probe(struct platform_device *pdev)
|
||||
|
||||
dss_debugfs_create_file("venc", venc_dump_regs);
|
||||
|
||||
venc_init_output(pdev);
|
||||
|
||||
venc_probe_pdata(pdev);
|
||||
|
||||
return 0;
|
||||
@ -866,6 +888,8 @@ static int __exit omap_venchw_remove(struct platform_device *pdev)
|
||||
|
||||
venc_panel_exit();
|
||||
|
||||
venc_uninit_output(pdev);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
venc_put_clocks();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user