summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn544/i2c.c
AgeCommit message (Collapse)Author
2016-05-01nfc: Drop owner assignment from i2c_driverKrzysztof Kozlowski
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 Westerberg
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 Ricard
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 Ricard
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-06-08NFC: pn544: use flags argument of devm_gpiod_get to set directionUwe Kleine-König
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-04-07NFC: logging neateningJoe Perches
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 Dolca
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-27NFC: PN544: GPIO access that may sleepRobert Dolca
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>
2014-11-28NFC: Don't include linux/unaligned/access_ok.hJohannes Berg
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-21NFC: pn544_i2c: Fix null pointer exception when not using platform dataClement Perrochaud
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-21NFC: pn544: i2c: Add device-tree (Open Firmware) support to PN544Clement Perrochaud
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 Wang
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 Wang
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>
2013-12-11nfc: Fix FSF address in file headersJeff Kirsher
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-24NFC: Standardize logging styleJoe Perches
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-08-13NFC: pn544: i2c: Add firmware download implementation for pn544Eric Lapuyade
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-13NFC: pn544: Add firmware operations hci opsEric Lapuyade
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-13NFC: pn544: i2c: Add firmware download mode power-on supportEric Lapuyade
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-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-09NFC: pn544: Use devm_kzalloc APISamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-09NFC: pn544: Use module_i2c_driverSamuel Ortiz
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-03Drivers: misc: remove __dev* attributes.Greg Kroah-Hartman
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 Holtmann
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: Separate pn544 hci driver in HW dependant and independant partsEric Lapuyade
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>