Example #1
0
/*
 * These are the device model conversion veneers; they convert the
 * device model structures to our more specific structures.
 */
static int amba_probe(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
	struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
	int ret;

	do {
		ret = amba_get_enable_vcore(pcdev);
		if (ret)
			break;

		ret = amba_get_enable_pclk(pcdev);
		if (ret)
			break;

		ret = pcdrv->probe(pcdev, id);
		if (ret == 0)
			break;

		amba_put_disable_pclk(pcdev);
		amba_put_disable_vcore(pcdev);
	} while (0);

	return ret;
}
Example #2
0
/*
 * These are the device model conversion veneers; they convert the
 * device model structures to our more specific structures.
 */
static int amba_probe(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
	const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
	int ret;

	do {
		ret = amba_get_enable_vcore(pcdev);
		if (ret)
			break;
                #ifndef CONFIG_MP_PLATFORM_ARM_MSTAR_ETM
		ret = amba_get_enable_pclk(pcdev);
		if (ret)
			break;
                #endif

		ret = pcdrv->probe(pcdev, id);
		if (ret == 0)
			break;

		amba_put_disable_pclk(pcdev);
		amba_put_disable_vcore(pcdev);
	} while (0);

	return ret;
}
Example #3
0
File: bus.c Project: 08opt/linux
/*
 * These are the device model conversion veneers; they convert the
 * device model structures to our more specific structures.
 */
static int amba_probe(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
	const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
	int ret;

	do {
		ret = amba_get_enable_vcore(pcdev);
		if (ret)
			break;

		ret = amba_get_enable_pclk(pcdev);
		if (ret)
			break;

		pm_runtime_get_noresume(dev);
		pm_runtime_set_active(dev);
		pm_runtime_enable(dev);

		ret = pcdrv->probe(pcdev, id);
		if (ret == 0)
			break;

		pm_runtime_disable(dev);
		pm_runtime_set_suspended(dev);
		pm_runtime_put_noidle(dev);

		amba_put_disable_pclk(pcdev);
		amba_put_disable_vcore(pcdev);
	} while (0);

	return ret;
}
Example #4
0
static int amba_remove(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *drv = to_amba_driver(dev->driver);
	int ret = drv->remove(pcdev);

	amba_put_disable_pclk(pcdev);
	amba_put_disable_vcore(pcdev);

	return ret;
}
Example #5
0
File: bus.c Project: 08opt/linux
static int amba_remove(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *drv = to_amba_driver(dev->driver);
	int ret;

	pm_runtime_get_sync(dev);
	ret = drv->remove(pcdev);
	pm_runtime_put_noidle(dev);

	/* Undo the runtime PM settings in amba_probe() */
	pm_runtime_disable(dev);
	pm_runtime_set_suspended(dev);
	pm_runtime_put_noidle(dev);

	amba_put_disable_pclk(pcdev);
	amba_put_disable_vcore(pcdev);

	return ret;
}