*/
#include <linux/kernel.h>
+#include <linux/list.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_graph.h>
-#include <linux/list.h>
#include "dss.h"
#include "omapdss.h"
static struct dss_device *dss_device;
-static struct list_head omapdss_comp_list;
-
-struct omapdss_comp_node {
- struct list_head list;
- struct device_node *node;
- bool dss_core_component;
-};
-
struct dss_device *omapdss_get_dss(void)
{
return dss_device;
}
EXPORT_SYMBOL(dispc_get_ops);
+
+/* -----------------------------------------------------------------------------
+ * OMAP DSS Devices Handling
+ */
+
+static LIST_HEAD(omapdss_devices_list);
+static DEFINE_MUTEX(omapdss_devices_lock);
+
+void omapdss_device_register(struct omap_dss_device *dssdev)
+{
+ mutex_lock(&omapdss_devices_lock);
+ list_add_tail(&dssdev->list, &omapdss_devices_list);
+ mutex_unlock(&omapdss_devices_lock);
+}
+
+void omapdss_device_unregister(struct omap_dss_device *dssdev)
+{
+ mutex_lock(&omapdss_devices_lock);
+ list_del(&dssdev->list);
+ mutex_unlock(&omapdss_devices_lock);
+}
+
+/* -----------------------------------------------------------------------------
+ * Components Handling
+ */
+
+static struct list_head omapdss_comp_list;
+
+struct omapdss_comp_node {
+ struct list_head list;
+ struct device_node *node;
+ bool dss_core_component;
+};
+
static bool omapdss_list_contains(const struct device_node *node)
{
struct omapdss_comp_node *comp;
mutex_lock(&panel_list_mutex);
list_add_tail(&dssdev->panel_list, &panel_list);
mutex_unlock(&panel_list_mutex);
+
+ omapdss_device_register(dssdev);
return 0;
}
EXPORT_SYMBOL(omapdss_register_display);
mutex_lock(&panel_list_mutex);
list_del(&dssdev->panel_list);
mutex_unlock(&panel_list_mutex);
+
+ omapdss_device_register(dssdev);
}
EXPORT_SYMBOL(omapdss_unregister_display);
struct module *owner;
+ struct list_head list;
struct list_head panel_list;
unsigned int alias_id;
int omapdss_register_display(struct omap_dss_device *dssdev);
void omapdss_unregister_display(struct omap_dss_device *dssdev);
+void omapdss_device_register(struct omap_dss_device *dssdev);
+void omapdss_device_unregister(struct omap_dss_device *dssdev);
+
struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev);
void omap_dss_put_device(struct omap_dss_device *dssdev);
#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
int omapdss_register_output(struct omap_dss_device *out)
{
list_add_tail(&out->output_list, &output_list);
+ omapdss_device_register(out);
return 0;
}
EXPORT_SYMBOL(omapdss_register_output);
void omapdss_unregister_output(struct omap_dss_device *out)
{
list_del(&out->output_list);
+ omapdss_device_unregister(out);
}
EXPORT_SYMBOL(omapdss_unregister_output);