static struct xlnx_bridge_helper helper;
+struct videomode;
/*
* Client functions
*/
}
EXPORT_SYMBOL(xlnx_bridge_get_output_fmts);
+/**
+ * xlnx_bridge_set_timing - Set the video timing
+ * @bridge: bridge to set
+ * @vm: Videomode
+ *
+ * Set the video mode so that timing can be generated using this
+ * by the video timing controller.
+ *
+ * Return: 0 on success. -ENOENT if no callback, -EFAULT if in error state,
+ * or return code from callback.
+ */
+int xlnx_bridge_set_timing(struct xlnx_bridge *bridge, struct videomode *vm)
+{
+ if (!bridge)
+ return 0;
+
+ if (helper.error)
+ return -EFAULT;
+
+ if (bridge->set_timing) {
+ bridge->set_timing(bridge, vm);
+ return 0;
+ }
+
+ return -ENOENT;
+}
+EXPORT_SYMBOL(xlnx_bridge_set_timing);
+
/**
* of_xlnx_bridge_get - Get the corresponding Xlnx bridge instance
* @bridge_np: The device node of the bridge device
#ifndef _XLNX_BRIDGE_H_
#define _XLNX_BRIDGE_H_
+struct videomode;
+
struct xlnx_bridge_debugfs_file;
/**
* @get_input_fmts: callback to get supported input formats.
* @set_output: callback to set the output
* @get_output_fmts: callback to get supported output formats.
+ * @set_timing: callback to set timing in connected video timing controller.
* @debugfs_file: for debugfs support
*/
struct xlnx_bridge {
u32 width, u32 height, u32 bus_fmt);
int (*get_output_fmts)(struct xlnx_bridge *bridge,
const u32 **fmts, u32 *count);
+ int (*set_timing)(struct xlnx_bridge *bridge, struct videomode *vm);
struct xlnx_bridge_debugfs_file *debugfs_file;
};
u32 width, u32 height, u32 bus_fmt);
int xlnx_bridge_get_output_fmts(struct xlnx_bridge *bridge,
const u32 **fmts, u32 *count);
+int xlnx_bridge_set_timing(struct xlnx_bridge *bridge, struct videomode *vm);
struct xlnx_bridge *of_xlnx_bridge_get(struct device_node *bridge_np);
void of_xlnx_bridge_put(struct xlnx_bridge *bridge);
return 0;
}
+static int xlnx_bridge_set_timing(struct xlnx_bridge *bridge,
+ struct videomode *vm)
+{
+ if (bridge)
+ return -ENODEV;
+ return 0;
+}
+
static inline struct xlnx_bridge *
of_xlnx_bridge_get(struct device_node *bridge_np)
{