]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
drm: platform encoder driver support
authorHyun Kwon <hyun.kwon@xilinx.com>
Tue, 6 May 2014 02:52:33 +0000 (19:52 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 8 May 2014 16:01:19 +0000 (18:01 +0200)
Add struct drm_platform_encoder_driver. This structure can be used for
the encoder slave drivers on a platform bus. The i2c specific assumption
better be removed, and other drm encoder slave interfaces would be updated
to be more generic.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
include/drm/drm_encoder_slave.h

index 8b9cc3671858f9a93430c94f3d1b5e231bf459e4..b088fd8b73ae6950858496c2de29160ac1339521 100644 (file)
@@ -159,6 +159,29 @@ static inline void drm_i2c_encoder_unregister(struct drm_i2c_encoder_driver *dri
 
 void drm_i2c_encoder_destroy(struct drm_encoder *encoder);
 
+/**
+ * struct drm_platform_encoder_driver
+ * @platform_driver: platform device driver
+ * @encoder_init: callback to initialize the slave encoder
+ *
+ * Describes a device driver for an encoder connected to
+ * through a platform bus. In addition to the entry points in @platform_driver
+ * an @encoder_init function should be provided. It will be called to
+ * give the driver an opportunity to allocate any per-encoder data
+ * structures and to initialize the @slave_funcs and (optionally)
+ * @slave_priv members of @encoder.
+ */
+struct drm_platform_encoder_driver {
+       struct platform_driver platform_driver;
+
+       int (*encoder_init)(struct platform_device *pdev,
+                           struct drm_device *dev,
+                           struct drm_encoder_slave *encoder);
+
+};
+#define to_drm_platform_encoder_driver(x) container_of((x), \
+                                                      struct drm_platform_encoder_driver, \
+                                                      platform_driver)
 
 /*
  * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: