diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-11-12 11:53:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:42 -0500 |
commit | 858ea5e941fad6a2f38d0c9722bbb842d46662fb (patch) | |
tree | 5c0e924b7ea2da60655ccdff8fce51d0f3694bdd /drivers/media/video/gspca/ov519.c | |
parent | f8f20188e863dfb43ac53364da0b8865d37c97e2 (diff) |
[media] gspca - ov519: Clearer debug and error messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/ov519.c')
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 0591ced5d021..7ae304d0ebf6 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -1885,6 +1885,8 @@ static void reg_w(struct sd *sd, u16 index, u16 value) | |||
1885 | req = 0x0a; | 1885 | req = 0x0a; |
1886 | /* fall through */ | 1886 | /* fall through */ |
1887 | case BRIDGE_W9968CF: | 1887 | case BRIDGE_W9968CF: |
1888 | PDEBUG(D_USBO, "SET %02x %04x %04x", | ||
1889 | req, value, index); | ||
1888 | ret = usb_control_msg(sd->gspca_dev.dev, | 1890 | ret = usb_control_msg(sd->gspca_dev.dev, |
1889 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), | 1891 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), |
1890 | req, | 1892 | req, |
@@ -1895,6 +1897,8 @@ static void reg_w(struct sd *sd, u16 index, u16 value) | |||
1895 | req = 1; | 1897 | req = 1; |
1896 | } | 1898 | } |
1897 | 1899 | ||
1900 | PDEBUG(D_USBO, "SET %02x 0000 %04x %02x", | ||
1901 | req, index, value); | ||
1898 | sd->gspca_dev.usb_buf[0] = value; | 1902 | sd->gspca_dev.usb_buf[0] = value; |
1899 | ret = usb_control_msg(sd->gspca_dev.dev, | 1903 | ret = usb_control_msg(sd->gspca_dev.dev, |
1900 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), | 1904 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), |
@@ -1904,13 +1908,10 @@ static void reg_w(struct sd *sd, u16 index, u16 value) | |||
1904 | sd->gspca_dev.usb_buf, 1, 500); | 1908 | sd->gspca_dev.usb_buf, 1, 500); |
1905 | leave: | 1909 | leave: |
1906 | if (ret < 0) { | 1910 | if (ret < 0) { |
1907 | err("Write reg 0x%04x -> [0x%02x] failed", | 1911 | err("reg_w %02x failed %d", index, ret); |
1908 | value, index); | ||
1909 | sd->gspca_dev.usb_err = ret; | 1912 | sd->gspca_dev.usb_err = ret; |
1910 | return; | 1913 | return; |
1911 | } | 1914 | } |
1912 | |||
1913 | PDEBUG(D_USBO, "Write reg 0x%04x -> [0x%02x]", value, index); | ||
1914 | } | 1915 | } |
1915 | 1916 | ||
1916 | /* Read from a OV519 register, note not valid for the w9968cf!! */ | 1917 | /* Read from a OV519 register, note not valid for the w9968cf!! */ |
@@ -1943,9 +1944,10 @@ static int reg_r(struct sd *sd, u16 index) | |||
1943 | 1944 | ||
1944 | if (ret >= 0) { | 1945 | if (ret >= 0) { |
1945 | ret = sd->gspca_dev.usb_buf[0]; | 1946 | ret = sd->gspca_dev.usb_buf[0]; |
1946 | PDEBUG(D_USBI, "Read reg [0x%02X] -> 0x%04X", index, ret); | 1947 | PDEBUG(D_USBI, "GET %02x 0000 %04x %02x", |
1948 | req, index, ret); | ||
1947 | } else { | 1949 | } else { |
1948 | err("Read reg [0x%02x] failed", index); | 1950 | err("reg_r %02x failed %d", index, ret); |
1949 | sd->gspca_dev.usb_err = ret; | 1951 | sd->gspca_dev.usb_err = ret; |
1950 | } | 1952 | } |
1951 | 1953 | ||
@@ -1970,7 +1972,7 @@ static int reg_r8(struct sd *sd, | |||
1970 | if (ret >= 0) { | 1972 | if (ret >= 0) { |
1971 | ret = sd->gspca_dev.usb_buf[0]; | 1973 | ret = sd->gspca_dev.usb_buf[0]; |
1972 | } else { | 1974 | } else { |
1973 | err("Read reg 8 [0x%02x] failed", index); | 1975 | err("reg_r8 %02x failed %d", index, ret); |
1974 | sd->gspca_dev.usb_err = ret; | 1976 | sd->gspca_dev.usb_err = ret; |
1975 | } | 1977 | } |
1976 | 1978 | ||
@@ -2023,7 +2025,7 @@ static void ov518_reg_w32(struct sd *sd, u16 index, u32 value, int n) | |||
2023 | 0, index, | 2025 | 0, index, |
2024 | sd->gspca_dev.usb_buf, n, 500); | 2026 | sd->gspca_dev.usb_buf, n, 500); |
2025 | if (ret < 0) { | 2027 | if (ret < 0) { |
2026 | err("Write reg32 [%02x] %08x failed", index, value); | 2028 | err("reg_w32 %02x failed %d", index, ret); |
2027 | sd->gspca_dev.usb_err = ret; | 2029 | sd->gspca_dev.usb_err = ret; |
2028 | } | 2030 | } |
2029 | } | 2031 | } |
@@ -2032,7 +2034,7 @@ static void ov511_i2c_w(struct sd *sd, u8 reg, u8 value) | |||
2032 | { | 2034 | { |
2033 | int rc, retries; | 2035 | int rc, retries; |
2034 | 2036 | ||
2035 | PDEBUG(D_USBO, "i2c 0x%02x -> [0x%02x]", value, reg); | 2037 | PDEBUG(D_USBO, "ov511_i2c_w %02x %02x", reg, value); |
2036 | 2038 | ||
2037 | /* Three byte write cycle */ | 2039 | /* Three byte write cycle */ |
2038 | for (retries = 6; ; ) { | 2040 | for (retries = 6; ; ) { |
@@ -2118,7 +2120,7 @@ static int ov511_i2c_r(struct sd *sd, u8 reg) | |||
2118 | 2120 | ||
2119 | value = reg_r(sd, R51x_I2C_DATA); | 2121 | value = reg_r(sd, R51x_I2C_DATA); |
2120 | 2122 | ||
2121 | PDEBUG(D_USBI, "i2c [0x%02X] -> 0x%02X", reg, value); | 2123 | PDEBUG(D_USBI, "ov511_i2c_r %02x %02x", reg, value); |
2122 | 2124 | ||
2123 | /* This is needed to make i2c_w() work */ | 2125 | /* This is needed to make i2c_w() work */ |
2124 | reg_w(sd, R511_I2C_CTL, 0x05); | 2126 | reg_w(sd, R511_I2C_CTL, 0x05); |
@@ -2135,7 +2137,7 @@ static void ov518_i2c_w(struct sd *sd, | |||
2135 | u8 reg, | 2137 | u8 reg, |
2136 | u8 value) | 2138 | u8 value) |
2137 | { | 2139 | { |
2138 | PDEBUG(D_USBO, "i2c 0x%02x -> [0x%02x]", value, reg); | 2140 | PDEBUG(D_USBO, "ov518_i2c_w %02x %02x", reg, value); |
2139 | 2141 | ||
2140 | /* Select camera register */ | 2142 | /* Select camera register */ |
2141 | reg_w(sd, R51x_I2C_SADDR_3, reg); | 2143 | reg_w(sd, R51x_I2C_SADDR_3, reg); |
@@ -2171,7 +2173,7 @@ static int ov518_i2c_r(struct sd *sd, u8 reg) | |||
2171 | /* Initiate 2-byte read cycle */ | 2173 | /* Initiate 2-byte read cycle */ |
2172 | reg_w(sd, R518_I2C_CTL, 0x05); | 2174 | reg_w(sd, R518_I2C_CTL, 0x05); |
2173 | value = reg_r(sd, R51x_I2C_DATA); | 2175 | value = reg_r(sd, R51x_I2C_DATA); |
2174 | PDEBUG(D_USBI, "i2c [0x%02X] -> 0x%02X", reg, value); | 2176 | PDEBUG(D_USBI, "ov518_i2c_r %02x %02x", reg, value); |
2175 | return value; | 2177 | return value; |
2176 | } | 2178 | } |
2177 | 2179 | ||
@@ -2189,11 +2191,11 @@ static void ovfx2_i2c_w(struct sd *sd, u8 reg, u8 value) | |||
2189 | (u16) value, (u16) reg, NULL, 0, 500); | 2191 | (u16) value, (u16) reg, NULL, 0, 500); |
2190 | 2192 | ||
2191 | if (ret < 0) { | 2193 | if (ret < 0) { |
2192 | err("i2c 0x%02x -> [0x%02x] failed", value, reg); | 2194 | err("ovfx2_i2c_w %02x failed %d", reg, ret); |
2193 | sd->gspca_dev.usb_err = ret; | 2195 | sd->gspca_dev.usb_err = ret; |
2194 | } | 2196 | } |
2195 | 2197 | ||
2196 | PDEBUG(D_USBO, "i2c 0x%02x -> [0x%02x]", value, reg); | 2198 | PDEBUG(D_USBO, "ovfx2_i2c_w %02x %02x", reg, value); |
2197 | } | 2199 | } |
2198 | 2200 | ||
2199 | static int ovfx2_i2c_r(struct sd *sd, u8 reg) | 2201 | static int ovfx2_i2c_r(struct sd *sd, u8 reg) |
@@ -2211,9 +2213,9 @@ static int ovfx2_i2c_r(struct sd *sd, u8 reg) | |||
2211 | 2213 | ||
2212 | if (ret >= 0) { | 2214 | if (ret >= 0) { |
2213 | ret = sd->gspca_dev.usb_buf[0]; | 2215 | ret = sd->gspca_dev.usb_buf[0]; |
2214 | PDEBUG(D_USBI, "i2c [0x%02X] -> 0x%02X", reg, ret); | 2216 | PDEBUG(D_USBI, "ovfx2_i2c_r %02x %02x", reg, ret); |
2215 | } else { | 2217 | } else { |
2216 | err("i2c read [0x%02x] failed", reg); | 2218 | err("ovfx2_i2c_r %02x failed %d", reg, ret); |
2217 | sd->gspca_dev.usb_err = ret; | 2219 | sd->gspca_dev.usb_err = ret; |
2218 | } | 2220 | } |
2219 | 2221 | ||
@@ -2472,7 +2474,7 @@ static void ov_hires_configure(struct sd *sd) | |||
2472 | PDEBUG(D_PROBE, "Sensor is an OV3610"); | 2474 | PDEBUG(D_PROBE, "Sensor is an OV3610"); |
2473 | sd->sensor = SEN_OV3610; | 2475 | sd->sensor = SEN_OV3610; |
2474 | } else { | 2476 | } else { |
2475 | err("Error unknown sensor type: 0x%02x%02x", | 2477 | err("Error unknown sensor type: %02x%02x", |
2476 | high, low); | 2478 | high, low); |
2477 | } | 2479 | } |
2478 | } | 2480 | } |