void nvhost_vic03_deinit(struct platform_device *dev) { struct vic03 *v = get_vic03(dev); struct nvhost_device_data *pdata = nvhost_get_devdata(dev); DEFINE_DMA_ATTRS(attrs); dma_set_attr(DMA_ATTR_READ_ONLY, &attrs); if (!v) return; if (pdata->scaling_init) nvhost_scale_hw_deinit(dev); if (v->ucode.mapped) { dma_free_attrs(&dev->dev, v->ucode.size, v->ucode.mapped, v->ucode.dma_addr, &attrs); v->ucode.mapped = NULL; v->ucode.dma_addr = 0; } /* zap, free */ set_vic03(dev, NULL); kfree(v); }
int nvhost_vic_prepare_poweroff(struct platform_device *dev) { struct nvhost_device_data *pdata = nvhost_get_devdata(dev); struct flcn *v; struct nvhost_channel *ch = pdata->channels[0]; nvhost_dbg_fn(""); if (pdata->scaling_deinit) nvhost_scale_hw_deinit(dev); if (ch && ch->dev) { mutex_lock(&ch->submitlock); ch->cur_ctx = NULL; mutex_unlock(&ch->submitlock); } v = get_flcn(pdata->pdev); return 0; }
void nvhost_msenc_deinit(struct platform_device *dev) { struct msenc *m = get_msenc(dev); struct nvhost_device_data *pdata = platform_get_drvdata(dev); if (pdata->scaling_init) nvhost_scale_hw_deinit(dev); if (!m) return; /* unpin, free ucode memory */ if (m->mapped) { dma_free_attrs(&dev->dev, m->size, m->mapped, m->phys, &m->attrs); m->mapped = NULL; } m->valid = false; kfree(m); set_msenc(dev, NULL); }
int nvhost_gr3d_t114_prepare_power_off(struct platform_device *dev) { nvhost_scale_hw_deinit(dev); return nvhost_gr3d_prepare_power_off(dev); }