diff options
-rw-r--r-- | drivers/media/i2c/adv7604.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index da256ddf06d3..f9503d2d1ed0 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -1207,6 +1207,8 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, | |||
1207 | 1207 | ||
1208 | static int read_stdi(struct v4l2_subdev *sd, struct stdi_readback *stdi) | 1208 | static int read_stdi(struct v4l2_subdev *sd, struct stdi_readback *stdi) |
1209 | { | 1209 | { |
1210 | u8 polarity; | ||
1211 | |||
1210 | if (no_lock_stdi(sd) || no_lock_sspd(sd)) { | 1212 | if (no_lock_stdi(sd) || no_lock_sspd(sd)) { |
1211 | v4l2_dbg(2, debug, sd, "%s: STDI and/or SSPD not locked\n", __func__); | 1213 | v4l2_dbg(2, debug, sd, "%s: STDI and/or SSPD not locked\n", __func__); |
1212 | return -1; | 1214 | return -1; |
@@ -1219,11 +1221,12 @@ static int read_stdi(struct v4l2_subdev *sd, struct stdi_readback *stdi) | |||
1219 | stdi->interlaced = io_read(sd, 0x12) & 0x10; | 1221 | stdi->interlaced = io_read(sd, 0x12) & 0x10; |
1220 | 1222 | ||
1221 | /* read SSPD */ | 1223 | /* read SSPD */ |
1222 | if ((cp_read(sd, 0xb5) & 0x03) == 0x01) { | 1224 | polarity = cp_read(sd, 0xb5); |
1223 | stdi->hs_pol = ((cp_read(sd, 0xb5) & 0x10) ? | 1225 | if ((polarity & 0x03) == 0x01) { |
1224 | ((cp_read(sd, 0xb5) & 0x08) ? '+' : '-') : 'x'); | 1226 | stdi->hs_pol = polarity & 0x10 |
1225 | stdi->vs_pol = ((cp_read(sd, 0xb5) & 0x40) ? | 1227 | ? (polarity & 0x08 ? '+' : '-') : 'x'; |
1226 | ((cp_read(sd, 0xb5) & 0x20) ? '+' : '-') : 'x'); | 1228 | stdi->vs_pol = polarity & 0x40 |
1229 | ? (polarity & 0x20 ? '+' : '-') : 'x'; | ||
1227 | } else { | 1230 | } else { |
1228 | stdi->hs_pol = 'x'; | 1231 | stdi->hs_pol = 'x'; |
1229 | stdi->vs_pol = 'x'; | 1232 | stdi->vs_pol = 'x'; |
@@ -1881,6 +1884,8 @@ static int adv7604_log_status(struct v4l2_subdev *sd) | |||
1881 | struct v4l2_dv_timings timings; | 1884 | struct v4l2_dv_timings timings; |
1882 | struct stdi_readback stdi; | 1885 | struct stdi_readback stdi; |
1883 | u8 reg_io_0x02 = io_read(sd, 0x02); | 1886 | u8 reg_io_0x02 = io_read(sd, 0x02); |
1887 | u8 edid_enabled; | ||
1888 | u8 cable_det; | ||
1884 | 1889 | ||
1885 | static const char * const csc_coeff_sel_rb[16] = { | 1890 | static const char * const csc_coeff_sel_rb[16] = { |
1886 | "bypassed", "YPbPr601 -> RGB", "reserved", "YPbPr709 -> RGB", | 1891 | "bypassed", "YPbPr601 -> RGB", "reserved", "YPbPr709 -> RGB", |
@@ -1910,20 +1915,22 @@ static int adv7604_log_status(struct v4l2_subdev *sd) | |||
1910 | 1915 | ||
1911 | v4l2_info(sd, "-----Chip status-----\n"); | 1916 | v4l2_info(sd, "-----Chip status-----\n"); |
1912 | v4l2_info(sd, "Chip power: %s\n", no_power(sd) ? "off" : "on"); | 1917 | v4l2_info(sd, "Chip power: %s\n", no_power(sd) ? "off" : "on"); |
1918 | edid_enabled = rep_read(sd, 0x7d); | ||
1913 | v4l2_info(sd, "EDID enabled port A: %s, B: %s, C: %s, D: %s\n", | 1919 | v4l2_info(sd, "EDID enabled port A: %s, B: %s, C: %s, D: %s\n", |
1914 | ((rep_read(sd, 0x7d) & 0x01) ? "Yes" : "No"), | 1920 | ((edid_enabled & 0x01) ? "Yes" : "No"), |
1915 | ((rep_read(sd, 0x7d) & 0x02) ? "Yes" : "No"), | 1921 | ((edid_enabled & 0x02) ? "Yes" : "No"), |
1916 | ((rep_read(sd, 0x7d) & 0x04) ? "Yes" : "No"), | 1922 | ((edid_enabled & 0x04) ? "Yes" : "No"), |
1917 | ((rep_read(sd, 0x7d) & 0x08) ? "Yes" : "No")); | 1923 | ((edid_enabled & 0x08) ? "Yes" : "No")); |
1918 | v4l2_info(sd, "CEC: %s\n", !!(cec_read(sd, 0x2a) & 0x01) ? | 1924 | v4l2_info(sd, "CEC: %s\n", !!(cec_read(sd, 0x2a) & 0x01) ? |
1919 | "enabled" : "disabled"); | 1925 | "enabled" : "disabled"); |
1920 | 1926 | ||
1921 | v4l2_info(sd, "-----Signal status-----\n"); | 1927 | v4l2_info(sd, "-----Signal status-----\n"); |
1928 | cable_det = io_read(sd, 0x6f); | ||
1922 | v4l2_info(sd, "Cable detected (+5V power) port A: %s, B: %s, C: %s, D: %s\n", | 1929 | v4l2_info(sd, "Cable detected (+5V power) port A: %s, B: %s, C: %s, D: %s\n", |
1923 | ((io_read(sd, 0x6f) & 0x10) ? "Yes" : "No"), | 1930 | ((cable_det & 0x10) ? "Yes" : "No"), |
1924 | ((io_read(sd, 0x6f) & 0x08) ? "Yes" : "No"), | 1931 | ((cable_det & 0x08) ? "Yes" : "No"), |
1925 | ((io_read(sd, 0x6f) & 0x04) ? "Yes" : "No"), | 1932 | ((cable_det & 0x04) ? "Yes" : "No"), |
1926 | ((io_read(sd, 0x6f) & 0x02) ? "Yes" : "No")); | 1933 | ((cable_det & 0x02) ? "Yes" : "No")); |
1927 | v4l2_info(sd, "TMDS signal detected: %s\n", | 1934 | v4l2_info(sd, "TMDS signal detected: %s\n", |
1928 | no_signal_tmds(sd) ? "false" : "true"); | 1935 | no_signal_tmds(sd) ? "false" : "true"); |
1929 | v4l2_info(sd, "TMDS signal locked: %s\n", | 1936 | v4l2_info(sd, "TMDS signal locked: %s\n", |