Skip to content

Commit 0b1437b

Browse files
jannaumarcan
authored andcommitted
drm: apple: dptx: Add DPTX_APCALL_ACTIVATE
Configures the phy to the correct dcp(ext) source by abusing submode in the phy_set_mode_ext() call. Signed-off-by: Janne Grunau <[email protected]>
1 parent fea4f60 commit 0b1437b

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

drivers/gpu/drm/apple/dptxep.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,24 @@ dptxport_call_get_supports_downspread(struct apple_epic_service *service,
363363
return 0;
364364
}
365365

366+
static int
367+
dptxport_call_activate(struct apple_epic_service *service,
368+
const void *data, size_t data_size,
369+
void *reply, size_t reply_size)
370+
{
371+
struct dptx_port *dptx = service->cookie;
372+
const struct apple_dcp *dcp = service->ep->dcp;
373+
374+
// TODO: hack, use phy_set_mode to select the correct DCP(EXT) input
375+
phy_set_mode_ext(dptx->atcphy, PHY_MODE_DP, dcp->index);
376+
377+
memcpy(reply, data, min(reply_size, data_size));
378+
if (reply_size > 4)
379+
memset(reply, 0, 4);
380+
381+
return 0;
382+
}
383+
366384
static int dptxport_call(struct apple_epic_service *service, u32 idx,
367385
const void *data, size_t data_size, void *reply,
368386
size_t reply_size)
@@ -397,13 +415,15 @@ static int dptxport_call(struct apple_epic_service *service, u32 idx,
397415
case DPTX_APCALL_GET_MAX_DRIVE_SETTINGS:
398416
return dptxport_call_get_max_drive_settings(service, reply,
399417
reply_size);
418+
case DPTX_APCALL_ACTIVATE:
419+
return dptxport_call_activate(service, data, data_size,
420+
reply, reply_size);
400421
default:
401422
/* just try to ACK and hope for the best... */
402423
dev_info(service->ep->dcp->dev, "DPTXPort: acking unhandled call %u\n",
403424
idx);
404425
fallthrough;
405426
/* we can silently ignore and just ACK these calls */
406-
case DPTX_APCALL_ACTIVATE:
407427
case DPTX_APCALL_DEACTIVATE:
408428
case DPTX_APCALL_SET_DRIVE_SETTINGS:
409429
case DPTX_APCALL_GET_DRIVE_SETTINGS:

0 commit comments

Comments
 (0)