cvp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/debugfs.h>
  6. #include <linux/dma-mapping.h>
  7. #include <linux/init.h>
  8. #include <linux/ioctl.h>
  9. #include <linux/list.h>
  10. #include <linux/module.h>
  11. #include <linux/of_platform.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/slab.h>
  14. #include <linux/types.h>
  15. #include <linux/version.h>
  16. #include <linux/io.h>
  17. #include "msm_cvp_core.h"
  18. #include "msm_cvp_common.h"
  19. #include "msm_cvp_debug.h"
  20. #include "msm_cvp_internal.h"
  21. #include "msm_cvp_res_parse.h"
  22. #include "msm_cvp_resources.h"
  23. #include "cvp_hfi_api.h"
  24. #include "cvp_private.h"
  25. #include "msm_cvp_clocks.h"
  26. #include "msm_cvp_dsp.h"
  27. #include "msm_cvp.h"
  28. #define CLASS_NAME "cvp"
  29. #define DRIVER_NAME "cvp"
  30. struct msm_cvp_drv *cvp_driver;
  31. static int cvp_open(struct inode *inode, struct file *filp)
  32. {
  33. struct msm_cvp_core *core = container_of(inode->i_cdev,
  34. struct msm_cvp_core, cdev);
  35. struct msm_cvp_inst *inst;
  36. dprintk(CVP_SESS, "%s: core->id: %d\n", __func__, core->id);
  37. inst = msm_cvp_open(core->id, MSM_CVP_USER);
  38. if (!inst) {
  39. dprintk(CVP_ERR, "Failed to create cvp instance\n");
  40. return -ENOMEM;
  41. }
  42. filp->private_data = inst;
  43. return 0;
  44. }
  45. static int cvp_close(struct inode *inode, struct file *filp)
  46. {
  47. int rc = 0;
  48. struct msm_cvp_inst *inst = filp->private_data;
  49. rc = msm_cvp_close(inst);
  50. filp->private_data = NULL;
  51. return rc;
  52. }
  53. static unsigned int cvp_poll(struct file *filp, struct poll_table_struct *p)
  54. {
  55. int rc = 0;
  56. struct msm_cvp_inst *inst = filp->private_data;
  57. unsigned long flags = 0;
  58. poll_wait(filp, &inst->event_handler.wq, p);
  59. spin_lock_irqsave(&inst->event_handler.lock, flags);
  60. if (inst->event_handler.event == CVP_SSR_EVENT)
  61. rc |= POLLPRI;
  62. if (inst->event_handler.event == CVP_DUMP_EVENT)
  63. rc |= POLLIN;
  64. inst->event_handler.event = CVP_NO_EVENT;
  65. spin_unlock_irqrestore(&inst->event_handler.lock, flags);
  66. return rc;
  67. }
  68. static const struct file_operations cvp_fops = {
  69. .owner = THIS_MODULE,
  70. .open = cvp_open,
  71. .release = cvp_close,
  72. .unlocked_ioctl = cvp_unblocked_ioctl,
  73. .compat_ioctl = cvp_compat_ioctl,
  74. .poll = cvp_poll,
  75. };
  76. static int read_platform_resources(struct msm_cvp_core *core,
  77. struct platform_device *pdev)
  78. {
  79. int rc = 0;
  80. if (!core || !pdev) {
  81. dprintk(CVP_ERR, "%s: Invalid params %pK %pK\n",
  82. __func__, core, pdev);
  83. return -EINVAL;
  84. }
  85. core->hfi_type = CVP_HFI_IRIS;
  86. core->resources.pdev = pdev;
  87. if (pdev->dev.of_node) {
  88. /* Target supports DT, parse from it */
  89. rc = cvp_read_platform_resources_from_drv_data(core);
  90. rc = cvp_read_platform_resources_from_dt(&core->resources);
  91. } else {
  92. dprintk(CVP_ERR, "pdev node is NULL\n");
  93. rc = -EINVAL;
  94. }
  95. return rc;
  96. }
  97. static void init_cycle_info(struct cvp_cycle_info *info)
  98. {
  99. memset(info->sum_fps, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  100. memset(info->hi_ctrl_lim, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  101. memset(info->lo_ctrl_lim, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  102. memset(info->cycle, 0,
  103. HFI_MAX_HW_THREADS*sizeof(struct cvp_cycle_stat));
  104. info->conf_freq = 0;
  105. }
  106. static int msm_cvp_initialize_core(struct platform_device *pdev,
  107. struct msm_cvp_core *core)
  108. {
  109. int i = 0;
  110. int rc = 0;
  111. if (!core)
  112. return -EINVAL;
  113. rc = read_platform_resources(core, pdev);
  114. if (rc) {
  115. dprintk(CVP_ERR, "Failed to get platform resources\n");
  116. return rc;
  117. }
  118. INIT_LIST_HEAD(&core->instances);
  119. mutex_init(&core->lock);
  120. mutex_init(&core->clk_lock);
  121. core->state = CVP_CORE_UNINIT;
  122. for (i = SYS_MSG_INDEX(SYS_MSG_START);
  123. i <= SYS_MSG_INDEX(SYS_MSG_END); i++) {
  124. init_completion(&core->completions[i]);
  125. }
  126. INIT_DELAYED_WORK(&core->fw_unload_work, msm_cvp_fw_unload_handler);
  127. INIT_WORK(&core->ssr_work, msm_cvp_ssr_handler);
  128. init_cycle_info(&core->dyn_clk);
  129. return rc;
  130. }
  131. static ssize_t link_name_show(struct device *dev,
  132. struct device_attribute *attr,
  133. char *buf)
  134. {
  135. struct msm_cvp_core *core = dev_get_drvdata(dev);
  136. if (core)
  137. if (dev == core->dev)
  138. return snprintf(buf, PAGE_SIZE, "msm_cvp\n");
  139. else
  140. return 0;
  141. else
  142. return 0;
  143. }
  144. static DEVICE_ATTR_RO(link_name);
  145. static ssize_t pwr_collapse_delay_store(struct device *dev,
  146. struct device_attribute *attr,
  147. const char *buf, size_t count)
  148. {
  149. unsigned long val = 0;
  150. int rc = 0;
  151. struct msm_cvp_core *core = NULL;
  152. rc = kstrtoul(buf, 0, &val);
  153. if (rc)
  154. return rc;
  155. else if (!val)
  156. return -EINVAL;
  157. core = get_cvp_core(MSM_CORE_CVP);
  158. if (!core)
  159. return -EINVAL;
  160. core->resources.msm_cvp_pwr_collapse_delay = val;
  161. return count;
  162. }
  163. static ssize_t pwr_collapse_delay_show(struct device *dev,
  164. struct device_attribute *attr,
  165. char *buf)
  166. {
  167. struct msm_cvp_core *core = NULL;
  168. core = get_cvp_core(MSM_CORE_CVP);
  169. if (!core)
  170. return -EINVAL;
  171. return snprintf(buf, PAGE_SIZE, "%u\n",
  172. core->resources.msm_cvp_pwr_collapse_delay);
  173. }
  174. static DEVICE_ATTR_RW(pwr_collapse_delay);
  175. static ssize_t thermal_level_show(struct device *dev,
  176. struct device_attribute *attr,
  177. char *buf)
  178. {
  179. return snprintf(buf, PAGE_SIZE, "%d\n", cvp_driver->thermal_level);
  180. }
  181. static ssize_t thermal_level_store(struct device *dev,
  182. struct device_attribute *attr,
  183. const char *buf, size_t count)
  184. {
  185. int rc = 0, val = 0;
  186. rc = kstrtoint(buf, 0, &val);
  187. if (rc || val < 0) {
  188. dprintk(CVP_WARN,
  189. "Invalid thermal level value: %s\n", buf);
  190. return -EINVAL;
  191. }
  192. dprintk(CVP_PWR, "Thermal level old %d new %d\n",
  193. cvp_driver->thermal_level, val);
  194. if (val == cvp_driver->thermal_level)
  195. return count;
  196. cvp_driver->thermal_level = val;
  197. msm_cvp_comm_handle_thermal_event();
  198. return count;
  199. }
  200. static DEVICE_ATTR_RW(thermal_level);
  201. static ssize_t sku_version_show(struct device *dev,
  202. struct device_attribute *attr, char *buf)
  203. {
  204. return scnprintf(buf, PAGE_SIZE, "%d",
  205. cvp_driver->sku_version);
  206. }
  207. static DEVICE_ATTR_RO(sku_version);
  208. static ssize_t boot_store(struct device *dev,
  209. struct device_attribute *attr,
  210. const char *buf, size_t count)
  211. {
  212. int rc = 0, val = 0;
  213. static int booted;
  214. rc = kstrtoint(buf, 0, &val);
  215. if (rc || val < 0) {
  216. dprintk(CVP_WARN,
  217. "Invalid boot value: %s\n", buf);
  218. return -EINVAL;
  219. }
  220. if (val > 0 && booted == 0) {
  221. struct msm_cvp_inst *inst;
  222. inst = msm_cvp_open(MSM_CORE_CVP, MSM_CVP_BOOT);
  223. if (!inst) {
  224. dprintk(CVP_ERR,
  225. "Failed to create cvp instance\n");
  226. return -ENOMEM;
  227. }
  228. rc = msm_cvp_close(inst);
  229. if (rc) {
  230. dprintk(CVP_ERR,
  231. "Failed to close cvp instance\n");
  232. return rc;
  233. }
  234. } else if ((val == 2) && booted) {
  235. struct msm_cvp_inst *inst;
  236. inst = msm_cvp_open(MSM_CORE_CVP, MSM_CVP_USER);
  237. if (!inst) {
  238. dprintk(CVP_ERR,
  239. "Failed to create eva instance\n");
  240. return -ENOMEM;
  241. }
  242. rc = msm_cvp_session_create(inst);
  243. if (rc)
  244. dprintk(CVP_ERR, "Failed to create eva session\n");
  245. rc = msm_cvp_close(inst);
  246. if (rc) {
  247. dprintk(CVP_ERR,
  248. "Failed to close eva instance\n");
  249. return rc;
  250. }
  251. }
  252. booted = 1;
  253. return count;
  254. }
  255. static DEVICE_ATTR_WO(boot);
  256. static struct attribute *msm_cvp_core_attrs[] = {
  257. &dev_attr_pwr_collapse_delay.attr,
  258. &dev_attr_thermal_level.attr,
  259. &dev_attr_sku_version.attr,
  260. &dev_attr_link_name.attr,
  261. &dev_attr_boot.attr,
  262. NULL
  263. };
  264. static struct attribute_group msm_cvp_core_attr_group = {
  265. .attrs = msm_cvp_core_attrs,
  266. };
  267. static const struct of_device_id msm_cvp_plat_match[] = {
  268. {.compatible = "qcom,msm-cvp"},
  269. {.compatible = "qcom,msm-cvp,context-bank"},
  270. {.compatible = "qcom,msm-cvp,bus"},
  271. {.compatible = "qcom,msm-cvp,mem-cdsp"},
  272. {}
  273. };
  274. static int msm_probe_cvp_device(struct platform_device *pdev)
  275. {
  276. int rc = 0;
  277. struct msm_cvp_core *core;
  278. if (!cvp_driver) {
  279. dprintk(CVP_ERR, "Invalid cvp driver\n");
  280. return -EINVAL;
  281. }
  282. core = kzalloc(sizeof(*core), GFP_KERNEL);
  283. if (!core)
  284. return -ENOMEM;
  285. core->platform_data = cvp_get_drv_data(&pdev->dev);
  286. dev_set_drvdata(&pdev->dev, core);
  287. rc = msm_cvp_initialize_core(pdev, core);
  288. if (rc) {
  289. dprintk(CVP_ERR, "Failed to init core\n");
  290. goto err_core_init;
  291. }
  292. core->id = MSM_CORE_CVP;
  293. rc = alloc_chrdev_region(&core->dev_num, 0, 1, DRIVER_NAME);
  294. if (rc < 0) {
  295. dprintk(CVP_ERR, "alloc_chrdev_region failed: %d\n",
  296. rc);
  297. goto err_alloc_chrdev;
  298. }
  299. core->class = class_create(THIS_MODULE, CLASS_NAME);
  300. if (IS_ERR(core->class)) {
  301. rc = PTR_ERR(core->class);
  302. dprintk(CVP_ERR, "class_create failed: %d\n",
  303. rc);
  304. goto err_class_create;
  305. }
  306. core->dev = device_create(core->class, NULL,
  307. core->dev_num, NULL, DRIVER_NAME);
  308. if (IS_ERR(core->dev)) {
  309. rc = PTR_ERR(core->dev);
  310. dprintk(CVP_ERR, "device_create failed: %d\n",
  311. rc);
  312. goto err_device_create;
  313. }
  314. dev_set_drvdata(core->dev, core);
  315. cdev_init(&core->cdev, &cvp_fops);
  316. rc = cdev_add(&core->cdev,
  317. MKDEV(MAJOR(core->dev_num), 0), 1);
  318. if (rc < 0) {
  319. dprintk(CVP_ERR, "cdev_add failed: %d\n",
  320. rc);
  321. goto error_cdev_add;
  322. }
  323. /* finish setting up the 'core' */
  324. mutex_lock(&cvp_driver->lock);
  325. if (cvp_driver->num_cores + 1 > MSM_CVP_CORES_MAX) {
  326. mutex_unlock(&cvp_driver->lock);
  327. dprintk(CVP_ERR, "Maximum cores already exist, core_no = %d\n",
  328. cvp_driver->num_cores);
  329. goto err_cores_exceeded;
  330. }
  331. cvp_driver->num_cores++;
  332. mutex_unlock(&cvp_driver->lock);
  333. rc = sysfs_create_group(&core->dev->kobj, &msm_cvp_core_attr_group);
  334. if (rc) {
  335. dprintk(CVP_ERR,
  336. "Failed to create attributes\n");
  337. goto err_cores_exceeded;
  338. }
  339. core->device = cvp_hfi_initialize(core->hfi_type, core->id,
  340. &core->resources, &cvp_handle_cmd_response);
  341. if (IS_ERR_OR_NULL(core->device)) {
  342. mutex_lock(&cvp_driver->lock);
  343. cvp_driver->num_cores--;
  344. mutex_unlock(&cvp_driver->lock);
  345. rc = PTR_ERR(core->device) ?: -EBADHANDLE;
  346. if (rc != -EPROBE_DEFER)
  347. dprintk(CVP_ERR, "Failed to create HFI device\n");
  348. else
  349. dprintk(CVP_CORE, "msm_cvp: request probe defer\n");
  350. goto err_hfi_initialize;
  351. }
  352. mutex_lock(&cvp_driver->lock);
  353. list_add_tail(&core->list, &cvp_driver->cores);
  354. mutex_unlock(&cvp_driver->lock);
  355. core->debugfs_root = msm_cvp_debugfs_init_core(
  356. core, cvp_driver->debugfs_root);
  357. cvp_driver->sku_version = core->resources.sku_version;
  358. dprintk(CVP_CORE, "populating sub devices\n");
  359. /*
  360. * Trigger probe for each sub-device i.e. qcom,msm-cvp,context-bank.
  361. * When msm_cvp_probe is called for each sub-device, parse the
  362. * context-bank details and store it in core->resources.context_banks
  363. * list.
  364. */
  365. rc = of_platform_populate(pdev->dev.of_node, msm_cvp_plat_match, NULL,
  366. &pdev->dev);
  367. if (rc) {
  368. dprintk(CVP_ERR, "Failed to trigger probe for sub-devices\n");
  369. goto err_fail_sub_device_probe;
  370. }
  371. atomic64_set(&core->kernel_trans_id, get_pkt_array_size());
  372. if (core->resources.dsp_enabled) {
  373. rc = cvp_dsp_device_init();
  374. if (rc)
  375. dprintk(CVP_WARN, "Failed to initialize DSP driver\n");
  376. } else {
  377. dprintk(CVP_DSP, "DSP interface not enabled\n");
  378. }
  379. return rc;
  380. err_fail_sub_device_probe:
  381. cvp_hfi_deinitialize(core->hfi_type, core->device);
  382. err_hfi_initialize:
  383. err_cores_exceeded:
  384. cdev_del(&core->cdev);
  385. error_cdev_add:
  386. device_destroy(core->class, core->dev_num);
  387. err_device_create:
  388. class_destroy(core->class);
  389. err_class_create:
  390. unregister_chrdev_region(core->dev_num, 1);
  391. err_alloc_chrdev:
  392. sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
  393. err_core_init:
  394. dev_set_drvdata(&pdev->dev, NULL);
  395. kfree(core);
  396. return rc;
  397. }
  398. static int msm_cvp_probe_mem_cdsp(struct platform_device *pdev)
  399. {
  400. return cvp_read_mem_cdsp_resources_from_dt(pdev);
  401. }
  402. static int msm_cvp_probe_context_bank(struct platform_device *pdev)
  403. {
  404. return cvp_read_context_bank_resources_from_dt(pdev);
  405. }
  406. static int msm_cvp_probe_bus(struct platform_device *pdev)
  407. {
  408. return cvp_read_bus_resources_from_dt(pdev);
  409. }
  410. static int msm_cvp_probe(struct platform_device *pdev)
  411. {
  412. /*
  413. * Sub devices probe will be triggered by of_platform_populate() towards
  414. * the end of the probe function after msm-cvp device probe is
  415. * completed. Return immediately after completing sub-device probe.
  416. */
  417. if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-cvp")) {
  418. return msm_probe_cvp_device(pdev);
  419. } else if (of_device_is_compatible(pdev->dev.of_node,
  420. "qcom,msm-cvp,bus")) {
  421. return msm_cvp_probe_bus(pdev);
  422. } else if (of_device_is_compatible(pdev->dev.of_node,
  423. "qcom,msm-cvp,context-bank")) {
  424. return msm_cvp_probe_context_bank(pdev);
  425. } else if (of_device_is_compatible(pdev->dev.of_node,
  426. "qcom,msm-cvp,mem-cdsp")) {
  427. return msm_cvp_probe_mem_cdsp(pdev);
  428. }
  429. /* How did we end up here? */
  430. MSM_CVP_ERROR(1);
  431. return -EINVAL;
  432. }
  433. static int msm_cvp_remove(struct platform_device *pdev)
  434. {
  435. int rc = 0;
  436. struct msm_cvp_core *core;
  437. if (!pdev) {
  438. dprintk(CVP_ERR, "%s invalid input %pK", __func__, pdev);
  439. return -EINVAL;
  440. }
  441. core = dev_get_drvdata(&pdev->dev);
  442. if (!core) {
  443. dprintk(CVP_ERR, "%s invalid core", __func__);
  444. return -EINVAL;
  445. }
  446. cvp_hfi_deinitialize(core->hfi_type, core->device);
  447. msm_cvp_free_platform_resources(&core->resources);
  448. sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
  449. dev_set_drvdata(&pdev->dev, NULL);
  450. mutex_destroy(&core->lock);
  451. mutex_destroy(&core->clk_lock);
  452. kfree(core);
  453. return rc;
  454. }
  455. static int msm_cvp_pm_suspend(struct device *dev)
  456. {
  457. int rc = 0;
  458. struct msm_cvp_core *core;
  459. /*
  460. * Bail out if
  461. * - driver possibly not probed yet
  462. * - not the main device. We don't support power management on
  463. * subdevices (e.g. context banks)
  464. */
  465. if (!dev || !dev->driver ||
  466. !of_device_is_compatible(dev->of_node, "qcom,msm-cvp"))
  467. return 0;
  468. core = dev_get_drvdata(dev);
  469. if (!core) {
  470. dprintk(CVP_ERR, "%s invalid core\n", __func__);
  471. return -EINVAL;
  472. }
  473. rc = msm_cvp_suspend(core->id);
  474. if (rc == -ENOTSUPP)
  475. rc = 0;
  476. else if (rc)
  477. dprintk(CVP_WARN, "Failed to suspend: %d\n", rc);
  478. return rc;
  479. }
  480. static int msm_cvp_pm_resume(struct device *dev)
  481. {
  482. dprintk(CVP_INFO, "%s\n", __func__);
  483. return 0;
  484. }
  485. static const struct dev_pm_ops msm_cvp_pm_ops = {
  486. SET_SYSTEM_SLEEP_PM_OPS(msm_cvp_pm_suspend, msm_cvp_pm_resume)
  487. };
  488. MODULE_DEVICE_TABLE(of, msm_cvp_plat_match);
  489. static struct platform_driver msm_cvp_driver = {
  490. .probe = msm_cvp_probe,
  491. .remove = msm_cvp_remove,
  492. .driver = {
  493. .name = "msm_cvp",
  494. .of_match_table = msm_cvp_plat_match,
  495. .pm = &msm_cvp_pm_ops,
  496. },
  497. };
  498. static int __init msm_cvp_init(void)
  499. {
  500. int rc = 0;
  501. cvp_driver = kzalloc(sizeof(*cvp_driver), GFP_KERNEL);
  502. if (!cvp_driver) {
  503. dprintk(CVP_ERR,
  504. "Failed to allocate memroy for msm_cvp_drv\n");
  505. return -ENOMEM;
  506. }
  507. INIT_LIST_HEAD(&cvp_driver->cores);
  508. mutex_init(&cvp_driver->lock);
  509. cvp_driver->debugfs_root = msm_cvp_debugfs_init_drv();
  510. if (!cvp_driver->debugfs_root)
  511. dprintk(CVP_ERR,
  512. "Failed to create debugfs for msm_cvp\n");
  513. rc = platform_driver_register(&msm_cvp_driver);
  514. if (rc) {
  515. dprintk(CVP_ERR,
  516. "Failed to register platform driver\n");
  517. debugfs_remove_recursive(cvp_driver->debugfs_root);
  518. kfree(cvp_driver);
  519. cvp_driver = NULL;
  520. return rc;
  521. }
  522. cvp_driver->msg_cache = KMEM_CACHE(cvp_session_msg, 0);
  523. cvp_driver->frame_cache = KMEM_CACHE(msm_cvp_frame, 0);
  524. cvp_driver->buf_cache = KMEM_CACHE(cvp_internal_buf, 0);
  525. cvp_driver->smem_cache = KMEM_CACHE(msm_cvp_smem, 0);
  526. return rc;
  527. }
  528. static void __exit msm_cvp_exit(void)
  529. {
  530. cvp_dsp_device_exit();
  531. kmem_cache_destroy(cvp_driver->msg_cache);
  532. kmem_cache_destroy(cvp_driver->frame_cache);
  533. kmem_cache_destroy(cvp_driver->buf_cache);
  534. kmem_cache_destroy(cvp_driver->smem_cache);
  535. platform_driver_unregister(&msm_cvp_driver);
  536. debugfs_remove_recursive(cvp_driver->debugfs_root);
  537. mutex_destroy(&cvp_driver->lock);
  538. kfree(cvp_driver);
  539. cvp_driver = NULL;
  540. }
  541. module_init(msm_cvp_init);
  542. module_exit(msm_cvp_exit);
  543. MODULE_SOFTDEP("pre: msm-mmrm");
  544. MODULE_LICENSE("GPL v2");