From ef75850e345b994f60f25a4c328c6d914672838d Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Thu, 15 Aug 2013 18:01:40 +0800 Subject: [PATCH] ENGR00275419-1 mxc dispdrv: introduce post init interface This patch adds a new post init interface in the mxc display driver. It may do necessary deferred operations after a display device's dev_id and disp_id pass usage check. This is a feasible way to avoid any setup being overwitten or damaged by a late coming display device which uses the same dev_id and disp_id with a display already registered. Signed-off-by: Liu Ying --- drivers/video/mxc/mxc_dispdrv.c | 2 ++ drivers/video/mxc/mxc_dispdrv.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/video/mxc/mxc_dispdrv.c b/drivers/video/mxc/mxc_dispdrv.c index 2e6da99c4f68..5193c7deef00 100644 --- a/drivers/video/mxc/mxc_dispdrv.c +++ b/drivers/video/mxc/mxc_dispdrv.c @@ -18,6 +18,8 @@ * A display device driver could call mxc_dispdrv_register(drv) in its dev_probe() function. * Move all dev_probe() things into mxc_dispdrv_driver->init(), init() function should init * and feedback setting; + * Necessary deferred operations can be done in mxc_dispdrv_driver->post_init(), + * after dev_id and disp_id pass usage check; * Move all dev_remove() things into mxc_dispdrv_driver->deinit(); * Move all dev_suspend() things into fb_notifier for SUSPEND, if there is; * Move all dev_resume() things into fb_notifier for RESUME, if there is; diff --git a/drivers/video/mxc/mxc_dispdrv.h b/drivers/video/mxc/mxc_dispdrv.h index d6dcf19dc404..127fd08ea391 100644 --- a/drivers/video/mxc/mxc_dispdrv.h +++ b/drivers/video/mxc/mxc_dispdrv.h @@ -33,6 +33,8 @@ struct mxc_dispdrv_setting { struct mxc_dispdrv_driver { const char *name; int (*init) (struct mxc_dispdrv_handle *, struct mxc_dispdrv_setting *); + /* deferred operations after dev_id and disp_id pass usage check */ + int (*post_init) (struct mxc_dispdrv_handle *, int dev_id, int disp_id); void (*deinit) (struct mxc_dispdrv_handle *); /* display driver enable function for extension */ int (*enable) (struct mxc_dispdrv_handle *); -- 2.39.5