aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-05-22 14:23:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-05-22 14:23:05 -0400
commit323a98db4d51e4fefc74290adfb5493047cbbe22 (patch)
treeb084691065908513b0695d0d404edd11d9357f63
parent6bb4880d9ef30375da4507aeabd6dc261a2c6c2b (diff)
parente3a6b14ceda0207c3405c6266e5177a85c0db044 (diff)
Samuel Ortiz <sameo@linux.intel.com> says:
"Merge tag 'nfc-fixes-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-fixes This is the first batch of NFC fixes for 3.10, and it contains: - 3 fixes for the NFC MEI support: * We now depend on the correct Kconfig symbol. * We register an MEI event callback whenever we enable an NFC device, otherwise we fail to read anything after an enable/disable cycle. * We only disable an MEI device from its disable mey_phy_ops, preventing useless consecutive disable calls. - An NFC Makefile cleanup, as I forgot to remove a commented out line when moving the LLCP code to the NFC top level directory." Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/nfc/Kconfig2
-rw-r--r--drivers/nfc/mei_phy.c9
-rw-r--r--drivers/nfc/microread/mei.c20
-rw-r--r--drivers/nfc/pn544/mei.c20
-rw-r--r--net/nfc/Makefile1
5 files changed, 20 insertions, 32 deletions
diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig
index 4775d4e61b88..74a852e4e41f 100644
--- a/drivers/nfc/Kconfig
+++ b/drivers/nfc/Kconfig
@@ -28,7 +28,7 @@ config NFC_WILINK
28 28
29config NFC_MEI_PHY 29config NFC_MEI_PHY
30 tristate "MEI bus NFC device support" 30 tristate "MEI bus NFC device support"
31 depends on INTEL_MEI_BUS_NFC && NFC_HCI 31 depends on INTEL_MEI && NFC_HCI
32 help 32 help
33 This adds support to use an mei bus nfc device. Select this if you 33 This adds support to use an mei bus nfc device. Select this if you
34 will use an HCI NFC driver for an NFC chip connected behind an 34 will use an HCI NFC driver for an NFC chip connected behind an
diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c
index b8f8abc422f0..1201bdbfb791 100644
--- a/drivers/nfc/mei_phy.c
+++ b/drivers/nfc/mei_phy.c
@@ -64,6 +64,15 @@ int nfc_mei_phy_enable(void *phy_id)
64 return r; 64 return r;
65 } 65 }
66 66
67 r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy);
68 if (r) {
69 pr_err("MEY_PHY: Event cb registration failed\n");
70 mei_cl_disable_device(phy->device);
71 phy->powered = 0;
72
73 return r;
74 }
75
67 phy->powered = 1; 76 phy->powered = 1;
68 77
69 return 0; 78 return 0;
diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c
index 1ad044dce7b6..cdf1bc53b257 100644
--- a/drivers/nfc/microread/mei.c
+++ b/drivers/nfc/microread/mei.c
@@ -43,24 +43,16 @@ static int microread_mei_probe(struct mei_cl_device *device,
43 return -ENOMEM; 43 return -ENOMEM;
44 } 44 }
45 45
46 r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
47 if (r) {
48 pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
49 goto err_out;
50 }
51
52 r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 46 r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
53 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
54 &phy->hdev); 48 &phy->hdev);
55 if (r < 0) 49 if (r < 0) {
56 goto err_out; 50 nfc_mei_phy_free(phy);
57
58 return 0;
59 51
60err_out: 52 return r;
61 nfc_mei_phy_free(phy); 53 }
62 54
63 return r; 55 return 0;
64} 56}
65 57
66static int microread_mei_remove(struct mei_cl_device *device) 58static int microread_mei_remove(struct mei_cl_device *device)
@@ -71,8 +63,6 @@ static int microread_mei_remove(struct mei_cl_device *device)
71 63
72 microread_remove(phy->hdev); 64 microread_remove(phy->hdev);
73 65
74 nfc_mei_phy_disable(phy);
75
76 nfc_mei_phy_free(phy); 66 nfc_mei_phy_free(phy);
77 67
78 return 0; 68 return 0;
diff --git a/drivers/nfc/pn544/mei.c b/drivers/nfc/pn544/mei.c
index 1eb48848a35a..b5d3d18179eb 100644
--- a/drivers/nfc/pn544/mei.c
+++ b/drivers/nfc/pn544/mei.c
@@ -43,24 +43,16 @@ static int pn544_mei_probe(struct mei_cl_device *device,
43 return -ENOMEM; 43 return -ENOMEM;
44 } 44 }
45 45
46 r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
47 if (r) {
48 pr_err(PN544_DRIVER_NAME ": event cb registration failed\n");
49 goto err_out;
50 }
51
52 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 46 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
53 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
54 &phy->hdev); 48 &phy->hdev);
55 if (r < 0) 49 if (r < 0) {
56 goto err_out; 50 nfc_mei_phy_free(phy);
57
58 return 0;
59 51
60err_out: 52 return r;
61 nfc_mei_phy_free(phy); 53 }
62 54
63 return r; 55 return 0;
64} 56}
65 57
66static int pn544_mei_remove(struct mei_cl_device *device) 58static int pn544_mei_remove(struct mei_cl_device *device)
@@ -71,8 +63,6 @@ static int pn544_mei_remove(struct mei_cl_device *device)
71 63
72 pn544_hci_remove(phy->hdev); 64 pn544_hci_remove(phy->hdev);
73 65
74 nfc_mei_phy_disable(phy);
75
76 nfc_mei_phy_free(phy); 66 nfc_mei_phy_free(phy);
77 67
78 return 0; 68 return 0;
diff --git a/net/nfc/Makefile b/net/nfc/Makefile
index fb799deaed4f..a76f4533cb6c 100644
--- a/net/nfc/Makefile
+++ b/net/nfc/Makefile
@@ -5,7 +5,6 @@
5obj-$(CONFIG_NFC) += nfc.o 5obj-$(CONFIG_NFC) += nfc.o
6obj-$(CONFIG_NFC_NCI) += nci/ 6obj-$(CONFIG_NFC_NCI) += nci/
7obj-$(CONFIG_NFC_HCI) += hci/ 7obj-$(CONFIG_NFC_HCI) += hci/
8#obj-$(CONFIG_NFC_LLCP) += llcp/
9 8
10nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ 9nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \
11 llcp_sock.o 10 llcp_sock.o