diff options
author | Rob Clark <rob@ti.com> | 2010-08-24 18:30:32 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2010-08-26 21:47:57 +0800 |
commit | 0bfcfcd4e240bcbdbb07a434b9fc043fae57b516 (patch) | |
tree | 0fcc794ca900b2e2db80135d4c989b9f6195a4c9 /arch | |
parent | 5120ec7190d8d11522a5ac670e59a24bfbce7bb0 (diff) |
OMAP4:DSS: add generic notifier mechanism
A callback can be registered by the dssdev client in order to be
notified of resolution changes, for example an external monitor
that is hot-plugged.
Multiple clients can now register for notification from one
dssdev, and the notification mechanism can be extended in the
future to add other events.
Note that this patch supersedes the "OMAP4:DSS: add callback to notify
client of resolution change" patch.
Signed-off-by: Rob Clark <rob@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-omap/include/plat/display.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index 829bee50400c..4d3c4d7bc157 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -23,6 +23,7 @@ #include <linux/list.h> #include <linux/kobject.h> #include <linux/device.h> +#include <linux/notifier.h> #include <asm/atomic.h> #include <plat/omap_hwmod.h> #include <plat/omap_device.h> @@ -601,9 +602,7 @@ struct omap_dss_device { enum omap_dss_display_state state; enum omap_channel channel; - /* callbacks to notify dssdev client */ - void *size_notify_arg; - void (*size_notify)(void *arg, int w, int h); + struct blocking_notifier_head notifier; /* platform specific */ int (*platform_enable)(struct omap_dss_device *dssdev); @@ -681,8 +680,18 @@ struct omap_dss_device *omap_dss_find_device(void *data, int omap_dss_start_device(struct omap_dss_device *dssdev); void omap_dss_stop_device(struct omap_dss_device *dssdev); -void omap_dss_update_size(struct omap_dss_device *dssdev, int w, int h); -void omap_dss_set_size_notify(struct omap_dss_device *dssdev, void (*notify)(void *arg, int w, int h), void *arg); +/* the event id of the event that occurred is passed in as the second arg + * to the notifier function, and the dssdev is passed as the third. + */ +enum omap_dss_event { + OMAP_DSS_SIZE_CHANGE + /* possibly add additional events, like hot-plug connect/disconnect */ +}; + +void omap_dss_notify(struct omap_dss_device *dssdev, enum omap_dss_event evt); +void omap_dss_add_notify(struct omap_dss_device *dssdev, struct notifier_block *nb); +void omap_dss_remove_notify(struct omap_dss_device *dssdev, struct notifier_block *nb); + int omap_dss_get_num_overlay_managers(void); struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); |