audio_notifier.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2016-2017, 2020-2021 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #include <linux/init.h>
  7. #include <linux/kernel.h>
  8. #include <linux/module.h>
  9. #include <linux/err.h>
  10. #include <linux/string.h>
  11. #include <linux/delay.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/of_device.h>
  14. #include <linux/slab.h>
  15. #include <linux/remoteproc.h>
  16. #include <linux/remoteproc/qcom_rproc.h>
  17. #include <dsp/audio_notifier.h>
  18. #include "audio_ssr.h"
  19. #include "audio_pdr.h"
  20. /* Audio states internal to notifier. Client */
  21. /* used states defined in audio_notifier.h */
  22. /* for AUDIO_NOTIFIER_SERVICE_DOWN & UP */
  23. #define NO_SERVICE -2
  24. #define UNINIT_SERVICE -1
  25. static struct platform_device *adsp_private;
  26. struct adsp_notify_private {
  27. struct rproc *rproc_h;
  28. };
  29. /*
  30. * Used for each client registered with audio notifier
  31. */
  32. struct client_data {
  33. struct list_head list;
  34. /* Notifier block given by client */
  35. struct notifier_block *nb;
  36. char client_name[20];
  37. int service;
  38. int domain;
  39. };
  40. /*
  41. * Used for each service and domain combination
  42. * Tracks information specific to the underlying
  43. * service.
  44. */
  45. struct service_info {
  46. const char name[20];
  47. int domain_id;
  48. int state;
  49. void *handle;
  50. /* Hook registered to service */
  51. union {
  52. void (*cb)(int, char *, void *);
  53. struct notifier_block *nb;
  54. } hook;
  55. /* Used to determine when to register and deregister service */
  56. int num_of_clients;
  57. /* List of all clients registered to the service and domain */
  58. struct srcu_notifier_head client_nb_list;
  59. };
  60. static int audio_notifier_ssr_adsp_cb(struct notifier_block *this,
  61. unsigned long opcode, void *data);
  62. static int audio_notifier_ssr_modem_cb(struct notifier_block *this,
  63. unsigned long opcode, void *data);
  64. static void audio_notifier_pdr_adsp_cb(int status, char *service_name, void *priv);
  65. static struct notifier_block notifier_ssr_adsp_nb = {
  66. .notifier_call = audio_notifier_ssr_adsp_cb,
  67. .priority = 0,
  68. };
  69. static struct notifier_block notifier_ssr_modem_nb = {
  70. .notifier_call = audio_notifier_ssr_modem_cb,
  71. .priority = 0,
  72. };
  73. static struct service_info service_data[AUDIO_NOTIFIER_MAX_SERVICES]
  74. [AUDIO_NOTIFIER_MAX_DOMAINS] = {
  75. {{
  76. .name = "SSR_ADSP",
  77. .domain_id = AUDIO_SSR_DOMAIN_ADSP,
  78. .state = AUDIO_NOTIFIER_SERVICE_DOWN,
  79. .hook.nb = &notifier_ssr_adsp_nb
  80. },
  81. {
  82. .name = "SSR_MODEM",
  83. .domain_id = AUDIO_SSR_DOMAIN_MODEM,
  84. .state = AUDIO_NOTIFIER_SERVICE_DOWN,
  85. .hook.nb = &notifier_ssr_modem_nb
  86. } },
  87. {{
  88. .name = "PDR_ADSP",
  89. .domain_id = AUDIO_PDR_DOMAIN_ADSP,
  90. .state = UNINIT_SERVICE,
  91. .hook.cb = &audio_notifier_pdr_adsp_cb
  92. },
  93. { /* PDR MODEM service not enabled */
  94. .name = "INVALID",
  95. .state = NO_SERVICE,
  96. .hook.nb = NULL
  97. } }
  98. };
  99. /* Master list of all audio notifier clients */
  100. LIST_HEAD(client_list);
  101. struct mutex notifier_mutex;
  102. static int audio_notifier_get_default_service(int domain)
  103. {
  104. int service = NO_SERVICE;
  105. /* initial service to connect per domain */
  106. switch (domain) {
  107. case AUDIO_NOTIFIER_ADSP_DOMAIN:
  108. service = AUDIO_NOTIFIER_PDR_SERVICE;
  109. break;
  110. case AUDIO_NOTIFIER_MODEM_DOMAIN:
  111. service = AUDIO_NOTIFIER_SSR_SERVICE;
  112. break;
  113. }
  114. return service;
  115. }
  116. #ifdef CONFIG_MSM_QDSP6_PDR
  117. static void audio_notifier_init_service(int service)
  118. {
  119. int i;
  120. for (i = 0; i < AUDIO_NOTIFIER_MAX_DOMAINS; i++) {
  121. if (service_data[service][i].state == UNINIT_SERVICE)
  122. service_data[service][i].state =
  123. AUDIO_NOTIFIER_SERVICE_DOWN;
  124. }
  125. }
  126. #else
  127. static void audio_notifier_init_service(int service)
  128. {
  129. int i;
  130. for (i = 0; i < AUDIO_NOTIFIER_MAX_DOMAINS; i++)
  131. service_data[service][i].state = NO_SERVICE;
  132. }
  133. #endif
  134. static bool audio_notifier_is_service_enabled(int service)
  135. {
  136. int i;
  137. for (i = 0; i < AUDIO_NOTIFIER_MAX_DOMAINS; i++)
  138. if (service_data[service][i].state != NO_SERVICE)
  139. return true;
  140. return false;
  141. }
  142. static int audio_notifier_reg_service(int service, int domain)
  143. {
  144. void *handle;
  145. int ret = 0;
  146. int curr_state = AUDIO_NOTIFIER_SERVICE_DOWN;
  147. struct platform_device *pdev = adsp_private;
  148. struct adsp_notify_private *priv = NULL;
  149. struct rproc *rproc;
  150. priv = platform_get_drvdata(pdev);
  151. if (!priv) {
  152. dev_err_ratelimited(&pdev->dev, " %s: Private data get failed\n", __func__);
  153. return ret;;
  154. }
  155. rproc = priv->rproc_h;
  156. switch (service) {
  157. case AUDIO_NOTIFIER_SSR_SERVICE:
  158. handle = audio_ssr_register(rproc->name,
  159. service_data[service][domain].hook.nb);
  160. break;
  161. case AUDIO_NOTIFIER_PDR_SERVICE:
  162. handle = audio_pdr_service_register(
  163. service_data[service][domain].domain_id,
  164. service_data[service][domain].hook.cb);
  165. curr_state = AUDIO_NOTIFIER_SERVICE_DOWN;
  166. break;
  167. default:
  168. pr_err_ratelimited("%s: Invalid service %d\n",
  169. __func__, service);
  170. ret = -EINVAL;
  171. goto done;
  172. }
  173. if (IS_ERR_OR_NULL(handle)) {
  174. pr_err_ratelimited("%s: handle is incorrect for service %s\n",
  175. __func__, service_data[service][domain].name);
  176. ret = -EINVAL;
  177. goto done;
  178. }
  179. service_data[service][domain].state = curr_state;
  180. service_data[service][domain].handle = handle;
  181. pr_info("%s: service %s is in use\n",
  182. __func__, service_data[service][domain].name);
  183. pr_debug("%s: service %s has current state %d, handle 0x%pK\n",
  184. __func__, service_data[service][domain].name,
  185. service_data[service][domain].state,
  186. service_data[service][domain].handle);
  187. done:
  188. return ret;
  189. }
  190. static int audio_notifier_dereg_service(int service, int domain)
  191. {
  192. int ret;
  193. switch (service) {
  194. case AUDIO_NOTIFIER_SSR_SERVICE:
  195. ret = audio_ssr_deregister(
  196. service_data[service][domain].handle,
  197. service_data[service][domain].hook.nb);
  198. break;
  199. case AUDIO_NOTIFIER_PDR_SERVICE:
  200. ret = audio_pdr_service_deregister(
  201. service_data[service][domain].domain_id);
  202. break;
  203. default:
  204. pr_err_ratelimited("%s: Invalid service %d\n",
  205. __func__, service);
  206. ret = -EINVAL;
  207. goto done;
  208. }
  209. if (ret < 0) {
  210. pr_err_ratelimited("%s: deregister failed for service %s, ret %d\n",
  211. __func__, service_data[service][domain].name, ret);
  212. goto done;
  213. }
  214. pr_debug("%s: service %s with handle 0x%pK deregistered\n",
  215. __func__, service_data[service][domain].name,
  216. service_data[service][domain].handle);
  217. service_data[service][domain].state = AUDIO_NOTIFIER_SERVICE_DOWN;
  218. service_data[service][domain].handle = NULL;
  219. done:
  220. return ret;
  221. }
  222. static int audio_notifier_reg_client_service(struct client_data *client_data,
  223. int service)
  224. {
  225. int ret = 0;
  226. int domain = client_data->domain;
  227. struct audio_notifier_cb_data data;
  228. switch (service) {
  229. case AUDIO_NOTIFIER_SSR_SERVICE:
  230. case AUDIO_NOTIFIER_PDR_SERVICE:
  231. if (service_data[service][domain].num_of_clients == 0)
  232. ret = audio_notifier_reg_service(service, domain);
  233. break;
  234. default:
  235. pr_err_ratelimited("%s: Invalid service for client %s, service %d, domain %d\n",
  236. __func__, client_data->client_name, service, domain);
  237. ret = -EINVAL;
  238. goto done;
  239. }
  240. if (ret < 0) {
  241. pr_err_ratelimited("%s: service registration failed on service %s for client %s\n",
  242. __func__, service_data[service][domain].name,
  243. client_data->client_name);
  244. goto done;
  245. }
  246. client_data->service = service;
  247. srcu_notifier_chain_register(
  248. &service_data[service][domain].client_nb_list,
  249. client_data->nb);
  250. service_data[service][domain].num_of_clients++;
  251. pr_debug("%s: registered client %s on service %s, current state 0x%x\n",
  252. __func__, client_data->client_name,
  253. service_data[service][domain].name,
  254. service_data[service][domain].state);
  255. /*
  256. * PDR registration returns current state
  257. * Force callback of client with current state for PDR
  258. */
  259. if (client_data->service == AUDIO_NOTIFIER_PDR_SERVICE) {
  260. data.service = service;
  261. data.domain = domain;
  262. (void)client_data->nb->notifier_call(client_data->nb,
  263. service_data[service][domain].state, &data);
  264. }
  265. done:
  266. return ret;
  267. }
  268. static int audio_notifier_reg_client(struct client_data *client_data)
  269. {
  270. int ret = 0;
  271. int service;
  272. int domain = client_data->domain;
  273. service = audio_notifier_get_default_service(domain);
  274. if (service < 0) {
  275. pr_err_ratelimited("%s: service %d is incorrect\n", __func__, service);
  276. ret = -EINVAL;
  277. goto done;
  278. }
  279. /* Search through services to find a valid one to register client on. */
  280. for (; service >= 0; service--) {
  281. /* If a service is not initialized, wait for it to come up. */
  282. if (service_data[service][domain].state == UNINIT_SERVICE)
  283. goto done;
  284. /* Skip unsupported service and domain combinations. */
  285. if (service_data[service][domain].state < 0)
  286. continue;
  287. /* Only register clients who have not acquired a service. */
  288. if (client_data->service != NO_SERVICE)
  289. continue;
  290. /*
  291. * Only register clients, who have not acquired a service, on
  292. * the best available service for their domain. Uninitialized
  293. * services will try to register all of their clients after
  294. * they initialize correctly or will disable their service and
  295. * register clients on the next best avaialable service.
  296. */
  297. pr_debug("%s: register client %s on service %s",
  298. __func__, client_data->client_name,
  299. service_data[service][domain].name);
  300. ret = audio_notifier_reg_client_service(client_data, service);
  301. if (ret < 0)
  302. pr_err_ratelimited("%s: client %s failed to register on service %s",
  303. __func__, client_data->client_name,
  304. service_data[service][domain].name);
  305. }
  306. done:
  307. return ret;
  308. }
  309. static int audio_notifier_dereg_client(struct client_data *client_data)
  310. {
  311. int ret = 0;
  312. int service = client_data->service;
  313. int domain = client_data->domain;
  314. switch (client_data->service) {
  315. case AUDIO_NOTIFIER_SSR_SERVICE:
  316. case AUDIO_NOTIFIER_PDR_SERVICE:
  317. if (service_data[service][domain].num_of_clients == 1)
  318. ret = audio_notifier_dereg_service(service, domain);
  319. break;
  320. case NO_SERVICE:
  321. goto done;
  322. default:
  323. pr_err_ratelimited("%s: Invalid service for client %s, service %d\n",
  324. __func__, client_data->client_name,
  325. client_data->service);
  326. ret = -EINVAL;
  327. goto done;
  328. }
  329. if (ret < 0) {
  330. pr_err_ratelimited("%s: deregister failed for client %s on service %s, ret %d\n",
  331. __func__, client_data->client_name,
  332. service_data[service][domain].name, ret);
  333. goto done;
  334. }
  335. ret = srcu_notifier_chain_unregister(&service_data[service][domain].
  336. client_nb_list, client_data->nb);
  337. if (ret < 0) {
  338. pr_err_ratelimited("%s: srcu_notifier_chain_unregister failed, ret %d\n",
  339. __func__, ret);
  340. goto done;
  341. }
  342. pr_debug("%s: deregistered client %s on service %s\n",
  343. __func__, client_data->client_name,
  344. service_data[service][domain].name);
  345. client_data->service = NO_SERVICE;
  346. if (service_data[service][domain].num_of_clients > 0)
  347. service_data[service][domain].num_of_clients--;
  348. done:
  349. return ret;
  350. }
  351. static void audio_notifier_reg_all_clients(void)
  352. {
  353. struct list_head *ptr, *next;
  354. struct client_data *client_data;
  355. int ret;
  356. list_for_each_safe(ptr, next, &client_list) {
  357. client_data = list_entry(ptr, struct client_data, list);
  358. ret = audio_notifier_reg_client(client_data);
  359. if (ret < 0)
  360. pr_err_ratelimited("%s: audio_notifier_reg_client failed for client %s, \
  361. ret %d\n", __func__, client_data->client_name,
  362. ret);
  363. }
  364. }
  365. static int audio_notifier_convert_opcode(unsigned long opcode,
  366. unsigned long *notifier_opcode)
  367. {
  368. int ret = 0;
  369. switch (opcode) {
  370. case QCOM_SSR_BEFORE_SHUTDOWN:
  371. case SERVREG_SERVICE_STATE_DOWN:
  372. *notifier_opcode = AUDIO_NOTIFIER_SERVICE_DOWN;
  373. break;
  374. case QCOM_SSR_AFTER_POWERUP:
  375. case SERVREG_SERVICE_STATE_UP:
  376. *notifier_opcode = AUDIO_NOTIFIER_SERVICE_UP;
  377. break;
  378. default:
  379. pr_debug("%s: Unused opcode 0x%lx\n", __func__, opcode);
  380. ret = -EINVAL;
  381. }
  382. return ret;
  383. }
  384. static int audio_notifier_service_cb(unsigned long opcode,
  385. int service, int domain)
  386. {
  387. int ret = 0;
  388. unsigned long notifier_opcode;
  389. struct audio_notifier_cb_data data;
  390. if (audio_notifier_convert_opcode(opcode, &notifier_opcode) < 0)
  391. goto done;
  392. data.service = service;
  393. data.domain = domain;
  394. pr_debug("%s: service %s, opcode 0x%lx\n",
  395. __func__, service_data[service][domain].name, notifier_opcode);
  396. mutex_lock(&notifier_mutex);
  397. service_data[service][domain].state = notifier_opcode;
  398. ret = srcu_notifier_call_chain(&service_data[service][domain].
  399. client_nb_list, notifier_opcode, &data);
  400. if (ret < 0)
  401. pr_err_ratelimited("%s: srcu_notifier_call_chain returned %d, service %s, \
  402. opcode 0x%lx\n", __func__, ret, service_data[service][domain].name,
  403. notifier_opcode);
  404. mutex_unlock(&notifier_mutex);
  405. done:
  406. return NOTIFY_OK;
  407. }
  408. static void audio_notifier_pdr_adsp_cb(int status, char *service_name, void *priv)
  409. {
  410. audio_notifier_service_cb(status, AUDIO_NOTIFIER_PDR_SERVICE, AUDIO_NOTIFIER_ADSP_DOMAIN);
  411. }
  412. static int audio_notifier_ssr_adsp_cb(struct notifier_block *this,
  413. unsigned long opcode, void *data)
  414. {
  415. return audio_notifier_service_cb(opcode,
  416. AUDIO_NOTIFIER_SSR_SERVICE,
  417. AUDIO_NOTIFIER_ADSP_DOMAIN);
  418. }
  419. static int audio_notifier_ssr_modem_cb(struct notifier_block *this,
  420. unsigned long opcode, void *data)
  421. {
  422. return audio_notifier_service_cb(opcode,
  423. AUDIO_NOTIFIER_SSR_SERVICE,
  424. AUDIO_NOTIFIER_MODEM_DOMAIN);
  425. }
  426. int audio_notifier_deregister(char *client_name)
  427. {
  428. int ret = 0;
  429. int ret2;
  430. struct list_head *ptr, *next;
  431. struct client_data *client_data = NULL;
  432. if (client_name == NULL) {
  433. pr_err_ratelimited("%s: client_name is NULL\n", __func__);
  434. ret = -EINVAL;
  435. goto done;
  436. }
  437. mutex_lock(&notifier_mutex);
  438. list_for_each_safe(ptr, next, &client_list) {
  439. client_data = list_entry(ptr, struct client_data, list);
  440. if (!strcmp(client_name, client_data->client_name)) {
  441. ret2 = audio_notifier_dereg_client(client_data);
  442. if (ret2 < 0) {
  443. pr_err_ratelimited("%s: audio_notifier_dereg_client failed, \
  444. ret %d\n, service %d, domain %d",
  445. __func__, ret2, client_data->service,
  446. client_data->domain);
  447. ret = ret2;
  448. continue;
  449. }
  450. list_del(&client_data->list);
  451. kfree(client_data);
  452. }
  453. }
  454. mutex_unlock(&notifier_mutex);
  455. done:
  456. return ret;
  457. }
  458. EXPORT_SYMBOL(audio_notifier_deregister);
  459. int audio_notifier_register(char *client_name, int domain,
  460. struct notifier_block *nb)
  461. {
  462. int ret;
  463. struct client_data *client_data;
  464. if (client_name == NULL) {
  465. pr_err_ratelimited("%s: client_name is NULL\n", __func__);
  466. ret = -EINVAL;
  467. goto done;
  468. } else if (nb == NULL) {
  469. pr_err_ratelimited("%s: Notifier block is NULL\n", __func__);
  470. ret = -EINVAL;
  471. goto done;
  472. }
  473. client_data = kmalloc(sizeof(*client_data), GFP_KERNEL);
  474. if (client_data == NULL) {
  475. ret = -ENOMEM;
  476. goto done;
  477. }
  478. INIT_LIST_HEAD(&client_data->list);
  479. client_data->nb = nb;
  480. strlcpy(client_data->client_name, client_name,
  481. sizeof(client_data->client_name));
  482. client_data->service = NO_SERVICE;
  483. client_data->domain = domain;
  484. mutex_lock(&notifier_mutex);
  485. ret = audio_notifier_reg_client(client_data);
  486. if (ret < 0) {
  487. mutex_unlock(&notifier_mutex);
  488. pr_err_ratelimited("%s: audio_notifier_reg_client for client %s failed ret = %d\n",
  489. __func__, client_data->client_name,
  490. ret);
  491. kfree(client_data);
  492. goto done;
  493. }
  494. list_add_tail(&client_data->list, &client_list);
  495. mutex_unlock(&notifier_mutex);
  496. done:
  497. return ret;
  498. }
  499. EXPORT_SYMBOL(audio_notifier_register);
  500. static int audio_notifier_subsys_init(void)
  501. {
  502. int i, j;
  503. mutex_init(&notifier_mutex);
  504. for (i = 0; i < AUDIO_NOTIFIER_MAX_SERVICES; i++) {
  505. for (j = 0; j < AUDIO_NOTIFIER_MAX_DOMAINS; j++) {
  506. if (service_data[i][j].state <= NO_SERVICE)
  507. continue;
  508. srcu_init_notifier_head(
  509. &service_data[i][j].client_nb_list);
  510. }
  511. }
  512. return 0;
  513. }
  514. static int audio_notifier_late_init(void)
  515. {
  516. /*
  517. * If pdr registration failed, register clients on next service
  518. * Do in late init to ensure that SSR subsystem is initialized
  519. */
  520. mutex_lock(&notifier_mutex);
  521. if (!audio_notifier_is_service_enabled(AUDIO_NOTIFIER_PDR_SERVICE))
  522. audio_notifier_reg_all_clients();
  523. mutex_unlock(&notifier_mutex);
  524. return 0;
  525. }
  526. static int audio_notify_probe(struct platform_device *pdev)
  527. {
  528. int ret = -EINVAL;
  529. struct adsp_notify_private *priv = NULL;
  530. struct property *prop;
  531. int size;
  532. phandle rproc_phandle;
  533. adsp_private = NULL;
  534. priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
  535. if (!priv) {
  536. ret = -ENOMEM;
  537. return ret;
  538. }
  539. platform_set_drvdata(pdev, priv);
  540. prop = of_find_property(pdev->dev.of_node, "qcom,rproc-handle", &size);
  541. if (!prop) {
  542. dev_err(&pdev->dev, "Missing remotproc handle\n");
  543. return ret;
  544. }
  545. rproc_phandle = be32_to_cpup(prop->value);
  546. priv->rproc_h = rproc_get_by_phandle(rproc_phandle);
  547. if (!priv->rproc_h) {
  548. dev_info_ratelimited(&pdev->dev, "remotproc handle NULL\n");
  549. ret = -EPROBE_DEFER;
  550. return ret;
  551. }
  552. adsp_private = pdev;
  553. audio_notifier_subsys_init();
  554. audio_notifier_init_service(AUDIO_NOTIFIER_PDR_SERVICE);
  555. /* Do not return error since PDR enablement is not critical */
  556. audio_notifier_late_init();
  557. return 0;
  558. }
  559. static int audio_notify_remove(struct platform_device *pdev)
  560. {
  561. return 0;
  562. }
  563. static const struct of_device_id adsp_notify_dt_match[] = {
  564. { .compatible = "qcom,adsp-notify" },
  565. { }
  566. };
  567. MODULE_DEVICE_TABLE(of, adsp_notify_dt_match);
  568. static struct platform_driver adsp_notify_driver = {
  569. .driver = {
  570. .name = "adsp-notify",
  571. .owner = THIS_MODULE,
  572. .of_match_table = adsp_notify_dt_match,
  573. .suppress_bind_attrs = true,
  574. },
  575. .probe = audio_notify_probe,
  576. .remove = audio_notify_remove,
  577. };
  578. static int __init audio_notifier_init(void)
  579. {
  580. return platform_driver_register(&adsp_notify_driver);
  581. }
  582. module_init(audio_notifier_init);
  583. static void __exit audio_notifier_exit(void)
  584. {
  585. platform_driver_unregister(&adsp_notify_driver);
  586. }
  587. module_exit(audio_notifier_exit);
  588. MODULE_SOFTDEP("pre: qcom_q6v5_pas");
  589. MODULE_DESCRIPTION("Audio notifier driver");
  590. MODULE_LICENSE("GPL v2");