コード例 #1
0
ファイル: mhl_8334.c プロジェクト: ChangYeoun/F93_Kite
static int mhl_rcp_recv(u8 key_code)
{
	int rc;
	if (rcp_key_code_tbl[(key_code & 0x7f)]) {
		/*
		 * TODO: Take action for the RCP cmd
		 */

		/* send ack to rcp cmd*/
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPK,
			key_code);
	} else {
		/* send rcp error */
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPE,
			MHL_RCPE_UNSUPPORTED_KEY_CODE);
		if (rc)
			return rc;
		/* send rcpk after rcpe send */
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPK,
			key_code);
	}
	return rc;
}
コード例 #2
0
static int mhl_rcp_recv(u8 key_code)
{
	int rc;
	if (rcp_key_code_tbl[(key_code & 0x7f)]) {

		
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPK,
			key_code);
	} else {
		
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPE,
			MHL_RCPE_UNSUPPORTED_KEY_CODE);
		if (rc)
			return rc;
		
		rc = mhl_msc_send_msc_msg(
			MHL_MSC_MSG_RCPK,
			key_code);
	}
	return rc;
}
コード例 #3
0
ファイル: mhl_8334.c プロジェクト: ChangYeoun/F93_Kite
static int mhl_rap_recv(u8 action_code)
{
	u8 error_code;

	switch (action_code) {
	/*case MHL_RAP_POLL:*/
	case MHL_RAP_CONTENT_ON:
	case MHL_RAP_CONTENT_OFF:
		mhl_rap_action(action_code);
		error_code = MHL_RAPK_NO_ERROR;
		/* notify userspace */
		break;
	default:
		error_code = MHL_RAPK_UNRECOGNIZED_ACTION_CODE;
		break;
	}
	/* prior send rapk */
	return mhl_msc_send_msc_msg(
		MHL_MSC_MSG_RAPK,
		error_code);
}
コード例 #4
0
static int mhl_rap_recv(u8 action_code)
{
	u8 error_code;

	switch (action_code) {
	
	case MHL_RAP_CONTENT_ON:
	case MHL_RAP_CONTENT_OFF:
		mhl_rap_action(action_code);
		error_code = MHL_RAPK_NO_ERROR;
		
		break;
	default:
		error_code = MHL_RAPK_UNRECOGNIZED_ACTION_CODE;
		break;
	}
	
	return mhl_msc_send_msc_msg(
		MHL_MSC_MSG_RAPK,
		error_code);
}
コード例 #5
0
int mhl_msc_recv_write_stat(struct mhl_tx_ctrl *mhl_ctrl,
			    u8 offset, u8 value)
{
	bool tmds_en;

	if (offset >= 2)
		return -EFAULT;

	switch (offset) {
	case 0:
		/*
		 * connected device bits
		 * changed and DEVCAP READY
		 */
		if (((value ^ mhl_ctrl->status[offset]) &
		     MHL_STATUS_DCAP_RDY)) {
			if (value & MHL_STATUS_DCAP_RDY) {
				mhl_ctrl->devcap_state = 0;
				mhl_msc_read_devcap_all(mhl_ctrl);
			} else {
				/*
				 * peer dcap turned not ready
				 * use old devap state
				 */
				pr_debug("%s: DCAP RDY bit cleared\n",
					 __func__);
			}
		}
		break;
	case 1:
		/*
		 * connected device bits
		 * changed and PATH ENABLED
		 * bit set
		 */
		tmds_en = mhl_check_tmds_enabled(mhl_ctrl);
		if ((value ^ mhl_ctrl->status[offset])
		    & MHL_STATUS_PATH_ENABLED) {
			if (value & MHL_STATUS_PATH_ENABLED) {
				if (tmds_en &&
				    (mhl_ctrl->devcap[offset] &
				     MHL_FEATURE_RAP_SUPPORT)) {
					mhl_msc_send_msc_msg(
						mhl_ctrl,
						MHL_MSC_MSG_RAP,
						MHL_RAP_CONTENT_ON);
				}
				mhl_ctrl->path_en_state
					|= (MHL_STATUS_PATH_ENABLED |
					    MHL_STATUS_CLK_MODE_NORMAL);
				mhl_msc_send_write_stat(
					mhl_ctrl,
					MHL_STATUS_REG_LINK_MODE,
					mhl_ctrl->path_en_state);
			} else {
				mhl_ctrl->path_en_state
					&= ~(MHL_STATUS_PATH_ENABLED |
					     MHL_STATUS_CLK_MODE_NORMAL);
				mhl_msc_send_write_stat(
					mhl_ctrl,
					MHL_STATUS_REG_LINK_MODE,
					mhl_ctrl->path_en_state);
			}
		}
		break;
	}
	mhl_ctrl->status[offset] = value;
	return 0;
}