blob: 1a2e9901a22eb4d5d14b52b56057b84d4bd19820 [file] [log] [blame]
Laurent Pinchart4bf8e192013-06-19 13:54:11 +02001/*
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 Pinchartef67a902013-06-17 03:13:11 +020019enum 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 Pinchart4bf8e192013-06-19 13:54:11 +020028enum rcar_du_encoder_type {
29 RCAR_DU_ENCODER_UNUSED = 0,
Laurent Pinchartef67a902013-06-17 03:13:11 +020030 RCAR_DU_ENCODER_NONE,
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020031 RCAR_DU_ENCODER_VGA,
32 RCAR_DU_ENCODER_LVDS,
33};
34
35struct 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 Pinchart91947312013-06-16 16:25:35 +020041struct rcar_du_connector_lvds_data {
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020042 struct rcar_du_panel_data panel;
43};
44
Laurent Pinchart91947312013-06-16 16:25:35 +020045struct rcar_du_connector_vga_data {
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020046 /* TODO: Add DDC information for EDID retrieval */
47};
48
Laurent Pinchart91947312013-06-16 16:25:35 +020049/*
50 * struct rcar_du_encoder_data - Encoder platform data
51 * @type: the encoder type (RCAR_DU_ENCODER_*)
Laurent Pinchartef67a902013-06-17 03:13:11 +020052 * @output: the DU output the connector is connected to (RCAR_DU_OUTPUT_*)
Laurent Pinchart91947312013-06-16 16:25:35 +020053 * @connector.lvds: platform data for LVDS connectors
54 * @connector.vga: platform data for VGA connectors
Laurent Pinchartef67a902013-06-17 03:13:11 +020055 *
56 * Encoder platform data describes an on-board encoder, its associated DU SoC
57 * output, and the connector.
Laurent Pinchart91947312013-06-16 16:25:35 +020058 */
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020059struct rcar_du_encoder_data {
Laurent Pinchart91947312013-06-16 16:25:35 +020060 enum rcar_du_encoder_type type;
Laurent Pinchartef67a902013-06-17 03:13:11 +020061 enum rcar_du_output output;
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020062
63 union {
Laurent Pinchart91947312013-06-16 16:25:35 +020064 struct rcar_du_connector_lvds_data lvds;
65 struct rcar_du_connector_vga_data vga;
66 } connector;
Laurent Pinchart4bf8e192013-06-19 13:54:11 +020067};
68
69struct rcar_du_platform_data {
70 struct rcar_du_encoder_data *encoders;
71 unsigned int num_encoders;
72};
73
74#endif /* __RCAR_DU_H__ */