atv_demod: add xtal config for tuner [1/3]

PD#171245: add xtal config for tuner

Change-Id: Id682294ea1e0de265df56509fa5fc4480212f7a7
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
nengwen.chen
2018-08-06 19:04:10 +08:00
committed by Yixun Lan
parent a8b6fdf0f3
commit cf0cf49f16
12 changed files with 41 additions and 14 deletions

View File

@@ -418,7 +418,8 @@
tuner_name = "r842_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0xf6>;
tuner_xtal = <3>;
tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
tuner_xtal_mode = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)

View File

@@ -419,7 +419,8 @@
tuner_name = "r842_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0xf6>;
tuner_xtal = <3>;
tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
tuner_xtal_mode = <3>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)

View File

@@ -410,7 +410,8 @@
tuner_name = "si2151_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal = <0>; */ /* unuse for si2151 */
/* tuner_xtal_mode = <0>; */
/* tuner_xtal_cap = <0>; */
};

View File

@@ -409,7 +409,8 @@
tuner_name = "r842_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0xf6>;
tuner_xtal = <0>;
tuner_xtal = <1>; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
tuner_xtal_mode = <0>;
/* NO_SHARE_XTAL(0)
* MASTER_TO_SLAVE_XTAL_IN(1)
* MASTER_TO_SLAVE_XTAL_OUT(2)

View File

@@ -610,7 +610,8 @@
tuner_name = "si2151_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal = <0>; */ /* unuse for si2151 */
/* tuner_xtal_mode = <0>; */
/* tuner_xtal_cap = <0>; */
};

View File

@@ -653,7 +653,8 @@
tuner_name = "si2151_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal = <0>; */ /* unuse for si2151 */
/* tuner_xtal_mode = <0>; */
/* tuner_xtal_cap = <0>; */
};

View File

@@ -603,8 +603,12 @@
tuner_name = "mxl661_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal_cap = <0>; */
tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
tuner_xtal_mode = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {

View File

@@ -603,8 +603,12 @@
tuner_name = "mxl661_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal_cap = <0>; */
tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
tuner_xtal_mode = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {

View File

@@ -602,8 +602,12 @@
tuner_name = "mxl661_tuner";
tuner_i2c_adap = <&i2c1>;
tuner_i2c_addr = <0x60>;
/* tuner_xtal = <0>; */
/* tuner_xtal_cap = <0>; */
tuner_xtal = <0>; /* 0: 16MHz, 1: 24MHz */
tuner_xtal_mode = <0>;
/* NO_SHARE_XTAL(0)
* SLAVE_XTAL_SHARE(1)
*/
tuner_xtal_cap = <30>; /* when tuner_xtal_mode = 1, set 25 */
};
atv-demod {

View File

@@ -458,11 +458,17 @@ static void aml_atvdemod_dt_parse(struct aml_atvdemod_device *pdev)
else
pdev->tuner_xtal = val;
ret = of_property_read_u32(node_tuner, "tuner_xtal_mode", &val);
if (ret)
pr_err("can't find tuner_xtal_mode.\n");
else
pdev->tuner_xtal_mode = val;
ret = of_property_read_u32(node_tuner, "tuner_xtal_cap", &val);
if (ret)
pr_err("can't find tuner_xtal_cap.\n");
else
pdev->tuner_xtal = val;
pdev->tuner_xtal_cap = val;
of_node_put(node_tuner);
}
@@ -491,6 +497,7 @@ int aml_attach_demod_tuner(struct aml_atvdemod_device *dev)
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;
if (!dev->tuner_attached) {

View File

@@ -41,6 +41,7 @@ struct aml_atvdemod_device {
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;

View File

@@ -144,8 +144,9 @@ enum tuner_type {
struct tuner_config {
u8 id;
u8 i2c_addr;
u8 xtal;
u8 xtal; /* 0: 16MHz, 1: 24MHz, 3: 27MHz */
u8 xtal_cap;
u8 xtal_mode;
};
extern struct dvb_frontend *mxl661_attach(struct dvb_frontend *fe,