示例#1
0
文件: core.c 项目: asmalldev/linux
static int intel_th_output_activate(struct intel_th_device *thdev)
{
	struct intel_th_driver *thdrv =
		to_intel_th_driver_or_null(thdev->dev.driver);
	int ret = 0;

	if (!thdrv)
		return -ENODEV;

	if (!try_module_get(thdrv->driver.owner))
		return -ENODEV;

	pm_runtime_get_sync(&thdev->dev);

	if (thdrv->activate)
		ret = thdrv->activate(thdev);
	else
		intel_th_trace_enable(thdev);

	if (ret) {
		pm_runtime_put(&thdev->dev);
		module_put(thdrv->driver.owner);
	}

	return ret;
}
示例#2
0
static int intel_th_output_activate(struct intel_th_device *thdev)
{
	struct intel_th_driver *thdrv = to_intel_th_driver(thdev->dev.driver);

	if (thdrv->activate)
		return thdrv->activate(thdev);

	intel_th_trace_enable(thdev);

	return 0;
}
示例#3
0
文件: pti.c 项目: 513855417/linux
static int intel_th_pti_activate(struct intel_th_device *thdev)
{
	struct pti_device *pti = dev_get_drvdata(&thdev->dev);
	u32 ctl = PTI_EN;

	if (pti->patgen)
		ctl |= pti->patgen << __ffs(PTI_PATGENMODE);
	if (pti->freeclk)
		ctl |= PTI_FCEN;
	ctl |= pti->mode << __ffs(PTI_MODE);
	ctl |= pti->clkdiv << __ffs(PTI_CLKDIV);

	iowrite32(ctl, pti->base + REG_PTI_CTL);

	intel_th_trace_enable(thdev);

	return 0;
}