aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-07-22 20:24:33 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-04 19:49:00 -0500
commit19ad6a01bbb011b88b7a12a5baad6888cf216b35 (patch)
tree30eba50d15ecb864983a9bf7b4984e28577985fd
parent1b0bfee39d531ffaf91b3294a2204b2ed8151fb8 (diff)
[media] mt2063: Print a message about the detected mt2063 type
This also helps to identify when a device is not initialized, if the bridge doesn't return an error for a I2C failed transfer. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/tuners/mt2063.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
index db347d9e7d45..fdf605034ca6 100644
--- a/drivers/media/common/tuners/mt2063.c
+++ b/drivers/media/common/tuners/mt2063.c
@@ -1790,6 +1790,7 @@ static int mt2063_init(struct dvb_frontend *fe)
1790 struct mt2063_state *state = fe->tuner_priv; 1790 struct mt2063_state *state = fe->tuner_priv;
1791 u8 all_resets = 0xF0; /* reset/load bits */ 1791 u8 all_resets = 0xF0; /* reset/load bits */
1792 const u8 *def = NULL; 1792 const u8 *def = NULL;
1793 char *step;
1793 u32 FCRUN; 1794 u32 FCRUN;
1794 s32 maxReads; 1795 s32 maxReads;
1795 u32 fcu_osc; 1796 u32 fcu_osc;
@@ -1807,10 +1808,24 @@ static int mt2063_init(struct dvb_frontend *fe)
1807 } 1808 }
1808 1809
1809 /* Check the part/rev code */ 1810 /* Check the part/rev code */
1810 if (((state->reg[MT2063_REG_PART_REV] != MT2063_B0) /* MT2063 B0 */ 1811 switch (state->reg[MT2063_REG_PART_REV]) {
1811 && (state->reg[MT2063_REG_PART_REV] != MT2063_B1) /* MT2063 B1 */ 1812 case MT2063_B0:
1812 && (state->reg[MT2063_REG_PART_REV] != MT2063_B3))) /* MT2063 B3 */ 1813 step = "B0";
1814 break;
1815 case MT2063_B1:
1816 step = "B1";
1817 break;
1818 case MT2063_B2:
1819 step = "B2";
1820 break;
1821 case MT2063_B3:
1822 step = "B3";
1823 break;
1824 default:
1825 printk(KERN_ERR "mt2063: Unknown mt2063 device ID (0x%02x)\n",
1826 state->reg[MT2063_REG_PART_REV]);
1813 return -ENODEV; /* Wrong tuner Part/Rev code */ 1827 return -ENODEV; /* Wrong tuner Part/Rev code */
1828 }
1814 1829
1815 /* Check the 2nd byte of the Part/Rev code from the tuner */ 1830 /* Check the 2nd byte of the Part/Rev code from the tuner */
1816 status = mt2063_read(state, MT2063_REG_RSVD_3B, 1831 status = mt2063_read(state, MT2063_REG_RSVD_3B,
@@ -1818,10 +1833,13 @@ static int mt2063_init(struct dvb_frontend *fe)
1818 1833
1819 /* b7 != 0 ==> NOT MT2063 */ 1834 /* b7 != 0 ==> NOT MT2063 */
1820 if (status < 0 || ((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00)) { 1835 if (status < 0 || ((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00)) {
1821 printk(KERN_ERR "Can't read mt2063 2nd part ID\n"); 1836 printk(KERN_ERR "mt2063: Unknown 2nd part ID\n");
1822 return -ENODEV; /* Wrong tuner Part/Rev code */ 1837 return -ENODEV; /* Wrong tuner Part/Rev code */
1823 } 1838 }
1824 1839
1840 dprintk(1, "Discovered a mt2063 %s (2nd part number 0x%02x)\n",
1841 step, state->reg[MT2063_REG_RSVD_3B]);
1842
1825 /* Reset the tuner */ 1843 /* Reset the tuner */
1826 status = mt2063_write(state, MT2063_REG_LO2CQ_3, &all_resets, 1); 1844 status = mt2063_write(state, MT2063_REG_LO2CQ_3, &all_resets, 1);
1827 if (status < 0) 1845 if (status < 0)