tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
+ atv-demod {
+ compatible = "amlogic, atv-demod";
+ status = "okay";
+ tuner = <&tuner>;
+ btsc_sap_mode = <1>;
+ /* pinctrl-names="atvdemod_agc_pins"; */
+ /* pinctrl-0=<&atvdemod_agc_pins>; */
+ reg = <0xff656000 0x2000 /* demod reg */
+ 0xff63c000 0x2000 /* hiu reg */
+ 0xff634000 0x2000 /* periphs reg */
+ 0xff64a000 0x2000>; /* audio reg */
+ reg_23cf = <0x88188832>;
+ /*default:0x88188832;r840 on haier:0x48188832*/
+ };
+
}; /* end of / */
&i2c0 {
tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
+ atv-demod {
+ compatible = "amlogic, atv-demod";
+ status = "okay";
+ tuner = <&tuner>;
+ btsc_sap_mode = <1>;
+ /* pinctrl-names="atvdemod_agc_pins"; */
+ /* pinctrl-0=<&atvdemod_agc_pins>; */
+ reg = <0xff656000 0x2000 /* demod reg */
+ 0xff63c000 0x2000 /* hiu reg */
+ 0xff634000 0x2000 /* periphs reg */
+ 0xff64a000 0x2000>; /* audio reg */
+ reg_23cf = <0x88188832>;
+ /*default:0x88188832;r840 on haier:0x48188832*/
+ };
+
bt-dev{
compatible = "amlogic, bt-dev";
status = "okay";
tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
+ atv-demod {
+ compatible = "amlogic, atv-demod";
+ status = "okay";
+ tuner = <&tuner>;
+ btsc_sap_mode = <1>;
+ /* pinctrl-names="atvdemod_agc_pins"; */
+ /* pinctrl-0=<&atvdemod_agc_pins>; */
+ reg = <0xff656000 0x2000 /* demod reg */
+ 0xff63c000 0x2000 /* hiu reg */
+ 0xff634000 0x2000 /* periphs reg */
+ 0xff64a000 0x2000>; /* audio reg */
+ reg_23cf = <0x88188832>;
+ /*default:0x88188832;r840 on haier:0x48188832*/
+ };
+
bt-dev{
compatible = "amlogic, bt-dev";
status = "okay";
pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
return 0;
}
+ } else if (is_meson_tl1_cpu()) {
+ amlatvdemod_hiu_reg_read(HHI_GCLK_MPEG0, &ret);
+ if (0 == ((1 << 22) & ret)) {
+ pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
+ return 0;
+ }
} else if (0 == (ADC_EN_ATV_DEMOD & tvafe_adc_get_pll_flag())) {
/* pr_dbg("%s atv demod pll not init\n", __func__); */
return 0;
pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
return 0;
}
+ } else if (is_meson_tl1_cpu()) {
+ amlatvdemod_hiu_reg_read(HHI_GCLK_MPEG0, &ret);
+ if (0 == ((1 << 22) & ret)) {
+ pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
+ return 0;
+ }
} else if (0 == (ADC_EN_ATV_DEMOD & tvafe_adc_get_pll_flag())) {
/* pr_dbg("%s atv demod pll not init\n", __func__); */
return 0;
int atvaudiodem_reg_read(unsigned int reg, unsigned int *val)
{
+#if 0
int ret = 0;
if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
return 0;
}
+ } else if (is_meson_tl1_cpu()) {
+ amlatvdemod_hiu_reg_read(HHI_GCLK_MPEG0, &ret);
+ if (0 == ((1 << 28) & ret)) {
+ pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
+ return 0;
+ }
}
-
+#endif
if (amlatvdemod_devp->audio_reg_base)
*val = readl(amlatvdemod_devp->audio_reg_base + reg);
int atvaudiodem_reg_write(unsigned int reg, unsigned int val)
{
+#if 0
int ret = 0;
if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
return 0;
}
+ } else if (is_meson_tl1_cpu()) {
+ amlatvdemod_hiu_reg_read(HHI_GCLK_MPEG0, &ret);
+ if (0 == ((1 << 28) & ret)) {
+ pr_err("%s GCLK_MPEG0:0x%x\n", __func__, ret);
+ return 0;
+ }
}
+#endif
if (amlatvdemod_devp->audio_reg_base)
writel(val, (amlatvdemod_devp->audio_reg_base + reg));
if (ret)
pr_info("atv init error.\n");
} else if (!strncmp(parm[0], "audout_mode", 11)) {
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu()
+ || is_meson_tl1_cpu()) {
atvauddemod_set_outputmode();
pr_info("atvauddemod_set_outputmode done ....\n");
}
} else if (!strncmp(parm[0], "signal_audmode", 14)) {
int stereo_flag, sap_flag;
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu()
+ || is_meson_tl1_cpu()) {
update_btsc_mode(1, &stereo_flag, &sap_flag);
pr_info("get signal_audmode done ....\n");
}
} else if (!strncmp(parm[0], "clk", 3)) {
adc_set_pll_cntl(1, 0x1, NULL);
atvdemod_clk_init();
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu())
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu()
+ || is_meson_tl1_cpu())
aud_demod_clk_gate(1);
pr_info("atvdemod_clk_init done ....\n");
} else if (!strncmp(parm[0], "tune", 4)) {
pr_info("audio_demod_reg_base = 0x%p.\n",
dev->audio_demod_reg_base);
+ } else if (is_meson_tl1_cpu()) {
+ dev->audio_demod_reg_base = ioremap(
+ round_down(0xff600340, 0x3), 4);
+
+ pr_info("audio_demod_reg_base = 0x%p.\n",
+ dev->audio_demod_reg_base);
}
aml_atvdemod_dt_parse(dev);
audio_thd_det();
if (atvaudio_det_outputmode_en &&
- (is_meson_txlx_cpu() || is_meson_txhd_cpu()))
+ (is_meson_txlx_cpu()
+ || is_meson_txhd_cpu()
+ || is_meson_tl1_cpu()))
atvauddemod_set_outputmode();
if (atvdemod_det_nonstd_en)
atvdemod_clk_init();
/* err_code = atvdemod_init(); */
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu() || is_meson_tl1_cpu()) {
aud_demod_clk_gate(1);
/* atvauddemod_init(); */
}
vdac_enable(0, 1);
adc_set_pll_cntl(0, ADC_EN_ATV_DEMOD, NULL);
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu())
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu() || is_meson_tl1_cpu())
aud_demod_clk_gate(0);
amlatvdemod_devp->std = 0;
case AML_ATVDEMOD_UNSCAN_MODE:
priv->scanning = false;
+ /* No need to enable when exiting the scan,
+ * but enable when actually played.
+ */
+#if 0
if (priv->afc.enable)
priv->afc.enable(&priv->afc);
if (priv->monitor.enable)
priv->monitor.enable(&priv->monitor);
+#endif
break;
}
/*
* set gate clk for btsc and nicam .
*/
- if (is_meson_txhd_cpu())
+ if (is_meson_txhd_cpu() || is_meson_tl1_cpu())
adec_wr_reg(0x28, 0xa);
set_standard(Audio_mode);
W_HIU_BIT(RESET1_REGISTER, 1, 7, 1);
}
#endif
- W_HIU_REG(HHI_ATV_DMD_SYS_CLK_CNTL, 0x80);
+ if (is_meson_tl1_cpu())
+ W_HIU_REG(HHI_ATV_DMD_SYS_CLK_CNTL, 0x1800080);
+ else
+ W_HIU_REG(HHI_ATV_DMD_SYS_CLK_CNTL, 0x80);
/* read_version_register(); */
int atvauddemod_init(void)
{
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu()) {
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu() || is_meson_tl1_cpu()) {
if (audio_thd_en)
audio_thd_init();
if (aud_auto)
aud_std = amlfmt_aud_standard(broad_std);
- /* configure_adec(aud_std); */
- /* adec_soft_reset(); */
+ else {
+ configure_adec(aud_std);
+ adec_soft_reset();
+ }
set_outputmode(aud_std, aud_mode);
} else {
/* for non support adec */
/* 1.set system clock when atv enter*/
pr_err("%s do configure_receiver ...\n", __func__);
- if (is_meson_txlx_cpu() || is_meson_txhd_cpu())
+ if (is_meson_txlx_cpu() || is_meson_txhd_cpu() || is_meson_tl1_cpu())
sound_format = 1;
configure_receiver(broad_std, if_freq, if_inv, gde_curve, sound_format);
pr_err("%s do atv_dmd_misc ...\n", __func__);