tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(3)
*/
- tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(3)
*/
- tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <38>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(3)
*/
- tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <0>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <0>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <0>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <0>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <38>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <38>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "disabled";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <38>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c0>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c0>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(3)
*/
- tuner_xtal_cap = <25>; /* when tuner_xtal_mode = 3, set 25 */
+ tuner_xtal_cap_0 = <25>; /* when tuner_xtal_mode = 3, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <0>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <0>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <3>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <0>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <0>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <38>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "r842_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0xf6>;
- tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "r842_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0xf6>;
+ tuner_xtal_0 = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)
* SLAVE_XTAL_OUT(3)
*/
- tuner_xtal_cap = <38>; /* 0 ~ 41 (pf) */
+ tuner_xtal_cap_0 = <38>; /* 0 ~ 41 (pf) */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "si2151_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- /* tuner_xtal = <0>; */ /* unuse for si2151 */
- /* tuner_xtal_mode = <0>; */
- /* tuner_xtal_cap = <0>; */
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "si2151_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ /* tuner_xtal_0 = <0>; */ /* unuse for si2151 */
+ /* tuner_xtal_mode_0 = <0>; */
+ /* tuner_xtal_cap_0 = <0>; */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "okay";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
tuner: tuner {
compatible = "amlogic, tuner";
status = "disabled";
- tuner_name = "mxl661_tuner";
- tuner_i2c_adap = <&i2c1>;
- tuner_i2c_addr = <0x60>;
- tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
- tuner_xtal_mode = <0>;
+ tuner_cur = <0>; /* default use tuner */
+ tuner_num = <1>; /* tuner number, multi tuner support */
+ tuner_name_0 = "mxl661_tuner";
+ tuner_i2c_adap_0 = <&i2c1>;
+ tuner_i2c_addr_0 = <0x60>;
+ tuner_xtal_0 = <0>; /* 0: 16MHz, 1: 24MHz */
+ tuner_xtal_mode_0 = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
- tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
+ tuner_xtal_cap_0 = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {
#include "atvauddemod_func.h"
-#define AMLATVDEMOD_VER "V2.08"
+#define AMLATVDEMOD_VER "V2.09"
struct aml_atvdemod_device *amlatvdemod_devp;
unsigned long tmp = 0, data = 0;
struct aml_atvdemod_device *dev =
container_of(class, struct aml_atvdemod_device, cls);
- struct atv_demod_priv *priv = dev->v4l2_fe.fe.analog_demod_priv;
+ /*struct atv_demod_priv *priv = dev->v4l2_fe.fe.analog_demod_priv;*/
buf_orig = kstrdup(buf, GFP_KERNEL);
ps = buf_orig;
if (parm[0] == NULL)
goto EXIT;
-
+#if 0
if (priv->state != ATVDEMOD_STATE_WORK) {
pr_info("atvdemod_state not work ....\n");
goto EXIT;
}
+#endif
if (!strncmp(parm[0], "init", 4)) {
ret = atv_demod_enter_mode(&dev->v4l2_fe.fe);
struct analog_parameters params;
struct v4l2_analog_parameters *p = NULL;
unsigned int std = 0;
+ unsigned int freq = 0;
fe = &dev->v4l2_fe.fe;
p = &dev->v4l2_fe.params;
else
std = p->std;
- params.frequency = p->frequency;
+ if (parm[2] && kstrtoul(parm[2], 0, &tmp) == 0)
+ freq = tmp;
+ else
+ freq = p->frequency;
+
+ params.frequency = freq;
params.mode = p->afc_range;
params.audmode = p->audmode;
params.std = std;
v4l2_std_to_str((0xffffff & dev->std)));
pr_info("[atvdemod] audmode: 0x%x\n", dev->audmode);
pr_info("[atvdemod] flag: %d\n", p->flag);
- pr_info("[atvdemod] tuner_id: %d\n", dev->tuner_id);
+ pr_info("[atvdemod] tuner_cur: %d\n", dev->tuner_cur);
+ pr_info("[atvdemod] tuner_id: %d\n",
+ dev->tuners[dev->tuner_cur].cfg.id);
pr_info("[atvdemod] if_freq: %d\n", dev->if_freq);
pr_info("[atvdemod] if_inv: %d\n", dev->if_inv);
pr_info("[atvdemod] fre_offset: %d\n", dev->fre_offset);
pr_info("[atvdemod] version: %s.\n", AMLATVDEMOD_VER);
+ } else if (!strncmp(parm[0], "attach_tuner", 12)) {
+ int tuner_id = 0;
+
+ if (parm[1] && kstrtoul(parm[1], 10, &tmp) == 0) {
+ val = tmp;
+
+ for (i = 0; i < dev->tuner_num; ++i) {
+ if (dev->tuners[i].cfg.id == val) {
+ tuner_id = dev->tuners[i].cfg.id;
+ break;
+ }
+ }
+
+ if (tuner_id == 0 || dev->tuner_cur == i) {
+ pr_err("%s: set nonsupport or the same tuner %d.\n",
+ __func__, val);
+ goto EXIT;
+ }
+
+ dev->tuner_cur = i;
+
+ ret = aml_attach_tuner(dev);
+ if (ret)
+ pr_info("attach_tuner error.\n");
+ else
+ pr_info("attach_tuner %d done.\n", tuner_id);
+ }
} else
pr_dbg("invalid command\n");
struct device_node *node_i2c = NULL;
unsigned int val = 0;
const char *str = NULL;
+ char buf[20] = { 0 };
int ret = 0;
+ int i = 0;
node = pdev->dev->of_node;
if (node == NULL) {
pdev->agc_pin = NULL;
pr_err("can't find agc pinmux.\n");
} else {
- pr_err("atvdemod agc pinmux name: %s\n",
- pdev->pin_name);
+ pr_err("atvdemod agc pinmux name: %s\n", pdev->pin_name);
}
ret = of_property_read_u32(node, "btsc_sap_mode", &val);
/* get tuner config node */
node_tuner = of_parse_phandle(node, "tuner", 0);
- if (node_tuner) {
- ret = of_property_read_string(node_tuner, "tuner_name", &str);
- if (ret)
- pr_err("can't find tuner.\n");
+ if (!node_tuner) {
+ pr_err("can't find tuner node.\n");
+ return;
+ }
+
+ ret = of_property_read_u32(node_tuner, "tuner_num", &val);
+ if (ret == 0)
+ pdev->tuner_num = val;
+ else {
+ pr_err("can't find tuner_num.\n");
+ return;
+ }
+
+ pdev->tuners = kcalloc(pdev->tuner_num, sizeof(struct aml_tuner),
+ GFP_KERNEL);
+ if (!pdev->tuners) {
+ /* pr_err("can't kcalloc for tuners.\n"); */
+ return;
+ }
+
+ ret = of_property_read_u32(node_tuner, "tuner_cur", &val);
+ if (ret) {
+ pr_err("can't find tuner_cur, use default 0.\n");
+ pdev->tuner_cur = -1;
+ } else
+ pdev->tuner_cur = val;
+
+ for (i = 0; i < pdev->tuner_num; ++i) {
+ snprintf(buf, sizeof(buf), "tuner_name_%d", i);
+ ret = of_property_read_string(node_tuner, buf, &str);
+ if (ret) {
+ pr_err("can't find tuner %d.\n", i);
+ continue;
+ }
+
+ if (!strncmp(str, "mxl661_tuner", 12))
+ pdev->tuners[i].cfg.id = AM_TUNER_MXL661;
+ else if (!strncmp(str, "si2151_tuner", 12))
+ pdev->tuners[i].cfg.id = AM_TUNER_SI2151;
+ else if (!strncmp(str, "si2159_tuner", 12))
+ pdev->tuners[i].cfg.id = AM_TUNER_SI2159;
+ else if (!strncmp(str, "r840_tuner", 10))
+ pdev->tuners[i].cfg.id = AM_TUNER_R840;
+ else if (!strncmp(str, "r842_tuner", 10))
+ pdev->tuners[i].cfg.id = AM_TUNER_R842;
else {
- if (!strncmp(str, "mxl661_tuner", 12))
- pdev->tuner_id = AM_TUNER_MXL661;
- else if (!strncmp(str, "si2151_tuner", 12))
- pdev->tuner_id = AM_TUNER_SI2151;
- else if (!strncmp(str, "si2159_tuner", 12))
- pdev->tuner_id = AM_TUNER_SI2159;
- else if (!strncmp(str, "r840_tuner", 10))
- pdev->tuner_id = AM_TUNER_R840;
- else if (!strncmp(str, "r842_tuner", 10))
- pdev->tuner_id = AM_TUNER_R842;
- else
- pr_err("nonsupport tuner: %s.\n", str);
+ pr_err("can't support tuner: %s.\n", str);
+ pdev->tuners[i].cfg.id = AM_TUNER_NONE;
}
- node_i2c = of_parse_phandle(node_tuner, "tuner_i2c_adap", 0);
+ snprintf(buf, sizeof(buf), "tuner_i2c_adap_%d", i);
+ node_i2c = of_parse_phandle(node_tuner, buf, 0);
if (node_i2c) {
- pdev->i2c_adp = of_find_i2c_adapter_by_node(node_i2c);
+ pdev->tuners[i].i2c_adp =
+ of_find_i2c_adapter_by_node(node_i2c);
of_node_put(node_i2c);
- if (!pdev->i2c_adp)
+ if (!pdev->tuners[i].i2c_adp)
pr_err("can't find tuner_i2c_adap.\n");
}
- ret = of_property_read_u32(node_tuner, "tuner_i2c_addr", &val);
+ snprintf(buf, sizeof(buf), "tuner_i2c_addr_%d", i);
+ ret = of_property_read_u32(node_tuner, buf, &val);
if (ret)
pr_err("can't find tuner_i2c_addr.\n");
else
- pdev->i2c_addr = val;
+ pdev->tuners[i].cfg.i2c_addr = val;
- ret = of_property_read_u32(node_tuner, "tuner_xtal", &val);
+ snprintf(buf, sizeof(buf), "tuner_xtal_%d", i);
+ ret = of_property_read_u32(node_tuner, buf, &val);
if (ret)
pr_err("can't find tuner_xtal.\n");
else
- pdev->tuner_xtal = val;
+ pdev->tuners[i].cfg.xtal = val;
- ret = of_property_read_u32(node_tuner, "tuner_xtal_mode", &val);
+ snprintf(buf, sizeof(buf), "tuner_xtal_mode_%d", i);
+ ret = of_property_read_u32(node_tuner, buf, &val);
if (ret)
pr_err("can't find tuner_xtal_mode.\n");
else
- pdev->tuner_xtal_mode = val;
+ pdev->tuners[i].cfg.xtal_mode = val;
- ret = of_property_read_u32(node_tuner, "tuner_xtal_cap", &val);
+ snprintf(buf, sizeof(buf), "tuner_xtal_cap_%d", i);
+ ret = of_property_read_u32(node_tuner, buf, &val);
if (ret)
pr_err("can't find tuner_xtal_cap.\n");
else
- pdev->tuner_xtal_cap = val;
+ pdev->tuners[i].cfg.xtal_cap = val;
- of_node_put(node_tuner);
+ pr_err("find tuner %d.\n", i);
}
+
+ of_node_put(node_tuner);
}
-int aml_attach_demod_tuner(struct aml_atvdemod_device *dev)
+int aml_attach_demod(struct aml_atvdemod_device *dev)
{
void *p = NULL;
struct v4l2_frontend *v4l2_fe = &dev->v4l2_fe;
struct dvb_frontend *fe = &v4l2_fe->fe;
- struct tuner_config cfg = { 0 };
- if (!dev->analog_attached) {
- p = v4l2_attach(aml_atvdemod_attach, fe, v4l2_fe,
- dev->i2c_adp, dev->i2c_addr, dev->tuner_id);
- if (p != NULL)
- dev->analog_attached = true;
- else {
- pr_err("%s: attach demod error.\n", __func__);
- return -1;
- }
+ if (dev->tuner_cur < 0) {
+ pr_err("%s: dev->tuner_cur [%d] error.\n",
+ __func__, dev->tuner_cur);
+ return -1;
}
- p = NULL;
+ p = v4l2_attach(aml_atvdemod_attach, fe, v4l2_fe,
+ dev->tuners[dev->tuner_cur].i2c_adp,
+ dev->tuners[dev->tuner_cur].cfg.i2c_addr,
+ dev->tuners[dev->tuner_cur].cfg.id);
+ if (p != NULL)
+ dev->analog_attached = true;
+ else {
+ pr_err("%s: attach demod error.\n", __func__);
+ return -1;
+ }
- cfg.id = dev->tuner_id;
- cfg.i2c_addr = dev->i2c_addr;
- cfg.xtal = dev->tuner_xtal;
- cfg.xtal_mode = dev->tuner_xtal_mode;
- cfg.xtal_cap = dev->tuner_xtal_cap;
+ return 0;
+}
- if (!dev->tuner_attached) {
- switch (dev->tuner_id) {
- case AM_TUNER_R840:
- p = v4l2_attach(r840_attach, fe,
- dev->i2c_adp, &cfg);
- break;
- case AM_TUNER_R842:
- p = v4l2_attach(r842_attach, fe,
- dev->i2c_adp, &cfg);
- break;
- case AM_TUNER_SI2151:
- p = v4l2_attach(si2151_attach, fe,
- dev->i2c_adp, &cfg);
- break;
- case AM_TUNER_SI2159:
- p = v4l2_attach(si2159_attach, fe,
- dev->i2c_adp, &cfg);
- break;
- case AM_TUNER_MXL661:
- p = v4l2_attach(mxl661_attach, fe,
- dev->i2c_adp, &cfg);
- break;
- }
+int aml_attach_tuner(struct aml_atvdemod_device *dev)
+{
+ void *p = NULL;
+ struct v4l2_frontend *v4l2_fe = &dev->v4l2_fe;
+ struct dvb_frontend *fe = &v4l2_fe->fe;
+ struct tuner_config *cfg = NULL;
- if (p != NULL)
- dev->tuner_attached = true;
- else {
- pr_err("%s: attach tuner [%d] error.\n",
- __func__, dev->tuner_id);
- return -1;
- }
+ if (dev->tuner_cur < 0) {
+ pr_err("%s: dev->tuner_cur [%d] error.\n",
+ __func__, dev->tuner_cur);
+ return -1;
+ }
+
+ cfg = &dev->tuners[dev->tuner_cur].cfg;
+
+ switch (cfg->id) {
+ case AM_TUNER_R840:
+ p = v4l2_attach(r840_attach, fe,
+ dev->tuners[dev->tuner_cur].i2c_adp, cfg);
+ break;
+ case AM_TUNER_R842:
+ p = v4l2_attach(r842_attach, fe,
+ dev->tuners[dev->tuner_cur].i2c_adp, cfg);
+ break;
+ case AM_TUNER_SI2151:
+ p = v4l2_attach(si2151_attach, fe,
+ dev->tuners[dev->tuner_cur].i2c_adp, cfg);
+ break;
+ case AM_TUNER_SI2159:
+ p = v4l2_attach(si2159_attach, fe,
+ dev->tuners[dev->tuner_cur].i2c_adp, cfg);
+ break;
+ case AM_TUNER_MXL661:
+ p = v4l2_attach(mxl661_attach, fe,
+ dev->tuners[dev->tuner_cur].i2c_adp, cfg);
+ break;
+ default:
+ pr_err("%s: Nonsupport tuner [%d].\n", __func__, cfg->id);
+ break;
+ }
+
+ if (p != NULL) {
+ dev->tuner_attached = true;
+ v4l2_fe->tuner_id = cfg->id;
+ v4l2_fe->i2c.addr = cfg->i2c_addr;
+ v4l2_fe->i2c.adapter = dev->tuners[dev->tuner_cur].i2c_adp;
+ } else {
+ pr_err("%s: attach tuner [%d] error.\n", __func__, cfg->id);
+ return -1;
}
return 0;
aml_atvdemod_dt_parse(dev);
- aml_attach_demod_tuner(dev);
+ aml_attach_demod(dev);
+ aml_attach_tuner(dev);
dev->v4l2_fe.dev = dev->dev;
- dev->v4l2_fe.tuner_id = dev->tuner_id;
- dev->v4l2_fe.i2c.addr = dev->i2c_addr;
- dev->v4l2_fe.i2c.adapter = dev->i2c_adp;
+
ret = v4l2_resister_frontend(&dev->v4l2_fe);
if (ret < 0) {
pr_err("resister v4l2 fail.\n");
fail_get_resource:
class_unregister(&dev->cls);
fail_class_register:
+ kfree(dev->tuners);
kfree(dev);
pr_info("%s: fail.\n", __func__);
amlatvdemod_devp = NULL;
+ kfree(dev->tuners);
kfree(dev);
pr_info("%s: OK.\n", __func__);
unsigned int reserved;
};
+struct aml_tuner {
+ struct tuner_config cfg;
+ unsigned int i2c_adapter_id;
+ struct i2c_adapter *i2c_adp;
+};
+
struct aml_atvdemod_device {
char *name;
struct class cls;
struct device *dev;
- unsigned int tuner_id;
- unsigned int tuner_xtal;
- unsigned int tuner_xtal_mode;
- unsigned int tuner_xtal_cap;
- unsigned int i2c_addr;
- unsigned int i2c_adapter_id;
- struct i2c_adapter *i2c_adp;
+ unsigned int tuner_num;
+ int tuner_cur;
+ struct aml_tuner *tuners;
unsigned int if_freq;
unsigned int if_inv;
extern struct aml_atvdemod_device *amlatvdemod_devp;
-extern int aml_attach_demod_tuner(struct aml_atvdemod_device *dev);
+extern int aml_attach_demod(struct aml_atvdemod_device *dev);
+extern int aml_attach_tuner(struct aml_atvdemod_device *dev);
#endif /* __ATV_DEMOD_DRIVER_H__ */
amlatvdemod_devp->std != p->param.std ||
amlatvdemod_devp->audmode != p->param.audmode ||
amlatvdemod_devp->if_freq != p->if_freq ||
- amlatvdemod_devp->if_inv != p->if_inv ||
- amlatvdemod_devp->tuner_id != p->tuner_id) {
+ amlatvdemod_devp->if_inv != p->if_inv) {
amlatvdemod_devp->std = p->param.std;
amlatvdemod_devp->audmode = p->param.audmode;
amlatvdemod_devp->if_freq = p->if_freq;
amlatvdemod_devp->if_inv = p->if_inv;
- amlatvdemod_devp->tuner_id = p->tuner_id;
atv_dmd_set_std();
atvdemod_init(!priv->scanning);
break;
case V4L2_SLOW_SEARCH_MODE:
- tvp->data = slow_mode;
+ slow_mode = tvp->data;
+ break;
+
+ case V4L2_SIF_OVER_MODULATION:
+ priv->sound_sys.sif_over_modulation = tvp->data;
break;
default:
break;
case V4L2_SLOW_SEARCH_MODE:
- slow_mode = tvp->data;
+ tvp->data = slow_mode;
break;
default:
unsigned int audio_std;
unsigned int input_mode;
unsigned int output_mode;
+ int sif_over_modulation;
};
struct atv_demod_priv {
if (!status)
return -1;
-#if 0
- if (analog_ops->tuner_status)
- analog_ops->tuner_status(&v4l2_fe->fe, status);
+
+ if (analog_ops->has_signal)
+ analog_ops->has_signal(&v4l2_fe->fe, (u16 *) status);
else if (tuner_ops->get_status)
- tuner_ops->get_status(&v4l2_fe->fe, status);
-#endif
+ tuner_ops->get_status(&v4l2_fe->fe, (u32 *) status);
return ret;
}
struct v4l2_property *tvp, struct file *file)
{
int r = 0;
+#if 0
+ int i = 0;
+ int id = 0;
+#endif
struct v4l2_analog_parameters *params = &v4l2_fe->params;
v4l2_property_dump(v4l2_fe, true, tvp);
break;
case V4L2_SOUND_SYS:
case V4L2_SLOW_SEARCH_MODE:
+ case V4L2_SIF_OVER_MODULATION:
/* Allow the frontend to override outgoing properties */
if (v4l2_fe->ops.set_property) {
r = v4l2_fe->ops.set_property(v4l2_fe, tvp);
| (params->audmode);
}
break;
+ case V4L2_FINE_TUNE:
+ params->frequency += tvp->data;
+ break;
+ case V4L2_TUNER_TYPE:
+#if 0 /* This supports dynamically setting the tuner type */
+ for (i = 0; i < amlatvdemod_devp->tuner_num; ++i) {
+ if (amlatvdemod_devp->tuners[i].cfg.id == tvp->data) {
+ id = amlatvdemod_devp->tuners[i].cfg.id;
+ break;
+ }
+ }
+
+ if (id == 0) {
+ pr_err("%s: nonsupport tuner %d.\n",
+ __func__, tvp->data);
+ return -EINVAL;
+ }
+
+ if (amlatvdemod_devp->tuner_cur == i) {
+ pr_err("%s: the same tuner %d.\n",
+ __func__, i);
+ break;
+ }
+
+ if (amlatvdemod_devp->tuner_attached) {
+ if (v4l2_fe->fe.ops.tuner_ops.release)
+ v4l2_fe->fe.ops.tuner_ops.release(&v4l2_fe->fe);
+ }
+
+ v4l2_fe->tuner_id = id;
+ if (aml_attach_tuner(amlatvdemod_devp) < 0) {
+ pr_err("%s: attach tuner %d error.\n",
+ __func__, id);
+ return -EINVAL;
+ }
+#endif
+ break;
+ case V4L2_TUNER_IF_FREQ:
+ break;
default:
return -EINVAL;
}
struct v4l2_property *tvp, struct file *file)
{
int r = 0;
+ int i = 0;
struct v4l2_analog_parameters *params = &v4l2_fe->params;
switch (tvp->cmd) {
/* std & 0x00FFFFFF: audio std */
tvp->data = params->std;
break;
+ case V4L2_TUNER_TYPE:
+ i = amlatvdemod_devp->tuner_cur;
+ if (i < 0) {
+ pr_err("%s: Has not been set tuner type.\n", __func__);
+ tvp->data = 0;
+ return -EINVAL;
+ }
+ tvp->data = amlatvdemod_devp->tuners[i].cfg.id;
+ break;
+ case V4L2_TUNER_IF_FREQ:
+ tvp->data = amlatvdemod_devp->if_freq;
+ break;
default:
pr_dbg("%s: V4L2 property %d doesn't exist\n",
__func__, tvp->cmd);
struct v4l2_frontend_private *fepriv = v4l2_fe->frontend_priv;
/* Because tuner ko insmod after demod, so need check */
- if (!amlatvdemod_devp->tuner_attached
- || !amlatvdemod_devp->analog_attached) {
- ret = aml_attach_demod_tuner(amlatvdemod_devp);
+ if (!amlatvdemod_devp->analog_attached) {
+ ret = aml_attach_demod(amlatvdemod_devp);
+ if (ret < 0) {
+ pr_err("%s: attach demod %d error.\n",
+ __func__, v4l2_fe->tuner_id);
+ return -EBUSY;
+ }
+ }
+
+ if (!amlatvdemod_devp->tuner_attached) {
+ ret = aml_attach_tuner(amlatvdemod_devp);
if (ret < 0) {
- pr_err("%s: attach demod or tuner %d error.\n",
+ pr_err("%s: attach tuner %d error.\n",
__func__, v4l2_fe->tuner_id);
return -EBUSY;
}
#define V4L2_SLOW_SEARCH_MODE 3
#define V4L2_FREQUENCY 4
#define V4L2_STD 5
+#define V4L2_FINE_TUNE 6
+#define V4L2_SIF_OVER_MODULATION 7
+#define V4L2_TUNER_TYPE 8
+#define V4L2_TUNER_IF_FREQ 9
struct v4l2_frontend;
atv_dmd_wr_byte(APB_BLOCK_ADDR_VDAGC, 0x45, 0x90); /*zhuangwei*/
atv_dmd_wr_long(APB_BLOCK_ADDR_VDAGC, 0x44, 0x5c8808c1);/*zhuangwei*/
- if (amlatvdemod_devp->tuner_id == AM_TUNER_R840 ||
- amlatvdemod_devp->tuner_id == AM_TUNER_R842) {
+ if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R840 ||
+ amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R842) {
/*zhuangwei*/
atv_dmd_wr_long(APB_BLOCK_ADDR_VDAGC, 0x3c, reg_23cf);
/*guanzhong@20150804a*/
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x08, 0x46170200);
}
- if (amlatvdemod_devp->tuner_id == AM_TUNER_MXL661) {
+ if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_MXL661) {
/*test in sky*/
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x04, 0xbffa0000);
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x00, 0x6f4000);
atv_dmd_wr_long(APB_BLOCK_ADDR_ADC_SE, 0x0, 0x03180e0f);
else
atv_dmd_wr_long(APB_BLOCK_ADDR_ADC_SE, 0x0, 0x03150e0f);
- if (amlatvdemod_devp->tuner_id == AM_TUNER_R840 ||
- amlatvdemod_devp->tuner_id == AM_TUNER_R842) {
+ if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R840 ||
+ amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R842) {
/*config pwm for tuner r840*/
atv_dmd_wr_byte(APB_BLOCK_ADDR_ADC_SE, 1, 0xf);
}
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x04, 0xc8);
/*26 dB dynamic range*/
atv_dmd_wr_byte(APB_BLOCK_ADDR_AGC_PWM, 0x09, 0xa);
- if (amlatvdemod_devp->tuner_id == AM_TUNER_R840 ||
- amlatvdemod_devp->tuner_id == AM_TUNER_R842) {
+ if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R840 ||
+ amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
+ == AM_TUNER_R842) {
/*config pwm for tuner r840*/
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0, 0xc80);
/* guanzhong for Tuner AGC shock */
void atv_dmd_set_std(void)
{
v4l2_std_id ptstd = amlatvdemod_devp->std;
+ int tuner_index = amlatvdemod_devp->tuner_cur;
+ int tuner_id = amlatvdemod_devp->tuners[tuner_index].cfg.id;
/* set broad standard of tuner*/
if (((ptstd & V4L2_COLOR_STD_PAL)
}
/* Tuner returns the if and signal inverted states */
- if ((amlatvdemod_devp->tuner_id == AM_TUNER_R840) ||
- (amlatvdemod_devp->tuner_id == AM_TUNER_R842) ||
- (amlatvdemod_devp->tuner_id == AM_TUNER_SI2151) ||
- (amlatvdemod_devp->tuner_id == AM_TUNER_SI2159) ||
- (amlatvdemod_devp->tuner_id == AM_TUNER_MXL661)) {
+ if ((tuner_id == AM_TUNER_R840) ||
+ (tuner_id == AM_TUNER_R842) ||
+ (tuner_id == AM_TUNER_SI2151) ||
+ (tuner_id == AM_TUNER_SI2159) ||
+ (tuner_id == AM_TUNER_MXL661)) {
if_freq = amlatvdemod_devp->if_freq;
if_inv = amlatvdemod_devp->if_inv;
}
/* For attach tuner driver start*/
enum tuner_type {
+ AM_TUNER_NONE = 0,
AM_TUNER_SI2176 = 1,
AM_TUNER_SI2196 = 2,
AM_TUNER_FQ1216 = 3,