Loading drivers/gpu/drm/msm/dp/dp_link.c +29 −29 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ static char *dp_link_get_audio_sample_rate(u32 rate) static int dp_link_get_period(struct dp_link_private *link, int const addr) { int ret = 0; u8 *bp; u8 bp; u8 data; u32 const param_len = 0x1; u32 const max_audio_period = 0xA; Loading @@ -224,7 +224,7 @@ static int dp_link_get_period(struct dp_link_private *link, int const addr) goto exit; } data = *bp; data = bp; /* Period - Bits 3:0 */ data = data & 0xF; Loading Loading @@ -322,7 +322,7 @@ static int dp_link_parse_audio_channel_period(struct dp_link_private *link) static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -337,7 +337,7 @@ static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Audio Pattern Type - Bits 7:0 */ if ((int)data > max_audio_pattern_type) { Loading @@ -356,7 +356,7 @@ static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) static int dp_link_parse_audio_mode(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -374,7 +374,7 @@ static int dp_link_parse_audio_mode(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Sampling Rate - Bits 3:0 */ sampling_rate = data & 0xF; Loading Loading @@ -528,14 +528,14 @@ static char *dp_link_bit_depth_to_string(u32 tbd) static int dp_link_parse_timing_params1(struct dp_link_private *link, int const addr, int const len, u32 *val) { u8 *bp; u8 bp[2]; int rlen; if (len < 2) return -EINVAL; /* Read the requested video link pattern (Byte 0x221). */ rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp, len); rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len); if (rlen < len) { pr_err("failed to read 0x%x\n", addr); return -EINVAL; Loading @@ -549,14 +549,14 @@ static int dp_link_parse_timing_params1(struct dp_link_private *link, static int dp_link_parse_timing_params2(struct dp_link_private *link, int const addr, int const len, u32 *val1, u32 *val2) { u8 *bp; u8 bp[2]; int rlen; if (len < 2) return -EINVAL; /* Read the requested video link pattern (Byte 0x221). */ rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp, len); rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len); if (rlen < len) { pr_err("failed to read 0x%x\n", addr); return -EINVAL; Loading @@ -571,7 +571,7 @@ static int dp_link_parse_timing_params2(struct dp_link_private *link, static int dp_link_parse_timing_params3(struct dp_link_private *link, int const addr, u32 *val) { u8 *bp; u8 bp; u32 len = 1; int rlen; Loading @@ -581,7 +581,7 @@ static int dp_link_parse_timing_params3(struct dp_link_private *link, pr_err("failed to read 0x%x\n", addr); return -EINVAL; } *val = bp[0]; *val = bp; return 0; } Loading @@ -597,7 +597,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) { int ret = 0; int rlen; u8 *bp; u8 bp; u8 data; u32 dyn_range; int const param_len = 0x1; Loading @@ -612,7 +612,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; if (!dp_link_is_video_pattern_valid(data)) { pr_err("invalid link video pattern = 0x%x\n", data); Loading @@ -634,7 +634,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Dynamic Range */ dyn_range = (data & BIT(3)) >> 3; Loading Loading @@ -789,7 +789,7 @@ static bool dp_link_is_lane_count_valid(u32 lane_count) */ static int dp_link_parse_link_training_params(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int ret = 0; int rlen; Loading @@ -803,7 +803,7 @@ static int dp_link_parse_link_training_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; if (!dp_link_is_link_rate_valid(data)) { pr_err("invalid link rate = 0x%x\n", data); Loading @@ -822,7 +822,7 @@ static int dp_link_parse_link_training_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; data &= 0x1F; if (!dp_link_is_lane_count_valid(data)) { Loading Loading @@ -861,7 +861,7 @@ static bool dp_link_is_phy_test_pattern_supported(u32 phy_test_pattern_sel) */ static int dp_link_parse_phy_test_params(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -876,7 +876,7 @@ static int dp_link_parse_phy_test_params(struct dp_link_private *link) goto end; } data = *bp; data = bp; link->request.phy_test_pattern_sel = data; Loading Loading @@ -939,7 +939,7 @@ static bool dp_link_is_test_supported(u32 test_requested) static int dp_link_parse_request(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; u32 const param_len = 0x1; Loading @@ -957,12 +957,12 @@ static int dp_link_parse_request(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("device service irq vector = 0x%x\n", data); if (!(data & BIT(1))) { pr_debug("no link requested\n"); pr_debug("no test requested\n"); goto end; } Loading @@ -978,7 +978,7 @@ static int dp_link_parse_request(struct dp_link_private *link) goto end; } data = *bp; data = bp; if (!dp_link_is_test_supported(data)) { pr_debug("link 0x%x not supported\n", data); Loading Loading @@ -1032,7 +1032,7 @@ static int dp_link_parse_request(struct dp_link_private *link) */ static void dp_link_parse_sink_count(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -1044,7 +1044,7 @@ static void dp_link_parse_sink_count(struct dp_link_private *link) return; } data = *bp; data = bp; /* BIT 7, BIT 5:0 */ link->sink_count.count = (data & BIT(7)) << 6 | (data & 0x63); Loading Loading @@ -1109,7 +1109,7 @@ static bool dp_link_phy_pattern_requested(struct dp_link *dp_link) static int dp_link_parse_vx_px(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int const param_len = 0x1; int const addr1 = 0x206; Loading @@ -1127,7 +1127,7 @@ static int dp_link_parse_vx_px(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("lanes 0/1 (Byte 0x206): 0x%x\n", data); Loading @@ -1148,7 +1148,7 @@ static int dp_link_parse_vx_px(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("lanes 2/3 (Byte 0x207): 0x%x\n", data); Loading drivers/gpu/drm/msm/dp/dp_usbpd.c +3 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,9 @@ static void dp_usbpd_response_cb(struct usbpd_svid_handler *hdlr, u8 cmd, pd->vdo = *vdos; dp_usbpd_get_status(pd); if (pd->dp_cb && pd->dp_cb->attention) pd->dp_cb->attention(pd->dev); if (!pd->dp_usbpd.alt_mode_cfg_done) dp_usbpd_send_event(pd, DP_USBPD_EVT_CONFIGURE); break; Loading Loading
drivers/gpu/drm/msm/dp/dp_link.c +29 −29 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ static char *dp_link_get_audio_sample_rate(u32 rate) static int dp_link_get_period(struct dp_link_private *link, int const addr) { int ret = 0; u8 *bp; u8 bp; u8 data; u32 const param_len = 0x1; u32 const max_audio_period = 0xA; Loading @@ -224,7 +224,7 @@ static int dp_link_get_period(struct dp_link_private *link, int const addr) goto exit; } data = *bp; data = bp; /* Period - Bits 3:0 */ data = data & 0xF; Loading Loading @@ -322,7 +322,7 @@ static int dp_link_parse_audio_channel_period(struct dp_link_private *link) static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -337,7 +337,7 @@ static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Audio Pattern Type - Bits 7:0 */ if ((int)data > max_audio_pattern_type) { Loading @@ -356,7 +356,7 @@ static int dp_link_parse_audio_pattern_type(struct dp_link_private *link) static int dp_link_parse_audio_mode(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -374,7 +374,7 @@ static int dp_link_parse_audio_mode(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Sampling Rate - Bits 3:0 */ sampling_rate = data & 0xF; Loading Loading @@ -528,14 +528,14 @@ static char *dp_link_bit_depth_to_string(u32 tbd) static int dp_link_parse_timing_params1(struct dp_link_private *link, int const addr, int const len, u32 *val) { u8 *bp; u8 bp[2]; int rlen; if (len < 2) return -EINVAL; /* Read the requested video link pattern (Byte 0x221). */ rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp, len); rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len); if (rlen < len) { pr_err("failed to read 0x%x\n", addr); return -EINVAL; Loading @@ -549,14 +549,14 @@ static int dp_link_parse_timing_params1(struct dp_link_private *link, static int dp_link_parse_timing_params2(struct dp_link_private *link, int const addr, int const len, u32 *val1, u32 *val2) { u8 *bp; u8 bp[2]; int rlen; if (len < 2) return -EINVAL; /* Read the requested video link pattern (Byte 0x221). */ rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp, len); rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len); if (rlen < len) { pr_err("failed to read 0x%x\n", addr); return -EINVAL; Loading @@ -571,7 +571,7 @@ static int dp_link_parse_timing_params2(struct dp_link_private *link, static int dp_link_parse_timing_params3(struct dp_link_private *link, int const addr, u32 *val) { u8 *bp; u8 bp; u32 len = 1; int rlen; Loading @@ -581,7 +581,7 @@ static int dp_link_parse_timing_params3(struct dp_link_private *link, pr_err("failed to read 0x%x\n", addr); return -EINVAL; } *val = bp[0]; *val = bp; return 0; } Loading @@ -597,7 +597,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) { int ret = 0; int rlen; u8 *bp; u8 bp; u8 data; u32 dyn_range; int const param_len = 0x1; Loading @@ -612,7 +612,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; if (!dp_link_is_video_pattern_valid(data)) { pr_err("invalid link video pattern = 0x%x\n", data); Loading @@ -634,7 +634,7 @@ static int dp_link_parse_video_pattern_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; /* Dynamic Range */ dyn_range = (data & BIT(3)) >> 3; Loading Loading @@ -789,7 +789,7 @@ static bool dp_link_is_lane_count_valid(u32 lane_count) */ static int dp_link_parse_link_training_params(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int ret = 0; int rlen; Loading @@ -803,7 +803,7 @@ static int dp_link_parse_link_training_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; if (!dp_link_is_link_rate_valid(data)) { pr_err("invalid link rate = 0x%x\n", data); Loading @@ -822,7 +822,7 @@ static int dp_link_parse_link_training_params(struct dp_link_private *link) ret = -EINVAL; goto exit; } data = *bp; data = bp; data &= 0x1F; if (!dp_link_is_lane_count_valid(data)) { Loading Loading @@ -861,7 +861,7 @@ static bool dp_link_is_phy_test_pattern_supported(u32 phy_test_pattern_sel) */ static int dp_link_parse_phy_test_params(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -876,7 +876,7 @@ static int dp_link_parse_phy_test_params(struct dp_link_private *link) goto end; } data = *bp; data = bp; link->request.phy_test_pattern_sel = data; Loading Loading @@ -939,7 +939,7 @@ static bool dp_link_is_test_supported(u32 test_requested) static int dp_link_parse_request(struct dp_link_private *link) { int ret = 0; u8 *bp; u8 bp; u8 data; int rlen; u32 const param_len = 0x1; Loading @@ -957,12 +957,12 @@ static int dp_link_parse_request(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("device service irq vector = 0x%x\n", data); if (!(data & BIT(1))) { pr_debug("no link requested\n"); pr_debug("no test requested\n"); goto end; } Loading @@ -978,7 +978,7 @@ static int dp_link_parse_request(struct dp_link_private *link) goto end; } data = *bp; data = bp; if (!dp_link_is_test_supported(data)) { pr_debug("link 0x%x not supported\n", data); Loading Loading @@ -1032,7 +1032,7 @@ static int dp_link_parse_request(struct dp_link_private *link) */ static void dp_link_parse_sink_count(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int rlen; int const param_len = 0x1; Loading @@ -1044,7 +1044,7 @@ static void dp_link_parse_sink_count(struct dp_link_private *link) return; } data = *bp; data = bp; /* BIT 7, BIT 5:0 */ link->sink_count.count = (data & BIT(7)) << 6 | (data & 0x63); Loading Loading @@ -1109,7 +1109,7 @@ static bool dp_link_phy_pattern_requested(struct dp_link *dp_link) static int dp_link_parse_vx_px(struct dp_link_private *link) { u8 *bp; u8 bp; u8 data; int const param_len = 0x1; int const addr1 = 0x206; Loading @@ -1127,7 +1127,7 @@ static int dp_link_parse_vx_px(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("lanes 0/1 (Byte 0x206): 0x%x\n", data); Loading @@ -1148,7 +1148,7 @@ static int dp_link_parse_vx_px(struct dp_link_private *link) goto end; } data = *bp; data = bp; pr_debug("lanes 2/3 (Byte 0x207): 0x%x\n", data); Loading
drivers/gpu/drm/msm/dp/dp_usbpd.c +3 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,9 @@ static void dp_usbpd_response_cb(struct usbpd_svid_handler *hdlr, u8 cmd, pd->vdo = *vdos; dp_usbpd_get_status(pd); if (pd->dp_cb && pd->dp_cb->attention) pd->dp_cb->attention(pd->dev); if (!pd->dp_usbpd.alt_mode_cfg_done) dp_usbpd_send_event(pd, DP_USBPD_EVT_CONFIGURE); break; Loading