当前位置: 首页>>代码示例>>C++>>正文


C++ pr_aud_err函数代码示例

本文整理汇总了C++中pr_aud_err函数的典型用法代码示例。如果您正苦于以下问题:C++ pr_aud_err函数的具体用法?C++ pr_aud_err怎么用?C++ pr_aud_err使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pr_aud_err函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: snddev_icodec_set_device_volume_impl

static int snddev_icodec_set_device_volume_impl(
		struct msm_snddev_info *dev_info, u32 volume)
{
	struct snddev_icodec_state *icodec;
	u8 afe_path_id;

	int rc = 0;

	icodec = dev_info->private_data;

	if (icodec->data->capability & SNDDEV_CAP_RX) {
		if (support_aic3254)
			return rc;
		afe_path_id = AFE_HW_PATH_CODEC_RX;
	} else
		afe_path_id = AFE_HW_PATH_CODEC_TX;

	if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_DIGITAL) {
		if (support_adie) {
			rc = adie_codec_set_device_digital_volume(icodec->adie_path,
					icodec->data->channel_mode ==
							REAL_STEREO_CHANNEL_MODE ?
						2 : icodec->data->channel_mode, volume);

			if (rc < 0) {
				pr_aud_err("%s: unable to set_device_digital_volume for"
					"%s volume in percentage = %u\n",
					__func__, dev_info->name, volume);
				return rc;
			}
		}

	} else if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_ANALOG) {
		if (support_adie) {
			rc = adie_codec_set_device_analog_volume(icodec->adie_path,
					icodec->data->channel_mode ==
							REAL_STEREO_CHANNEL_MODE ?
						2 : icodec->data->channel_mode, volume);
			if (rc < 0) {
				pr_aud_err("%s: unable to set_device_analog_volume for"
					"%s volume in percentage = %u\n",
					__func__, dev_info->name, volume);
				return rc;
			}
		}
	} else {
		pr_aud_err("%s: Invalid device volume control\n", __func__);
		return -EPERM;
	}
	return rc;
}
开发者ID:MaxGomez,项目名称:HTC-SPADE-7x30-3.0-ION,代码行数:51,代码来源:snddev_icodec.c

示例2: elite_audio_init

static int __init elite_audio_init(void)
{
	int ret;
	#ifdef CONFIG_AUDIO_USAGE_FOR_POWER_CONSUMPTION
	int retval = 0;
	#endif
	pr_aud_info("%s", __func__);

	msm8960_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8960_snd_device) {
		pr_aud_err("%s, Platform device allocation failed\n", __func__);
		return -ENOMEM;
	}

	platform_set_drvdata(msm8960_snd_device, &snd_soc_card_msm8960);
	ret = platform_device_add(msm8960_snd_device);
	if (ret) {
		pr_aud_err("%s, Platform device add failed\n", __func__);
		platform_device_put(msm8960_snd_device);
		return ret;
	}

	mutex_init(&audio_notifier_lock);
	pr_aud_info("%s: register cable detect func for dock", __func__);
	ret = cable_detect_register_notifier(&audio_dock_notifier);

	#ifdef CONFIG_AUDIO_USAGE_FOR_POWER_CONSUMPTION
	/* Create two audio status file nodes, audio_speaker_t and
	 * audio_headset_t under /sys/audio_stats/					*/
	if (audio_stat_kobj == NULL)
	{
		audio_stat_kobj = kobject_create_and_add("audio_stats", NULL);
		retval = sysfs_create_file(audio_stat_kobj, attrs[0]);
		if (!retval)
		{
			pr_err("Speaker file node creation failed under kobject\n");
		}
		retval = sysfs_create_file(audio_stat_kobj, attrs[1]);
		if (!retval)
		{
			pr_err("Headset file node creation failed under kobject\n");
		}
	}
	#endif

	htc_8960_register_q6asm_ops(&qops);
	htc_8960_register_pcm_routing_ops(&rops);
	acoustic_register_ops(&acoustic);
	return ret;

}
开发者ID:Team-Blackout,项目名称:BeastMode-Evita,代码行数:51,代码来源:board-elite-audio.c

示例3: audio_mvs_stop

static int audio_mvs_stop(struct audio_mvs_info_type *audio)
{
	int rc = 0;
	struct audio_mvs_release_msg release_msg;

	pr_aud_info("%s:\n", __func__);

	/* Release MVS. */
	memset(&release_msg, 0, sizeof(release_msg));
	release_msg.client_id = cpu_to_be32(MVS_CLIENT_ID_VOIP);

	msm_rpc_setup_req(&release_msg.rpc_hdr,
			  audio->rpc_prog,
			  audio->rpc_ver,
			  MVS_RELEASE_PROC);

	audio->rpc_status = RPC_STATUS_FAILURE;
	rc = msm_rpc_write(audio->rpc_endpt, &release_msg, sizeof(release_msg));

	if (rc >= 0) {
		pr_debug("%s: RPC write for release done\n", __func__);

		rc = wait_event_timeout(audio->wait,
				(audio->rpc_status != RPC_STATUS_FAILURE),
				1 * HZ);

		if (rc > 0) {
			pr_debug("%s: Wait event for release succeeded\n",
				 __func__);

			audio->state = AUDIO_MVS_STOPPED;

			/* Un-block read in case it is waiting for data. */
			wake_up(&audio->out_wait);

			rc = 0;
		} else {
			pr_aud_err("%s: Wait event for release failed %d\n",
			       __func__, rc);
		}
	} else {
		pr_aud_err("%s: RPC write for release failed %d\n", __func__, rc);
	}

	/* Allow sleep. */
	wake_unlock(&audio->suspend_lock);
	wake_unlock(&audio->idle_lock);

	return rc;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:50,代码来源:audio_mvs.c

示例4: audio_mvs_setup_voc

static int audio_mvs_setup_voc(struct audio_mvs_info_type *audio)
{
	int rc = 0;
	struct audio_mvs_set_voc_mode_msg set_voc_mode_msg;

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

	/* Set EVRC mode. */
	memset(&set_voc_mode_msg, 0, sizeof(set_voc_mode_msg));
	set_voc_mode_msg.min_rate = cpu_to_be32(audio->rate_type);
	set_voc_mode_msg.max_rate = cpu_to_be32(audio->rate_type);

	msm_rpc_setup_req(&set_voc_mode_msg.rpc_hdr,
			  audio->rpc_prog,
			  audio->rpc_ver,
			  MVS_VOC_SET_FRAME_RATE_PROC);

	audio->rpc_status = RPC_STATUS_FAILURE;
	rc = msm_rpc_write(audio->rpc_endpt,
			   &set_voc_mode_msg,
			   sizeof(set_voc_mode_msg));

	if (rc >= 0) {
		pr_debug("%s: RPC write for set voc mode done\n", __func__);

		rc = wait_event_timeout(audio->wait,
				      (audio->rpc_status != RPC_STATUS_FAILURE),
				      1 * HZ);

		if (rc > 0) {
			pr_debug("%s: Wait event for set voc mode succeeded\n",
				 __func__);

			/* Save the MVS configuration information. */
			audio->frame_mode = MVS_FRAME_MODE_VOC_RX;

			rc = 0;
		} else {
			pr_aud_err("%s: Wait event for set voc mode failed %d\n",
			       __func__, rc);
		}
	} else {
		pr_aud_err("%s: RPC write for set voc mode failed %d\n",
		       __func__, rc);
	}

	return rc;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:48,代码来源:audio_mvs.c

示例5: msm_device_volume_put

static int msm_device_volume_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int rc = -EPERM;
	struct msm_snddev_info *dev_info;

	int dev_id = ucontrol->value.integer.value[0];
	int volume = ucontrol->value.integer.value[1];

	MM_DBG("dev_id = %d, volume = %d\n", dev_id, volume);

	pr_aud_info("[ALSA] msm_set_device_volume: dev %d, volume %d\n",
		dev_id, volume);
	dev_info = audio_dev_ctrl_find_dev(dev_id);

	if (IS_ERR(dev_info)) {
		rc = PTR_ERR(dev_info);
		pr_aud_err("%s: audio_dev_ctrl_find_dev failed. %ld \n",
			__func__, PTR_ERR(dev_info));
		return rc;
	}

	MM_DBG("dev_name = %s dev_id = %d, volume = %d\n",
				dev_info->name, dev_id, volume);

	if (dev_info->dev_ops.set_device_volume)
		rc = dev_info->dev_ops.set_device_volume(dev_info, volume);
	else {
		pr_aud_info("%s : device %s does not support device volume "
				"control.", __func__, dev_info->name);
		return -EPERM;
	}

	return rc;
}
开发者ID:OMFGB,项目名称:OMFGB_Mecha_Kernel,代码行数:35,代码来源:msm7x30.c

示例6: shooter_u_snddev_bmic_pamp_on

void shooter_u_snddev_bmic_pamp_on(int en)
{
	int ret;

	pr_aud_info("%s %d\n", __func__, en);

	if (en) {
		ret = pm8058_micbias_enable(OTHC_MICBIAS_1, OTHC_SIGNAL_ALWAYS_ON);
		if (ret)
			pr_aud_err("%s: Enabling back mic power failed\n", __func__);
	} else {
		ret = pm8058_micbias_enable(OTHC_MICBIAS_1, OTHC_SIGNAL_OFF);
		if (ret)
			pr_aud_err("%s: Enabling back mic power failed\n", __func__);
	}
}
开发者ID:cmartinbaughman,项目名称:msm8660_3.4_htc_kernel,代码行数:16,代码来源:board-shooter_u-audio.c

示例7: audio_out_listener

static void audio_out_listener(u32 evt_id, union auddev_evt_data *evt_payload,
				void *private_data)
{
	struct audio *audio = private_data;
	switch (evt_id) {
	case AUDDEV_EVT_DEV_RDY:
		MM_DBG(":AUDDEV_EVT_DEV_RDY\n");
		audio->source |= (0x1 << evt_payload->routing_id);
		if (audio->running == 1 && audio->enabled == 1)
			audpp_route_stream(audio->dec_id, audio->source);
		break;
	case AUDDEV_EVT_DEV_RLS:
		MM_DBG(":AUDDEV_EVT_DEV_RLS\n");
		audio->source &= ~(0x1 << evt_payload->routing_id);
		if (audio->running == 1 && audio->enabled == 1)
			audpp_route_stream(audio->dec_id, audio->source);
		break;
	case AUDDEV_EVT_STREAM_VOL_CHG:
		audio->vol_pan.volume = evt_payload->session_vol;
		MM_DBG(":AUDDEV_EVT_STREAM_VOL_CHG, stream vol %d\n",
				audio->vol_pan.volume);
		if (audio->running)
			audpp_dsp_set_vol_pan(audio->dec_id, &audio->vol_pan,
					POPP);
		break;
	default:
		pr_aud_err("ERROR:wrong event\n");
		break;
       }
}
开发者ID:MaxGomez,项目名称:HTC-SPADE-7x30-3.0-ION,代码行数:30,代码来源:audio_out.c

示例8: fm_audio_ioctl

static long fm_audio_ioctl(struct file *file, unsigned int cmd,
		unsigned long arg)
{
	struct audio *audio = file->private_data;
	int rc = -EINVAL;


	mutex_lock(&audio->lock);
	switch (cmd) {
	case AUDIO_START:
		pr_aud_info("%s: AUDIO_START\n", __func__);
		rc = fm_audio_enable(audio);
		break;
	case AUDIO_STOP:
		pr_aud_info("%s: AUDIO_STOP\n", __func__);
		rc = fm_audio_disable(audio);
		audio->running = 0;
		audio->enabled = 0;
		break;
	case AUDIO_GET_SESSION_ID:
		if (copy_to_user((void *) arg, &audio->dec_id,
					sizeof(unsigned short)))
			rc = -EFAULT;
		else
			rc = 0;
		break;
	default:
		rc = -EINVAL;
		pr_aud_err("%s: Un supported IOCTL\n", __func__);
	}
	mutex_unlock(&audio->lock);
	return rc;
}
开发者ID:Albinoman887,项目名称:pyramid-3.4.10,代码行数:33,代码来源:fm.c

示例9: msm_clear_all_session

int msm_clear_all_session()
{
	int rc = 0;
	int i = 0, j = 0;
	pr_aud_info("%s:\n", __func__);
	mutex_lock(&routing_info.adm_mutex);
	mutex_lock(&routing_info.copp_list_mutex);
	for (j = 1; j < MAX_SESSIONS; j++) {
		for (i = 0; i < AFE_MAX_PORTS; i++) {
			if (routing_info.copp_list[j][i] != DEVICE_IGNORE) {
				rc = adm_close(
					routing_info.copp_list[j][i]);
				if (rc < 0) {
					pr_aud_err("%s: adm close fail copp[%d]"
					"session[%d] rc[%d]\n",
					__func__,
					routing_info.copp_list[j][i],
					j, rc);
					continue;
				}
				routing_info.copp_list[j][i] = DEVICE_IGNORE;
				rc = 0;
			}
		}
	}
	mutex_unlock(&routing_info.copp_list_mutex);
	mutex_unlock(&routing_info.adm_mutex);
	return rc;
}
开发者ID:Alex163,项目名称:htc-kernel-pyramid,代码行数:29,代码来源:audio_dev_ctl.c

示例10: adie_codec_set_device_analog_volume

int adie_codec_set_device_analog_volume(struct adie_codec_path *path_ptr,
		u32 num_channels, u32 volume /* in percentage */)
{
	pr_aud_err("%s: analog device volume not supported\n", __func__);

	return -EPERM;
}
开发者ID:Flemmard,项目名称:htc7x30-3.0,代码行数:7,代码来源:marimba-codec.c

示例11: verdi_lte_reset_timpani

void verdi_lte_reset_timpani(void)
{
	pr_aud_err("hard reset timpani\n");
	gpio_set_value(VERDI_LTE_AUD_QTR_RESET, 0);
	mdelay(10);
	gpio_set_value(VERDI_LTE_AUD_QTR_RESET, 1);
}
开发者ID:finniest,项目名称:hive_kernel,代码行数:7,代码来源:board-verdi-lte-audio.c

示例12: verdi_lte_reset_3254

void verdi_lte_reset_3254(void)
{
	pr_aud_err("hard reset aic3254\n");
	gpio_set_value(PM8058_GPIO_PM_TO_SYS(VERDI_LTE_AUD_CODEC_RST), 0);
	mdelay(1);
	gpio_set_value(PM8058_GPIO_PM_TO_SYS(VERDI_LTE_AUD_CODEC_RST), 1);
}
开发者ID:finniest,项目名称:hive_kernel,代码行数:7,代码来源:board-verdi-lte-audio.c

示例13: msm_clear_session_id

int msm_clear_session_id(int session_id)
{
	int rc = 0;
	int i = 0;
	if (session_id < 1 || session_id > 8)
		return -EINVAL;
	pr_debug("%s: session[%d]\n", __func__, session_id);
	mutex_lock(&routing_info.adm_mutex);
	mutex_lock(&routing_info.copp_list_mutex);
	for (i = 0; i < AFE_MAX_PORTS; i++) {
		if (routing_info.copp_list[session_id][i] != DEVICE_IGNORE) {
			rc = adm_close(routing_info.copp_list[session_id][i]);
			if (rc < 0) {
				pr_aud_err("%s: adm close fail port[%d] rc[%d]\n",
					__func__,
					routing_info.copp_list[session_id][i],
					rc);
				continue;
			}
			routing_info.copp_list[session_id][i] = DEVICE_IGNORE;
			rc = 0;
		}
	}
	mutex_unlock(&routing_info.copp_list_mutex);
	mutex_unlock(&routing_info.adm_mutex);

	return rc;
}
开发者ID:Alex163,项目名称:htc-kernel-pyramid,代码行数:28,代码来源:audio_dev_ctl.c

示例14: msm8960_enable_codec_ext_clk

int msm8960_enable_codec_ext_clk(
		struct snd_soc_codec *codec, int enable)
{
	pr_debug("%s: enable = %d\n", __func__, enable);
	if (enable) {
		clk_users++;
		pr_debug("%s: clk_users = %d\n", __func__, clk_users);
		if (clk_users != 1)
			return 0;

		codec_clk = clk_get(NULL, "i2s_spkr_osr_clk");
		if (codec_clk) {
			clk_set_rate(codec_clk, TABLA_EXT_CLK_RATE);
			clk_enable(codec_clk);
			tabla_mclk_enable(codec, 1);
		} else {
			pr_aud_err("%s: Error setting Tabla MCLK\n", __func__);
			clk_users--;
			return -EINVAL;
		}
	} else {
		pr_debug("%s: clk_users = %d\n", __func__, clk_users);
		if (clk_users == 0)
			return 0;
		clk_users--;
		if (!clk_users) {
			pr_debug("%s: disabling MCLK. clk_users = %d\n",
					 __func__, clk_users);
			clk_disable(codec_clk);
			clk_put(codec_clk);
			tabla_mclk_enable(codec, 0);
		}
	}
	return 0;
}
开发者ID:KIMMINWOO,项目名称:FusionUlt-AOSP-MR1,代码行数:35,代码来源:board-fighter-audio.c

示例15: audio_enable

/* must be called with audio->lock held */
static int audio_enable(struct audio *audio)
{
	pr_aud_info("audio_enable\n");

	if (audio->enabled)
		return 0;

	/* refuse to start if we're not ready */
	if (!audio->out[0].used || !audio->out[1].used)
		return -EIO;

	/* we start buffers 0 and 1, so buffer 0 will be the
	 * next one the dsp will want
	 */
	audio->out_tail = 0;
	audio->out_needed = 0;

	audio_prevent_sleep(audio);

	if (audpp_enable(-1, audio_dsp_event, audio)) {
		pr_aud_err("audpp_enable() failed\n");
		audio_allow_sleep(audio);
		return -ENODEV;
	}

	audio->enabled = 1;
	htc_pwrsink_set(PWRSINK_AUDIO, 100);
	return 0;
}
开发者ID:MaxGomez,项目名称:HTC-SPADE-7x30-3.0-ION,代码行数:30,代码来源:audio_out.c


注:本文中的pr_aud_err函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。