qcom_aoss.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2019, Linaro Ltd
  4. */
  5. #include <linux/clk-provider.h>
  6. #include <linux/debugfs.h>
  7. #include <linux/interrupt.h>
  8. #include <linux/io.h>
  9. #include <linux/mailbox_client.h>
  10. #include <linux/module.h>
  11. #include <linux/of_platform.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/thermal.h>
  14. #include <linux/slab.h>
  15. #include <linux/soc/qcom/qcom_aoss.h>
  16. #include <linux/ipc_logging.h>
  17. #define QMP_DESC_MAGIC 0x0
  18. #define QMP_DESC_VERSION 0x4
  19. #define QMP_DESC_FEATURES 0x8
  20. /* AOP-side offsets */
  21. #define QMP_DESC_UCORE_LINK_STATE 0xc
  22. #define QMP_DESC_UCORE_LINK_STATE_ACK 0x10
  23. #define QMP_DESC_UCORE_CH_STATE 0x14
  24. #define QMP_DESC_UCORE_CH_STATE_ACK 0x18
  25. #define QMP_DESC_UCORE_MBOX_SIZE 0x1c
  26. #define QMP_DESC_UCORE_MBOX_OFFSET 0x20
  27. /* Linux-side offsets */
  28. #define QMP_DESC_MCORE_LINK_STATE 0x24
  29. #define QMP_DESC_MCORE_LINK_STATE_ACK 0x28
  30. #define QMP_DESC_MCORE_CH_STATE 0x2c
  31. #define QMP_DESC_MCORE_CH_STATE_ACK 0x30
  32. #define QMP_DESC_MCORE_MBOX_SIZE 0x34
  33. #define QMP_DESC_MCORE_MBOX_OFFSET 0x38
  34. #define QMP_STATE_UP GENMASK(15, 0)
  35. #define QMP_STATE_DOWN GENMASK(31, 16)
  36. #define QMP_MAGIC 0x4d41494c /* mail */
  37. #define QMP_VERSION 1
  38. /* 64 bytes is enough to store the requests and provides padding to 4 bytes */
  39. #define QMP_MSG_LEN 64
  40. #define QMP_NUM_COOLING_RESOURCES 2
  41. static bool qmp_cdev_max_state = 1;
  42. struct qmp_cooling_device {
  43. struct thermal_cooling_device *cdev;
  44. struct qmp *qmp;
  45. char *name;
  46. bool state;
  47. };
  48. /**
  49. * struct qmp - driver state for QMP implementation
  50. * @msgram: iomem referencing the message RAM used for communication
  51. * @dev: reference to QMP device
  52. * @mbox_client: mailbox client used to ring the doorbell on transmit
  53. * @mbox_chan: mailbox channel used to ring the doorbell on transmit
  54. * @offset: offset within @msgram where messages should be written
  55. * @size: maximum size of the messages to be transmitted
  56. * @event: wait_queue for synchronization with the IRQ
  57. * @tx_lock: provides synchronization between multiple callers of qmp_send()
  58. * @qdss_clk: QDSS clock hw struct
  59. * @cooling_devs: thermal cooling devices
  60. */
  61. struct qmp {
  62. void __iomem *msgram;
  63. struct device *dev;
  64. struct mbox_client mbox_client;
  65. struct mbox_chan *mbox_chan;
  66. size_t offset;
  67. size_t size;
  68. wait_queue_head_t event;
  69. struct mutex tx_lock;
  70. struct clk_hw qdss_clk;
  71. struct qmp_cooling_device *cooling_devs;
  72. #if IS_ENABLED(CONFIG_DEBUG_FS)
  73. struct dentry *debugfs_file;
  74. #endif /* CONFIG_DEBUG_FS */
  75. };
  76. /* IPC Logging helpers */
  77. #define AOSS_IPC_LOG_PAGE_CNT 2
  78. static void *ilc;
  79. #define AOSS_INFO(x, ...) \
  80. ipc_log_string(ilc, "[%s]: "x, __func__, ##__VA_ARGS__)
  81. static void qmp_kick(struct qmp *qmp)
  82. {
  83. mbox_send_message(qmp->mbox_chan, NULL);
  84. mbox_client_txdone(qmp->mbox_chan, 0);
  85. }
  86. static bool qmp_magic_valid(struct qmp *qmp)
  87. {
  88. return readl(qmp->msgram + QMP_DESC_MAGIC) == QMP_MAGIC;
  89. }
  90. static bool qmp_link_acked(struct qmp *qmp)
  91. {
  92. return readl(qmp->msgram + QMP_DESC_MCORE_LINK_STATE_ACK) == QMP_STATE_UP;
  93. }
  94. static bool qmp_mcore_channel_acked(struct qmp *qmp)
  95. {
  96. return readl(qmp->msgram + QMP_DESC_MCORE_CH_STATE_ACK) == QMP_STATE_UP;
  97. }
  98. static bool qmp_ucore_channel_up(struct qmp *qmp)
  99. {
  100. return readl(qmp->msgram + QMP_DESC_UCORE_CH_STATE) == QMP_STATE_UP;
  101. }
  102. static int qmp_open(struct qmp *qmp)
  103. {
  104. int ret;
  105. u32 val;
  106. if (!qmp_magic_valid(qmp)) {
  107. dev_err(qmp->dev, "QMP magic doesn't match\n");
  108. return -EINVAL;
  109. }
  110. val = readl(qmp->msgram + QMP_DESC_VERSION);
  111. if (val != QMP_VERSION) {
  112. dev_err(qmp->dev, "unsupported QMP version %d\n", val);
  113. return -EINVAL;
  114. }
  115. qmp->offset = readl(qmp->msgram + QMP_DESC_MCORE_MBOX_OFFSET);
  116. qmp->size = readl(qmp->msgram + QMP_DESC_MCORE_MBOX_SIZE);
  117. if (!qmp->size) {
  118. dev_err(qmp->dev, "invalid mailbox size\n");
  119. return -EINVAL;
  120. }
  121. /* Ack remote core's link state */
  122. val = readl(qmp->msgram + QMP_DESC_UCORE_LINK_STATE);
  123. writel(val, qmp->msgram + QMP_DESC_UCORE_LINK_STATE_ACK);
  124. /* Set local core's link state to up */
  125. writel(QMP_STATE_UP, qmp->msgram + QMP_DESC_MCORE_LINK_STATE);
  126. qmp_kick(qmp);
  127. ret = wait_event_timeout(qmp->event, qmp_link_acked(qmp), HZ);
  128. if (!ret) {
  129. dev_err(qmp->dev, "ucore didn't ack link\n");
  130. goto timeout_close_link;
  131. }
  132. writel(QMP_STATE_UP, qmp->msgram + QMP_DESC_MCORE_CH_STATE);
  133. qmp_kick(qmp);
  134. ret = wait_event_timeout(qmp->event, qmp_ucore_channel_up(qmp), HZ);
  135. if (!ret) {
  136. dev_err(qmp->dev, "ucore didn't open channel\n");
  137. goto timeout_close_channel;
  138. }
  139. /* Ack remote core's channel state */
  140. writel(QMP_STATE_UP, qmp->msgram + QMP_DESC_UCORE_CH_STATE_ACK);
  141. qmp_kick(qmp);
  142. ret = wait_event_timeout(qmp->event, qmp_mcore_channel_acked(qmp), HZ);
  143. if (!ret) {
  144. dev_err(qmp->dev, "ucore didn't ack channel\n");
  145. goto timeout_close_channel;
  146. }
  147. return 0;
  148. timeout_close_channel:
  149. writel(QMP_STATE_DOWN, qmp->msgram + QMP_DESC_MCORE_CH_STATE);
  150. timeout_close_link:
  151. writel(QMP_STATE_DOWN, qmp->msgram + QMP_DESC_MCORE_LINK_STATE);
  152. qmp_kick(qmp);
  153. return -ETIMEDOUT;
  154. }
  155. static void qmp_close(struct qmp *qmp)
  156. {
  157. writel(QMP_STATE_DOWN, qmp->msgram + QMP_DESC_MCORE_CH_STATE);
  158. writel(QMP_STATE_DOWN, qmp->msgram + QMP_DESC_MCORE_LINK_STATE);
  159. qmp_kick(qmp);
  160. }
  161. static irqreturn_t qmp_intr(int irq, void *data)
  162. {
  163. struct qmp *qmp = data;
  164. AOSS_INFO("\n");
  165. wake_up_all(&qmp->event);
  166. return IRQ_HANDLED;
  167. }
  168. static bool qmp_message_empty(struct qmp *qmp)
  169. {
  170. AOSS_INFO("ack msg size: %u\n", readl(qmp->msgram + qmp->offset));
  171. return readl(qmp->msgram + qmp->offset) == 0;
  172. }
  173. /**
  174. * qmp_send() - send a message to the AOSS
  175. * @qmp: qmp context
  176. * @data: message to be sent
  177. * @len: length of the message
  178. *
  179. * Transmit @data to AOSS and wait for the AOSS to acknowledge the message.
  180. * @len must be a multiple of 4 and not longer than the mailbox size. Access is
  181. * synchronized by this implementation.
  182. *
  183. * Return: 0 on success, negative errno on failure
  184. */
  185. int qmp_send(struct qmp *qmp, const void *data, size_t len)
  186. {
  187. long time_left;
  188. int ret;
  189. if (WARN_ON(IS_ERR_OR_NULL(qmp) || !data))
  190. return -EINVAL;
  191. if (WARN_ON(len + sizeof(u32) > qmp->size))
  192. return -EINVAL;
  193. if (WARN_ON(len % sizeof(u32)))
  194. return -EINVAL;
  195. mutex_lock(&qmp->tx_lock);
  196. /* The message RAM only implements 32-bit accesses */
  197. __iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
  198. data, len / sizeof(u32));
  199. writel(len, qmp->msgram + qmp->offset);
  200. /* Read back len to confirm data written in message RAM */
  201. readl(qmp->msgram + qmp->offset);
  202. qmp_kick(qmp);
  203. AOSS_INFO("msg: %.*s\n", len, (char *)data);
  204. time_left = wait_event_interruptible_timeout(qmp->event,
  205. qmp_message_empty(qmp), HZ);
  206. if (!time_left) {
  207. dev_err(qmp->dev, "ucore did not ack channel\n");
  208. ret = -ETIMEDOUT;
  209. /* Clear message from buffer */
  210. AOSS_INFO("timed out clearing msg: %.*s\n", len, (char *)data);
  211. writel(0, qmp->msgram + qmp->offset);
  212. } else {
  213. ret = 0;
  214. AOSS_INFO("ack: %.*s\n", len, (char *)data);
  215. }
  216. mutex_unlock(&qmp->tx_lock);
  217. return ret;
  218. }
  219. EXPORT_SYMBOL(qmp_send);
  220. static int qmp_qdss_clk_prepare(struct clk_hw *hw)
  221. {
  222. static const char buf[QMP_MSG_LEN] = "{class: clock, res: qdss, val: 1}";
  223. struct qmp *qmp = container_of(hw, struct qmp, qdss_clk);
  224. return qmp_send(qmp, buf, sizeof(buf));
  225. }
  226. static void qmp_qdss_clk_unprepare(struct clk_hw *hw)
  227. {
  228. static const char buf[QMP_MSG_LEN] = "{class: clock, res: qdss, val: 0}";
  229. struct qmp *qmp = container_of(hw, struct qmp, qdss_clk);
  230. qmp_send(qmp, buf, sizeof(buf));
  231. }
  232. static const struct clk_ops qmp_qdss_clk_ops = {
  233. .prepare = qmp_qdss_clk_prepare,
  234. .unprepare = qmp_qdss_clk_unprepare,
  235. };
  236. static int qmp_qdss_clk_add(struct qmp *qmp)
  237. {
  238. static const struct clk_init_data qdss_init = {
  239. .ops = &qmp_qdss_clk_ops,
  240. .name = "qdss",
  241. };
  242. int ret;
  243. qmp->qdss_clk.init = &qdss_init;
  244. ret = clk_hw_register(qmp->dev, &qmp->qdss_clk);
  245. if (ret < 0) {
  246. dev_err(qmp->dev, "failed to register qdss clock\n");
  247. return ret;
  248. }
  249. ret = of_clk_add_hw_provider(qmp->dev->of_node, of_clk_hw_simple_get,
  250. &qmp->qdss_clk);
  251. if (ret < 0) {
  252. dev_err(qmp->dev, "unable to register of clk hw provider\n");
  253. clk_hw_unregister(&qmp->qdss_clk);
  254. }
  255. return ret;
  256. }
  257. static void qmp_qdss_clk_remove(struct qmp *qmp)
  258. {
  259. of_clk_del_provider(qmp->dev->of_node);
  260. clk_hw_unregister(&qmp->qdss_clk);
  261. }
  262. static int qmp_cdev_get_max_state(struct thermal_cooling_device *cdev,
  263. unsigned long *state)
  264. {
  265. *state = qmp_cdev_max_state;
  266. return 0;
  267. }
  268. static int qmp_cdev_get_cur_state(struct thermal_cooling_device *cdev,
  269. unsigned long *state)
  270. {
  271. struct qmp_cooling_device *qmp_cdev = cdev->devdata;
  272. *state = qmp_cdev->state;
  273. return 0;
  274. }
  275. static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
  276. unsigned long state)
  277. {
  278. struct qmp_cooling_device *qmp_cdev = cdev->devdata;
  279. char buf[QMP_MSG_LEN] = {};
  280. bool cdev_state;
  281. int ret;
  282. /* Normalize state */
  283. cdev_state = !!state;
  284. if (qmp_cdev->state == state)
  285. return 0;
  286. snprintf(buf, sizeof(buf),
  287. "{class: volt_flr, event:zero_temp, res:%s, value:%s}",
  288. qmp_cdev->name,
  289. cdev_state ? "on" : "off");
  290. ret = qmp_send(qmp_cdev->qmp, buf, sizeof(buf));
  291. if (!ret)
  292. qmp_cdev->state = cdev_state;
  293. return ret;
  294. }
  295. static const struct thermal_cooling_device_ops qmp_cooling_device_ops = {
  296. .get_max_state = qmp_cdev_get_max_state,
  297. .get_cur_state = qmp_cdev_get_cur_state,
  298. .set_cur_state = qmp_cdev_set_cur_state,
  299. };
  300. static int qmp_cooling_device_add(struct qmp *qmp,
  301. struct qmp_cooling_device *qmp_cdev,
  302. struct device_node *node)
  303. {
  304. char *cdev_name = (char *)node->name;
  305. qmp_cdev->qmp = qmp;
  306. qmp_cdev->state = !qmp_cdev_max_state;
  307. qmp_cdev->name = cdev_name;
  308. qmp_cdev->cdev = devm_thermal_of_cooling_device_register
  309. (qmp->dev, node,
  310. cdev_name,
  311. qmp_cdev, &qmp_cooling_device_ops);
  312. if (IS_ERR(qmp_cdev->cdev))
  313. dev_err(qmp->dev, "unable to register %s cooling device\n",
  314. cdev_name);
  315. return PTR_ERR_OR_ZERO(qmp_cdev->cdev);
  316. }
  317. static int qmp_cooling_devices_register(struct qmp *qmp)
  318. {
  319. struct device_node *np, *child;
  320. int count = 0;
  321. int ret;
  322. np = qmp->dev->of_node;
  323. qmp->cooling_devs = devm_kcalloc(qmp->dev, QMP_NUM_COOLING_RESOURCES,
  324. sizeof(*qmp->cooling_devs),
  325. GFP_KERNEL);
  326. if (!qmp->cooling_devs)
  327. return -ENOMEM;
  328. for_each_available_child_of_node(np, child) {
  329. if (!of_find_property(child, "#cooling-cells", NULL))
  330. continue;
  331. ret = qmp_cooling_device_add(qmp, &qmp->cooling_devs[count++],
  332. child);
  333. if (ret) {
  334. of_node_put(child);
  335. goto unroll;
  336. }
  337. }
  338. if (!count)
  339. devm_kfree(qmp->dev, qmp->cooling_devs);
  340. return 0;
  341. unroll:
  342. while (--count >= 0)
  343. thermal_cooling_device_unregister
  344. (qmp->cooling_devs[count].cdev);
  345. devm_kfree(qmp->dev, qmp->cooling_devs);
  346. return ret;
  347. }
  348. static void qmp_cooling_devices_remove(struct qmp *qmp)
  349. {
  350. int i;
  351. for (i = 0; i < QMP_NUM_COOLING_RESOURCES; i++)
  352. thermal_cooling_device_unregister(qmp->cooling_devs[i].cdev);
  353. }
  354. /**
  355. * qmp_get() - get a qmp handle from a device
  356. * @dev: client device pointer
  357. *
  358. * Return: handle to qmp device on success, ERR_PTR() on failure
  359. */
  360. struct qmp *qmp_get(struct device *dev)
  361. {
  362. struct platform_device *pdev;
  363. struct device_node *np;
  364. struct qmp *qmp;
  365. if (!dev || !dev->of_node)
  366. return ERR_PTR(-EINVAL);
  367. np = of_parse_phandle(dev->of_node, "qcom,qmp", 0);
  368. if (!np)
  369. return ERR_PTR(-ENODEV);
  370. pdev = of_find_device_by_node(np);
  371. of_node_put(np);
  372. if (!pdev)
  373. return ERR_PTR(-EINVAL);
  374. qmp = platform_get_drvdata(pdev);
  375. if (!qmp) {
  376. put_device(&pdev->dev);
  377. return ERR_PTR(-EPROBE_DEFER);
  378. }
  379. return qmp;
  380. }
  381. EXPORT_SYMBOL(qmp_get);
  382. /**
  383. * qmp_put() - release a qmp handle
  384. * @qmp: qmp handle obtained from qmp_get()
  385. */
  386. void qmp_put(struct qmp *qmp)
  387. {
  388. /*
  389. * Match get_device() inside of_find_device_by_node() in
  390. * qmp_get()
  391. */
  392. if (!IS_ERR_OR_NULL(qmp))
  393. put_device(qmp->dev);
  394. }
  395. EXPORT_SYMBOL(qmp_put);
  396. #if IS_ENABLED(CONFIG_DEBUG_FS)
  397. static ssize_t aoss_dbg_write(struct file *file, const char __user *userstr,
  398. size_t len, loff_t *pos)
  399. {
  400. struct qmp *qmp = file->private_data;
  401. char buf[QMP_MSG_LEN] = {};
  402. int ret;
  403. if (!len || len >= QMP_MSG_LEN)
  404. return -EINVAL;
  405. ret = copy_from_user(buf, userstr, len);
  406. if (ret)
  407. return -EFAULT;
  408. ret = qmp_send(qmp, strim(buf), QMP_MSG_LEN);
  409. return ret ? ret : len;
  410. }
  411. static const struct file_operations aoss_dbg_fops = {
  412. .open = simple_open,
  413. .write = aoss_dbg_write,
  414. };
  415. #endif /* CONFIG_DEBUG_FS */
  416. static int qmp_probe(struct platform_device *pdev)
  417. {
  418. struct qmp *qmp;
  419. int irq;
  420. int ret;
  421. qmp = devm_kzalloc(&pdev->dev, sizeof(*qmp), GFP_KERNEL);
  422. if (!qmp)
  423. return -ENOMEM;
  424. qmp->dev = &pdev->dev;
  425. init_waitqueue_head(&qmp->event);
  426. mutex_init(&qmp->tx_lock);
  427. ilc = ipc_log_context_create(AOSS_IPC_LOG_PAGE_CNT, "aoss", 0);
  428. qmp->msgram = devm_platform_ioremap_resource(pdev, 0);
  429. if (IS_ERR(qmp->msgram))
  430. return PTR_ERR(qmp->msgram);
  431. qmp->mbox_client.dev = &pdev->dev;
  432. qmp->mbox_client.knows_txdone = true;
  433. qmp->mbox_chan = mbox_request_channel(&qmp->mbox_client, 0);
  434. if (IS_ERR(qmp->mbox_chan)) {
  435. dev_err(&pdev->dev, "failed to acquire ipc mailbox\n");
  436. return PTR_ERR(qmp->mbox_chan);
  437. }
  438. irq = platform_get_irq(pdev, 0);
  439. ret = devm_request_irq(&pdev->dev, irq, qmp_intr, 0,
  440. "aoss-qmp", qmp);
  441. if (ret < 0) {
  442. dev_err(&pdev->dev, "failed to request interrupt\n");
  443. goto err_free_mbox;
  444. }
  445. enable_irq_wake(irq);
  446. ret = qmp_open(qmp);
  447. if (ret < 0)
  448. goto err_free_mbox;
  449. ret = qmp_qdss_clk_add(qmp);
  450. if (ret)
  451. goto err_close_qmp;
  452. ret = qmp_cooling_devices_register(qmp);
  453. if (ret)
  454. dev_err(&pdev->dev, "failed to register aoss cooling devices\n");
  455. platform_set_drvdata(pdev, qmp);
  456. dev_set_drvdata(&pdev->dev, qmp);
  457. #if IS_ENABLED(CONFIG_DEBUG_FS)
  458. qmp->debugfs_file = debugfs_create_file("aoss_send_message", 0220, NULL,
  459. qmp, &aoss_dbg_fops);
  460. #endif /* CONFIG_DEBUG_FS */
  461. return 0;
  462. err_close_qmp:
  463. qmp_close(qmp);
  464. err_free_mbox:
  465. mbox_free_channel(qmp->mbox_chan);
  466. return ret;
  467. }
  468. static int qmp_remove(struct platform_device *pdev)
  469. {
  470. struct qmp *qmp = platform_get_drvdata(pdev);
  471. #if IS_ENABLED(CONFIG_DEBUG_FS)
  472. debugfs_remove(qmp->debugfs_file);
  473. #endif /* CONFIG_DEBUG_FS */
  474. qmp_qdss_clk_remove(qmp);
  475. qmp_cooling_devices_remove(qmp);
  476. qmp_close(qmp);
  477. mbox_free_channel(qmp->mbox_chan);
  478. return 0;
  479. }
  480. static int aoss_qmp_mbox_freeze(struct device *dev)
  481. {
  482. return 0;
  483. }
  484. static int aoss_qmp_mbox_restore(struct device *dev)
  485. {
  486. struct qmp *qmp = dev_get_drvdata(dev);
  487. int ret;
  488. ret = qmp_open(qmp);
  489. if (ret < 0)
  490. dev_err(dev, "QMP restore failed, ret = %d\n", ret);
  491. return 0;
  492. }
  493. static const struct dev_pm_ops aoss_qmp_mbox_pm_ops = {
  494. .freeze_late = aoss_qmp_mbox_freeze,
  495. .restore_early = aoss_qmp_mbox_restore,
  496. };
  497. static const struct of_device_id qmp_dt_match[] = {
  498. { .compatible = "qcom,sc7180-aoss-qmp", },
  499. { .compatible = "qcom,sc7280-aoss-qmp", },
  500. { .compatible = "qcom,sdm845-aoss-qmp", },
  501. { .compatible = "qcom,sm6150-aoss-qmp", },
  502. { .compatible = "qcom,sm8150-aoss-qmp", },
  503. { .compatible = "qcom,sm8250-aoss-qmp", },
  504. { .compatible = "qcom,sm8350-aoss-qmp", },
  505. { .compatible = "qcom,aoss-qmp", },
  506. {}
  507. };
  508. MODULE_DEVICE_TABLE(of, qmp_dt_match);
  509. static struct platform_driver qmp_driver = {
  510. .driver = {
  511. .name = "qcom_aoss_qmp",
  512. .of_match_table = qmp_dt_match,
  513. .suppress_bind_attrs = true,
  514. .pm = &aoss_qmp_mbox_pm_ops,
  515. },
  516. .probe = qmp_probe,
  517. .remove = qmp_remove,
  518. };
  519. module_platform_driver(qmp_driver);
  520. MODULE_DESCRIPTION("Qualcomm AOSS QMP driver");
  521. MODULE_LICENSE("GPL v2");