• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MM_INFO函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: aux_pcm_probe

static int aux_pcm_probe(struct platform_device *pdev)
{
	int rc = 0;
	struct resource *mem_src;

	MM_INFO("aux_pcm_probe \n");
	mem_src = platform_get_resource_byname(pdev, IORESOURCE_MEM,
						"aux_codec_reg_addr");
	if (!mem_src) {
		rc = -ENODEV;
		goto done;
	}

	the_aux_pcm_state.aux_pcm_base = ioremap(mem_src->start,
		(mem_src->end - mem_src->start) + 1);
	if (!the_aux_pcm_state.aux_pcm_base) {
		rc = -ENOMEM;
		goto done;
	}
	rc = get_aux_pcm_gpios(pdev);
	if (rc) {
		MM_ERR("GPIO configuration failed\n");
		rc = -ENODEV;
	}

done:	return rc;

}
开发者ID:Akinus,项目名称:htc-kernel-msm7x30,代码行数:28,代码来源:aux_pcm.c


示例2: afe_dsp_event

static void afe_dsp_event(void *data, unsigned id, size_t len,
			    void (*getevent)(void *ptr, size_t len))
{
	struct msm_afe_state *afe = data;

	MM_DBG("msg_id %d \n", id);

	switch (id) {
	case AFE_APU_MSG_CODEC_CONFIG_ACK: {
		struct afe_msg_codec_config_ack afe_ack;
		getevent(&afe_ack, AFE_APU_MSG_CODEC_CONFIG_ACK_LEN);
		MM_DBG("%s: device_id: %d device activity: %d\n", __func__,
		afe_ack.device_id, afe_ack.device_activity);
		if (afe_ack.device_activity == AFE_MSG_CODEC_CONFIG_DISABLED)
			afe->codec_config[GETDEVICEID(afe_ack.device_id)] = 0;
		else
			afe->codec_config[GETDEVICEID(afe_ack.device_id)] =
			afe_ack.device_activity;

		wake_up(&afe->wait);
		break;
	}
	case AFE_APU_MSG_VOC_TIMING_SUCCESS:
		MM_INFO("Received VOC_TIMING_SUCCESS message from AFETASK\n");
		break;
	case ADSP_MESSAGE_ID:
		MM_DBG("Received ADSP event: module enable/disable(audpptask)");
		break;
	default:
		MM_ERR("unexpected message from afe \n");
	}

	return;
}
开发者ID:DRHAX34,项目名称:android_kernel_zte_sailboat,代码行数:34,代码来源:afe.c


示例3: snddev_icodec_debug_write

static ssize_t snddev_icodec_debug_write(struct file *filp,
	const char __user *ubuf, size_t cnt, loff_t *ppos)
{
	char *lb_str = filp->private_data;
	char cmd;

	if (get_user(cmd, ubuf))
		return -EFAULT;

	MM_INFO("%s %c\n", lb_str, cmd);

	if (!strcmp(lb_str, "adie_loopback")) {
		switch (cmd) {
		case '1':
			debugfs_adie_loopback(1);
			break;
		case '0':
			debugfs_adie_loopback(0);
			break;
		}
	} else if (!strcmp(lb_str, "afe_loopback")) {
		switch (cmd) {
		case '1':
			debugfs_afe_loopback(1);
			break;
		case '0':
			debugfs_afe_loopback(0);
			break;
		}
	}

	return cnt;
}
开发者ID:lupohirp,项目名称:Acer-Liquid-A1-2.6.35,代码行数:33,代码来源:snddev_icodec.c


示例4: snddev_ecodec_init

static int __init snddev_ecodec_init(void)
{
	int rc = 0;
	struct snddev_ecodec_drv_state *ecodec_drv = &snddev_ecodec_drv;

	MM_INFO("snddev_ecodec_init\n");
	rc = platform_driver_register(&snddev_ecodec_driver);
	if (IS_ERR_VALUE(rc))
		goto error_platform_driver;
	ecodec_drv->ecodec_clk = clk_get(NULL, "ecodec_clk");
	if (IS_ERR(ecodec_drv->ecodec_clk))
		goto error_ecodec_clk;
	ecodec_drv->lpa_core_clk = clk_get(NULL, "lpa_core_clk");
	if (IS_ERR(ecodec_drv->lpa_core_clk))
		goto error_lpa_core_clk;


	mutex_init(&ecodec_drv->dev_lock);
	ecodec_drv->rx_active = 0;
	ecodec_drv->tx_active = 0;
	return 0;

error_lpa_core_clk:
	clk_put(ecodec_drv->ecodec_clk);
error_ecodec_clk:
	platform_driver_unregister(&snddev_ecodec_driver);
error_platform_driver:

	MM_ERR("encounter error\n");
	return -ENODEV;
}
开发者ID:andr00ib,项目名称:3.0.94-victor-kernel,代码行数:31,代码来源:snddev_ecodec.c


示例5: afe_config_fm_volume

int afe_config_fm_volume(uint16_t volume)
{
	struct afe_cmd_fm_volume_config cmd;
	struct msm_afe_state *afe = &the_afe_state;
	int rc = 0;

	MM_INFO(" configure fm volume\n");
	mutex_lock(&afe->lock);
	if (!afe->in_use) {
		/* enable afe */
		rc = msm_adsp_get("AFETASK", &afe->mod, &afe->adsp_ops, afe);
		if (rc < 0) {
			MM_ERR("%s: failed to get AFETASK module\n", __func__);
			goto error_adsp_get;
		}
		rc = msm_adsp_enable(afe->mod);
		if (rc < 0)
			goto error_adsp_enable;
	}
	memset(&cmd, 0, sizeof(cmd));
	cmd.cmd_id = AFE_CMD_FM_PLAYBACK_VOLUME_CMD;
	cmd.volume = volume;

	afe_send_queue(afe, &cmd, sizeof(cmd));

	mutex_unlock(&afe->lock);
	return rc;
error_adsp_enable:
	msm_adsp_put(afe->mod);
error_adsp_get:
	mutex_unlock(&afe->lock);
	return rc;
}
开发者ID:DRHAX34,项目名称:android_kernel_zte_sailboat,代码行数:33,代码来源:afe.c


示例6: afe_config_loopback

/*******************************************************************************
*	Function Name :  afe_config_loopback
*	Args : enable or disable DSP loopback.
*	dependencies : If QCOM changes ADSP firmware loopback command  may not work. 
*
********************************************************************************/
int afe_config_loopback(uint16_t enable)
{
	struct afe_cmd_loopback_config cmd;
	struct msm_afe_state *afe = &the_afe_state;
	int rc = 0;

	MM_INFO(" configure loopback %d\n",enable);
	mutex_lock(&afe->lock);
	if (!afe->in_use) {
		/* enable afe */
		rc = msm_adsp_get("AFETASK", &afe->mod, &afe->adsp_ops, afe);
		if (rc < 0) {
			MM_ERR("%s: failed to get AFETASK module\n", __func__);
			goto error_adsp_get;
		}
		rc = msm_adsp_enable(afe->mod);
		if (rc < 0)
			goto error_adsp_enable;
	}
	memset(&cmd, 0, sizeof(cmd));
	cmd.cmd_id = AFE_CMD_VOICE_LOOPBACK_CMD;
	cmd.enable = enable;

	afe_send_queue(afe, &cmd, sizeof(cmd));

	mutex_unlock(&afe->lock);
	return rc;
error_adsp_enable:
	msm_adsp_put(afe->mod);
error_adsp_get:
	mutex_unlock(&afe->lock);
	return rc;
}
开发者ID:lMonsterl,项目名称:LG_Revolution_Kernel,代码行数:39,代码来源:afe.c


示例7: lge_amp_ctl_probe

static int lge_amp_ctl_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
	struct amp_data *data;
	struct i2c_adapter *adapter = client->adapter;
	int err;

	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA))	{
		err = -EOPNOTSUPP;
		return err;
	}

	MM_INFO("\n");

	data = kzalloc(sizeof(struct amp_data), GFP_KERNEL);
	if (NULL == data)
		return -ENOMEM;
	_data = data;
	data->client = client;
	i2c_set_clientdata(client, data);

	if (lge_bd_rev >= LGE_REV_B)
		wm9093_amp_init(data);
	else
		tpa2055_amp_init(data);

	MM_ERR("%s chip found : bd rev : %d\n", client->name, lge_bd_rev);

	data->amp_off_all();
	err = misc_register(&lge_amp_misc);

	return 0;
}
开发者ID:poogie,项目名称:kernel_optimus_sol,代码行数:32,代码来源:lge_audio_amp.c


示例8: audrec_dsp_event

static void audrec_dsp_event(void *data, unsigned id, size_t len,
			    void (*getevent)(void *ptr, size_t len))
{
	struct audio_in *audio = data;
	uint16_t msg[3];
	getevent(msg, sizeof(msg));

	switch (id) {
	case AUDREC_MSG_CMD_CFG_DONE_MSG:
		if (msg[0] & AUDREC_MSG_CFG_DONE_TYPE_0_UPDATE) {
			if (msg[0] & AUDREC_MSG_CFG_DONE_TYPE_0_ENA) {
				MM_INFO("CFG ENABLED\n");
				audio_in_encoder_config(audio);
			} else {
				MM_INFO("CFG SLEEP\n");
				audio->running = 0;
				audio->tx_agc_enable = 0;
				audio->ns_enable = 0;
				audio->iir_enable = 0;
			}
		} else {
			MM_INFO("CMD_CFG_DONE %x\n", msg[0]);
		}
		break;
	case AUDREC_MSG_CMD_AREC_PARAM_CFG_DONE_MSG: {
		MM_INFO("PARAM CFG DONE\n");
		audio->running = 1;
		audio_dsp_set_tx_agc(audio);
		audio_dsp_set_ns(audio);
		audio_dsp_set_iir(audio);
		break;
	}
	case AUDREC_MSG_FATAL_ERR_MSG:
		MM_ERR("ERROR %x\n", msg[0]);
		break;
	case AUDREC_MSG_PACKET_READY_MSG:
/* REC_DBG("type %x, count %d", msg[0], (msg[1] | (msg[2] << 16))); */
		audio_in_get_dsp_frames(audio);
		break;
	case ADSP_MESSAGE_ID:
		MM_DBG("Received ADSP event: module \
				enable/disable(audrectask)\n");
		break;
	default:
		MM_ERR("unknown event %d\n", id);
	}
}
开发者ID:F4uzan,项目名称:skernel_u0,代码行数:47,代码来源:audio_in.c


示例9: msm_adsp_get

int msm_adsp_get(const char *name, struct msm_adsp_module **out,
		 struct msm_adsp_ops *ops, void *driver_data)
{
	struct msm_adsp_module *module;
	int rc = 0;
	static uint32_t init_info_cmd_sent;

	mutex_lock(&adsp_info.lock);
	if (!init_info_cmd_sent) {
		init_waitqueue_head(&adsp_info.init_info_wait);
		msm_get_init_info();
		rc = wait_event_timeout(adsp_info.init_info_wait,
			adsp_info.init_info_state == ADSP_STATE_INIT_INFO,
			5 * HZ);
		if (!rc) {
			MM_ERR("INIT_INFO failed\n");
			mutex_unlock(&adsp_info.lock);
			return -ETIMEDOUT;

		}
		init_info_cmd_sent++;
	}
	mutex_unlock(&adsp_info.lock);

	module = find_adsp_module_by_name(&adsp_info, name);
	if (!module)
		return -ENODEV;

	mutex_lock(&module->lock);
	MM_INFO("opening module %s\n", module->name);

	if (module->ops) {
		rc = -EBUSY;
		goto done;
	}

	rc = adsp_rpc_init(module);
	if (rc)
		goto done;

	module->ops = ops;
	module->driver_data = driver_data;
	*out = module;
	rc = rpc_adsp_rtos_app_to_modem(RPC_ADSP_RTOS_CMD_REGISTER_APP,
					module->id, module);
	if (rc) {
		module->ops = NULL;
		module->driver_data = NULL;
		*out = NULL;
		MM_ERR("REGISTER_APP failed\n");
		goto done;
	}

	MM_DBG("module %s has been registered\n", module->name);

done:
	mutex_unlock(&module->lock);
	return rc;
}
开发者ID:Alexxis2233,项目名称:gcore_kernel,代码行数:59,代码来源:adsp.c


示例10: remote_cb_function

static void remote_cb_function(void *context, u32 param,
				void *evt_buf, u32 len)
{
	struct voice_header *hdr;
	struct voice_data *v = context;

	hdr = (struct voice_header *)evt_buf;

	MM_INFO("len=%d id=%d\n", len, hdr->id);

	if (len <= 0) {
		MM_ERR("unexpected event with length %d \n", len);
		return;
	}

	switch (hdr->id) {
	case EVENT_ACQUIRE_START:
		atomic_inc(&v->acq_start_flag);
		wake_up(&v->dev_wait);
		mutex_lock(&voice.lock);
		v->voc_event = VOICE_ACQUIRE_START;
		v->network = ((struct voice_network *)evt_buf)->network_info;
		mutex_unlock(&voice.lock);
		complete(&v->complete);
		break;
	case EVENT_RELEASE_START:
		/* If ACQUIRED come in before the RELEASE,
		* will only services the RELEASE */
		atomic_inc(&v->rel_start_flag);
		wake_up(&v->voc_wait);
		wake_up(&v->dev_wait);
		mutex_lock(&voice.lock);
		v->voc_event = VOICE_RELEASE_START;
		mutex_unlock(&voice.lock);
		complete(&v->complete);
		break;
	case EVENT_CHANGE_START:
		mutex_lock(&voice.lock);
		v->voc_event = VOICE_CHANGE_START;
		mutex_unlock(&voice.lock);
		complete(&v->complete);
		break;
	case EVENT_NETWORK_RECONFIG:
		/* send network change to audio_dev,
		if sample rate is less than 16k,
		otherwise, send acquire done */
		mutex_lock(&voice.lock);
		v->voc_event = VOICE_NETWORK_RECONFIG;
		v->network = ((struct voice_network *)evt_buf)->network_info;
		mutex_unlock(&voice.lock);
		complete(&v->complete);
		break;
	default:
		MM_ERR("Undefined event %d \n", hdr->id);
	}

}
开发者ID:lupohirp,项目名称:Acer-Liquid-A1-2.6.35,代码行数:57,代码来源:voice.c


示例11: lge_amp_ctl_remove

static int lge_amp_ctl_remove(struct i2c_client *client)
{
	struct amp_data *data = i2c_get_clientdata(client);
	kfree(data);

	MM_INFO("\n");
	i2c_set_clientdata(client, NULL);
	return 0;
}
开发者ID:poogie,项目名称:kernel_optimus_sol,代码行数:9,代码来源:lge_audio_amp.c


示例12: set_amp_speaker_stereo_audio

void set_amp_speaker_stereo_audio(void)
{
	int fail=0;
	fail |= WriteI2C(SUBSYSTEM_CONTROL, (~SWS & ~BYPASS & ~SSM_EN));
	fail |= WriteI2C(INPUT_CONTROL, (amp_cal_data[SPEAKER_AUDIO_INPUT] | IN2_SE)); 							//Modify for desired IN gain 
	fail |= WriteI2C(SPEAKER_VOLUME, (SPK_EN | amp_cal_data[SPEAKER_AUDIO_OUTPUT]));							//Modify for desired SP gain
	fail |= WriteI2C(SPEAKER_OUTPUT, SPKOUT_IN2);

    MM_INFO("7 set_amp_speaker_stereo_voice() %d\n", fail);
}
开发者ID:Bengineered,项目名称:kernel-lge-msm7x30,代码行数:10,代码来源:lge_tpa2055-amp_C800.c


示例13: voice_cmd_device_info

static int voice_cmd_device_info(struct voice_data *v)
{
	struct voice_device cmd;
	int err, vol;

	MM_INFO("tx_dev=%d, rx_dev=%d, tx_sample=%d, tx_mute=%d\n",
			v->dev_tx.dev_acdb_id, v->dev_rx.dev_acdb_id,
			v->dev_tx.sample, v->dev_tx.mute);

	mutex_lock(&voice.vol_lock);

	cmd.hdr.id = CMD_DEVICE_INFO;
	cmd.hdr.data_len = sizeof(struct voice_device) -
			sizeof(struct voice_header);
	cmd.tx_device = v->dev_tx.dev_acdb_id;
	cmd.rx_device = v->dev_rx.dev_acdb_id;
	if (v->network == NETWORK_WCDMA_WB)
		vol = v->min_rx_vol[VOC_WB_INDEX] +
			((v->max_rx_vol[VOC_WB_INDEX] -
			v->min_rx_vol[VOC_WB_INDEX]) * v->dev_rx.volume)/100;
	else
		vol = v->min_rx_vol[VOC_NB_INDEX] +
			((v->max_rx_vol[VOC_NB_INDEX] -
			v->min_rx_vol[VOC_NB_INDEX]) * v->dev_rx.volume)/100;
	cmd.rx_volume = (u32)vol; /* in mb */
	cmd.rx_mute = 0;
	cmd.tx_mute = v->dev_tx.mute;
	cmd.rx_sample = v->dev_rx.sample/1000;
	cmd.tx_sample = v->dev_tx.sample/1000;
#if 1 // CPAUDIO : send more info to CP from AP
	if (v->network == NETWORK_WCDMA_WB)
	{
		cmd.rx_volume_min = v->min_rx_vol[VOC_WB_INDEX];
		cmd.rx_volume_max = v->max_rx_vol[VOC_WB_INDEX];
	}
	else
	{
		cmd.rx_volume_min = v->min_rx_vol[VOC_NB_INDEX];
		cmd.rx_volume_max = v->max_rx_vol[VOC_NB_INDEX];
	}
	cmd.rx_volume_percentage = v->dev_rx.volume;
#endif

	MM_DBG("rx_vol=%d, rx_sample=%d\n", cmd.rx_volume, v->dev_rx.sample);

	err = dalrpc_fcn_5(VOICE_DALRPC_CMD, v->handle, &cmd,
			 sizeof(struct voice_device));

	mutex_unlock(&voice.vol_lock);

	if (err)
		MM_ERR("Voice device command failed\n");
	return err;
}
开发者ID:erik96,项目名称:Samsung-Galaxy-S-Plus,代码行数:54,代码来源:voice.c


示例14: afe_exit

static void __exit afe_exit(void)
{
	MM_INFO("AFE driver exit\n");
#ifdef CONFIG_DEBUG_FS
	if (debugfs_afelb)
		debugfs_remove(debugfs_afelb);
#endif
	if (the_afe_state.mod)
		msm_adsp_put(the_afe_state.mod);
	return;
}
开发者ID:LDrifta,项目名称:Kernel_MS910_ZVD_Speed_Unlshd,代码行数:11,代码来源:afe.c


示例15: audpre_dsp_event

/* ------------------- dsp --------------------- */
static void audpre_dsp_event(void *data, unsigned id, size_t len,
			    void (*getevent)(void *ptr, size_t len))
{
	uint16_t msg[2];
	getevent(msg, sizeof(msg));

	switch (id) {
	case AUDPREPROC_MSG_CMD_CFG_DONE_MSG:
		MM_INFO("type %d, status_flag %d\n", msg[0], msg[1]);
		break;
	case AUDPREPROC_MSG_ERROR_MSG_ID:
		MM_INFO("err_index %d\n", msg[0]);
		break;
	case ADSP_MESSAGE_ID:
		MM_DBG("Received ADSP event: module enable(audpreproctask)\n");
		break;
	default:
		MM_ERR("unknown event %d\n", id);
	}
}
开发者ID:F4uzan,项目名称:skernel_u0,代码行数:21,代码来源:audio_in.c


示例16: set_amp_headset_mono_voice

void set_amp_headset_mono_voice(void)
{
	int fail=0;
	fail |= WriteI2C(SUBSYSTEM_CONTROL, (~SWS & ~BYPASS & ~SSM_EN));
	fail |= WriteI2C(INPUT_CONTROL, (amp_cal_data[HEADSET_VOICE_INPUT] | IN1_DIFF)); 				//Modify for desired IN gain 
	fail |= WriteI2C(HP_LEFT_VOLUME, (HPL_VOL_M60DB | HPL_EN | HP_TRACK));
	fail |= WriteI2C(HP_RIGHT_VOLUME, (HPR_VOL_M60DB | HPR_EN));
	fail |= WriteI2C(HEADPHONE_OUTPUT, HPOUT_IN1);
	fail |= WriteI2C(HP_LEFT_VOLUME, (amp_cal_data[HEADSET_VOICE_OUTPUT]  | HPL_EN | HP_TRACK));			//Modify for desired HP gain

	fail |= WriteI2C(SPEAKER_OUTPUT, SPKOUT_MUTE);
    MM_INFO("2 set_amp_headset_mono_voice() %d\n", fail);
}
开发者ID:Bengineered,项目名称:kernel-lge-msm7x30,代码行数:13,代码来源:lge_tpa2055-amp_C800.c


示例17: audio_enable

/* must be called with audio->lock held */
static int audio_enable(struct audio *audio)
{
	struct audmgr_config cfg;
	int rc;

	MM_INFO("\n"); /* Macro prints the file name and function */

	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;

	cfg.tx_rate = RPC_AUD_DEF_SAMPLE_RATE_NONE;
	cfg.rx_rate = RPC_AUD_DEF_SAMPLE_RATE_48000;
	cfg.def_method = RPC_AUD_DEF_METHOD_HOST_PCM;
	cfg.codec = RPC_AUD_DEF_CODEC_PCM;
	cfg.snd_method = RPC_SND_METHOD_MIDI;

	audio_prevent_sleep(audio);	
	rc = audmgr_enable(&audio->audmgr, &cfg);
	if (rc < 0) {
		audio_allow_sleep(audio);
		return rc;
	}

#ifdef CONFIG_AMP_MAX97000
	if(!audio_enabled)
	{
		audio_enabled = 1;
		//max97000_resume();
	}
#endif
	if (audpp_enable(-1, audio_dsp_event, audio)) {
		MM_ERR("audpp_enable() failed\n");
		audmgr_disable(&audio->audmgr);
		audio_allow_sleep(audio);
		return -ENODEV;
	}

	audio->enabled = 1;
	htc_pwrsink_set(PWRSINK_AUDIO, 100);
	return 0;
}
开发者ID:chraso,项目名称:GT-I5500_,代码行数:52,代码来源:audio_out.c


示例18: snddev_icodec_set_device_volume

int snddev_icodec_set_device_volume(struct msm_snddev_info *dev_info,
		u32 volume)
{
	struct snddev_icodec_state *icodec;
	struct mutex *lock;
	struct snddev_icodec_drv_state *drv = &snddev_icodec_drv;
	int rc = -EPERM;

	if (!dev_info) {
		MM_INFO("device not intilized.\n");
		return  -EINVAL;
	}

	icodec = dev_info->private_data;

	if (!(icodec->data->dev_vol_type & (SNDDEV_DEV_VOL_DIGITAL
				| SNDDEV_DEV_VOL_ANALOG))) {

		MM_INFO("device %s does not support device volume "
				"control.", dev_info->name);
		return -EPERM;
	}
	dev_info->dev_volume =  volume;

	if (icodec->data->capability & SNDDEV_CAP_RX)
		lock = &drv->rx_lock;
	else if (icodec->data->capability & SNDDEV_CAP_LB)
		lock = &drv->lb_lock;
	else
		lock = &drv->tx_lock;

	mutex_lock(lock);

	rc = snddev_icodec_set_device_volume_impl(dev_info,
			dev_info->dev_volume);
	mutex_unlock(lock);
	return rc;
}
开发者ID:0987363,项目名称:BMW-OpenSource,代码行数:38,代码来源:snddev_icodec.c


示例19: audio_open

static int audio_open(struct inode *inode, struct file *file)
{
	struct audio *audio = &the_audio;
	int rc, cnt;

	mutex_lock(&audio->lock);

	if (audio->opened) {
		MM_ERR("busy as driver already in open state\n");
		rc = -EBUSY;
		goto done;
	}

	if (!audio->data) {
		audio->data = kmalloc(BUFSZ, GFP_KERNEL);
		if (!audio->data) {
			MM_ERR("could not allocate buffers\n");
			rc = -ENOMEM;
			goto done;
		}
	}

	audio->client = msm_rpc_register_client("voice_pcm_interface_client",
				SND_VOC_PCM_INTERFACE_PROG,
				SND_VOC_PCM_INTERFACE_VERS, 1,
				pcm_interface_process_callback_routine);
	if (IS_ERR(audio->client)) {
		MM_ERR("Failed to register voice pcm interface client"\
			"to 0x%8x\n", SND_VOC_PCM_INTERFACE_PROG);
		kfree(audio->data);
		audio->data = NULL;
		rc = -ENODEV;
		goto done;
	}
	MM_INFO("voice pcm client registred %p\n", audio->client);
	for (cnt = 0; cnt < MAX_VOC_FRAMES; cnt++) {
		audio->out[cnt].data = (audio->data +\
					((MAX_VOC_FRAME_SIZE * 2) * cnt));
		audio->out[cnt].size = MAX_VOC_FRAME_SIZE * 2;
		MM_DBG("data ptr = %p\n", audio->out[cnt].data);
	}
	file->private_data = audio;
	audio_flush(audio);
	audio->opened = 1;
	rc = 0;
done:
	mutex_unlock(&audio->lock);
	return rc;
}
开发者ID:F4uzan,项目名称:f4kernel-u0,代码行数:49,代码来源:snd_pcm_client.c


示例20: store_btlb_value

static ssize_t store_btlb_value(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	int lb = 0;
	sscanf(buf, "%d", &lb);
	MM_INFO("[BTUI] store_btlb_value : old(%d) new(%d) \n", lb_status,lb);

	/* skip when same status */
	if (lb == lb_status)
		return count;

	/* set loopback */
	bt_sco_set_loopback_mode(lb);
	return count;
}
开发者ID:andr00ib,项目名称:3.0.94-victor-kernel,代码行数:15,代码来源:snddev_ecodec.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MNT_ILOCK函数代码示例发布时间:2022-05-30
下一篇:
C++ MM_FREE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap