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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRm/USAAoJEIqAPN1PVmxKGQAP/0/z0fjFr4V2hYgqqcpmo0AH
 exxKB36AB6C9FhDHPxd695vWImM62vqpVQuNF/qS4FeYpXHukWYcun3uDYK4xgwY
 udvhMJbwVUSpr33E8pouvGVMmyepk0wEzlazywnmwNmUUhYADNXh8ISiSUP1Op5E
 WlhGQob1tmVZBr28HHgJ2gT7ezDighiGd2RxzsmBLFIeFf0hN5LQdQoLqOMRORgR
 QFQ75r3GR2K/1CmhXGVugiyzhVSmChfsOFSQh1cssOYU+x+GJXaqk3eqvAEv1Y98
 OdtK8RG4uOMZKTzJxPtHInp0dSOQFN2vh5IvZeIIW5B5Kd2xv5z43xBwQprQ8Btm
 metPTrQylxTAWLss01YP0TMkDDBxkXxygmFkvZsS66tRU7D/VyupfAIkBO0yW+5G
 5QpJ8NWioUWe31nDLdg0ro/KlDPlYPpnBS9wN5Q/cQH+bpzHEMeOaaxZQxqQGZQ2
 Ep13KGXFuraOVLIvY90bNCNji4aAwqOdFdAk70fFafB1xUjEjKDu8/TZyBGK5zoI
 Dc7cJbh81svdNoILL3N++yusnWAvcXinPIagL2PQCMRfcYrPVIp+kmhm+FYGGD39
 UaIH9wAFdRigxCde4lS+x5mCFu3CJ7A/u1FpH+xNopbNPoGBfYRqNXxlxbknI1Ch
 gD1r5NoJYvbUat0tTSpN
 =24Oz
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
John W. Linville 2013-05-22 14:23:05 -04:00
commit 323a98db4d
5 changed files with 20 additions and 32 deletions

View File

@ -28,7 +28,7 @@ config NFC_WILINK
config NFC_MEI_PHY
tristate "MEI bus NFC device support"
depends on INTEL_MEI_BUS_NFC && NFC_HCI
depends on INTEL_MEI && NFC_HCI
help
This adds support to use an mei bus nfc device. Select this if you
will use an HCI NFC driver for an NFC chip connected behind an

View File

@ -64,6 +64,15 @@ int nfc_mei_phy_enable(void *phy_id)
return r;
}
r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy);
if (r) {
pr_err("MEY_PHY: Event cb registration failed\n");
mei_cl_disable_device(phy->device);
phy->powered = 0;
return r;
}
phy->powered = 1;
return 0;

View File

@ -43,26 +43,18 @@ static int microread_mei_probe(struct mei_cl_device *device,
return -ENOMEM;
}
r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
if (r) {
pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
goto err_out;
}
r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
&phy->hdev);
if (r < 0)
goto err_out;
return 0;
err_out:
if (r < 0) {
nfc_mei_phy_free(phy);
return r;
}
return 0;
}
static int microread_mei_remove(struct mei_cl_device *device)
{
struct nfc_mei_phy *phy = mei_cl_get_drvdata(device);
@ -71,8 +63,6 @@ static int microread_mei_remove(struct mei_cl_device *device)
microread_remove(phy->hdev);
nfc_mei_phy_disable(phy);
nfc_mei_phy_free(phy);
return 0;

View File

@ -43,26 +43,18 @@ static int pn544_mei_probe(struct mei_cl_device *device,
return -ENOMEM;
}
r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
if (r) {
pr_err(PN544_DRIVER_NAME ": event cb registration failed\n");
goto err_out;
}
r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
&phy->hdev);
if (r < 0)
goto err_out;
return 0;
err_out:
if (r < 0) {
nfc_mei_phy_free(phy);
return r;
}
return 0;
}
static int pn544_mei_remove(struct mei_cl_device *device)
{
struct nfc_mei_phy *phy = mei_cl_get_drvdata(device);
@ -71,8 +63,6 @@ static int pn544_mei_remove(struct mei_cl_device *device)
pn544_hci_remove(phy->hdev);
nfc_mei_phy_disable(phy);
nfc_mei_phy_free(phy);
return 0;

View File

@ -5,7 +5,6 @@
obj-$(CONFIG_NFC) += nfc.o
obj-$(CONFIG_NFC_NCI) += nci/
obj-$(CONFIG_NFC_HCI) += hci/
#obj-$(CONFIG_NFC_LLCP) += llcp/
nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \
llcp_sock.o