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> |
Laurent Pinchart | 9338203 | 2016-11-28 20:51:09 +0200 | [diff] [blame] | 18 | #include <drm/drm_encoder.h> |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 19 | |
Laurent Pinchart | bf7149f | 2016-11-18 03:22:37 +0200 | [diff] [blame] | 20 | struct drm_panel; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 21 | struct rcar_du_device; |
Laurent Pinchart | 90374b5 | 2013-06-17 13:48:27 +0200 | [diff] [blame] | 22 | struct rcar_du_lvdsenc; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 23 | |
| 24 | struct rcar_du_encoder { |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 25 | struct drm_encoder base; |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 26 | enum rcar_du_output output; |
Laurent Pinchart | bf7149f | 2016-11-18 03:22:37 +0200 | [diff] [blame] | 27 | struct rcar_du_connector *connector; |
Laurent Pinchart | 90374b5 | 2013-06-17 13:48:27 +0200 | [diff] [blame] | 28 | struct rcar_du_lvdsenc *lvds; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | #define to_rcar_encoder(e) \ |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 32 | container_of(e, struct rcar_du_encoder, base) |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 33 | |
Archit Taneja | 1d92611 | 2016-07-18 08:44:04 +0530 | [diff] [blame] | 34 | #define rcar_encoder_to_drm_encoder(e) (&(e)->base) |
Laurent Pinchart | 4b96b70 | 2014-03-31 01:50:16 +0200 | [diff] [blame] | 35 | |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 36 | struct rcar_du_connector { |
| 37 | struct drm_connector connector; |
| 38 | struct rcar_du_encoder *encoder; |
Laurent Pinchart | bf7149f | 2016-11-18 03:22:37 +0200 | [diff] [blame] | 39 | struct drm_panel *panel; |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | #define to_rcar_connector(c) \ |
| 43 | container_of(c, struct rcar_du_connector, connector) |
| 44 | |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 45 | int rcar_du_encoder_init(struct rcar_du_device *rcdu, |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 46 | enum rcar_du_output output, |
Laurent Pinchart | 3ea4d5e | 2014-09-17 14:41:57 +0300 | [diff] [blame] | 47 | struct device_node *enc_node, |
| 48 | struct device_node *con_node); |
Laurent Pinchart | 6978f12 | 2013-06-15 15:02:12 +0200 | [diff] [blame] | 49 | |
| 50 | #endif /* __RCAR_DU_ENCODER_H__ */ |