@@ -286,6 +286,12 @@ static void sii8620_mt_msc_cmd_send(struct sii8620 *ctx,
286
286
sii8620_write (ctx , REG_MSC_COMMAND_START ,
287
287
BIT_MSC_COMMAND_START_MSC_MSG );
288
288
break ;
289
+ case MHL_READ_DEVCAP_REG :
290
+ case MHL_READ_XDEVCAP_REG :
291
+ sii8620_write (ctx , REG_MSC_CMD_OR_OFFSET , msg -> reg [1 ]);
292
+ sii8620_write (ctx , REG_MSC_COMMAND_START ,
293
+ BIT_MSC_COMMAND_START_READ_DEVCAP );
294
+ break ;
289
295
default :
290
296
dev_err (ctx -> dev , "%s: command %#x not supported\n" , __func__ ,
291
297
msg -> reg [0 ]);
@@ -455,6 +461,35 @@ static void sii8620_mt_read_devcap(struct sii8620 *ctx, bool xdevcap)
455
461
msg -> recv = sii8620_mt_read_devcap_recv ;
456
462
}
457
463
464
+ static void sii8620_mt_read_devcap_reg_recv (struct sii8620 * ctx ,
465
+ struct sii8620_mt_msg * msg )
466
+ {
467
+ u8 reg = msg -> reg [0 ] & 0x7f ;
468
+
469
+ if (msg -> reg [0 ] & 0x80 )
470
+ ctx -> xdevcap [reg ] = msg -> ret ;
471
+ else
472
+ ctx -> devcap [reg ] = msg -> ret ;
473
+ }
474
+
475
+ static void sii8620_mt_read_devcap_reg (struct sii8620 * ctx , u8 reg )
476
+ {
477
+ struct sii8620_mt_msg * msg = sii8620_mt_msg_new (ctx );
478
+
479
+ if (!msg )
480
+ return ;
481
+
482
+ msg -> reg [0 ] = (reg & 0x80 ) ? MHL_READ_XDEVCAP_REG : MHL_READ_DEVCAP_REG ;
483
+ msg -> reg [1 ] = reg ;
484
+ msg -> send = sii8620_mt_msc_cmd_send ;
485
+ msg -> recv = sii8620_mt_read_devcap_reg_recv ;
486
+ }
487
+
488
+ static inline void sii8620_mt_read_xdevcap_reg (struct sii8620 * ctx , u8 reg )
489
+ {
490
+ sii8620_mt_read_devcap_reg (ctx , reg | 0x80 );
491
+ }
492
+
458
493
static void sii8620_fetch_edid (struct sii8620 * ctx )
459
494
{
460
495
u8 lm_ddc , ddc_cmd , int3 , cbus ;
0 commit comments