/* Return: 0 if all went well, else returns appropriate error value.  */
static int ti_sci_cmd_clk_is_on(const struct ti_sci_handle *handle, u32 dev_id, u8 clk_id, bool *req_state, bool *curr_state)
/* Return: 0 if all went well, else returns appropriate error value.  */
static int ti_sci_cmd_clk_is_on(const struct ti_sci_handle *handle, u32 dev_id, u8 clk_id, bool *req_state, bool *curr_state)
{
	u8 c_state = 0, r_state = 0;
	int ret;
	if (!req_state && !curr_state)
		return -EINVAL;
	ret = ti_sci_cmd_get_clock_state(handle, dev_id, clk_id,
					 &r_state, &c_state);
	if (ret)
		return ret;
	if (req_state)
		*req_state = (r_state == MSG_CLOCK_SW_STATE_REQ);
	if (curr_state)
		*curr_state = (c_state == MSG_CLOCK_HW_STATE_READY);
	return 0;
}