aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-08-20nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC ChipRobert Baldyga11-0/+1532
Add driver for Samsung S3FWRN5 NFC controller. S3FWRN5 is using NCI protocol and I2C communication interface. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-19NFC: trf7970a: Add NULL check to clear up smatch warningMark Greer1-1/+3
Although it should be unnecessary, add a NULL pointer check to trf7970a_send_upstream() to eliminate a smatch warning. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-19NFC: trf7970a: SDD_EN is bit 5 not bit 3Mark Greer1-1/+1
The SDD_EN bit in the NFC Target Detection Level Register is bit 5 not bit 3 so change the TRF7970A_NFC_TARGET_LEVEL_SDD_EN macro accordingly. Reported-by: Raymond Lei <Raymond.Lei@ecolab.com> Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Remove pr_err in rcv_queue when ndlc header is unknownChristophe Ricard1-1/+0
spi phy needs to use ndlc_recv at every spi transaction causing "unknown packet control byte" error message each time the header is 00. Make this silent. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Add spi phy support for st21nfcbChristophe Ricard3-0/+406
st21nfcb does support another phy than i2c: spi. st21nfcc does not support spi as the spi ios are used by the AMS RF booster. st21nfcb is not following NCI NFC Forum recommendations for spi but rely on ST prioritary protocol ndlc as for i2c. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Free data with irrelevant NDLC PCB_SYNC valueChristophe Ricard1-1/+3
PCB_SYNC different than PCB_TYPE_SUPERVISOR or PCB_TYPE_DATAFRAME should be discarded. Irrelevant data may be forwarded up to the ndlc state machine by phys like spi to prevent missing potential data during "write" transactions. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Remove data from ack_pending_q when receiving a SYNC_ACKChristophe Ricard1-0/+2
When receiving a NDLC PCB_SYNC_ACK the pending data was never removed from ack_pending_q and cleared. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17NFC: st-nci: fix use of uninitialized variables in error pathChristophe Ricard1-4/+4
st_nci_hci_load_session() calls kfree_skb() on unitialized variables skb_pipe_info and skb_pipe_list if the call to nci_hci_connect_gate() failed. Reword the error path to not use these variables when they are not initialized. While at it, there seemed to be a memory leak because skb_pipe_info was only freed once, after the for-loop, even though several ones were created by nci_hci_send_cmd. Cc: stable@vger.kernel.org Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17NFC: st21nfca: fix use of uninitialized variables in error pathChristophe Ricard1-5/+6
st21nfca_hci_load_session() calls kfree_skb() on unitialized variables skb_pipe_info and skb_pipe_list if the call to nfc_hci_connect_gate() failed. Reword the error path to not use these variables when they are not initialized. While at it, there seemed to be a memory leak because skb_pipe_info was only freed once, after the for-loop, even though several ones were created by nfc_hci_send_cmd. Fixes: ec03ff1a8f9a ("NFC: st21nfca: Remove skb_pipe_list and skb_pipe_info useless allocation") Cc: stable@vger.kernel.org Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Fix non accurate comment for st_nci_i2c_readChristophe Ricard1-7/+2
Due to a copy and paste error st_nci_i2c_read still contains st21nfca header comment. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Fix typo when changing from st21nfcb to st-nciChristophe Ricard1-9/+9
Replace ST21NFCB with ST_NCI or st21nfcb with st_nci as it was forgotten in commit "nfc: st-nci: Rename st21nfcb to st-nci" ed06aeefdac348cfb91a3db5fe1067e3202afd70 Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-08-17nfc: st-nci: Remove duplicate file platform_data/st_nci.hChristophe Ricard1-1/+1
commit "nfc: st-nci: Rename st21nfcb to st-nci" adds include/linux/platform_data/st_nci.h duplicated with include/linux/platform_data/st-nci.h. Only drivers/nfc/st-nci/i2c.c uses platform_data/st_nci.h. Cc: stable@vger.kernel.org Reported-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-26Merge tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds4-36/+301
Pull char/misc driver updates from Greg KH: "Here's the big char/misc driver pull request for 4.2-rc1. Lots of mei, extcon, coresight, uio, mic, and other driver updates in here. Full details in the shortlog. All of these have been in linux-next for some time with no reported problems" * tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (176 commits) mei: me: wait for power gating exit confirmation mei: reset flow control on the last client disconnection MAINTAINERS: mei: add mei_cl_bus.h to maintained file list misc: sram: sort and clean up included headers misc: sram: move reserved block logic out of probe function misc: sram: add private struct device and virt_base members misc: sram: report correct SRAM pool size misc: sram: bump error message level on unclean driver unbinding misc: sram: fix device node reference leak on error misc: sram: fix enabled clock leak on error path misc: mic: Fix reported static checker warning misc: mic: Fix randconfig build error by including errno.h uio: pruss: Drop depends on ARCH_DAVINCI_DA850 from config uio: pruss: Add CONFIG_HAS_IOMEM dependence uio: pruss: Include <linux/sizes.h> extcon: Redefine the unique id of supported external connectors without 'enum extcon' type char:xilinx_hwicap:buffer_icap - change 1/0 to true/false for bool type variable in function buffer_icap_set_configuration(). Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion parport: check exclusive access before register w1: use correct lock on error in w1_seq_show() ...
2015-06-13NFC: nfcmrvl: set PB_BAIL_OUT at setupVincent Cuissard2-0/+9
PB_BAIL_OUT parameter as to be set to one. This is needed because digital protocol 1.0 is used in combination with ISO15693 protocol. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-13NFC: nfcmrvl: Allow ISO15693 protocolVincent Cuissard1-0/+1
Reference Marvell NFC controller as ISO15693 capable. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-13NFC: nfcmrvl: small fix in USB driverVincent Cuissard1-0/+1
Marvell NFC USB driver has to be updated to follow new multi PHY driver interface. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: add UART driverVincent Cuissard4-0/+246
Add support of Marvell NFC chip controlled over UART Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: add platform_data and DT configurationVincent Cuissard3-26/+82
Declare nfcmrvl platform_data structure and few DT parameters for nfcmrvl driver. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: add chip reset managementVincent Cuissard2-0/+38
Low level driver can specify a GPIO that will be used to reset the chip. Thanks to this the driver can ensure the state of the device at init. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: update USB device idVincent Cuissard1-1/+2
Device ID was not restrictive enough. This patch select the USB device with the full device and interface characteristics. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: update nci recv frame APIVincent Cuissard3-16/+23
Update internal nci recv frame API to use skbuff phy management to generic part of the driver. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: add support of HCI-based transportVincent Cuissard3-4/+52
In some configuration NCI packet can be encapsulated in HCI packets. This patch had the support of this. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-11NFC: nfcmrvl: remove integration related settingsVincent Cuissard1-9/+0
These settings are related to a specific integration that requires the firmware to drive some GPIOs for external RF coexistency. Since this is really linked to specific hardware integration let's remove them. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-10nfc: st-nci: Rename st21nfcb to st-nciChristophe Ricard15-544/+547
STMicroelectronics NFC NCI chips family is extending with the new ST21NFCC using the AMS AS39230 RF booster. The st21nfcb driver is relevant for this solution and might be with future products. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Configure CLF with NCI proprietary commandChristophe Ricard3-1/+29
In order to prevent any NFC feature when NFC is disable and to save power, (down to 4uA) put the CLF in hibernate mode with RF deactivated. Add the equivalent to enable the NFC feature when initiating the st21nfcb driver. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: disable irq when st21nfcb is disabledChristophe Ricard1-4/+4
When st21nfcb is disabled, the irq line may remain active while no data are available, flooding the system with irrelevant i2c transaction. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Move powered flag from phy to ndlc layerChristophe Ricard3-5/+5
The powered flag can be set from the ndlc_open and ndlc_close layer. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Move st21nfcb_nci_remove in ndlc_removeChristophe Ricard1-2/+2
Removing st21nfcb may need to execute some specific commands before stopping the ndlc state machine. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Add support for nci proprietary commandsChristophe Ricard2-0/+27
On st21nfcb, nci proprietary commands are available to run specific chip operations (for example: power management) Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Fix st21nfcb_nci_closeChristophe Ricard1-1/+3
When closing st21nfcb driver, flag ST21NFCB_NCI_RUNNING can be cleared only once the ndlc and the transport (i2c or spi) layers are released. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Add ndlc_close in st21nfcb_nci_removeChristophe Ricard1-0/+4
In order to release the st21nfcb properly close the ndlc layer first. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: remove st21nfcb_nci_i2c_disableChristophe Ricard1-3/+0
ndlc_remove already calls st21nfcb_nci_i2c_disable and phy->powered is already set to 0. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Do not remove header once the payload is sentChristophe Ricard1-7/+0
Once the data is sent, we need to preserve the full frame for the ndlc state machine. If the NDLC ACK is not received in time, the ndlc layer will resend the same frame. Having the header byte pulled will corrupt the frame. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: st21nfcb: Remove inappropriate kfree on a devm_kzalloc pointerFiro Yang1-3/+0
Since ndev->driver_data is allocated by devm_kzalloc(), we do not need the inappropriate kfree to free it in driver's remove function. Freeing will trigger when driver unloads. Cc: stable@vger.kernel.org Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Firo Yang <firogm@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: pn544: use flags argument of devm_gpiod_get to set directionUwe Kleine-König1-32/+11
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Use this to simplify the driver. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. While touching this also do some minor coding style fixes. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: microread: drop unused variableTomas Winkler1-3/+0
In microread_i2c_irq_thread_fn 'client' set but not used Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-09NFC: Remove obsolete setting of DEBUGValentin Rothberg2-4/+0
CONFIG_DYNAMIC_DEBUG is the right toggle to enable pr_debug(). Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-08NFC: trf7970a: Handle extra byte in response to Type 5 RMB commandsMark A. Greer1-4/+19
The current versions of the trf7970a has an erratum where it returns an extra byte in the response to 'Read Multiple Block' (RMB) commands. This command is issued to Type 5 tags (i.e., ISO/IEC 15693 tags) by the neard daemon. To handle this, define a new Device Tree property, 't5t-rmb-extra-byte-quirk', which indicates that the associated trf7970a device has this erratum. The trf7970a device driver will then ensure that the response length to RMB commands is reduced by one byte (for devices with the erratum). Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-08NFC: nxp-nci: Fix build warningSamuel Ortiz1-0/+1
When GPIO is not enabled we hit this kind of warning: drivers/nfc/nxp-nci/i2c.c: In function 'nxp_nci_i2c_acpi_config': drivers/nfc/nxp-nci/i2c.c:320:2: error: implicit declaration of function 'devm_gpiod_get_index' [-Werror=implicit-function-declaration] gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2); This is fixed by explicitely including gpio/consumer.h. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-06-08NFC: nxp-nci_i2c: Add support for enumerating through ACPIOleg Zhurakivskyy1-0/+51
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-05-31mei: fix up uuid matchingGreg Kroah-Hartman1-1/+1
A previous commit, c93b76b34b4d ("mei: bus: report also uuid in module alias") caused a build error as I missed applying a needed patch to add some macros to uapi/linux/uuid.h. Instead of those additional macros, change the mei code to use the existing uuid structure directly. Fixes: c93b76b34b4d Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24NFC: mei_phy: adjust mei nfc header according the specTomas Winkler1-27/+31
1. mei_nfc_hci_hdr and mei_nfc_hdr are just the same thing so drop one 2. use mei_nfc_hdr structure as the member of the command and the reply instead of replicating all header fields. 3. dump the header for easier debugging Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24NFC: mei_phy: move all nfc logic from mei driver to nfcTomas Winkler2-35/+293
move nfc logic to mei_phy module, we prefer as much as possible not to deal with a particualr client protocol in the mei generic infrasutcutre Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24mei: bus: report also uuid in module aliasTomas Winkler3-2/+5
In order to automate modules matching add device uuid which is reported in client enumeration, keep also the name that is needed in for nfc distinguishing radio vendor Report mei:name:uuid Cc: linux-api@vger.kernel.org Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-07NFC: logging neateningJoe Perches8-43/+36
Add missing terminating newlines to nfc_info and nfc_err to avoid possible interleaving from other messages. Miscellanea: o typo fix of "unknonwn" in message o remove unnecessary OOM messages as there's a generic dump_stack() o realign arguments Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-04-06NFC: pn533: fix error return codeJulia Lawall1-1/+3
Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-04-06NFC: nxp-nci: Release firmware when switching to FW mode failsSamuel Ortiz1-1/+3
In that case, the firmware work will never be scheduled, will never complete and thus the firmware will never be released. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-04-06NFC: nxp-nxi: Remove useless fw pointer checkSamuel Ortiz1-2/+1
It request_firmware returns 0, the request succeeded and the firmware pointer is valid. No need to check for it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-04-06nfc: st21nfca: Add additional comments about EVT_TRANSACTIONChristophe Ricard1-1/+10
Add comments about HCI EVT_TRANSACTION in order to make the code understandable by other readers. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-04-06nfc: st21nfcb: Add additional comments about EVT_TRANSACTIONChristophe Ricard1-1/+8
Add comments about HCI EVT_TRANSACTION in order to make the code understandable by other readers. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>