aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc/pn544 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-05-01nfc: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2016-03-03NFC: pn544: Drop two useless checks in ACPI probe pathMika Westerberg1-13/+1
When pn544_hci_i2c_acpi_request_resources() gets called we already know that the entries in ->acpi_match_table have matched ACPI ID of the device. In addition I2C client pointer cannot be NULL in any case (otherwise I2C core would not call ->probe() for the driver in the first place). Drop the two useless checks from the driver. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-12-29nfc: pn544: Remove i2c client gpio irq configurationChristophe Ricard1-34/+1
gpio irq is already configured by the core i2c layers when reaching the probe function Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-12-29nfc: pn544: Remove #ifdef CONFIG_OFChristophe Ricard1-11/+0
All of_* APIs are safe if CONFIG_OF is not define. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-11-04Merge tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds1-7/+7
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver update for 4.4-rc1. Lots of different driver and subsystem updates, hwtracing being the largest with the addition of some new platforms that are now supported. Full details in the shortlog. All of these have been in linux-next for a long time with no reported issues" * tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (181 commits) fpga: socfpga: Fix check of return value of devm_request_irq lkdtm: fix ACCESS_USERSPACE test mcb: Destroy IDA on module unload mcb: Do not return zero on error path in mcb_pci_probe() mei: bus: set the device name before running fixup mei: bus: use correct lock ordering mei: Fix debugfs filename in error output char: ipmi: ipmi_ssif: Replace timeval with timespec64 fpga: zynq-fpga: Fix issue with drvdata being overwritten. fpga manager: remove unnecessary null pointer checks fpga manager: ensure lifetime with of_fpga_mgr_get fpga: zynq-fpga: Change fw format to handle bin instead of bit. fpga: zynq-fpga: Fix unbalanced clock handling misc: sram: partition base address belongs to __iomem space coresight: etm3x: adding documentation for sysFS's cpu interface vme: 8-bit status/id takes 256 values, not 255 fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000 ARM: zynq: dt: Updated devicetree for Zynq 7000 platform. ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager. ver_linux: proc/modules, limit text processing to 'sed' ...
2015-10-19NFC: pn544: Auto-select core moduleJean Delvare1-11/+7
As I understand it, the core nfc_pn544 module is useless without either the I2C or the MEI access module. So hide NFC_PN544 and select it automatically if either NFC_PN544_I2C or NFC_PN544_MEI is selected. This avoids presenting NFC_PN544 when neither NFC_PN544_I2C nor NFC_PN544_MEI can be selected. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-09-20mei: bus: use mei_cldev_ prefix for the API functionsTomas Winkler1-3/+3
Use mei_cldev_ prefix for all mei client bus api functions in order to resolve prefix conflict with functions that handle client function and are defined in client.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-20mei: bus: complete variable rename of type struct mei_cl_deviceTomas Winkler1-4/+4
In the commit 5c079ae11921 ("mei: bus: fix drivers and devices names confusion") we set the variables of type struct mei_cl_device to 'cldev' but few places were left out, namely mei_cl_bus.h header and the mei nfc drivers. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-20mei: bus: add client protocol version to the device aliasTomas Winkler1-1/+1
The device alias now looks like mei:S:uuid:N:* In that way we can bind different drivers to clients with different protocol versions if required. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-26Merge tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds1-1/+1
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-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-05-24mei: bus: report also uuid in module aliasTomas Winkler1-1/+1
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 Perches1-5/+2
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-01-28NFC: Add ACPI support for NXP PN544Robert Dolca1-2/+109
Currently there is no support for ACPI. This patch uses the following configuration: - Device id: NXP5440 - Pin mapping: - 0 IRQ pin - 1 enable pin - 2 firmware pin Signed-off-by: Robert Dolca <robert.dolca@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-01-28NFC: PN544: GPIO access that may sleepRobert Dolca1-10/+12
gpio_set_value was replaced with gpio_set_value_cansleep in order to allow GPIO access that may sleep. This is particularelly useful when GPIO is accessed using busses like I2C, SPI, USB Signed-off-by: Robert Dolca <robert.dolca@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-01-28NFC: pn544: Change event_received gate parameter to pipeChristophe Ricard1-1/+2
The below event_received hci handler has change the gate parameter to pipe. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
2014-11-28NFC: Don't include linux/unaligned/access_ok.hJohannes Berg1-1/+1
This is a specific implementation, <asm/unaligned.h> is the multiplexer that has the arch-specific knowledge of which of the implementations needs to be used, so include that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-04-22NFC: pn544_i2c: Fix null pointer exception when not using platform dataClement Perrochaud1-1/+5
Fixes a null pointer exception occurring when the IRQ request in pn544_hci_i2c_probe fails and no platform data is available. Signed-off-by: Clément Perrochaud <clement.perrochaud@nxp.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-04-22NFC: pn544: i2c: Add device-tree (Open Firmware) support to PN544Clement Perrochaud1-17/+131
Add functions to recover hardware resources from the device-tree when not provided by the platform data. Signed-off-by: Clément Perrochaud <clement.perrochaud@nxp.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16NFC: pn544: i2c: Support PN544 C3 secure firmware downloadArron Wang1-6/+174
PN544 C3 firmwares already contain the command frames to be sent, but as they may exceed the i2c maximum payload, we need to fragment them into secure chunks and send them through the secure write command. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16NFC: pn544: Pass hardware variant information when downloading firmwareArron Wang3-3/+16
Different pn544 hardware variant may use different commands to download new firmwares. The C2 does a regular firmware download while the C3 uses a more secure protocol. As a consequence we need to pass the hardware variant from the HCI SW version command reply down to the pn544 i2c layer, in order to use the right protocol at run time. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-01-04NFC: pn544: Refactor hw_config valuesArman Uguray1-24/+24
Some of the EEPROM configurations that are assigned by the PN544 driver are set by the firmware and should not be modified by the driver. Others are certain user mode configurations that are currently getting set to values that shouldn't necessarily be dictated by the driver. This patch changes most user and system mode configurations to the firmware defaults. Signed-off-by: Arman Uguray <armansito@chromium.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-12-11nfc: Fix FSF address in file headersJeff Kirsher4-12/+4
Several files refer to an old address for the Free Software Foundation in the file header comment. Resolve by replacing the address with the URL <http://www.gnu.org/licenses/> so that we do not have to keep updating the header comments anytime the address changes. CC: linux-wireless@vger.kernel.org CC: Lauro Ramos Venancio <lauro.venancio@openbossa.org> CC: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> CC: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-25NFC: Standardize logging styleJoe Perches2-29/+26
Use standardized styles to minimize coding defects. Always use nfc_<level> where feasible. Add \n to formats where appropriate. Typo "it it" correction. Add #define pr_fmt where appropriate. Remove function tracing logging messages. Remove OOM messages. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-09-25NFC: pn544: Add SE enable/disable operationArron Wang1-7/+79
To enable the UICC secure element, we first enable the UICC gate list in order for the SE to be able to use all RF technologies. For the embedded SE, we just turn the eSE default mode to ON. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-09-25NFC: pn544: Add SE discover operationArron Wang1-0/+30
For the SWP secure element, we send the proprietary SELF_TEST_SWP command and check the response. For the WI secure element, we simply try to switch to the default embedded SE mode. If that works, it means we have an embedded SE. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-14NFC: pn544: i2c: Add firmware download implementation for pn544Eric Lapuyade1-12/+334
The pn544 can enter a firmware update mode where firmware blobs can be pushed through the i2c line and flashed on the target. A special command allows to verify that blobs are correctly flashed and this is what we do for every downloaded firmware blob. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-14NFC: pn544: Add firmware operations hci opsEric Lapuyade4-4/+21
The firmware operation callback is passed by the physical layer to the hci driver during probe. All the driver does is to store it and call it when the fw_upload hci ops is invoked. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-14NFC: pn544: i2c: Add firmware download mode power-on supportEric Lapuyade3-6/+14
This is in preparation for pn544-i2c firmware download feature, where we need to know if we're in regular or firmware upload mode. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-14NFC: Remove the static supported_se fieldSamuel Ortiz1-4/+2
Supported secure elements are typically found during a discovery process initiated when the NFC controller is up and running. For a given NFC chipset there can be many configurations (embedded SE or not, with or without a SIM card wired to the NFC controller SWP interface, etc...) and thus driver code will never know before hand which SEs are available. So we remove this field, it will be replaced by a real SE discovery mechanism. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-14NFC: pn544: Remove Felica and Jewel device presence checkArron Wang1-6/+3
There is no builtin command for driver to check the presence of Felica and Jewel device, it is more reasonable for the userspace daemon neard to build seperate commands to check the presence of the card. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-14NFC: pn544: Identify Type F NFC-DEP through NFCID2Arron Wang1-10/+15
NFCID2 is defined as the first 2 manufacturer ID (IDm) bytes. NFC DEP (NFC peer to peer) devices Type-F NFCID2 must start with 0x01fe according to the NFC Digital Specification. By checking those first 2 bytes we send the right command either to the reader gate when NFCID2 != 0x1fe (The NFC tag case) or to the NFCIP1 gate when seeing an NFC DEP device (The NFC peer to peer case). Without this fix, Felica (Type F) tags are not properly detected with this driver. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-21NFC: mei: Do not disable MEI devices from their remove routineSamuel Ortiz1-2/+0
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 Ortiz1-13/+5
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-04-16NFC: pn544: Add MEI physical layerSamuel Ortiz3-1/+135
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-01-28Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville4-62/+75
2013-01-10NFC: Initial Secure Element APISamuel Ortiz1-2/+4
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 Ortiz1-14/+6
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Use module_i2c_driverSamuel Ortiz1-23/+1
The pn544 init routine does nothing but adding the driver to the i2c bus. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Separate the core code and the i2c one into different modulesSamuel Ortiz3-2/+32
As we may need to support other physical layers, we can avoid linking the core part into each and every pn544 module. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Add HCI quirks to support driver (non)standard implementationsEric Lapuyade1-1/+1
Some chips diverge from the HCI spec in their implementation of standard features. This adds a new quirks parameter to nfc_hci_allocate_device() to let the driver indicate its divergence. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Fixed skb leak in tm_send() nfc and hci ops implementationsEric Lapuyade1-2/+8
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Changed event_received hci ops result semanticEric Lapuyade1-5/+11
Some chips use a standard HCI event code, destined to a proprietary gate, with a different meaning. Therefore, the HCI driver must always have a chance to intercept the event before standard processing is attempted. The new semantic specifies that the result value "1" means that the driver doesn't especially handle the event. result <= 0 means it was handled. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Added error handling in event_received hci opsEric Lapuyade1-14/+13
There is no use to return an error if the caller doesn't get it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-03Drivers: misc: remove __dev* attributes.Greg Kroah-Hartman1-4/+4
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-19NFC: Move pn544.h to linux/platform_data/Marcel Holtmann1-1/+1
The pn544.h just provides the platform data struct and defines and nothing else. So move it to to linux/platform_data/ now. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-10-26NFC: Fix sparse warnings due to missing staticArron Wang1-2/+2
Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-10-26NFC: Separate pn544 hci driver in HW dependant and independant partsEric Lapuyade4-0/+1401
The driver now has all HCI stuff isolated in one file, and all the hardware link specifics in another. Writing a pn544 driver on top of another hardware link is now just a matter of adding a new file for that new hardware specifics. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>