On Tue, Apr 22, 2014 at 04:09:11AM +0530, Ajay Kumar wrote:
Most of the panels need an init sequence as mentioned below: -- poweron LCD unit/LCD_EN -- start video data -- poweron LED unit/BL_EN And, a de-init sequence as mentioned below: -- poweroff LED unit/BL_EN -- stop video data -- poweroff LCD unit/LCD_EN With existing callbacks for drm panel, we cannot accomodate such panels, since only two callbacks, i.e "panel_enable" and panel_disable are supported.
This patch adds: -- "pre_enable" callback which can be called before the actual video data is on, and then call the "enable" callback after the video data is available.
-- "post_disable" callback which can be called after the video data is off, and use "disable" callback to do something before switching off the video data.
Now, we can easily map the above scenario as shown below: poweron LCD unit/LCD_EN = "pre_enable" callback poweron LED unit/BL_EN = "enable" callback poweroff LED unit/BL_EN = "disable" callback poweroff LCD unit/LCD_EN = "post_disable" callback
I don't like this. What happens when the next panel comes around that has a yet slightly different requirement? Will we introduce a new pre_pre_enable() and post_post_disable() function then?
There's got to be a better way to solve this.
Thierry