Commit 85d0c4b5 authored by Thierry Reding's avatar Thierry Reding

drm/tegra: sor: Introduce audio enable/disable callbacks

In order to support different modes (DP in addition to HDMI), split out
the audio setup/teardown into callbacks.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent a9087cf2
...@@ -398,6 +398,8 @@ struct tegra_sor_ops { ...@@ -398,6 +398,8 @@ struct tegra_sor_ops {
const char *name; const char *name;
int (*probe)(struct tegra_sor *sor); int (*probe)(struct tegra_sor *sor);
int (*remove)(struct tegra_sor *sor); int (*remove)(struct tegra_sor *sor);
void (*audio_enable)(struct tegra_sor *sor);
void (*audio_disable)(struct tegra_sor *sor);
}; };
struct tegra_sor { struct tegra_sor {
...@@ -3008,6 +3010,8 @@ static const struct tegra_sor_ops tegra_sor_hdmi_ops = { ...@@ -3008,6 +3010,8 @@ static const struct tegra_sor_ops tegra_sor_hdmi_ops = {
.name = "HDMI", .name = "HDMI",
.probe = tegra_sor_hdmi_probe, .probe = tegra_sor_hdmi_probe,
.remove = tegra_sor_hdmi_remove, .remove = tegra_sor_hdmi_remove,
.audio_enable = tegra_sor_hdmi_audio_enable,
.audio_disable = tegra_sor_hdmi_audio_disable,
}; };
static int tegra_sor_dp_probe(struct tegra_sor *sor) static int tegra_sor_dp_probe(struct tegra_sor *sor)
...@@ -3616,9 +3620,11 @@ static irqreturn_t tegra_sor_irq(int irq, void *data) ...@@ -3616,9 +3620,11 @@ static irqreturn_t tegra_sor_irq(int irq, void *data)
tegra_hda_parse_format(format, &sor->format); tegra_hda_parse_format(format, &sor->format);
tegra_sor_hdmi_audio_enable(sor); if (sor->ops->audio_enable)
sor->ops->audio_enable(sor);
} else { } else {
tegra_sor_hdmi_audio_disable(sor); if (sor->ops->audio_disable)
sor->ops->audio_disable(sor);
} }
} }
......
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