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


C++ dev_notice函数代码示例

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


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

示例1: cypress_touchkey_con_hw

static void cypress_touchkey_con_hw(struct cypress_touchkey_info *dev_info,
								bool flag)
{
	struct cypress_touchkey_info *info =  dev_info;

	gpio_set_value(info->pdata->gpio_led_en, flag ? 1 : 0);

#if defined(SEC_TOUCHKEY_DEBUG)
	dev_notice(&info->client->dev,
			"%s : called with flag %d.\n", __func__, flag);
#endif
}
开发者ID:GhostNetwork-Project,项目名称:android_kernel_samsung_msm8226,代码行数:12,代码来源:cypress-touchkey.c

示例2: tegra_cec_suspend

static int tegra_cec_suspend(struct platform_device *pdev, pm_message_t state)
{
	struct tegra_cec *cec = platform_get_drvdata(pdev);

	/* cancel the work queue */
	cancel_work_sync(&cec->work);

	clk_disable(cec->clk);

	dev_notice(&pdev->dev, "suspended\n");
	return 0;
}
开发者ID:aicjofs,项目名称:android_kernel_fuhu_t8400n,代码行数:12,代码来源:tegra_cec.c

示例3: mv88fx_initalize_machine_data

static int mv88fx_initalize_machine_data(struct platform_device *pdev)
{
	struct resource *r = NULL;
	int err = 0;

	mv88fx_snd_debug("mv88fx_initalize_machine_data");

	mv88fx_machine_data.port = pdev->id;
	mv88fx_machine_data.pdata =
		(struct orion_i2s_platform_data *)pdev->dev.platform_data;

	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!r) {
		err = -ENXIO;
		goto error;
	}
	r = request_mem_region(r->start, SZ_16K, DRIVER_NAME);
	if (!r) {
		err = -EBUSY;
		goto error;
	}
	mv88fx_machine_data.res = r;
	mv88fx_machine_data.base = ioremap(r->start, SZ_16K);

	if (!mv88fx_machine_data.base) {
		mv88fx_snd_error("ioremap failed");
		err = -ENOMEM;
		goto error;
	}
	mv88fx_machine_data.base -= MV_AUDIO_REGS_OFFSET(mv88fx_machine_data.port);

	mv88fx_machine_data.irq = platform_get_irq(pdev, 0);
	if (mv88fx_machine_data.irq == NO_IRQ) {
		err = -ENXIO;
		goto error;
	}
#if defined(CONFIG_HAVE_CLK)
	mv88fx_machine_data.clk = clk_get(&pdev->dev, NULL);
	if (IS_ERR(mv88fx_machine_data.clk))
		dev_notice(&pdev->dev, "cannot get clkdev\n");
	else
		clk_enable(mv88fx_machine_data.clk);
#endif
	return 0;
error:
	if (mv88fx_machine_data.base) {
		iounmap(mv88fx_machine_data.base);
		mv88fx_machine_data.base = NULL;
	}
	release_mem_region(mv88fx_machine_data.res->start, SZ_16K);
	return err;
}
开发者ID:cruisesha,项目名称:linux-2.6.32.9,代码行数:52,代码来源:mv88fx-rt5630.c

示例4: touchkey_led_control

static ssize_t touchkey_led_control(struct device *dev,
		 struct device_attribute *attr, const char *buf,
		 size_t count)
{
	struct abov_tk_info *info = dev_get_drvdata(dev);
	struct i2c_client *client = info->client;
	int data;
	int ret;
	u8 cmd;

	ret = sscanf(buf, "%d", &data);
	if (ret != 1) {
		dev_err(&client->dev, "%s: cmd read err\n", __func__);
		return count;
	}

	if (!(data == 0 || data == 1)) {
		dev_err(&client->dev, "%s: wrong command(%d)\n",
			__func__, data);
		return count;
	}

	if (!info->enabled)
		return count;

	if (data == 1) {
		dev_notice(&client->dev, "led on\n");
		cmd = CMD_LED_ON;
	} else {
		dev_notice(&client->dev, "led off\n");
		cmd = CMD_LED_OFF;
	}
	if(info->pdata->gpio_tkey_led_en >= 0)
		gpio_direction_output(info->pdata->gpio_tkey_led_en,data);
	ret = abov_tk_i2c_write(client, ABOV_BTNSTATUS, &cmd, 1);
	if (ret < 0)
		dev_err(&client->dev, "%s fail(%d)\n", __func__, ret);
	return count;
}
开发者ID:PhilZ-cwm6,项目名称:android_kernel_samsung_klte,代码行数:39,代码来源:abov_touchkey.c

示例5: ccp_platform_remove

static int ccp_platform_remove(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct ccp_device *ccp = dev_get_drvdata(dev);

	ccp_destroy(ccp);

	kfree(ccp);

	dev_notice(dev, "disabled\n");

	return 0;
}
开发者ID:168519,项目名称:linux,代码行数:13,代码来源:ccp-platform.c

示例6: queue_work

static void cypress_touchkey_brightness_set
		(struct led_classdev *led_cdev, enum led_brightness brightness)
{
	/* Must not sleep, use a workqueue if needed */
	if (!info)
		return;

	info->brightness = brightness;

	if (info->current_status && !touchkey_update_status)
		queue_work(info->led_wq, &info->led_work);
	else
		dev_notice(&info->client->dev, "%s under suspend status or FW updating\n", __func__);
}
开发者ID:1N4148,项目名称:android_kernel_samsung_golden,代码行数:14,代码来源:cypress-touchkey.c

示例7: ccp_get_irqs

static int ccp_get_irqs(struct ccp_device *ccp)
{
	struct device *dev = ccp->dev;
	int ret;

	ret = ccp_get_irq(ccp);
	if (!ret)
		return 0;

	/* Couldn't get an interrupt */
	dev_notice(dev, "could not enable interrupts (%d)\n", ret);

	return ret;
}
开发者ID:168519,项目名称:linux,代码行数:14,代码来源:ccp-platform.c

示例8: cypress_touchkey_con_hw

static void cypress_touchkey_con_hw(struct cypress_touchkey_info *info, bool flag)
{

	if (flag) {
		gpio_set_value(info->pdata->gpio_ldo_en, 1);
		gpio_set_value(info->pdata->gpio_led_en, 1);
	} else {
		gpio_set_value(info->pdata->gpio_led_en, 0);
		gpio_set_value(info->pdata->gpio_ldo_en, 0);
	}
#if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP)
	dev_notice(&info->client->dev, "%s : called with flag %d.\n", __func__, flag);
#endif
}
开发者ID:1N4148,项目名称:android_kernel_samsung_golden,代码行数:14,代码来源:cypress-touchkey.c

示例9: tc300k_led_control

static ssize_t tc300k_led_control(struct device *dev,
	 struct device_attribute *attr, const char *buf, size_t count)
{
	struct tc300k_data *data = dev_get_drvdata(dev);
	struct i2c_client *client = data->client;
	int scan_buffer;
	int ret;
	u8 cmd;

	ret = sscanf(buf, "%d", &scan_buffer);
	if (ret != 1) {
		dev_err(&client->dev, "%s: cmd read err\n", __func__);
		return count;
	}

	if (!(scan_buffer == 0 || scan_buffer == 1)) {
		dev_err(&client->dev, "%s: wrong command(%d)\n",
			__func__, scan_buffer);
		return count;
	}

	if ((!data->enabled) || data->fw_downloding)
		return count;

	if (scan_buffer == 1) {
		dev_notice(&client->dev, "led on\n");
		cmd = TC300K_CMD_LED_ON;
	} else {
		dev_notice(&client->dev, "led off\n");
		cmd = TC300K_CMD_LED_OFF;
	}
	ret = i2c_smbus_write_byte_data(client, TC300K_CMD_ADDR, cmd);
	if (ret < 0)
		dev_err(&client->dev, "%s fail(%d)\n", __func__, ret);

	return count;
}
开发者ID:arshull,项目名称:halaszk-UNIVERSAL5420,代码行数:37,代码来源:tc300k.c

示例10: touchkey_fw_update

static ssize_t touchkey_fw_update(struct device *dev,
			struct device_attribute *attr, const char *buf, size_t count)
{
	struct abov_tk_info *info = dev_get_drvdata(dev);
	struct i2c_client *client = info->client;
	int ret;
	u8 cmd;

	if (info->fw_update_possible == false) {
		dev_err(&client->dev, "%s fail (no reset pin)\n", __func__);
		info->fw_update_state = 2;
		goto touchkey_fw_update_out;
	}

	switch(*buf) {
	case 's':
	case 'S':
		cmd = BUILT_IN;
		break;
	case 'i':
	case 'I':
		cmd = SDCARD;
		break;
	default:
		info->fw_update_state = 2;
		goto touchkey_fw_update_out;
	}

	info->fw_update_state = 1;
	disable_irq(info->irq);
	info->enabled = false;
	ret = abov_flash_fw(info, false, cmd);
	if (info->glovemode)
		abov_glove_mode_enable(client, CMD_GLOVE_ON);
	info->enabled = true;
	enable_irq(info->irq);
	if (ret) {
		dev_err(&client->dev, "%s fail\n", __func__);
		info->fw_update_state = 2;
	} else {
		dev_notice(&client->dev, "%s success\n", __func__);
		info->fw_update_state = 0;
	}

touchkey_fw_update_out:
	dev_dbg(&client->dev, "%s : %d\n", __func__, info->fw_update_state);

	return count;
}
开发者ID:PhilZ-cwm6,项目名称:android_kernel_samsung_klte,代码行数:49,代码来源:abov_touchkey.c

示例11: kern_open

/*
* The open implementation.
*/
static int kern_open(struct inode *inode, struct file *filp)
{
	/* you can use dev_printk like you would printk only with the
	added device... */
	dev_printk(KERN_DEBUG, my_device, "this is my debug message");
	/* or better yet, use the predefined ones: */
	dev_emerg(my_device, "emergency");
	dev_alert(my_device, "alert");
	dev_crit(my_device, "critical");
	dev_err(my_device, "error");
	dev_warn(my_device, "warning");
	dev_notice(my_device, "notice");
	dev_info(my_device, "info");
	return 0;
}
开发者ID:ycqiu,项目名称:demos-linux,代码行数:18,代码来源:mod_dev_print.c

示例12: ni_tio_handle_interrupt

void ni_tio_handle_interrupt(struct ni_gpct *counter,
			     struct comedi_subdevice *s)
{
	unsigned int cidx = counter->counter_index;
	unsigned long flags;
	int gate_error;
	int tc_error;
	int perm_stale_data;

	ni_tio_acknowledge_and_confirm(counter, &gate_error, &tc_error,
				       &perm_stale_data);
	if (gate_error) {
		dev_notice(counter->counter_dev->dev->class_dev,
			   "%s: Gi_Gate_Error detected.\n", __func__);
		s->async->events |= COMEDI_CB_OVERFLOW;
	}
	if (perm_stale_data)
		s->async->events |= COMEDI_CB_ERROR;
	switch (counter->counter_dev->variant) {
	case ni_gpct_variant_m_series:
	case ni_gpct_variant_660x:
		if (ni_tio_read(counter, NITIO_DMA_STATUS_REG(cidx)) &
		    GI_DRQ_ERROR) {
			dev_notice(counter->counter_dev->dev->class_dev,
				   "%s: Gi_DRQ_Error detected.\n", __func__);
			s->async->events |= COMEDI_CB_OVERFLOW;
		}
		break;
	case ni_gpct_variant_e_series:
		break;
	}
	spin_lock_irqsave(&counter->lock, flags);
	if (counter->mite_chan)
		mite_ack_linkc(counter->mite_chan, s, true);
	spin_unlock_irqrestore(&counter->lock, flags);
}
开发者ID:513855417,项目名称:linux,代码行数:36,代码来源:ni_tiocmd.c

示例13: iwmct_dbg_init_params

void iwmct_dbg_init_params(struct iwmct_priv *priv)
{
#ifdef CONFIG_IWMC3200TOP_DEBUG
	int i;

	for (i = 0; i < log_level_argc; i++) {
		dev_notice(&priv->func->dev, "log_level[%d]=0x%X\n",
						i, log_level[i]);
		iwmct_log_set_filter((log_level[i] >> 8) & 0xFF,
			       log_level[i] & 0xFF);
	}
	for (i = 0; i < log_level_fw_argc; i++) {
		dev_notice(&priv->func->dev, "log_level_fw[%d]=0x%X\n",
						i, log_level_fw[i]);
		iwmct_log_set_fw_filter((log_level_fw[i] >> 8) & 0xFF,
				  log_level_fw[i] & 0xFF);
	}
#endif

	priv->dbg.blocks = blocks;
	LOG_INFO(priv, INIT, "blocks=%d\n", blocks);
	priv->dbg.dump = (bool)dump;
	LOG_INFO(priv, INIT, "dump=%d\n", dump);
	priv->dbg.jump = (bool)jump;
	LOG_INFO(priv, INIT, "jump=%d\n", jump);
	priv->dbg.direct = (bool)direct;
	LOG_INFO(priv, INIT, "direct=%d\n", direct);
	priv->dbg.checksum = (bool)checksum;
	LOG_INFO(priv, INIT, "checksum=%d\n", checksum);
	priv->dbg.fw_download = (bool)fw_download;
	LOG_INFO(priv, INIT, "fw_download=%d\n", fw_download);
	priv->dbg.block_size = block_size;
	LOG_INFO(priv, INIT, "block_size=%d\n", block_size);
	priv->dbg.download_trans_blks = download_trans_blks;
	LOG_INFO(priv, INIT, "download_trans_blks=%d\n", download_trans_blks);
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:36,代码来源:main.c

示例14: set_pwm

static ssize_t set_pwm(struct device *dev, struct device_attribute
		       *devattr, const char *buf, size_t count)
{
	struct pc87427_data *data = dev_get_drvdata(dev);
	int nr = to_sensor_dev_attr(devattr)->index;
	unsigned long val;
	int iobase = data->address[LD_FAN];
	u8 mode;

	if (kstrtoul(buf, 10, &val) < 0 || val > 0xff)
		return -EINVAL;

	mutex_lock(&data->lock);
	pc87427_readall_pwm(data, nr);
	mode = data->pwm_enable[nr] & PWM_ENABLE_MODE_MASK;
	if (mode != PWM_MODE_MANUAL && mode != PWM_MODE_OFF) {
		dev_notice(dev,
			   "Can't set PWM%d duty cycle while not in manual mode\n",
			   nr + 1);
		mutex_unlock(&data->lock);
		return -EPERM;
	}

	/* We may have to change the mode */
	if (mode == PWM_MODE_MANUAL && val == 0) {
		/* Transition from Manual to Off */
		update_pwm_enable(data, nr, PWM_MODE_OFF);
		mode = PWM_MODE_OFF;
		dev_dbg(dev, "Switching PWM%d from %s to %s\n", nr + 1,
			"manual", "off");
	} else if (mode == PWM_MODE_OFF && val != 0) {
		/* Transition from Off to Manual */
		update_pwm_enable(data, nr, PWM_MODE_MANUAL);
		mode = PWM_MODE_MANUAL;
		dev_dbg(dev, "Switching PWM%d from %s to %s\n", nr + 1,
			"off", "manual");
	}

	data->pwm[nr] = val;
	if (mode == PWM_MODE_MANUAL)
		outb(val, iobase + PC87427_REG_PWM_DUTY);
	mutex_unlock(&data->lock);

	return count;
}
开发者ID:03199618,项目名称:linux,代码行数:45,代码来源:pc87427.c

示例15: xonar_ext_power_gpio_changed

static void xonar_ext_power_gpio_changed(struct oxygen *chip)
{
	struct xonar_generic *data = chip->model_data;
	u8 has_power;

	has_power = !!(oxygen_read8(chip, data->ext_power_reg)
		       & data->ext_power_bit);
	if (has_power != data->has_power) {
		data->has_power = has_power;
		if (has_power) {
			dev_notice(chip->card->dev, "power restored\n");
		} else {
			dev_crit(chip->card->dev,
				   "Hey! Don't unplug the power cable!\n");
			/* TODO: stop PCMs */
		}
	}
}
开发者ID:020gzh,项目名称:linux,代码行数:18,代码来源:xonar_lib.c


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