Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 1 | /* |
| 2 | * rcar_du_encoder.h -- R-Car Display Unit Encoder |
| 3 | * |
Laurent Pinchart | 36d5046 | 2014-02-06 18:13:52 +0100 | [diff] [blame] | 4 | * Copyright (C) 2013-2014 Renesas Electronics Corporation |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 5 | * |
| 6 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __RCAR_DU_ENCODER_H__ |
| 15 | #define __RCAR_DU_ENCODER_H__ |
| 16 | |
| 17 | #include <drm/drm_crtc.h> |
| 18 | |
| 19 | struct rcar_du_device; |
Laurent Pinchart | 637e619 | 2014-03-30 21:55:38 +0200 | [diff] [blame] | 20 | struct rcar_du_hdmienc; |
Laurent Pinchart | 90374b5 | 2013-06-17 13:48:27 +0200 | [diff] [blame] | 21 | struct rcar_du_lvdsenc; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 22 | |
Laurent Pinchart | 2378ad1 | 2014-09-17 02:07:52 +0300 | [diff] [blame] | 23 | enum rcar_du_encoder_type { |
| 24 | RCAR_DU_ENCODER_UNUSED = 0, |
| 25 | RCAR_DU_ENCODER_NONE, |
| 26 | RCAR_DU_ENCODER_VGA, |
| 27 | RCAR_DU_ENCODER_LVDS, |
Laurent Pinchart | 637e619 | 2014-03-30 21:55:38 +0200 | [diff] [blame] | 28 | RCAR_DU_ENCODER_HDMI, |
Laurent Pinchart | 2378ad1 | 2014-09-17 02:07:52 +0300 | [diff] [blame] | 29 | }; |
| 30 | |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 31 | struct rcar_du_encoder { |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 32 | struct drm_encoder base; |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 33 | enum rcar_du_output output; |
Laurent Pinchart | 637e619 | 2014-03-30 21:55:38 +0200 | [diff] [blame] | 34 | struct rcar_du_hdmienc *hdmi; |
Laurent Pinchart | 90374b5 | 2013-06-17 13:48:27 +0200 | [diff] [blame] | 35 | struct rcar_du_lvdsenc *lvds; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | #define to_rcar_encoder(e) \ |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 39 | container_of(e, struct rcar_du_encoder, base) |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 40 | |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 41 | #define rcar_encoder_to_drm_encoder(e) (&(e)->base) |
Laurent Pinchart | 4b96b70 | 2014-03-31 01:50:16 +0200 | [diff] [blame] | 42 | |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 43 | struct rcar_du_connector { |
| 44 | struct drm_connector connector; |
| 45 | struct rcar_du_encoder *encoder; |
| 46 | }; |
| 47 | |
| 48 | #define to_rcar_connector(c) \ |
| 49 | container_of(c, struct rcar_du_connector, connector) |
| 50 | |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 51 | int rcar_du_encoder_init(struct rcar_du_device *rcdu, |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 52 | enum rcar_du_encoder_type type, |
| 53 | enum rcar_du_output output, |
Laurent Pinchart | 3ea4d5e | 2014-09-17 14:41:57 +0300 | [diff] [blame] | 54 | struct device_node *enc_node, |
| 55 | struct device_node *con_node); |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 56 | |
| 57 | #endif /* __RCAR_DU_ENCODER_H__ */ |