aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri@ti.com>2012-03-20 23:02:01 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 08:17:06 -0400
commit35547626f3cc527d5e899bbfbac6b9e373f47aa0 (patch)
tree8b80136667c91e48c601fab95fb24b12361478b4 /drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
parentc1164ed87ea592c2001a0040ffbf9a75cf501d1c (diff)
OMAPDSS: HDMI: Relocate N/CTS calculation
The N and CTS parameters are relevant to all HDMI implementations and not specific to a given IP. Hence, the calculation is relocated into the generic HDMI driver. Also, deep color is not queried but it is still considered in the calculation of N. This is to be changed when deep color functionality is implemented in the driver. Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c')
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index b572101c1d03..6178bdac3842 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -1202,63 +1202,6 @@ void hdmi_core_audio_infoframe_config(struct hdmi_ip_data *ip_data,
1202 */ 1202 */
1203} 1203}
1204 1204
1205int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
1206 u32 sample_freq, u32 *n, u32 *cts)
1207{
1208 u32 r;
1209 u32 deep_color = 0;
1210 u32 pclk = ip_data->cfg.timings.pixel_clock;
1211
1212 if (n == NULL || cts == NULL)
1213 return -EINVAL;
1214 /*
1215 * Obtain current deep color configuration. This needed
1216 * to calculate the TMDS clock based on the pixel clock.
1217 */
1218 r = REG_GET(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, 1, 0);
1219 switch (r) {
1220 case 1: /* No deep color selected */
1221 deep_color = 100;
1222 break;
1223 case 2: /* 10-bit deep color selected */
1224 deep_color = 125;
1225 break;
1226 case 3: /* 12-bit deep color selected */
1227 deep_color = 150;
1228 break;
1229 default:
1230 return -EINVAL;
1231 }
1232
1233 switch (sample_freq) {
1234 case 32000:
1235 if ((deep_color == 125) && ((pclk == 54054)
1236 || (pclk == 74250)))
1237 *n = 8192;
1238 else
1239 *n = 4096;
1240 break;
1241 case 44100:
1242 *n = 6272;
1243 break;
1244 case 48000:
1245 if ((deep_color == 125) && ((pclk == 54054)
1246 || (pclk == 74250)))
1247 *n = 8192;
1248 else
1249 *n = 6144;
1250 break;
1251 default:
1252 *n = 0;
1253 return -EINVAL;
1254 }
1255
1256 /* Calculate CTS. See HDMI 1.3a or 1.4a specifications */
1257 *cts = pclk * (*n / 128) * deep_color / (sample_freq / 10);
1258
1259 return 0;
1260}
1261
1262int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data) 1205int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data)
1263{ 1206{
1264 REG_FLD_MOD(hdmi_wp_base(ip_data), 1207 REG_FLD_MOD(hdmi_wp_base(ip_data),