diff options
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi/hdmi.c')
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 9d00dcba6959..e5af4b45d0b6 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -251,11 +251,17 @@ fail: #include <linux/of_gpio.h> +// this is still needed on downstream kernel for now just for +// hdmi_msm_audio_info_setup() / hdmi_msm_audio_sample_rate_reset.. +// TODO sane interface between audio and display.. +struct platform_device *hdmi_pdev_hack; + static void set_hdmi_pdev(struct drm_device *dev, struct platform_device *pdev) { struct msm_drm_private *priv = dev->dev_private; priv->hdmi_pdev = pdev; + hdmi_pdev_hack = pdev; } #ifdef CONFIG_OF @@ -395,6 +401,34 @@ static int hdmi_dev_remove(struct platform_device *pdev) return 0; } +static struct hdmi *find_hdmi(void) +{ + return hdmi_pdev_hack ? platform_get_drvdata(hdmi_pdev_hack) : NULL; +} + +int hdmi_msm_audio_info_setup(bool enabled, u32 num_of_channels, + u32 channel_allocation, u32 level_shift, bool down_mix) +{ + struct hdmi *hdmi = find_hdmi(); + printk("DEBUG::: %s \n", __func__); + if (!hdmi) + return -EINVAL; + printk("DEBUG:::1 %s \n", __func__); + return hdmi_audio_info_setup(hdmi, enabled, num_of_channels, + channel_allocation, level_shift, down_mix); +} +EXPORT_SYMBOL(hdmi_msm_audio_info_setup); + +void hdmi_msm_audio_sample_rate_reset(int rate) +{ + struct hdmi *hdmi = find_hdmi(); + if (!hdmi) + return; + printk("DEBUG::: %s \n", __func__); + hdmi_audio_set_sample_rate(hdmi, rate); +} +EXPORT_SYMBOL(hdmi_msm_audio_sample_rate_reset); + static const struct of_device_id dt_match[] = { { .compatible = "qcom,hdmi-tx-8074" }, { .compatible = "qcom,hdmi-tx-8960" }, |