Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4a33e32 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher
Browse files

drm/amd/powerplay: clean up code in vega10_smumgr.c



1. fix typo in print message info.
2. fix block comments's coding style.

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 236763d3
Loading
Loading
Loading
Loading
+45 −56
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ static bool vega10_is_smc_ram_running(struct pp_smumgr *smumgr)
	return false;
}

/**
/*
 * Check if SMC has responded to previous message.
 *
 * @param    smumgr  the address of the powerplay hardware manager.
@@ -96,9 +96,8 @@ static uint32_t vega10_wait_for_response(struct pp_smumgr *smumgr)
	return cgs_read_register(smumgr->device, reg);
}

/**
/*
 * Send a message to the SMC, and do not wait for its response.
*
 * @param    smumgr  the address of the powerplay hardware manager.
 * @param    msg the message to send.
 * @return   Always return 0.
@@ -118,12 +117,11 @@ int vega10_send_msg_to_smc_without_waiting(struct pp_smumgr *smumgr,
	return 0;
}

/**
/*
 * Send a message to the SMC, and wait for its response.
*
 * @param    smumgr  the address of the powerplay hardware manager.
 * @param    msg the message to send.
* @return   The response that came from the SMC.
 * @return   Always return 0.
 */
int vega10_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg)
{
@@ -141,17 +139,17 @@ int vega10_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg)
	vega10_send_msg_to_smc_without_waiting(smumgr, msg);

	if (vega10_wait_for_response(smumgr) != 1)
		pr_err("Failed to send Message: 0x%x\n.", msg);
		pr_err("Failed to send message: 0x%x\n", msg);

	return 0;
}

/**
/*
 * Send a message to the SMC with parameter
 * @param    smumgr:  the address of the powerplay hardware manager.
 * @param    msg: the message to send.
 * @param    parameter: the parameter to send
 * @return   The response that came from the SMC.
 * @return   Always return 0.
 */
int vega10_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr,
		uint16_t msg, uint32_t parameter)
@@ -174,15 +172,14 @@ int vega10_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr,
	vega10_send_msg_to_smc_without_waiting(smumgr, msg);

	if (vega10_wait_for_response(smumgr) != 1)
		pr_err("Failed to send Message: 0x%x\n.", msg);
		pr_err("Failed to send message: 0x%x\n", msg);

	return 0;
}


/**
/*
 * Send a message to the SMC with parameter, do not wait for response
*
 * @param    smumgr:  the address of the powerplay hardware manager.
 * @param    msg: the message to send.
 * @param    parameter: the parameter to send
@@ -200,9 +197,8 @@ int vega10_send_msg_to_smc_with_parameter_without_waiting(
	return vega10_send_msg_to_smc_without_waiting(smumgr, msg);
}

/**
/*
 * Retrieve an argument from SMC.
*
 * @param    smumgr  the address of the powerplay hardware manager.
 * @param    arg     pointer to store the argument from SMC.
 * @return   Always return 0.
@@ -219,7 +215,7 @@ int vega10_read_arg_from_smc(struct pp_smumgr *smumgr, uint32_t *arg)
	return 0;
}

/**
/*
 * Copy table from SMC into driver FB
 * @param   smumgr    the address of the SMC manager
 * @param   table_id    the driver's table ID to copy from
@@ -257,7 +253,7 @@ int vega10_copy_table_from_smc(struct pp_smumgr *smumgr,
	return 0;
}

/**
/*
 * Copy table from Driver FB into SMC
 * @param   smumgr    the address of the SMC manager
 * @param   table_id    the table to copy from
@@ -378,13 +374,6 @@ static int vega10_verify_smc_interface(struct pp_smumgr *smumgr)
	return 0;
}

/**
* Write a 32bit value to the SMC SRAM space.
* ALL PARAMETERS ARE IN HOST BYTE ORDER.
* @param    smumgr  the address of the powerplay hardware manager.
* @param    smc_addr the address in the SMC RAM to access.
* @param    value to write to the SMC SRAM.
*/
static int vega10_smu_init(struct pp_smumgr *smumgr)
{
	struct vega10_smumgr *priv;