drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / drivers / nfc / pn544 / mei.c
blobc493f2dbd0e21136bbec6850e741d052a9502190
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
5 * HCI based Driver for NXP pn544 NFC Chip
6 */
8 #include <linux/module.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/nfc.h>
11 #include <net/nfc/hci.h>
12 #include <net/nfc/llc.h>
14 #include "../mei_phy.h"
15 #include "pn544.h"
17 #define PN544_DRIVER_NAME "pn544"
19 static int pn544_mei_probe(struct mei_cl_device *cldev,
20 const struct mei_cl_device_id *id)
22 struct nfc_mei_phy *phy;
23 int r;
25 phy = nfc_mei_phy_alloc(cldev);
26 if (!phy)
27 return -ENOMEM;
29 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
30 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
31 NULL, &phy->hdev);
32 if (r < 0) {
33 nfc_mei_phy_free(phy);
35 return r;
38 return 0;
41 static void pn544_mei_remove(struct mei_cl_device *cldev)
43 struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
45 pn544_hci_remove(phy->hdev);
47 nfc_mei_phy_free(phy);
50 static struct mei_cl_device_id pn544_mei_tbl[] = {
51 { PN544_DRIVER_NAME, MEI_NFC_UUID, MEI_CL_VERSION_ANY},
53 /* required last entry */
54 { }
56 MODULE_DEVICE_TABLE(mei, pn544_mei_tbl);
58 static struct mei_cl_driver pn544_driver = {
59 .id_table = pn544_mei_tbl,
60 .name = PN544_DRIVER_NAME,
62 .probe = pn544_mei_probe,
63 .remove = pn544_mei_remove,
66 module_mei_cl_driver(pn544_driver);
68 MODULE_LICENSE("GPL");
69 MODULE_DESCRIPTION(DRIVER_DESC);