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


C++ dev_vdbg函数代码示例

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


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

示例1: show_proxim_data

/* Display proxim data  */
static ssize_t show_proxim_data(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
	struct ltr558_chip *chip = iio_priv(indio_dev);
	int prox_data = 0;
	ssize_t buf_count = 0;

	dev_vdbg(dev, "%s()\n", __func__);
	mutex_lock(&chip->lock);

	if (chip->is_prox_enable) {
		prox_data = ltr558_ps_read(chip->client);
		chip->prox_reading = prox_data;
		buf_count = sprintf(buf, "%d\n", prox_data);
	}
	else
		buf_count = sprintf(buf, "%d\n", chip->prox_reading);
	mutex_unlock(&chip->lock);
	return buf_count;
}
开发者ID:FrozenCow,项目名称:FIRE-ICE,代码行数:22,代码来源:ltr558als.c

示例2: cyttsp4_log_btn_data

static void cyttsp4_log_btn_data(struct cyttsp4_btn_data *bd)
{
	struct device *dev = bd->dev;
	struct cyttsp4_core_data *cd = dev_get_drvdata(dev);
	u8 *pr_buf = cd->pr_buf;
	struct cyttsp4_sysinfo *si = bd->si;
	int cur;
	int t;

	for (cur = 0; cur < si->si_ofs.num_btns; cur++) {
		pr_buf[0] = 0;
		snprintf(pr_buf, CY_MAX_PRBUF_SIZE, "btn_rec[%d]=0x", cur);
		/*for (t = 0; t < si->si_ofs.btn_rec_size; t++)
			snprintf(pr_buf, CY_MAX_PRBUF_SIZE, "%s%02X",
				pr_buf, si->btn_rec_data
				[(cur * si->si_ofs.btn_rec_size) + t]);*/

		dev_vdbg(dev, "%s: %s\n", __func__, pr_buf);
	}
	return;
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:21,代码来源:cyttsp4_btn.c

示例3: cyttsp4_btn_open

static int cyttsp4_btn_open(struct input_dev *input)
{
	struct device *dev = input->dev.parent;
	struct cyttsp4_core_data *cd = dev_get_drvdata(dev);

	pm_runtime_get_sync(dev);
	cd->number_of_open_input_device++;
	cd->pm_runtime_usage_count++;

	dev_vdbg(dev, "%s: setup subscriptions\n", __func__);

	/* set up touch call back */
	_cyttsp4_subscribe_attention(dev, CY_ATTEN_IRQ, CY_MODULE_BTN,
		cyttsp4_btn_attention, CY_MODE_OPERATIONAL);

	/* set up startup call back */
	_cyttsp4_subscribe_attention(dev, CY_ATTEN_STARTUP, CY_MODULE_BTN,
		cyttsp4_startup_attention, 0);

	return 0;
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:21,代码来源:cyttsp4_btn.c

示例4: cyttsp4_xy_worker

/* read xy_data for all current CapSense button touches */
static int cyttsp4_xy_worker(struct cyttsp4_btn_data *bd)
{
	struct device *dev = &bd->ttsp->dev;
	struct cyttsp4_sysinfo *si = bd->si;
	u8 rep_stat = si->xy_mode[si->si_ofs.rep_ofs + 1];
#ifdef VERBOSE_DEBUG
	int rc;
#endif

	/* rep_data for bad packet check */
	if (IS_BAD_PKT(rep_stat)) {
		dev_dbg(dev, "%s: Invalid buffer detected\n", __func__);
		return 0;
	}

	/* extract button press/release touch information */
	if (si->si_ofs.num_btns > 0) {
		cyttsp4_get_btn_touches(bd);
#ifdef VERBOSE_DEBUG
		/* read button diff data */
		rc = cyttsp4_read(bd->ttsp, CY_MODE_OPERATIONAL,
				si->si_ofs.tt_stat_ofs + 1 +
				si->si_ofs.max_tchs * si->si_ofs.tch_rec_size,
				si->btn_rec_data,
				si->si_ofs.num_btns * si->si_ofs.btn_rec_size);
		if (rc < 0) {
			dev_err(dev, "%s: read fail on button regs r=%d\n",
					__func__, rc);
			return 0;
		}

		/* log button press/release touch information */
		cyttsp4_log_btn_data(bd);
#endif
	}

	dev_vdbg(dev, "%s: done\n", __func__);

	return 0;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:41,代码来源:cyttsp4_btn.c

示例5: cyttsp5_spi_xfer

static int cyttsp5_spi_xfer(u8 op, struct cyttsp5_spi *ts, u8 *buf, int length)
{
	struct device *dev = &ts->client->dev;
	struct spi_message msg;
	struct spi_transfer xfer[2];
	u8 w_header[2];
	u8 r_header[2];
	int rc;

	memset(xfer, 0, sizeof(xfer));

	spi_message_init(&msg);
	cyttsp5_spi_add_rw_msg(&msg, &xfer[0], w_header, r_header, op);

	switch (op) {
	case CY_SPI_RD_OP:
		xfer[1].rx_buf = buf;
		xfer[1].len = length;
		spi_message_add_tail(&xfer[1], &msg);
		break;
	case CY_SPI_WR_OP:
		xfer[1].tx_buf = buf;
		xfer[1].len = length;
		spi_message_add_tail(&xfer[1], &msg);
		break;
	default:
		rc = -EIO;
		goto exit;
	}

	rc = spi_sync(ts->client, &msg);
exit:
	if (rc < 0)
		dev_vdbg(dev, "%s: spi_sync() error %d\n", __func__, rc);

	if (r_header[0] != CY_SPI_SYNC_ACK)
		return -EIO;

	return rc;
}
开发者ID:98416,项目名称:Z7Max_NX505J_H129_kernel,代码行数:40,代码来源:cyttsp5_spi.c

示例6: ab8500_regulator_set_mode

static int ab8500_regulator_set_mode(struct regulator_dev *rdev,
				     unsigned int mode)
{
	int ret = 0;

	struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);

	if (info == NULL) {
		dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
		return -EINVAL;
	}

	switch (mode) {
	case REGULATOR_MODE_NORMAL:
		info->update_val = info->update_val_normal;
		break;
	case REGULATOR_MODE_IDLE:
		info->update_val = info->update_val_idle;
		break;
	default:
		return -EINVAL;
	}

	if (info->is_enabled) {
		ret = abx500_mask_and_set_register_interruptible(info->dev,
			info->update_bank, info->update_reg,
			info->update_mask, info->update_val);
		if (ret < 0)
			dev_err(rdev_get_dev(rdev),
				"couldn't set regulator mode\n");

		dev_vdbg(rdev_get_dev(rdev),
			"%s-set_mode (bank, reg, mask, value): "
			"0x%x, 0x%x, 0x%x, 0x%x\n",
			info->desc.name, info->update_bank, info->update_reg,
			info->update_mask, info->update_val);
	}

	return ret;
}
开发者ID:krachlatte,项目名称:Sony-Xperia-Go-ST27i,代码行数:40,代码来源:ab8500.c

示例7: exynos_drd_switch_start_peripheral

static int exynos_drd_switch_start_peripheral(struct usb_otg *otg, int on)
{
	int ret;

	if (!otg->gadget)
		return -EINVAL;

	dev_dbg(otg->phy->dev, "Turn %s gadget %s\n",
			on ? "on" : "off", otg->gadget->name);

	/* Samsung KOR S/W GROUP kmato.kim for MDM*/
	if (is_usb_locked) {
		ret = usb_gadget_vbus_disconnect(otg->gadget);
		pr_info("%s: Becuase MDM abnomal deleted, usb vbus disconnect \n",
			__func__);
		return ret;
	}

	if (on) {
		/* Start device only if host is off */
		if (!exynos_drd_switch_is_host_off(otg)) {
			/*
			 * REVISIT: if host is not suspended shall we check
			 * runtime_error flag and clear it, if it is set?
			 * It will give an additional chance to the host
			 * to be suspended if runtime error happened.
			 */
			dev_vdbg(otg->phy->dev, "%s: host is still active\n",
						__func__);
			return -EAGAIN;
		}

		ret = usb_gadget_vbus_connect(otg->gadget);
	} else {
		ret = usb_gadget_vbus_disconnect(otg->gadget);
		/* Currently always return 0 */
	}

	return ret;
}
开发者ID:Svard73,项目名称:SM-T700-T705-Kernel,代码行数:40,代码来源:exynos-drd-switch.c

示例8: cyttsp4_mt_process_touch

static void cyttsp4_mt_process_touch(struct cyttsp4_mt_data *md,
	struct cyttsp4_touch *touch)
{
	struct device *dev = md->dev;
	int tmp;
	bool flipped;

	if (md->pdata->flags & CY_MT_FLAG_FLIP) {
		tmp = touch->abs[CY_TCH_X];
		touch->abs[CY_TCH_X] = touch->abs[CY_TCH_Y];
		touch->abs[CY_TCH_Y] = tmp;
		flipped = true;
	} else
		flipped = false;

	if (md->pdata->flags & CY_MT_FLAG_INV_X) {
		if (flipped)
			touch->abs[CY_TCH_X] = md->si->si_ofs.max_y -
				touch->abs[CY_TCH_X];
		else
			touch->abs[CY_TCH_X] = md->si->si_ofs.max_x -
				touch->abs[CY_TCH_X];
	}
	if (md->pdata->flags & CY_MT_FLAG_INV_Y) {
		if (flipped)
			touch->abs[CY_TCH_Y] = md->si->si_ofs.max_x -
				touch->abs[CY_TCH_Y];
		else
			touch->abs[CY_TCH_Y] = md->si->si_ofs.max_y -
				touch->abs[CY_TCH_Y];
	}

	dev_vdbg(dev, "%s: flip=%s inv-x=%s inv-y=%s x=%04X(%d) y=%04X(%d)\n",
		__func__, flipped ? "true" : "false",
		md->pdata->flags & CY_MT_FLAG_INV_X ? "true" : "false",
		md->pdata->flags & CY_MT_FLAG_INV_Y ? "true" : "false",
		touch->abs[CY_TCH_X], touch->abs[CY_TCH_X],
		touch->abs[CY_TCH_Y], touch->abs[CY_TCH_Y]);
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:39,代码来源:cyttsp4_mt_common.c

示例9: ux500_pd_amba_runtime_idle

static int ux500_pd_amba_runtime_idle(struct device *dev)
{
	int (*callback)(struct device *) = NULL;
	int ret;

	dev_vdbg(dev, "%s()\n", __func__);

	/*
	 * Do not bypass AMBA bus runtime functions by calling generic runtime
	 * directly. A future fix could be to implement a
	 * "pm_bus_generic_runtime_*" API which we can use instead.
	 */
	if (dev->bus && dev->bus->pm)
		callback = dev->bus->pm->runtime_idle;

	if (callback)
		ret = callback(dev);
	else
		ret = pm_generic_runtime_idle(dev);

	return ret;
}
开发者ID:1DeMaCr,项目名称:Codina_Kernel-3.x,代码行数:22,代码来源:runtime.c

示例10: exynos_drd_switch_start_peripheral

static int exynos_drd_switch_start_peripheral(struct usb_otg *otg, int on)
{
	int ret;

	if (!otg->gadget)
		return -EINVAL;

	dev_dbg(otg->phy->dev, "Turn %s gadget %s\n",
			on ? "on" : "off", otg->gadget->name);

#ifdef CONFIG_TARGET_LOCALE_KOR
	if (is_usb_locked) {
		ret = usb_gadget_vbus_disconnect(otg->gadget);
		return ret;
	}
#endif

	if (on) {
		/* Start device only if host is off */
		if (!exynos_drd_switch_is_host_off(otg)) {
			/*
			 * REVISIT: if host is not suspended shall we check
			 * runtime_error flag and clear it, if it is set?
			 * It will give an additional chance to the host
			 * to be suspended if runtime error happened.
			 */
			dev_vdbg(otg->phy->dev, "%s: host is still active\n",
						__func__);
			return -EAGAIN;
		}

		ret = usb_gadget_vbus_connect(otg->gadget);
	} else {
		ret = usb_gadget_vbus_disconnect(otg->gadget);
		/* Currently always return 0 */
	}

	return ret;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:Adam-Kernel-GS4,代码行数:39,代码来源:exynos-drd-switch.c

示例11: cyttsp5_command_store

static ssize_t cyttsp5_command_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t size)
{
	struct cyttsp5_device_access_data *dad
		= cyttsp5_get_device_access_data(dev);
	ssize_t length;
	int rc;

	mutex_lock(&dad->sysfs_lock);
	dad->status = 0;
	dad->response_length = 0;
	length = cyttsp5_ic_parse_input(dev, buf, size, dad->ic_buf,
			CY_MAX_PRBUF_SIZE);
	if (length <= 0) {
		dev_err(dev, "%s: %s Group Data store\n", __func__,
				"Malformed input for");
		goto exit;
	}

	/* write ic_buf to log */
	cyttsp5_pr_buf(dev, dad->pr_buf, dad->ic_buf, length, "ic_buf");

	//pm_runtime_get_sync(dev);
	rc = cmd->cmd->user_cmd(dev, 1, CY_MAX_PRBUF_SIZE,
			dad->response_buf, length, dad->ic_buf,
			&dad->response_length);
	//pm_runtime_put(dev);
	if (rc) {
		dad->response_length = 0;
		dev_err(dev, "%s: Failed to store command\n", __func__);
	} else {
		dad->status = 1;
	}

exit:
	mutex_unlock(&dad->sysfs_lock);
	dev_vdbg(dev, "%s: return size=%d\n", __func__, size);
	return size;
}
开发者ID:vikrant82,项目名称:t320_kernel,代码行数:39,代码来源:cyttsp5_device_access.c

示例12: store_als_persist

static ssize_t store_als_persist(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	struct iio_dev *indio_dev = dev_get_drvdata(dev);
	struct isl29028_chip *chip = iio_priv(indio_dev);
	unsigned long lval;

	dev_vdbg(dev, "%s()\n", __func__);

	if (strict_strtoul(buf, 10, &lval))
		return -EINVAL;

	if ((lval > 16) || (lval < 0x0)) {
		dev_err(dev, "The als persist is not supported\n");
		return -EINVAL;
	}

	mutex_lock(&chip->lock);
	chip->als_persist = (int)lval;
	mutex_unlock(&chip->lock);
	return count;
}
开发者ID:Mrchenkeyu,项目名称:android_kernel_zte_pluto,代码行数:22,代码来源:isl29028.c

示例13: wm8994_read

static int wm8994_read(struct wm8994 *wm8994, unsigned short reg,
		       int bytes, void *dest)
{
	int ret, i;
	u16 *buf = dest;

	BUG_ON(bytes % 2);
	BUG_ON(bytes <= 0);

	ret = wm8994->read_dev(wm8994, reg, bytes, dest);
	if (ret < 0)
		return ret;

	for (i = 0; i < bytes / 2; i++) {
		buf[i] = be16_to_cpu(buf[i]);

		dev_vdbg(wm8994->dev, "Read %04x from R%d(0x%x)\n",
			 buf[i], reg + i, reg + i);
	}

	return 0;
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:22,代码来源:wm8994-core.c

示例14: cyttsp4_spi_write_block_data

static s32 cyttsp4_spi_write_block_data(struct cyttsp4_spi *ts, u16 addr,
				int length, const void *data, int max_xfer)
{
	int rc = -EINVAL;
	int retry = 0;
	int trans_len;
	struct device *dev = &ts->client->dev;

	dev_vdbg(dev, "%s: Enter\n", __func__);

	while (length > 0) {
		trans_len = min(length, max_xfer);

		rc = cyttsp4_spi_xfer(CY_SPI_WR_OP, ts, addr, (void *)data,
				trans_len);
		if (rc < 0) {
			dev_err(dev, "%s: Fail write r=%d\n", __func__, rc);
			goto exit;
		} else if (rc > 0) {
			/* Perform retry or fail */
			if (retry++ < CY_SPI_NUM_RETRY) {
				dev_dbg(dev, "%s: ACK error, retry %d\n",
					__func__, retry);
				continue;
			} else {
				dev_err(dev, "%s: ACK error\n", __func__);
				rc = -EIO;
				goto exit;
			}
		}

		length -= trans_len;
		data += trans_len;
		addr += trans_len;
	}
exit:
	return rc;
}
开发者ID:jarpii,项目名称:android_kernel_huawei_Soulfire,代码行数:38,代码来源:cyttsp4_spi.c

示例15: dwc3_gadget_ep0_queue

int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
		gfp_t gfp_flags)
{
	struct dwc3_request		*req = to_dwc3_request(request);
	struct dwc3_ep			*dep = to_dwc3_ep(ep);
	struct dwc3			*dwc = dep->dwc;

	unsigned long			flags;

	int				ret;

	spin_lock_irqsave(&dwc->lock, flags);
	if (!dep->desc) {
		dev_dbg(dwc->dev, "trying to queue request %p to disabled %s\n",
				request, dep->name);
		ret = -ESHUTDOWN;
		goto out;
	}

	/* we share one TRB for ep0/1 */
	if (!list_empty(&dwc->eps[0]->request_list) ||
			!list_empty(&dwc->eps[1]->request_list) ||
			dwc->ep0_status_pending) {
		ret = -EBUSY;
		goto out;
	}

	dev_vdbg(dwc->dev, "queueing request %p to %s length %d, state '%s'\n",
			request, dep->name, request->length,
			dwc3_ep0_state_string(dwc->ep0state));

	ret = __dwc3_gadget_ep0_queue(dep, req);

out:
	spin_unlock_irqrestore(&dwc->lock, flags);

	return ret;
}
开发者ID:ashang,项目名称:xpenology-3.x,代码行数:38,代码来源:ep0.c


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