Beispiel #1
0
static int nvhost_drv_remove(struct device *_dev)
{
	struct nvhost_driver *drv = to_nvhost_driver(_dev->driver);
	struct nvhost_device *dev = to_nvhost_device(_dev);

	return drv->remove(dev);
}
Beispiel #2
0
static void nvhost_drv_shutdown(struct device *_dev)
{
	struct nvhost_driver *drv = to_nvhost_driver(_dev->driver);
	struct nvhost_device *dev = to_nvhost_device(_dev);

	drv->shutdown(dev);
}
Beispiel #3
0
static void podgov_idle_handler(struct work_struct *work)
{
	struct delayed_work *idle_timer =
		container_of(work, struct delayed_work, work);
	struct podgov_info_rec *podgov =
		container_of(idle_timer, struct podgov_info_rec, idle_timer);
	struct devfreq *df = podgov->power_manager;

	/* Retrieve device driver ops and the device struct */
	struct device *d = df->dev.parent;
	struct nvhost_driver *drv = to_nvhost_driver(d->driver);
	struct nvhost_device *dev = dev = to_nvhost_device(d);

	int notify_idle = 0;

	mutex_lock(&df->lock);

	if (!podgov->enable) {
		mutex_unlock(&df->lock);
		return;
	}

	if (podgov->last_event_type == DEVICE_IDLE &&
		df->previous_freq > df->min_freq)
		notify_idle = 1;

	mutex_unlock(&df->lock);

	if (drv->idle && notify_idle)
		drv->idle(dev);
}
Beispiel #4
0
static int nvhost_legacy_resume(struct device *dev)
{
	struct nvhost_driver *pdrv = to_nvhost_driver(dev->driver);
	struct nvhost_device *pdev = to_nvhost_device(dev);
	int ret = 0;

	if (dev->driver && pdrv->resume)
		ret = pdrv->resume(pdev);

	return ret;
}
Beispiel #5
0
static int nvhost_legacy_suspend(struct device *dev, pm_message_t mesg)
{
	struct nvhost_driver *pdrv = to_nvhost_driver(dev->driver);
	struct nvhost_device *pdev = to_nvhost_device(dev);
	int ret = 0;

	if (dev->driver && pdrv->suspend)
		ret = pdrv->suspend(pdev, mesg);

	return ret;
}
Beispiel #6
0
static int nvhost_bus_match(struct device *_dev, struct device_driver *drv)
{
    struct nvhost_device *dev = to_nvhost_device(_dev);
    struct nvhost_driver *ndrv = to_nvhost_driver(drv);

    /* check if driver support multiple devices through id_table */
    if (ndrv->id_table)
        return nvhost_bus_match_id(dev, ndrv->id_table) != NULL;
    else /* driver does not support id_table */
        return !strncmp(dev->name, drv->name, strlen(drv->name));
}
Beispiel #7
0
static int nvhost_drv_probe(struct device *_dev)
{
    struct nvhost_driver *drv = to_nvhost_driver(_dev->driver);
    struct nvhost_device *dev = to_nvhost_device(_dev);

    if (drv && drv->probe) {
        if (drv->id_table)
            return drv->probe(dev, nvhost_bus_match_id(dev, drv->id_table));
        else
            return drv->probe(dev, NULL);
    }
    else
        return -ENODEV;
}
Beispiel #8
0
static int __devinit msenc_probe(struct nvhost_device *dev,
		struct nvhost_device_id *id_table)
{
	int err = 0;
	struct nvhost_driver *drv = to_nvhost_driver(dev->dev.driver);

	drv->init = nvhost_msenc_init;
	drv->deinit = nvhost_msenc_deinit;
	drv->finalize_poweron = nvhost_msenc_finalize_poweron;

	err = nvhost_client_device_get_resources(dev);
	if (err)
		return err;

	return nvhost_client_device_init(dev);
}
Beispiel #9
0
static inline int t30_nvhost_hwctx_handler_init(struct nvhost_channel *ch)
{
	int err = 0;
	unsigned long syncpts = ch->dev->syncpts;
	unsigned long waitbases = ch->dev->waitbases;
	u32 syncpt = find_first_bit(&syncpts, BITS_PER_LONG);
	u32 waitbase = find_first_bit(&waitbases, BITS_PER_LONG);
	struct nvhost_driver *drv = to_nvhost_driver(ch->dev->dev.driver);

	if (drv->alloc_hwctx_handler) {
		ch->ctxhandler = drv->alloc_hwctx_handler(syncpt,
				waitbase, ch);
		if (!ch->ctxhandler)
			err = -ENOMEM;
	}

	return err;
}