static void recalc_vinfo_sync_duration(struct vinfo_s *info, unsigned int frac)
{
struct frac_rate_table *fr = &fr_tab[0];
- struct hdmitx_dev *hdev = &hdmitx_device;
pr_info(SYS "recalc before %s %d %d\n", info->name,
info->sync_duration_num, info->sync_duration_den);
info->sync_duration_num = fr->sync_num_int;
info->sync_duration_den = fr->sync_den_int;
}
-
- if (hdev->chip_type == MESON_CPU_ID_G12A)
- if ((hdev->cur_VIC ==
- HDMI_3840x2160p60_16x9) ||
- (hdev->cur_VIC ==
- HDMI_4096x2160p60_256x135))
- if (hdev->para->cs !=
- COLORSPACE_YUV420) {
- info->sync_duration_num
- = fr->sync_num_int;
- info->sync_duration_den
- = fr->sync_den_int;
- }
break;
}
fr++;
frac_rate = hdev->frac_rate_policy;
para = hdmi_get_fmt_paras(vic);
- if (para && (para->name) && likely_frac_rate_mode(para->name)) {
- if (hdev->chip_type == MESON_CPU_ID_G12A)
- if ((vic == HDMI_3840x2160p60_16x9) ||
- (vic == HDMI_4096x2160p60_256x135))
- if (para->cs != COLORSPACE_YUV420) {
- pr_info("g12a 6GHz doesn't have frac_rate\n");
- frac_rate = 0;
- }
- } else {
+ if (para && (para->name) && likely_frac_rate_mode(para->name))
+ ;
+ else {
pr_info("%s doesn't have frac_rate\n", para->name);
frac_rate = 0;
}
*/
#include <linux/printk.h>
+#include <linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h>
#include "common.h"
#include "mach_reg.h"
static bool set_hpll_hclk_v1(unsigned int m, unsigned int frac_val)
{
int ret = 0;
+ struct hdmitx_dev *hdev = get_hdmitx_device();
hd_write_reg(P_HHI_HDMI_PLL_CNTL0, 0x0b3a0400 | (m & 0xff));
hd_set_reg_bits(P_HHI_HDMI_PLL_CNTL0, 0x3, 28, 2);
hd_write_reg(P_HHI_HDMI_PLL_CNTL1, frac_val);
+ hd_write_reg(P_HHI_HDMI_PLL_CNTL2, 0x00000000);
+
if (frac_val == 0x8148) {
- hd_write_reg(P_HHI_HDMI_PLL_CNTL2, 0x00000000);
- hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a685c00);
- hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x44331290);
+ if (((hdev->para->vic == HDMI_3840x2160p50_16x9) ||
+ (hdev->para->vic == HDMI_3840x2160p60_16x9) ||
+ (hdev->para->vic == HDMI_3840x2160p50_64x27) ||
+ (hdev->para->vic == HDMI_3840x2160p60_64x27)) &&
+ (hdev->para->cs != COLORSPACE_YUV420)) {
+ hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a685c00);
+ hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x11551293);
+ } else {
+ hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a685c00);
+ hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x44331290);
+ }
} else {
- hd_write_reg(P_HHI_HDMI_PLL_CNTL2, 0x00000000);
hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a68dc00);
hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x65771290);
}
case 5940000:
if (set_hpll_hclk_v1(0xf7, frac_rate ? 0x8148 : 0x10000))
break;
- else if (set_hpll_hclk_v2(0x7b, frac_rate ? 0x140b4 : 0x18000))
+ else if (set_hpll_hclk_v2(0x7b, 0x18000))
break;
- else if (set_hpll_hclk_v3(0xf7, frac_rate ? 0x8148 : 0x10000))
+ else if (set_hpll_hclk_v3(0xf7, 0x10000))
break;
else
break;