blob: 5422fa4df2727518356e66825d86321f119ff445 [file] [log] [blame]
Laurent Pinchart6978f122013-06-15 15:02:12 +02001/*
2 * rcar_du_encoder.h -- R-Car Display Unit Encoder
3 *
Laurent Pinchart36d50462014-02-06 18:13:52 +01004 * Copyright (C) 2013-2014 Renesas Electronics Corporation
Laurent Pinchart6978f122013-06-15 15:02:12 +02005 *
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 Pinchart93382032016-11-28 20:51:09 +020018#include <drm/drm_encoder.h>
Laurent Pinchart6978f122013-06-15 15:02:12 +020019
Laurent Pinchartbf7149f2016-11-18 03:22:37 +020020struct drm_panel;
Laurent Pinchart6978f122013-06-15 15:02:12 +020021struct rcar_du_device;
Laurent Pinchart90374b52013-06-17 13:48:27 +020022struct rcar_du_lvdsenc;
Laurent Pinchart6978f122013-06-15 15:02:12 +020023
24struct rcar_du_encoder {
Archit Taneja1d926112016-07-18 08:44:04 +053025 struct drm_encoder base;
Laurent Pinchartef67a902013-06-17 03:13:11 +020026 enum rcar_du_output output;
Laurent Pinchartbf7149f2016-11-18 03:22:37 +020027 struct rcar_du_connector *connector;
Laurent Pinchart90374b52013-06-17 13:48:27 +020028 struct rcar_du_lvdsenc *lvds;
Laurent Pinchart6978f122013-06-15 15:02:12 +020029};
30
31#define to_rcar_encoder(e) \
Archit Taneja1d926112016-07-18 08:44:04 +053032 container_of(e, struct rcar_du_encoder, base)
Laurent Pinchart6978f122013-06-15 15:02:12 +020033
Archit Taneja1d926112016-07-18 08:44:04 +053034#define rcar_encoder_to_drm_encoder(e) (&(e)->base)
Laurent Pinchart4b96b702014-03-31 01:50:16 +020035
Laurent Pinchart6978f122013-06-15 15:02:12 +020036struct rcar_du_connector {
37 struct drm_connector connector;
38 struct rcar_du_encoder *encoder;
Laurent Pinchartbf7149f2016-11-18 03:22:37 +020039 struct drm_panel *panel;
Laurent Pinchart6978f122013-06-15 15:02:12 +020040};
41
42#define to_rcar_connector(c) \
43 container_of(c, struct rcar_du_connector, connector)
44
Laurent Pinchart6978f122013-06-15 15:02:12 +020045int rcar_du_encoder_init(struct rcar_du_device *rcdu,
Laurent Pinchartef67a902013-06-17 03:13:11 +020046 enum rcar_du_output output,
Laurent Pinchart3ea4d5e2014-09-17 14:41:57 +030047 struct device_node *enc_node,
48 struct device_node *con_node);
Laurent Pinchart6978f122013-06-15 15:02:12 +020049
50#endif /* __RCAR_DU_ENCODER_H__ */