Commit b5814fff authored by Russell King's avatar Russell King

drm: bridge/dw_hdmi: introduce interface to setting sample rate

Introduce dw_hdmi_set_sample_rate(), which allows us to configure the
audio sample rate, setting the CTS/N values appropriately.
Tested-by: default avatarYakir Yang <ykk@rock-chips.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent b91eee8c
...@@ -365,6 +365,16 @@ static void hdmi_clk_regenerator_update_pixel_clock(struct dw_hdmi *hdmi) ...@@ -365,6 +365,16 @@ static void hdmi_clk_regenerator_update_pixel_clock(struct dw_hdmi *hdmi)
mutex_unlock(&hdmi->audio_mutex); mutex_unlock(&hdmi->audio_mutex);
} }
void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate)
{
mutex_lock(&hdmi->audio_mutex);
hdmi->sample_rate = rate;
hdmi_set_clk_regenerator(hdmi, hdmi->hdmi_data.video_mode.mpixelclock,
hdmi->sample_rate, hdmi->ratio);
mutex_unlock(&hdmi->audio_mutex);
}
EXPORT_SYMBOL_GPL(dw_hdmi_set_sample_rate);
/* /*
* this submodule is responsible for the video data synchronization. * this submodule is responsible for the video data synchronization.
* for example, for RGB 4:4:4 input, the data map is defined as * for example, for RGB 4:4:4 input, the data map is defined as
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <drm/drmP.h> #include <drm/drmP.h>
struct dw_hdmi;
enum { enum {
DW_HDMI_RES_8, DW_HDMI_RES_8,
DW_HDMI_RES_10, DW_HDMI_RES_10,
...@@ -59,4 +61,7 @@ int dw_hdmi_bind(struct device *dev, struct device *master, ...@@ -59,4 +61,7 @@ int dw_hdmi_bind(struct device *dev, struct device *master,
void *data, struct drm_encoder *encoder, void *data, struct drm_encoder *encoder,
struct resource *iores, int irq, struct resource *iores, int irq,
const struct dw_hdmi_plat_data *plat_data); const struct dw_hdmi_plat_data *plat_data);
void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
#endif /* __IMX_HDMI_H__ */ #endif /* __IMX_HDMI_H__ */
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