]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/video/omapdss.h
OMAPDSS: SDI: Add ops
[karo-tx-linux.git] / include / video / omapdss.h
index 6a699f537a68863a5bb9ec89021235869ca1e7fd..c5935a824ec5ab0d80024e046f1880b310754db0 100644 (file)
@@ -70,6 +70,7 @@ enum omap_display_type {
        OMAP_DISPLAY_TYPE_DSI           = 1 << 3,
        OMAP_DISPLAY_TYPE_VENC          = 1 << 4,
        OMAP_DISPLAY_TYPE_HDMI          = 1 << 5,
+       OMAP_DISPLAY_TYPE_DVI           = 1 << 6,
 };
 
 enum omap_plane {
@@ -515,7 +516,7 @@ struct omap_overlay_manager {
        enum omap_dss_output_id supported_outputs;
 
        /* dynamic fields */
-       struct omap_dss_output *output;
+       struct omap_dss_device *output;
 
        /*
         * The following functions do not block:
@@ -529,7 +530,7 @@ struct omap_overlay_manager {
         */
 
        int (*set_output)(struct omap_overlay_manager *mgr,
-               struct omap_dss_output *output);
+               struct omap_dss_device *output);
        int (*unset_output)(struct omap_overlay_manager *mgr);
 
        int (*set_manager_info)(struct omap_overlay_manager *mgr,
@@ -572,27 +573,42 @@ struct omap_dss_writeback_info {
        u8 pre_mult_alpha;
 };
 
-struct omap_dss_output {
-       struct list_head list;
+struct omapdss_dpi_ops {
+       int (*connect)(struct omap_dss_device *dssdev,
+                       struct omap_dss_device *dst);
+       void (*disconnect)(struct omap_dss_device *dssdev,
+                       struct omap_dss_device *dst);
 
-       const char *name;
+       int (*enable)(struct omap_dss_device *dssdev);
+       void (*disable)(struct omap_dss_device *dssdev);
 
-       /* display type supported by the output */
-       enum omap_display_type type;
+       int (*check_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
+       void (*set_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
+       void (*get_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
 
-       /* DISPC channel for this output */
-       enum omap_channel dispc_channel;
+       void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines);
+};
 
-       /* output instance */
-       enum omap_dss_output_id id;
+struct omapdss_sdi_ops {
+       int (*connect)(struct omap_dss_device *dssdev,
+                       struct omap_dss_device *dst);
+       void (*disconnect)(struct omap_dss_device *dssdev,
+                       struct omap_dss_device *dst);
 
-       /* output's platform device pointer */
-       struct platform_device *pdev;
+       int (*enable)(struct omap_dss_device *dssdev);
+       void (*disable)(struct omap_dss_device *dssdev);
 
-       /* dynamic fields */
-       struct omap_overlay_manager *manager;
+       int (*check_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
+       void (*set_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
+       void (*get_timings)(struct omap_dss_device *dssdev,
+                       struct omap_video_timings *timings);
 
-       struct omap_dss_device *device;
+       void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs);
 };
 
 struct omap_dss_device {
@@ -602,12 +618,15 @@ struct omap_dss_device {
        /* new device, pointer to panel device */
        struct device *dev;
 
+       struct module *owner;
+
        struct list_head panel_list;
 
        /* alias in the form of "display%d" */
        char alias[16];
 
        enum omap_display_type type;
+       enum omap_display_type output_type;
 
        /* obsolete, to be removed */
        enum omap_channel channel;
@@ -628,9 +647,6 @@ struct omap_dss_device {
 
                struct {
                        int module;
-
-                       bool ext_te;
-                       u8 ext_te_gpio;
                } dsi;
 
                struct {
@@ -651,10 +667,6 @@ struct omap_dss_device {
                struct rfbi_timings rfbi_timings;
        } ctrl;
 
-       int reset_gpio;
-
-       int max_backlight_level;
-
        const char *name;
 
        /* used to match device to driver */
@@ -664,22 +676,36 @@ struct omap_dss_device {
 
        struct omap_dss_driver *driver;
 
+       union {
+               const struct omapdss_dpi_ops *dpi;
+               const struct omapdss_sdi_ops *sdi;
+       } ops;
+
        /* helper variable for driver suspend/resume */
        bool activate_after_resume;
 
        enum omap_display_caps caps;
 
-       struct omap_dss_output *output;
+       struct omap_dss_device *output;
 
        enum omap_dss_display_state state;
 
        enum omap_dss_audio_state audio_state;
 
-       /* platform specific  */
-       int (*platform_enable)(struct omap_dss_device *dssdev);
-       void (*platform_disable)(struct omap_dss_device *dssdev);
-       int (*set_backlight)(struct omap_dss_device *dssdev, int level);
-       int (*get_backlight)(struct omap_dss_device *dssdev);
+       /* OMAP DSS output specific fields */
+
+       struct list_head list;
+
+       /* DISPC channel for this output */
+       enum omap_channel dispc_channel;
+
+       /* output instance */
+       enum omap_dss_output_id id;
+
+       /* dynamic fields */
+       struct omap_overlay_manager *manager;
+
+       struct omap_dss_device *device;
 };
 
 struct omap_dss_hdmi_data
@@ -771,7 +797,7 @@ void omap_dss_unregister_driver(struct omap_dss_driver *);
 int omapdss_register_display(struct omap_dss_device *dssdev);
 void omapdss_unregister_display(struct omap_dss_device *dssdev);
 
-void omap_dss_get_device(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)
 struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
@@ -798,14 +824,16 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
 int omap_dss_get_num_overlays(void);
 struct omap_overlay *omap_dss_get_overlay(int num);
 
-struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
-struct omap_dss_output *omap_dss_find_output(const char *name);
-struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node);
-int omapdss_output_set_device(struct omap_dss_output *out,
+int omapdss_register_output(struct omap_dss_device *output);
+void omapdss_unregister_output(struct omap_dss_device *output);
+struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
+struct omap_dss_device *omap_dss_find_output(const char *name);
+struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
+int omapdss_output_set_device(struct omap_dss_device *out,
                struct omap_dss_device *dssdev);
-int omapdss_output_unset_device(struct omap_dss_output *out);
+int omapdss_output_unset_device(struct omap_dss_device *out);
 
-struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
+struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
 struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev);
 
 void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
@@ -909,9 +937,9 @@ void omapdss_compat_uninit(void);
 
 struct dss_mgr_ops {
        int (*connect)(struct omap_overlay_manager *mgr,
-               struct omap_dss_output *dst);
+               struct omap_dss_device *dst);
        void (*disconnect)(struct omap_overlay_manager *mgr,
-               struct omap_dss_output *dst);
+               struct omap_dss_device *dst);
 
        void (*start_update)(struct omap_overlay_manager *mgr);
        int (*enable)(struct omap_overlay_manager *mgr);
@@ -930,9 +958,9 @@ int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
 void dss_uninstall_mgr_ops(void);
 
 int dss_mgr_connect(struct omap_overlay_manager *mgr,
-               struct omap_dss_output *dst);
+               struct omap_dss_device *dst);
 void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
-               struct omap_dss_output *dst);
+               struct omap_dss_device *dst);
 void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
                const struct omap_video_timings *timings);
 void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,