Example #1
0
void send_adm_cal(int port_id, int path)
{
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;

	pr_debug("%s\n", __func__);

	/* Maps audio_dev_ctrl path definition to ACDB definition */
	acdb_path = path - 1;
	if ((acdb_path >= NUM_AUDPROC_BUFFERS) ||
		(acdb_path < 0)) {
		pr_err("%s: Path is not RX or TX, path = %d\n",
			__func__, path);
		goto done;
	}

	pr_debug("%s: Sending audproc cal\n", __func__);
	get_audproc_cal(acdb_path, &aud_cal);
	send_cal(port_id, &aud_cal);

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);
	send_cal(port_id, &aud_cal);
done:
	return;
}
Example #2
0
void send_adm_cal(int port_id, int path)
{
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;

	pr_debug("%s\n", __func__);

	/* Maps audio_dev_ctrl path definition to ACDB definition */
	acdb_path = path - 1;

	pr_debug("%s: Sending audproc cal\n", __func__);
	get_audproc_cal(acdb_path, &aud_cal);
	if (!send_adm_cal_block(port_id, &aud_cal))
		pr_info("%s: Audproc cal sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_info("%s: Audproc cal not sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);
	if (!send_adm_cal_block(port_id, &aud_cal))
		pr_info("%s: Audvol cal sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_info("%s: Audvol cal not sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
}
Example #3
0
static void send_adm_cal(int port_id, int path)
{
	int			result = 0;
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;
	int flag = 0;
	int index = afe_get_port_index(port_id);

	pr_debug("%s\n", __func__);

	/* Maps audio_dev_ctrl path definition to ACDB definition */
	acdb_path = path - 1;

	pr_debug("%s: Sending audproc cal\n", __func__);
	get_audproc_cal(acdb_path, &aud_cal);

	/* map & cache buffers used */
	if (((mem_addr_audproc[acdb_path].cal_paddr != aud_cal.cal_paddr)  &&
		(aud_cal.cal_size > 0)) ||
		(aud_cal.cal_size > mem_addr_audproc[acdb_path].cal_size)) {

		if (mem_addr_audproc[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(
				&mem_addr_audproc[acdb_path].cal_paddr,
				&mem_addr_audproc[acdb_path].cal_size, 1);

		result = adm_memory_map_regions(&aud_cal.cal_paddr, 0,
					&aud_cal.cal_size, 1);
		if (result < 0)
			pr_err("ADM audproc mmap did not work! path = %d, "
				"addr = 0x%x, size = %d\n", acdb_path,
				aud_cal.cal_paddr, aud_cal.cal_size);
		else
			mem_addr_audproc[acdb_path] = aud_cal;
	}
	if (this_adm.prev_index != index) {
		if (!send_adm_cal_block(port_id, &aud_cal))
			pr_debug("%s: Audproc cal sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
		else
			pr_debug("%s: Audproc cal not sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
		this_adm.prev_index = index;
		flag = 1;
	}

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);

	/* map & cache buffers used */
	if (((mem_addr_audvol[acdb_path].cal_paddr != aud_cal.cal_paddr)  &&
		(aud_cal.cal_size > 0))  ||
		(aud_cal.cal_size > mem_addr_audvol[acdb_path].cal_size)) {
		if (mem_addr_audvol[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(
				&mem_addr_audvol[acdb_path].cal_paddr,
				&mem_addr_audvol[acdb_path].cal_size, 1);

		result = adm_memory_map_regions(&aud_cal.cal_paddr, 0,
					&aud_cal.cal_size, 1);
		if (result < 0)
			pr_err("ADM audvol mmap did not work! path = %d, "
				"addr = 0x%x, size = %d\n", acdb_path,
				aud_cal.cal_paddr, aud_cal.cal_size);
		else
			mem_addr_audvol[acdb_path] = aud_cal;
	}
	if ((this_adm.prev_index == index) && (flag == 1)) {
		if (!send_adm_cal_block(port_id, &aud_cal))
			pr_debug("%s: Audvol cal sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
		else
			pr_debug("%s: Audvol cal not sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
	}

}
Example #4
0
static void send_adm_cal(int port_id, int path)
{
	int			result = 0;
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;

	pr_debug("%s\n", __func__);

	
	acdb_path = path - 1;

	pr_debug("%s: Sending audproc cal\n", __func__);
	get_audproc_cal(acdb_path, &aud_cal);

	
	if (((mem_addr_audproc[acdb_path].cal_paddr != aud_cal.cal_paddr)  &&
		(aud_cal.cal_size > 0)) ||
		(aud_cal.cal_size > mem_addr_audproc[acdb_path].cal_size)) {

		if (mem_addr_audproc[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(
				&mem_addr_audproc[acdb_path].cal_paddr,
				&mem_addr_audproc[acdb_path].cal_size, 1);

		result = adm_memory_map_regions(&aud_cal.cal_paddr, 0,
					&aud_cal.cal_size, 1);
		if (result < 0)
			pr_err("ADM audproc mmap did not work! path = %d, "
				"addr = 0x%x, size = %d\n", acdb_path,
				aud_cal.cal_paddr, aud_cal.cal_size);
		else
			mem_addr_audproc[acdb_path] = aud_cal;
	}

	if (!send_adm_cal_block(port_id, &aud_cal))
		pr_debug("%s: Audproc cal sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_debug("%s: Audproc cal not sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);

	
	if (((mem_addr_audvol[acdb_path].cal_paddr != aud_cal.cal_paddr)  &&
		(aud_cal.cal_size > 0))  ||
		(aud_cal.cal_size > mem_addr_audvol[acdb_path].cal_size)) {
		if (mem_addr_audvol[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(
				&mem_addr_audvol[acdb_path].cal_paddr,
				&mem_addr_audvol[acdb_path].cal_size, 1);

		result = adm_memory_map_regions(&aud_cal.cal_paddr, 0,
					&aud_cal.cal_size, 1);
		if (result < 0)
			pr_err("ADM audvol mmap did not work! path = %d, "
				"addr = 0x%x, size = %d\n", acdb_path,
				aud_cal.cal_paddr, aud_cal.cal_size);
		else
			mem_addr_audvol[acdb_path] = aud_cal;
	}

	if (!send_adm_cal_block(port_id, &aud_cal))
		pr_debug("%s: Audvol cal sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_debug("%s: Audvol cal not sent for port id: %d, path %d\n",
			__func__, port_id, acdb_path);
}
Example #5
0
static void send_adm_cal(int port_id, int path, int perf_mode)
{
	int			result = 0;
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;
	int			size = 4096;
	pr_debug("%s\n", __func__);

	/* Maps audio_dev_ctrl path definition to ACDB definition */
	acdb_path = path - 1;

	pr_debug("%s: Sending audproc cal\n", __func__);
	get_audproc_cal(acdb_path, &aud_cal);

	/* map & cache buffers used */
	atomic_set(&this_adm.mem_map_cal_index, acdb_path);
	if (((this_adm.mem_addr_audproc[acdb_path].cal_paddr !=
		aud_cal.cal_paddr)  && (aud_cal.cal_size > 0)) ||
		(aud_cal.cal_size >
		this_adm.mem_addr_audproc[acdb_path].cal_size)) {

		if (this_adm.mem_addr_audproc[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(GLOBAL_CFG);

		result = adm_memory_map_regions(GLOBAL_CFG,
						&aud_cal.cal_paddr,
						0, &size, 1);
		if (result < 0) {
			pr_err("ADM audproc mmap did not work! path = %d, addr = 0x%x, size = %d\n",
				acdb_path, aud_cal.cal_paddr,
				aud_cal.cal_size);
		} else {
			this_adm.mem_addr_audproc[acdb_path].cal_paddr =
							aud_cal.cal_paddr;
			this_adm.mem_addr_audproc[acdb_path].cal_size = size;
		}
	}

	if (!send_adm_cal_block(port_id, &aud_cal, perf_mode))
		pr_debug("%s: Audproc cal sent for port id: %#x, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_debug("%s: Audproc cal not sent for port id: %#x, path %d\n",
			__func__, port_id, acdb_path);

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);

	/* map & cache buffers used */
	atomic_set(&this_adm.mem_map_cal_index,
		(acdb_path + MAX_AUDPROC_TYPES));
	if (((this_adm.mem_addr_audvol[acdb_path].cal_paddr !=
		aud_cal.cal_paddr)  && (aud_cal.cal_size > 0))  ||
		(aud_cal.cal_size >
		this_adm.mem_addr_audvol[acdb_path].cal_size)) {

		if (this_adm.mem_addr_audvol[acdb_path].cal_paddr != 0)
			adm_memory_unmap_regions(GLOBAL_CFG);

		result = adm_memory_map_regions(GLOBAL_CFG, &aud_cal.cal_paddr,
						0, &size, 1);
		if (result < 0) {
			pr_err("ADM audvol mmap did not work! path = %d, addr = 0x%x, size = %d\n",
				acdb_path, aud_cal.cal_paddr,
				aud_cal.cal_size);
		} else {
			this_adm.mem_addr_audvol[acdb_path].cal_paddr =
							aud_cal.cal_paddr;
			this_adm.mem_addr_audvol[acdb_path].cal_size = size;
		}
	}

	if (!send_adm_cal_block(port_id, &aud_cal, perf_mode))
		pr_debug("%s: Audvol cal sent for port id: %#x, path %d\n",
			__func__, port_id, acdb_path);
	else
		pr_debug("%s: Audvol cal not sent for port id: %#x, path %d\n",
			__func__, port_id, acdb_path);
}