summaryrefslogtreecommitdiff
path: root/drivers/nfc
AgeCommit message (Collapse)Author
2013-11-28nfc: return if NFC is in shutdown stateRakesh Goyal
Bug 1362875 Change-Id: Ic9ee8cfc63a7c5fd5c6785178a27a705c9d140fe Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-on: http://git-master/r/276631 (cherry picked from commit c61b6503a1ac51add321841891ec5c3a8a354cf3) Reviewed-on: http://git-master/r/336603 GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-09-14nfc: implement i2c shutdown for nxp nfcAnita Kar
Implementation of i2c shutdown for pn544 nfc module to discard any i2c communication after shutdown. Bug 1203783 Change-Id: I105d65239f50c3a97dc4cb4256ae87cbdcdca736 Signed-off-by: Anita Kar <akar@nvidia.com> Reviewed-on: http://git-master/r/191956 (cherry picked from commit 192b67666215b59f8316a78d6d290a0e9952df01) Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: http://git-master/r/201674 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-09-14nfc: implement i2c shutdown for Broadcom nfcAnita Kar
Implementation of i2c shutdown for bcm2079x nfc module to discard any i2c communication after shutdown. Bug 1203783 Change-Id: I10ac641629d5c6ab8d0adb229588a89d77ab99ae Signed-off-by: Anita Kar <akar@nvidia.com> Reviewed-on: http://git-master/r/191939 GVS: Gerrit_Virtual_Submit (cherry picked from commit 3777260ddec2fe578e7985dbec401cfce887d01f) Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: http://git-master/r/201642 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-09-14nfc: correct indentationRakesh Goyal
Bug 1190304 Reviewed-on: http://git-master/r/172799 (cherry picked from commit 684c496cd5c52dc49ba5a4ba66235b7a9260bdde) Change-Id: I42236ba8dad1e8e167920ed3521d8990a3a99fb0 Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-on: http://git-master/r/187417 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-09-14nfc: add support for brcm2079x driverAnita Kar
we have received this driver from BRCM support website. Pushing driver in original. Bug 1190304 Reviewed-on: http://git-master/r/172565 (cherry picked from commit 13def7b53c52f4c68f9d64c296ab0ac3810dc972) Change-Id: I56f7a3e1391a78db73ed91527e21f717d0f599b3 Signed-off-by: Anita Kar <akar@nvidia.com> Reviewed-on: http://git-master/r/187411 Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com> Tested-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-09-14drivers: nfc: pn544: Add 1ms delay after I2C read and writeMohan T
pn544 seems to be slow in handling I2C read/write requests. Even though pn544 acks the read/write but next operation fails. Bug: 915848 Bug: 914700 Bug: 914691 Bug: 915598 Change-Id: I7851d0d4b7c24810ad27f3e0fbd4542b52dc8a5e Signed-off-by: Mohan T <mohant@nvidia.com> Reviewed-on: http://git-master/r/72867 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rakesh Kumar <krakesh@nvidia.com> Reviewed-by: Alok Chauhan <alokc@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: Ra5ba478ae198bdbcc078f6f136bcfe554c8ba13a
2013-09-14nfc: control firmware download and nfc_enRakesh Goyal
control firmware download and VEN using gpio Bug 846684 Bug 873017 Change-Id: I58391ac60e1b9cf440a186c155f993c9293f8223 Reviewed-on: http://git-master/r/62702 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R74ce3100c395b696c347fce4b4c9f5913aae3717
2013-09-14driver: nfc: code clean-up to make it compilableRakesh Goyal
1. Code cleaning so it can compile 2. changes in pn544 driver to condition use of firmware download gpio bug 846684 bug 873017 Reviewed-on: http://git-master/r/57329 (cherry picked from commit ddde05ce297da3038a770d575bc27bdfe7444c35) Change-Id: I1381fca040bd4bcc51a6a6a43cd33297a697c27e Reviewed-on: http://git-master/r/62699 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R2b25ef5ee689076ebca99d13e5a23b1f0cc4da98
2013-09-14nfc: initial commit of pn544 nfc driverRakesh Goyal
Bug 846684 Bug 873017 Reviewed-on: http://git-master/r/55880 (cherry picked from commit 9ed3de486a47dfc8598e73157bccd76ff518048b) Change-Id: If85503592945bd5967e03ab429f5973dac0c65f7 Reviewed-on: http://git-master/r/62696 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R75e0a2682ffd4d007722eaabe19c9cb20d27a9b7
2013-05-21NFC: mei: Do not disable MEI devices from their remove routineSamuel Ortiz
Enabling and disabling device is exclusively handled by the mei_phy_ops. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-21NFC: mei_phy: Register event callback when enabling the deviceSamuel Ortiz
The callback registration starts a waiting read, so it needs to be fired everytime the device is enabled. Otherwise following writes will never get an answer back. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-21NFC: mei_phy depends on INTEL_MEISamuel Ortiz
INTEL_MEI_BUS_NFC never made it upstream, so make it depend on INTEL_MEI. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-16NFC: pn544: Add MEI physical layerSamuel Ortiz
With the new mei_phy NFC driver API, the pn544 MEI physical layer is minimal and similar to the microread one. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-16NFC: mei: Add a common mei bus API for NFC driversEric Lapuyade
This isolates the common code that is required to use an mei bus nfc device from an NFC HCI drivers. This prepares for future drivers for NFC chips connected behind an Intel Management Engine controller. The microread_mei HCI driver is also modified to use that common code. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Turn radio on and off when bringing the device up and downSamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add missing usb_put_devMarina Makienko
Add missing usb_put_dev on failure path in pn533_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Marina Makienko <makienko@ispras.ru> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Increase version numberWaldemar Rymarkiewicz
Major features added in 0.2 version: * frame ops added to support wider set of devices * support of ACS ACR122U Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Remove unused pn533_cmd_complete_tWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add pn533_abort_cmd procedureWaldemar Rymarkiewicz
pn533_abort_cmd() aborts last command sent to the controller and cancels already requested urb. As ACR122U does not support any mechanism (as ACK for standard PN533) which aborts last command this cannot be issued for this device. Otherwise, acr122u will behave in an unstable way. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add support for ACS ACR122U readerWaldemar Rymarkiewicz
ACS ACR122U is an USB NFC reader, PC/SC and CCID compilant, based on NXP PN532 chip. Internally, it's build of MCU, PN532 and an antenna. MCU makes the device CCID and PC/SC compilant and provide USB connection. In this achitecture, a host cannot talk directly to PN532 and must rely on MCU. Luckily, MCU exposes pseud-APDU through PC/SC Escape mechanism which let the host to transmit standard PN532 commands directly to PN532 chip with some limitations. The frame roughly looks like: CCID header | APDU header | PN532 header (pc_to_rdr_escape) | (pseudo apdu Direct Tramsmit) | (len, TFI, cmd, params) Accordign to limitations, ACR122U does't provide any mechanism to abort last issued command. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add protocol type for frame opsWaldemar Rymarkiewicz
As not all devices require ACK confirmation of every request sent to the controller, differentiate two protocol types. First one, request-ack-response and the second one request-response type. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Move wq_in_error to cmd contextWaldemar Rymarkiewicz
Rename 'wq_in_error' field to more relevant 'status' and move it to cmd context struct. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Re-group fields in struct pn533Waldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Avoid function declarationsWaldemar Rymarkiewicz
Reorder code to avoid functions declaration. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Simplify __pn533_send_frame_asyncWaldemar Rymarkiewicz
In all cases (send_cmd_async, send_data_async and send_sync) pn533_send_async_complete() handles all responses internally, so there is no need to pass this as a callback. Cmd context is passed to __pn533_send_frame_async in all the cases as well. It's already kept in struct pn533 which is available all the time the device is attached. So we can make use of it instead. Therefore, cmd_complete and cmd_complete_arg are no needed any more. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix incorrect kfree of complete argsWaldemar Rymarkiewicz
We must free 'cmd_complete_mi_arg' and not 'cmd_complete_arg' when getting send error handling fragmented response. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Remove redundant cmd_ prefix in the structWaldemar Rymarkiewicz
'cmd->code' looks better then 'cmd->cmd_code' Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Keep cmd context in pn533 structWaldemar Rymarkiewicz
Keep cmd context in pn533 struct instead of only cmd code. The context already includes cmd_code. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Optimise issued cmd context trackingWaldemar Rymarkiewicz
Use struct pn533_cmd instead of pn533_send_async_complete_arg to track the context of the issued cmd. This way pn533_send_async_complete_arg struct is no needed anymore. Just move issuer complete callback to pn533_cmd struct. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix memleak while scheduling next cmdWaldemar Rymarkiewicz
In case of error from __pn533_send_frame_async() while sending next cmd from the queue (cmd_wq), cmd->req, cmd->resp and cmd->arg pointers won't be freed. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Rename pn533_fw_reset appropriatelyWaldemar Rymarkiewicz
Define explicitely it is Pasori specific reset command. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Update copyrights noteWaldemar Rymarkiewicz
Remove duplicated authors info from the header as well. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix div by zero while stopping pollingWaldemar Rymarkiewicz
Depends on timing division by zero can happen when user stops polling. pn533_stop_poll() resets modulation counter on stop_poll, but meanwhile we get response for last poll request and try, despite of stop poll request, to schedule next modulation for polling. Log message: [345.922515] pn533 1-1.3:1.0: pn533_stop_poll [345.928314] pn533 1-1.3:1.0: pn533_send_ack [345.932769] pn533 1-1.3:1.0: Received a frame. [345.937438] PN533 RX: 00 00 ff 03 fd d5 4b 00 e0 00 [345.942840] pn533 1-1.3:1.0: pn533_poll_complete [345.947753] pn533 1-1.3:1.0: pn533_start_poll_complete [345.953186] Division by zero in kernel. [345.957244] [<c001b38c>] (unwind_backtrace+0x0/0xf0) [345.965698] [<c0260e78>] (Ldiv0+0x8/0x10) [345.974060] [<c0260e60>] (__aeabi_idivmod+0x8/0x18) [345.983978] [<c02e0064>] (pn533_poll_complete+0x3c0/0x500) [345.994903] [<c02df690>] (pn533_send_async_complete+0x7c/0xc0) [346.005828] [<c02e028c>] (pn533_wq_cmd_complete+0x1c/0x34) [346.016113] [<c005d134>] (process_one_work+0x1ac/0x57c) [346.025848] [<c005d85c>] (worker_thread+0x168/0x42c) [346.034576] [<c00620c0>] (kthread+0xa4/0xb0) Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Print out response status bits in hexWaldemar Rymarkiewicz
For better debugging as the codes are defined in hex in the spec. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Reword all std frame logic functWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Use dynamic debug for pn533 hex dumpsSamuel Ortiz
Those can be very verbose and we only want them when debugging pn533. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-01NFC: microread: Fix build failure due to a new MEI bus APISamuel Ortiz
uuid device_id field is removed and mei_device is renamed mei_cl_device. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-18Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/dvm/tx.c drivers/net/wireless/ti/wlcore/sdio.c drivers/net/wireless/ti/wlcore/spi.c
2013-02-11NFC: microread: Fix mei physical layerSamuel Ortiz
The MEI bus API changed according to the latest comments from the char-misc maintainers, and this patch fixes the microread mei physical layer code according to those changes: We pass the MEI id back to the probe routine, and the mei_driver takes a table of MEI ids instead of one static id. Also, mei_bus_driver got renamed to mei_driver, mei_bus_client to mei_device, and mei_bus_set/get_clientdata to mei_set/get_clientdata. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-08NFC: pn533: Fix target polling modeThierry Escande
Remove unneeded bitwise OR operator on uninitialized sk_buff data Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-08NFC: microread: Add MEI physical layerSamuel Ortiz
On some peculiar worlds, microreads are found hidden behind MEIs and needs to be accessed through the ME bus. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-03NFC: microread: Add i2c physical layerSamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-03NFC: Initial support for Inside Secure microreadEric Lapuyade
Inside Secure microread is an HCI based NFC chipset. This initial support includes reader and p2p (Target and initiator) modes. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-29nfc: pn533: Remove unreachable codeWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-29nfc: pn533: Use static poll_mod and std_frame_opsWaldemar Rymarkiewicz
These variables are not exported. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-28Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2013-01-13NFC: pn533: Fix bad allocation sizeThierry Escande
Use dereferenced pointer in sizeof instead of pointer itself. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix missing parenthesisWaldemar Rymarkiewicz
This is a quite critical patch as it fixes potential reference to undefined general_bytes which were never set correctly on target activation due to missing parenthesis. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Initial Secure Element APISamuel Ortiz
Each NFC adapter can have several links to different secure elements and that property needs to be exported by the drivers. A secure element link can be enabled and disabled, and card emulation will be handled by the currently active one. Otherwise card emulation will be host implemented. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Use devm_kzalloc APISamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>