Commit 425f02fd authored by Archit Taneja's avatar Archit Taneja Committed by Tomi Valkeinen

omapdss: HDMI: Use OMAP4 HDMI core functions directly and remove hdmi_ip_ops

After removing wrapper, pll and phy funcs from ti_hdmi_4xxx_ip.c, we are left
with OMAP4 HDMI core functions. Use these directly in hdmi.c rather than using
hdmi_ip_ops. Rename the core functions with a 'hdmi4' suffix.

We used to have hdmi_ip_ops so that one could support HDMI within a TI SoC which
had a non-DSS display subsytem. This however never got put into use, and hence
these ops aren't useful any more.

The DT/hwmod information for hdmi doesn't split the address space according to
the required sub blocks. Keep the address offset and size information in the
driver for now. This will be removed when the driver gets the information
correctly from DT/hwmod.
Signed-off-by: default avatarArchit Taneja <archit@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 5cac5aee
......@@ -789,39 +789,6 @@ static const struct omap_dss_features omap5_dss_features = {
.burst_size_unit = 16,
};
#if defined(CONFIG_OMAP4_DSS_HDMI)
/* HDMI OMAP4 Functions*/
static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
.video_configure = ti_hdmi_4xxx_basic_configure,
.read_edid = ti_hdmi_4xxx_read_edid,
.dump_core = ti_hdmi_4xxx_core_dump,
#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
.audio_start = ti_hdmi_4xxx_audio_start,
.audio_stop = ti_hdmi_4xxx_audio_stop,
.audio_config = ti_hdmi_4xxx_audio_config,
.audio_get_dma_port = ti_hdmi_4xxx_audio_get_dma_port,
#endif
};
void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
enum omapdss_version version)
{
switch (version) {
case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
ip_data->ops = &omap4_hdmi_functions;
break;
default:
ip_data->ops = NULL;
}
WARN_ON(ip_data->ops == NULL);
}
#endif
/* Functions returning values related to a DSS feature */
int dss_feat_get_num_mgrs(void)
{
......
......@@ -20,10 +20,6 @@
#ifndef __OMAP2_DSS_FEATURES_H
#define __OMAP2_DSS_FEATURES_H
#if defined(CONFIG_OMAP4_DSS_HDMI)
#include "ti_hdmi.h"
#endif
#define MAX_DSS_MANAGERS 4
#define MAX_DSS_OVERLAYS 4
#define MAX_DSS_LCD_MANAGERS 3
......@@ -117,8 +113,4 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
bool dss_has_feature(enum dss_feat_id id);
void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
void dss_features_init(enum omapdss_version version);
#if defined(CONFIG_OMAP4_DSS_HDMI)
void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
enum omapdss_version version);
#endif
#endif
......@@ -37,12 +37,10 @@
#include <video/omapdss.h>
#include "ti_hdmi.h"
#include "ti_hdmi_4xxx_ip.h"
#include "dss.h"
#include "dss_features.h"
#define HDMI_CORE_SYS 0x400
#define HDMI_CORE_AV 0x900
/* HDMI EDID Length move this */
#define HDMI_EDID_MAX_LENGTH 256
#define EDID_TIMING_DESCRIPTOR_SIZE 0x12
......@@ -493,7 +491,8 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
goto err_phy_enable;
}
hdmi.ip_data.ops->video_configure(&hdmi.ip_data);
hdmi4_configure(&hdmi.ip_data.core, &hdmi.ip_data.wp,
&hdmi.ip_data.cfg);
/* bypass TV gamma table */
dispc_enable_gamma_table(0);
......@@ -594,7 +593,7 @@ static void hdmi_dump_regs(struct seq_file *s)
hdmi_wp_dump(&hdmi.ip_data.wp, s);
hdmi_pll_dump(&hdmi.ip_data.pll, s);
hdmi_phy_dump(&hdmi.ip_data.phy, s);
hdmi.ip_data.ops->dump_core(&hdmi.ip_data, s);
hdmi4_core_dump(&hdmi.ip_data.core, s);
hdmi_runtime_put();
mutex_unlock(&hdmi.lock);
......@@ -609,7 +608,7 @@ static int read_edid(u8 *buf, int len)
r = hdmi_runtime_get();
BUG_ON(r);
r = hdmi.ip_data.ops->read_edid(&hdmi.ip_data, buf, len);
r = hdmi4_read_edid(&hdmi.ip_data.core, buf, len);
hdmi_runtime_put();
mutex_unlock(&hdmi.lock);
......@@ -813,7 +812,6 @@ static bool hdmi_mode_has_audio(void)
else
return false;
}
#endif
static int hdmi_connect(struct omap_dss_device *dssdev,
......@@ -822,8 +820,6 @@ static int hdmi_connect(struct omap_dss_device *dssdev,
struct omap_overlay_manager *mgr;
int r;
dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version());
r = hdmi_init_regulator();
if (r)
return r;
......@@ -914,12 +910,12 @@ static void hdmi_audio_disable(struct omap_dss_device *dssdev)
static int hdmi_audio_start(struct omap_dss_device *dssdev)
{
return hdmi.ip_data.ops->audio_start(&hdmi.ip_data);
return hdmi4_audio_start(&hdmi.ip_data.core, &hdmi.ip_data.wp);
}
static void hdmi_audio_stop(struct omap_dss_device *dssdev)
{
hdmi.ip_data.ops->audio_stop(&hdmi.ip_data);
hdmi4_audio_stop(&hdmi.ip_data.core, &hdmi.ip_data.wp);
}
static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
......@@ -946,7 +942,7 @@ static int hdmi_audio_config(struct omap_dss_device *dssdev,
goto err;
}
r = hdmi.ip_data.ops->audio_config(&hdmi.ip_data, audio);
r = hdmi4_audio_config(&hdmi.ip_data.core, &hdmi.ip_data.wp, audio);
if (r)
goto err;
......@@ -1053,6 +1049,10 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
if (r)
return r;
r = hdmi4_core_init(pdev, &hdmi.ip_data.core);
if (r)
return r;
r = hdmi_get_clocks(pdev);
if (r) {
DSSERR("can't get clocks\n");
......@@ -1061,9 +1061,6 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
hdmi.ip_data.core_sys_offset = HDMI_CORE_SYS;
hdmi.ip_data.core_av_offset = HDMI_CORE_AV;
hdmi_init_output(pdev);
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
......
......@@ -145,27 +145,6 @@ struct hdmi_audio_dma {
u16 fifo_threshold;
};
struct ti_hdmi_ip_ops {
void (*video_configure)(struct hdmi_ip_data *ip_data);
int (*read_edid)(struct hdmi_ip_data *ip_data, u8 *edid, int len);
void (*dump_core)(struct hdmi_ip_data *ip_data, struct seq_file *s);
#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
int (*audio_start)(struct hdmi_ip_data *ip_data);
void (*audio_stop)(struct hdmi_ip_data *ip_data);
int (*audio_config)(struct hdmi_ip_data *ip_data,
struct omap_dss_audio *audio);
int (*audio_get_dma_port)(u32 *offset, u32 *size);
#endif
};
/*
* Refer to section 8.2 in HDMI 1.3 specification for
* details about infoframe databytes
......@@ -223,17 +202,19 @@ struct hdmi_phy_data {
int irq;
};
struct hdmi_core_data {
void __iomem *base;
struct hdmi_core_infoframe_avi avi_cfg;
};
struct hdmi_ip_data {
struct hdmi_wp_data wp;
struct hdmi_pll_data pll;
struct hdmi_phy_data phy;
struct hdmi_core_data core;
unsigned long core_sys_offset;
unsigned long core_av_offset;
const struct ti_hdmi_ip_ops *ops;
struct hdmi_config cfg;
struct hdmi_core_infoframe_avi avi_cfg;
/* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
struct mutex lock;
......@@ -273,9 +254,6 @@ void hdmi_phy_disable(struct hdmi_phy_data *phy, struct hdmi_wp_data *wp);
void hdmi_phy_dump(struct hdmi_phy_data *phy, struct seq_file *s);
int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy);
int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, u8 *edid, int len);
void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts);
int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable);
......@@ -284,10 +262,5 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
struct hdmi_audio_format *aud_fmt);
void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
struct hdmi_audio_dma *aud_dma);
int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_audio_stop(struct hdmi_ip_data *ip_data);
int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data,
struct omap_dss_audio *audio);
int ti_hdmi_4xxx_audio_get_dma_port(u32 *offset, u32 *size);
#endif
#endif
This diff is collapsed.
......@@ -400,4 +400,18 @@ struct hdmi_core_audio_config {
bool en_spdif;
};
int hdmi4_read_edid(struct hdmi_core_data *core, u8 *edid, int len);
void hdmi4_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
struct hdmi_config *cfg);
void hdmi4_core_dump(struct hdmi_core_data *core, struct seq_file *s);
int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
int hdmi4_audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
struct omap_dss_audio *audio);
int hdmi4_audio_get_dma_port(u32 *offset, u32 *size);
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment