0001
0002
0003
0004
0005
0006
0007 #ifndef _STI_HDMI_H_
0008 #define _STI_HDMI_H_
0009
0010 #include <linux/hdmi.h>
0011 #include <linux/platform_device.h>
0012
0013 #include <media/cec-notifier.h>
0014
0015 #include <drm/drm_modes.h>
0016 #include <drm/drm_property.h>
0017
0018 #define HDMI_STA 0x0010
0019 #define HDMI_STA_DLL_LCK BIT(5)
0020 #define HDMI_STA_HOT_PLUG BIT(4)
0021
0022 struct sti_hdmi;
0023
0024 struct hdmi_phy_ops {
0025 bool (*start)(struct sti_hdmi *hdmi);
0026 void (*stop)(struct sti_hdmi *hdmi);
0027 };
0028
0029 struct hdmi_audio_params {
0030 bool enabled;
0031 unsigned int sample_width;
0032 unsigned int sample_rate;
0033 struct hdmi_audio_infoframe cea;
0034 };
0035
0036 #define DEFAULT_COLORSPACE_MODE HDMI_COLORSPACE_RGB
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066 struct sti_hdmi {
0067 struct device dev;
0068 struct drm_device *drm_dev;
0069 struct drm_display_mode mode;
0070 void __iomem *regs;
0071 void __iomem *syscfg;
0072 struct clk *clk_pix;
0073 struct clk *clk_tmds;
0074 struct clk *clk_phy;
0075 struct clk *clk_audio;
0076 int irq;
0077 u32 irq_status;
0078 struct hdmi_phy_ops *phy_ops;
0079 bool enabled;
0080 bool hpd;
0081 wait_queue_head_t wait_event;
0082 bool event_received;
0083 struct reset_control *reset;
0084 struct i2c_adapter *ddc_adapt;
0085 enum hdmi_colorspace colorspace;
0086 bool hdmi_monitor;
0087 struct platform_device *audio_pdev;
0088 struct hdmi_audio_params audio;
0089 struct drm_connector *drm_connector;
0090 struct cec_notifier *notifier;
0091 };
0092
0093 u32 hdmi_read(struct sti_hdmi *hdmi, int offset);
0094 void hdmi_write(struct sti_hdmi *hdmi, u32 val, int offset);
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 struct hdmi_phy_config {
0109 u32 min_tmds_freq;
0110 u32 max_tmds_freq;
0111 u32 config[4];
0112 };
0113
0114 #endif