swr-haptics.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/device.h>
  6. #include <linux/init.h>
  7. #include <linux/module.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/regmap.h>
  10. #include <linux/regulator/consumer.h>
  11. #include <linux/slab.h>
  12. #include <soc/soundwire.h>
  13. #include <sound/soc.h>
  14. #include <sound/soc-dapm.h>
  15. #define HAPTICS_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
  16. SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
  17. SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000 |\
  18. SNDRV_PCM_RATE_384000)
  19. #define HAPTICS_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
  20. SNDRV_PCM_FMTBIT_S24_LE |\
  21. SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
  22. /* SWR register definition */
  23. #define SWR_HAP_ACCESS_BASE 0x3000
  24. #define FIFO_WR_READY_REG (SWR_HAP_ACCESS_BASE + 0x8)
  25. #define NUM_PAT_SMPL_REG (SWR_HAP_ACCESS_BASE + 0x9)
  26. #define SWR_WR_ACCESS_REG (SWR_HAP_ACCESS_BASE + 0xa)
  27. #define CAL_TLRA_STATUS_MSB_REG (SWR_HAP_ACCESS_BASE + 0xb)
  28. #define CAL_TLRA_STATUS_LSB_REG (SWR_HAP_ACCESS_BASE + 0xc)
  29. #define AUTO_RES_CAL_DONE_REG (SWR_HAP_ACCESS_BASE + 0xd)
  30. #define SWR_READ_DATA_REG (SWR_HAP_ACCESS_BASE + 0x80)
  31. #define SWR_PLAY_REG (SWR_HAP_ACCESS_BASE + 0x81)
  32. #define SWR_VMAX_REG (SWR_HAP_ACCESS_BASE + 0x82)
  33. #define SWR_PLAY_BIT BIT(7)
  34. #define SWR_BRAKE_EN_BIT BIT(3)
  35. #define SWR_PLAY_SRC_MASK GENMASK(2, 0)
  36. #define SWR_PLAY_SRC_VAL_SWR 4
  37. #define SWR_HAP_REG_MAX (SWR_HAP_ACCESS_BASE + 0xff)
  38. static struct reg_default swr_hap_reg_defaults[] = {
  39. {FIFO_WR_READY_REG, 1},
  40. {NUM_PAT_SMPL_REG, 8},
  41. {SWR_WR_ACCESS_REG, 1},
  42. {CAL_TLRA_STATUS_MSB_REG, 0},
  43. {CAL_TLRA_STATUS_LSB_REG, 0},
  44. {AUTO_RES_CAL_DONE_REG, 0},
  45. {SWR_READ_DATA_REG, 0},
  46. {SWR_PLAY_REG, 4},
  47. {SWR_VMAX_REG, 0},
  48. };
  49. enum {
  50. PORT_ID_DT_IDX,
  51. NUM_CH_DT_IDX,
  52. CH_MASK_DT_IDX,
  53. CH_RATE_DT_IDX,
  54. PORT_TYPE_DT_IDX,
  55. NUM_SWR_PORT_DT_PARAMS,
  56. };
  57. struct swr_port {
  58. u8 port_id;
  59. u8 ch_mask;
  60. u32 ch_rate;
  61. u8 num_ch;
  62. u8 port_type;
  63. };
  64. struct swr_haptics_dev {
  65. struct device *dev;
  66. struct swr_device *swr_slave;
  67. struct snd_soc_component *component;
  68. struct regmap *regmap;
  69. struct swr_port port;
  70. struct regulator *vdd;
  71. u8 vmax;
  72. };
  73. static bool swr_hap_volatile_register(struct device *dev, unsigned int reg)
  74. {
  75. switch (reg) {
  76. case SWR_READ_DATA_REG:
  77. case SWR_PLAY_REG:
  78. case SWR_VMAX_REG:
  79. return 1;
  80. default:
  81. return 0;
  82. }
  83. }
  84. static bool swr_hap_readable_register(struct device *dev, unsigned int reg)
  85. {
  86. if (reg <= SWR_HAP_ACCESS_BASE)
  87. return 0;
  88. return 1;
  89. }
  90. static bool swr_hap_writeable_register(struct device *dev, unsigned int reg)
  91. {
  92. if (reg <= SWR_HAP_ACCESS_BASE)
  93. return 0;
  94. switch (reg) {
  95. case FIFO_WR_READY_REG:
  96. case NUM_PAT_SMPL_REG:
  97. case SWR_WR_ACCESS_REG:
  98. case CAL_TLRA_STATUS_MSB_REG:
  99. case CAL_TLRA_STATUS_LSB_REG:
  100. case AUTO_RES_CAL_DONE_REG:
  101. case SWR_READ_DATA_REG:
  102. return 0;
  103. }
  104. return 1;
  105. }
  106. struct regmap_config swr_hap_regmap_config = {
  107. .reg_bits = 16,
  108. .val_bits = 8,
  109. .cache_type = REGCACHE_RBTREE,
  110. .reg_defaults = swr_hap_reg_defaults,
  111. .num_reg_defaults = ARRAY_SIZE(swr_hap_reg_defaults),
  112. .max_register = SWR_HAP_REG_MAX,
  113. .volatile_reg = swr_hap_volatile_register,
  114. .readable_reg = swr_hap_readable_register,
  115. .writeable_reg = swr_hap_writeable_register,
  116. .reg_format_endian = REGMAP_ENDIAN_NATIVE,
  117. .val_format_endian = REGMAP_ENDIAN_NATIVE,
  118. .can_multi_write = true,
  119. };
  120. static const struct snd_kcontrol_new hap_swr_dac_port[] = {
  121. SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0)
  122. };
  123. static int hap_enable_swr_dac_port(struct snd_soc_dapm_widget *w,
  124. struct snd_kcontrol *kcontrol, int event)
  125. {
  126. struct snd_soc_component *swr_hap_comp =
  127. snd_soc_dapm_to_component(w->dapm);
  128. struct swr_haptics_dev *swr_hap;
  129. u8 port_id, ch_mask, num_ch, port_type, num_port;
  130. u32 ch_rate;
  131. unsigned int val;
  132. int rc;
  133. if (!swr_hap_comp) {
  134. pr_err("%s: swr_hap_component is NULL\n", __func__);
  135. return -EINVAL;
  136. }
  137. swr_hap = snd_soc_component_get_drvdata(swr_hap_comp);
  138. if (!swr_hap) {
  139. pr_err("%s: get swr_haptics_dev failed\n", __func__);
  140. return -ENODEV;
  141. }
  142. dev_dbg(swr_hap->dev, "%s: %s event %d\n", __func__, w->name, event);
  143. num_port = 1;
  144. port_id = swr_hap->port.port_id;
  145. ch_mask = swr_hap->port.ch_mask;
  146. ch_rate = swr_hap->port.ch_rate;
  147. num_ch = swr_hap->port.num_ch;
  148. port_type = swr_hap->port.port_type;
  149. switch (event) {
  150. case SND_SOC_DAPM_PRE_PMU:
  151. rc = regmap_write(swr_hap->regmap, SWR_VMAX_REG, swr_hap->vmax);
  152. if (rc) {
  153. dev_err(swr_hap->dev, "%s: SWR_VMAX update failed, rc=%d\n",
  154. __func__, rc);
  155. return rc;
  156. }
  157. regmap_read(swr_hap->regmap, SWR_VMAX_REG, &val);
  158. regmap_read(swr_hap->regmap, SWR_READ_DATA_REG, &val);
  159. dev_dbg(swr_hap->dev, "%s: swr_vmax is set to 0x%x\n", __func__, val);
  160. swr_device_wakeup_vote(swr_hap->swr_slave);
  161. swr_connect_port(swr_hap->swr_slave, &port_id, num_port,
  162. &ch_mask, &ch_rate, &num_ch, &port_type);
  163. break;
  164. case SND_SOC_DAPM_POST_PMU:
  165. swr_slvdev_datapath_control(swr_hap->swr_slave,
  166. swr_hap->swr_slave->dev_num, true);
  167. /* trigger SWR play */
  168. val = SWR_PLAY_BIT | SWR_PLAY_SRC_VAL_SWR;
  169. rc = regmap_write(swr_hap->regmap, SWR_PLAY_REG, val);
  170. if (rc) {
  171. dev_err(swr_hap->dev, "%s: Enable SWR_PLAY failed, rc=%d\n",
  172. __func__, rc);
  173. return rc;
  174. }
  175. break;
  176. case SND_SOC_DAPM_PRE_PMD:
  177. /* stop SWR play */
  178. val = 0;
  179. rc = regmap_write(swr_hap->regmap, SWR_PLAY_REG, val);
  180. if (rc) {
  181. dev_err(swr_hap->dev, "%s: Enable SWR_PLAY failed, rc=%d\n",
  182. __func__, rc);
  183. return rc;
  184. }
  185. break;
  186. case SND_SOC_DAPM_POST_PMD:
  187. swr_disconnect_port(swr_hap->swr_slave, &port_id, num_port,
  188. &ch_mask, &port_type);
  189. swr_slvdev_datapath_control(swr_hap->swr_slave,
  190. swr_hap->swr_slave->dev_num, false);
  191. swr_device_wakeup_unvote(swr_hap->swr_slave);
  192. break;
  193. default:
  194. break;
  195. }
  196. return 0;
  197. }
  198. static int haptics_vmax_get(struct snd_kcontrol *kcontrol,
  199. struct snd_ctl_elem_value *ucontrol)
  200. {
  201. struct snd_soc_component *component =
  202. snd_soc_kcontrol_component(kcontrol);
  203. struct swr_haptics_dev *swr_hap =
  204. snd_soc_component_get_drvdata(component);
  205. pr_debug("%s: vmax %u\n", __func__, swr_hap->vmax);
  206. ucontrol->value.integer.value[0] = swr_hap->vmax;
  207. return 0;
  208. }
  209. static int haptics_vmax_put(struct snd_kcontrol *kcontrol,
  210. struct snd_ctl_elem_value *ucontrol)
  211. {
  212. struct snd_soc_component *component =
  213. snd_soc_kcontrol_component(kcontrol);
  214. struct swr_haptics_dev *swr_hap =
  215. snd_soc_component_get_drvdata(component);
  216. swr_hap->vmax = ucontrol->value.integer.value[0];
  217. pr_debug("%s: vmax %u\n", __func__, swr_hap->vmax);
  218. return 0;
  219. }
  220. static const struct snd_kcontrol_new haptics_snd_controls[] = {
  221. SOC_SINGLE_EXT("Haptics Amplitude Step", SND_SOC_NOPM, 0, 100, 0,
  222. haptics_vmax_get, haptics_vmax_put),
  223. };
  224. static const struct snd_soc_dapm_widget haptics_comp_dapm_widgets[] = {
  225. SND_SOC_DAPM_INPUT("HAP_IN"),
  226. SND_SOC_DAPM_MIXER_E("SWR DAC_Port", SND_SOC_NOPM, 0, 0,
  227. hap_swr_dac_port, ARRAY_SIZE(hap_swr_dac_port),
  228. hap_enable_swr_dac_port,
  229. SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
  230. SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
  231. SND_SOC_DAPM_SPK("HAP_OUT", NULL),
  232. };
  233. static const struct snd_soc_dapm_route haptics_comp_dapm_route[] = {
  234. {"SWR DAC_Port", "Switch", "HAP_IN"},
  235. {"HAP_OUT", NULL, "SWR DAC_Port"},
  236. };
  237. static int haptics_comp_probe(struct snd_soc_component *component)
  238. {
  239. struct snd_soc_dapm_context *dapm;
  240. struct swr_haptics_dev *swr_hap =
  241. snd_soc_component_get_drvdata(component);
  242. if (!swr_hap) {
  243. pr_err("%s: get swr_haptics_dev failed\n", __func__);
  244. return -EINVAL;
  245. }
  246. snd_soc_component_init_regmap(component, swr_hap->regmap);
  247. dapm = snd_soc_component_get_dapm(component);
  248. if (dapm && dapm->component) {
  249. snd_soc_dapm_ignore_suspend(dapm, "HAP_IN");
  250. snd_soc_dapm_ignore_suspend(dapm, "HAP_OUT");
  251. }
  252. return 0;
  253. }
  254. static void haptics_comp_remove(struct snd_soc_component *component)
  255. {
  256. }
  257. static const struct snd_soc_component_driver swr_haptics_component = {
  258. .name = "swr-haptics",
  259. .probe = haptics_comp_probe,
  260. .remove = haptics_comp_remove,
  261. .controls = haptics_snd_controls,
  262. .num_controls = ARRAY_SIZE(haptics_snd_controls),
  263. .dapm_widgets = haptics_comp_dapm_widgets,
  264. .num_dapm_widgets = ARRAY_SIZE(haptics_comp_dapm_widgets),
  265. .dapm_routes = haptics_comp_dapm_route,
  266. .num_dapm_routes = ARRAY_SIZE(haptics_comp_dapm_route),
  267. };
  268. static struct snd_soc_dai_driver haptics_dai[] = {
  269. {
  270. .name = "swr_haptics",
  271. .playback = {
  272. .stream_name = "HAPTICS_AIF Playback",
  273. .rates = HAPTICS_RATES,
  274. .formats = HAPTICS_FORMATS,
  275. .rate_max = 192000,
  276. .rate_min = 8000,
  277. .channels_min = 1,
  278. .channels_max = 1,
  279. },
  280. },
  281. };
  282. static int swr_haptics_parse_port_mapping(struct swr_device *sdev)
  283. {
  284. struct swr_haptics_dev *swr_hap = swr_get_dev_data(sdev);
  285. u32 port_cfg[NUM_SWR_PORT_DT_PARAMS];
  286. int rc;
  287. if (!swr_hap) {
  288. dev_err(&sdev->dev, "%s: get swr_haptics_dev failed\n",
  289. __func__);
  290. return -EINVAL;
  291. }
  292. rc = of_property_read_u32_array(sdev->dev.of_node, "qcom,rx_swr_ch_map",
  293. port_cfg, NUM_SWR_PORT_DT_PARAMS);
  294. if (rc < 0) {
  295. dev_err(swr_hap->dev, "%s: Get qcom,rx_swr_ch_map failed, rc=%d\n",
  296. __func__, rc);
  297. return -EINVAL;
  298. }
  299. swr_hap->port.port_id = (u8) port_cfg[PORT_ID_DT_IDX];
  300. swr_hap->port.num_ch = (u8) port_cfg[NUM_CH_DT_IDX];
  301. swr_hap->port.ch_mask = (u8) port_cfg[CH_MASK_DT_IDX];
  302. swr_hap->port.ch_rate = port_cfg[CH_RATE_DT_IDX];
  303. swr_hap->port.port_type = (u8) port_cfg[PORT_TYPE_DT_IDX];
  304. dev_dbg(swr_hap->dev, "%s: port_id = %d, ch_mask = %d, ch_rate = %d, num_ch = %d, port_type = %d\n",
  305. __func__, swr_hap->port.port_id,
  306. swr_hap->port.ch_mask, swr_hap->port.ch_rate,
  307. swr_hap->port.num_ch, swr_hap->port.port_type);
  308. return 0;
  309. }
  310. static int swr_haptics_probe(struct swr_device *sdev)
  311. {
  312. struct swr_haptics_dev *swr_hap;
  313. int rc;
  314. u8 devnum;
  315. int retry = 5;
  316. swr_hap = devm_kzalloc(&sdev->dev,
  317. sizeof(struct swr_haptics_dev), GFP_KERNEL);
  318. if (!swr_hap)
  319. return -ENOMEM;
  320. /* VMAX default to 5V */
  321. swr_hap->vmax = 100;
  322. swr_hap->swr_slave = sdev;
  323. swr_hap->dev = &sdev->dev;
  324. swr_set_dev_data(sdev, swr_hap);
  325. rc = swr_haptics_parse_port_mapping(sdev);
  326. if (rc < 0) {
  327. dev_err(swr_hap->dev, "%s: failed to parse swr port mapping, rc=%d\n",
  328. __func__, rc);
  329. goto clean;
  330. }
  331. swr_hap->vdd = devm_regulator_get(swr_hap->dev, "swr-slave");
  332. if (IS_ERR(swr_hap->vdd)) {
  333. rc = PTR_ERR(swr_hap->vdd);
  334. if (rc != -EPROBE_DEFER)
  335. dev_err(swr_hap->dev, "%s: get swr-slave-supply failed, rc=%d\n",
  336. __func__, rc);
  337. goto clean;
  338. }
  339. rc = regulator_enable(swr_hap->vdd);
  340. if (rc < 0) {
  341. dev_err(swr_hap->dev, "%s: enable swr-slave-vdd failed, rc=%d\n",
  342. __func__, rc);
  343. goto clean;
  344. }
  345. do {
  346. /* Add delay for soundwire enumeration */
  347. usleep_range(500, 510);
  348. rc = swr_get_logical_dev_num(sdev, sdev->addr, &devnum);
  349. } while (rc && --retry);
  350. if (rc) {
  351. dev_err(swr_hap->dev, "%s: failed to get devnum for swr-haptics, rc=%d\n",
  352. __func__, rc);
  353. rc = -EPROBE_DEFER;
  354. goto clean;
  355. }
  356. sdev->dev_num = devnum;
  357. swr_hap->regmap = devm_regmap_init_swr(sdev, &swr_hap_regmap_config);
  358. if (IS_ERR(swr_hap->regmap)) {
  359. rc = PTR_ERR(swr_hap->regmap);
  360. dev_err(swr_hap->dev, "%s: init regmap failed, rc=%d\n",
  361. __func__, rc);
  362. goto dev_err;
  363. }
  364. rc = snd_soc_register_component(&sdev->dev,
  365. &swr_haptics_component, haptics_dai, ARRAY_SIZE(haptics_dai));
  366. if (rc) {
  367. dev_err(swr_hap->dev, "%s: register swr_haptics component failed, rc=%d\n",
  368. __func__, rc);
  369. goto dev_err;
  370. }
  371. return 0;
  372. dev_err:
  373. regulator_disable(swr_hap->vdd);
  374. swr_remove_device(sdev);
  375. clean:
  376. swr_set_dev_data(sdev, NULL);
  377. return rc;
  378. }
  379. static int swr_haptics_remove(struct swr_device *sdev)
  380. {
  381. struct swr_haptics_dev *swr_hap;
  382. int rc = 0;
  383. swr_hap = swr_get_dev_data(sdev);
  384. if (!swr_hap) {
  385. dev_err(&sdev->dev, "%s: no data for swr_hap\n", __func__);
  386. rc = -ENODEV;
  387. goto clean;
  388. }
  389. rc = regulator_disable(swr_hap->vdd);
  390. if (rc < 0) {
  391. dev_err(swr_hap->dev, "%s: disable swr-slave failed, rc=%d\n",
  392. __func__, rc);
  393. goto clean;
  394. }
  395. clean:
  396. snd_soc_unregister_component(&sdev->dev);
  397. swr_set_dev_data(sdev, NULL);
  398. return rc;
  399. }
  400. static int swr_haptics_device_up(struct swr_device *sdev)
  401. {
  402. struct swr_haptics_dev *swr_hap;
  403. int rc;
  404. swr_hap = swr_get_dev_data(sdev);
  405. if (!swr_hap) {
  406. dev_err(&sdev->dev, "%s: no data for swr_hap\n", __func__);
  407. return -ENODEV;
  408. }
  409. /* Take SWR slave out of reset */
  410. rc = regulator_enable(swr_hap->vdd);
  411. if (rc < 0) {
  412. dev_err(swr_hap->dev, "%s: enable swr-slave failed, rc=%d\n",
  413. __func__, rc);
  414. return rc;
  415. }
  416. return 0;
  417. }
  418. static int swr_haptics_device_down(struct swr_device *sdev)
  419. {
  420. struct swr_haptics_dev *swr_hap = swr_get_dev_data(sdev);
  421. int rc;
  422. if (!swr_hap) {
  423. dev_err(&sdev->dev, "%s: no data for swr_hap\n", __func__);
  424. return -ENODEV;
  425. }
  426. /* Put SWR slave into reset */
  427. rc = regulator_disable(swr_hap->vdd);
  428. if (rc < 0) {
  429. dev_err(swr_hap->dev, "%s: disable swr-slave failed, rc=%d\n",
  430. __func__, rc);
  431. return rc;
  432. }
  433. return 0;
  434. }
  435. static int swr_haptics_suspend(struct device *dev)
  436. {
  437. struct swr_haptics_dev *swr_hap;
  438. int rc = 0;
  439. swr_hap = swr_get_dev_data(to_swr_device(dev));
  440. if (!swr_hap) {
  441. dev_err(dev, "%s: no data for swr_hap\n", __func__);
  442. return -ENODEV;
  443. }
  444. trace_printk("%s: suspended\n", __func__);
  445. return rc;
  446. }
  447. static int swr_haptics_resume(struct device *dev)
  448. {
  449. struct swr_haptics_dev *swr_hap;
  450. int rc = 0;
  451. swr_hap = swr_get_dev_data(to_swr_device(dev));
  452. if (!swr_hap) {
  453. dev_err(dev, "%s: no data for swr_hap\n", __func__);
  454. return -ENODEV;
  455. }
  456. trace_printk("%s: resumed\n", __func__);
  457. return rc;
  458. }
  459. static const struct of_device_id swr_haptics_match_table[] = {
  460. { .compatible = "qcom,swr-haptics", },
  461. { .compatible = "qcom,pm8350b-swr-haptics", },
  462. { },
  463. };
  464. static const struct swr_device_id swr_haptics_id[] = {
  465. {"swr-haptics", 0},
  466. {"pm8350b-swr-haptics", 0},
  467. {},
  468. };
  469. static const struct dev_pm_ops swr_haptics_pm_ops = {
  470. .suspend = swr_haptics_suspend,
  471. .resume = swr_haptics_resume,
  472. };
  473. static struct swr_driver swr_haptics_driver = {
  474. .driver = {
  475. .name = "swr-haptics",
  476. .owner = THIS_MODULE,
  477. .pm = &swr_haptics_pm_ops,
  478. .of_match_table = swr_haptics_match_table,
  479. },
  480. .probe = swr_haptics_probe,
  481. .remove = swr_haptics_remove,
  482. .id_table = swr_haptics_id,
  483. .device_up = swr_haptics_device_up,
  484. .device_down = swr_haptics_device_down,
  485. };
  486. static int __init swr_haptics_init(void)
  487. {
  488. return swr_driver_register(&swr_haptics_driver);
  489. }
  490. static void __exit swr_haptics_exit(void)
  491. {
  492. swr_driver_unregister(&swr_haptics_driver);
  493. }
  494. module_init(swr_haptics_init);
  495. module_exit(swr_haptics_exit);
  496. MODULE_DESCRIPTION("SWR haptics driver");
  497. MODULE_LICENSE("GPL v2");