Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 1 | /* |
| 2 | * rcar_du.h -- R-Car Display Unit DRM driver |
| 3 | * |
| 4 | * Copyright (C) 2013 Renesas Corporation |
| 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_H__ |
| 15 | #define __RCAR_DU_H__ |
| 16 | |
| 17 | #include <drm/drm_mode.h> |
| 18 | |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 19 | enum rcar_du_output { |
| 20 | RCAR_DU_OUTPUT_DPAD0, |
| 21 | RCAR_DU_OUTPUT_DPAD1, |
| 22 | RCAR_DU_OUTPUT_LVDS0, |
| 23 | RCAR_DU_OUTPUT_LVDS1, |
| 24 | RCAR_DU_OUTPUT_TCON, |
| 25 | RCAR_DU_OUTPUT_MAX, |
| 26 | }; |
| 27 | |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 28 | enum rcar_du_encoder_type { |
| 29 | RCAR_DU_ENCODER_UNUSED = 0, |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 30 | RCAR_DU_ENCODER_NONE, |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 31 | RCAR_DU_ENCODER_VGA, |
| 32 | RCAR_DU_ENCODER_LVDS, |
| 33 | }; |
| 34 | |
| 35 | struct rcar_du_panel_data { |
| 36 | unsigned int width_mm; /* Panel width in mm */ |
| 37 | unsigned int height_mm; /* Panel height in mm */ |
| 38 | struct drm_mode_modeinfo mode; |
| 39 | }; |
| 40 | |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 41 | struct rcar_du_connector_lvds_data { |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 42 | struct rcar_du_panel_data panel; |
| 43 | }; |
| 44 | |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 45 | struct rcar_du_connector_vga_data { |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 46 | /* TODO: Add DDC information for EDID retrieval */ |
| 47 | }; |
| 48 | |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 49 | /* |
| 50 | * struct rcar_du_encoder_data - Encoder platform data |
| 51 | * @type: the encoder type (RCAR_DU_ENCODER_*) |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 52 | * @output: the DU output the connector is connected to (RCAR_DU_OUTPUT_*) |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 53 | * @connector.lvds: platform data for LVDS connectors |
| 54 | * @connector.vga: platform data for VGA connectors |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 55 | * |
| 56 | * Encoder platform data describes an on-board encoder, its associated DU SoC |
| 57 | * output, and the connector. |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 58 | */ |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 59 | struct rcar_du_encoder_data { |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 60 | enum rcar_du_encoder_type type; |
Laurent Pinchart | ef67a90 | 2013-06-17 03:13:11 +0200 | [diff] [blame] | 61 | enum rcar_du_output output; |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 62 | |
| 63 | union { |
Laurent Pinchart | 9194731 | 2013-06-16 16:25:35 +0200 | [diff] [blame] | 64 | struct rcar_du_connector_lvds_data lvds; |
| 65 | struct rcar_du_connector_vga_data vga; |
| 66 | } connector; |
Laurent Pinchart | 4bf8e19 | 2013-06-19 13:54:11 +0200 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | struct rcar_du_platform_data { |
| 70 | struct rcar_du_encoder_data *encoders; |
| 71 | unsigned int num_encoders; |
| 72 | }; |
| 73 | |
| 74 | #endif /* __RCAR_DU_H__ */ |