summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NFC: nfcmrvl: Allow ISO15693 protocolVincent Cuissard2015-06-131-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>
* NFC: nfcmrvl: small fix in USB driverVincent Cuissard2015-06-131-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>
* NFC: nfcmrvl: add UART driverVincent Cuissard2015-06-117-1/+284
| | | | | | | 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>
* NFC: nfcmrvl: add platform_data and DT configurationVincent Cuissard2015-06-114-26/+113
| | | | | | | | 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>
* NFC: nci: add generic uart supportVincent Cuissard2015-06-116-0/+554
| | | | | | | | | | | | | | | | | Some NFC controller supports UART as host interface. As with SPI, a lot of code can be shared between vendor drivers. This patch add the generic support of UART and provides some extension API for vendor specific needs. This code is strongly inspired by the Bluetooth HCI ldisc implementation. NCI UART vendor drivers will have to register themselves to this layer via nci_uart_register. Underlying tty will have to be configured from user land thanks to an ioctl. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nfcmrvl: add chip reset managementVincent Cuissard2015-06-112-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>
* NFC: nfcmrvl: update USB device idVincent Cuissard2015-06-111-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>
* NFC: nfcmrvl: update nci recv frame APIVincent Cuissard2015-06-113-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>
* NFC: nfcmrvl: add support of HCI-based transportVincent Cuissard2015-06-113-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>
* NFC: nfcmrvl: remove integration related settingsVincent Cuissard2015-06-111-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>
* nfc: st-nci: Rename st21nfcb to st-nciChristophe Ricard2015-06-1018-553/+585
| | | | | | | | | | 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>
* NFC: nci: Export nci_req_completeSamuel Ortiz2015-06-101-0/+1
| | | | | | Drivers implementing proprietary ops may need it now. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: netlink: Implement vendor command supportSamuel Ortiz2015-06-092-0/+65
| | | | | | | | | | | | | | | | Vendor commands are passed from userspace through the NFC_CMD_VENDOR netlink command, allowing driver and hardware specific operations implementations like for example RF tuning or production line calibration. Drivers will associate a set of vendor commands to a vendor id, which could typically be an OUI. The netlink kernel implementation will try to match the received vendor id and sub command attributes with the registered ones. When such match is found, the driver defined sub command routine is called. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Introduce vendor commands structuresSamuel Ortiz2015-06-093-0/+36
| | | | | | | | | | | | | Together with inline routines to associate a vendor commands array with an NFC device. Vendor commands allow vendors to implement their very specific operations from driver code instead of adding new stack ops for non NFC generic commands. Vendors need to select their own unique IDs and use that as a namespace for defining sub commands. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: st21nfcb: Configure CLF with NCI proprietary commandChristophe Ricard2015-06-093-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>
* NFC: st21nfcb: disable irq when st21nfcb is disabledChristophe Ricard2015-06-091-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>
* NFC: st21nfcb: Move powered flag from phy to ndlc layerChristophe Ricard2015-06-093-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>
* NFC: st21nfcb: Move st21nfcb_nci_remove in ndlc_removeChristophe Ricard2015-06-091-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>
* NFC: nci: Move close ops call in nci_close_deviceChristophe Ricard2015-06-091-4/+6
| | | | | | | | | When closing the device some data (proprietary commands) might be sent. The core state machine needs to be set for correct command execution. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: st21nfcb: Add support for nci proprietary commandsChristophe Ricard2015-06-092-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>
* NFC: st21nfcb: Fix st21nfcb_nci_closeChristophe Ricard2015-06-091-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>
* NFC: st21nfcb: Add ndlc_close in st21nfcb_nci_removeChristophe Ricard2015-06-091-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>
* NFC: st21nfcb: remove st21nfcb_nci_i2c_disableChristophe Ricard2015-06-091-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>
* NFC: st21nfcb: Do not remove header once the payload is sentChristophe Ricard2015-06-091-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>
* NFC: st21nfcb: Remove inappropriate kfree on a devm_kzalloc pointerFiro Yang2015-06-091-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>
* NFC: nci: Add nci_prop_cmd allowing to send proprietary nci cmdChristophe Ricard2015-06-092-0/+28
| | | | | | | | Handle allowing to send proprietary nci commands anywhere in the nci state machine. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nci: Add nci init ops for early device initializationChristophe Ricard2015-06-092-2/+8
| | | | | | | | Some device may need to execute some proprietary commands in order to "wake-up"; Before the nci state initialization. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nci: Add NCI_RESET return code check before setupChristophe Ricard2015-06-091-2/+3
| | | | | | | setup was executed in any case, even if NCI_RESET failed. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nci: Handle proprietary response and notificationsSamuel Ortiz2015-06-094-0/+86
| | | | | | | | Allow for drivers to explicitly define handlers for each proprietary notifications and responses they expect to support. Reviewed-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nci: hci: Fix releasing uninitialized skbsJoe Perches2015-06-091-8/+3
| | | | | | | | | | | | | Several of these goto exit; uses should be direct returns as skb is not yet initialized by nci_hci_get_param(). Miscellanea: o Use !memcmp instead of memcmp() == 0 o Remove unnecessary goto from if () {... goto exit;} else {...} exit: Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: pn544: use flags argument of devm_gpiod_get to set directionUwe Kleine-König2015-06-091-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>
* NFC: microread: drop unused variableTomas Winkler2015-06-091-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>
* NFC: Remove obsolete setting of DEBUGValentin Rothberg2015-06-092-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>
* NFC: trf7970a: Handle extra byte in response to Type 5 RMB commandsMark A. Greer2015-06-082-4/+23
| | | | | | | | | | | | | | | | 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>
* NFC: Fix typo in nfc-hci.txtMasanari Iida2015-06-081-1/+1
| | | | | | | This patch fix a spelling typo in nfc-hci.txt Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nxp-nci: Fix build warningSamuel Ortiz2015-06-081-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>
* NFC: nxp-nci_i2c: Add support for enumerating through ACPIOleg Zhurakivskyy2015-06-081-0/+51
| | | | | Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* net: phy: bcm7xxx: update workaround to fix 100BaseT corner casesFlorian Fainelli2015-06-081-2/+5
| | | | | | | | | Update the AFE_TX_CONFIG value to solve marginal rise/fall issues observed when the link is operating in 100BaseT. This workaround applies to GPHY revisions D0, E0 and newer. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'phy-micrel'David S. Miller2015-06-081-15/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jaeden Amero says: ==================== net/phy: micrel: Center FLP timing at 16ms In v2, we add an additional cleanup commit to make an array of strings static const and to improve const correctness generally. We also no longer unnecessarily initialize the result variable in ksz9031_center_flp_timing(). In v3, we remove the unnecessary result variable from ksz9031_config_init() introduced by a previous version of "net/phy: micrel: Center FLP timing at 16ms". In v4, we modify the commit message of "net/phy: micrel: Center FLP timing at 16ms" to replace the awkward quotation of the data sheet's programming procedure with an explanation of why we program the FLP burst registers and restart auto-negotiation where we do (config_init). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * net/phy: micrel: Center FLP timing at 16msJaeden Amero2015-06-081-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Link failures have been observed when using the KSZ9031 with HP 1810-8G and HP 1910-8G network switches. Center the FLP timing at 16ms to help avoid intermittent link failures. >From the KSZ9031RNX and KSZ9031MNX data sheets revision 2.2, section "Auto-Negotiation Timing": The KSZ9031[RNX or MNX] Fast Link Pulse (FLP) burst-to-burst transmit timing for Auto-Negotiation defaults to 8ms. IEEE 802.3 Standard specifies this timing to be 16ms +/-8ms. Some PHY link partners need to receive the FLP with 16ms centered timing; otherwise, there can be intermittent link failures and long link-up times. The PHY data sheet recommends configuring the FLP burst registers after power-up/reset and immediately thereafter restarting auto-negotiation, so we center the FLP timing at 16ms and then restart auto-negotiation in the config_init for KSZ9031. Signed-off-by: Jaeden Amero <jaeden.amero@ni.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net/phy: micrel: Comment MMD address of extended registersJaeden Amero2015-06-081-0/+1
| | | | | | | | | | | | | | | | There are some defines for a few pad skew related extended registers. Specify for which MMD Address (dev_addr) they are for. Signed-off-by: Jaeden Amero <jaeden.amero@ni.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net/phy: micrel: Be more const correctJaeden Amero2015-06-081-14/+15
|/ | | | | | | | | | | In a few places in this driver, we weren't using const where we could have. Use const more. In addition, change the arrays of strings in ksz9031_config_init() to be not only const, but also static. Signed-off-by: Jaeden Amero <jaeden.amero@ni.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* fib_trie: coding style: Use pointer after checkFiro Yang2015-06-071-8/+13
| | | | | | | | | | | | | | | | | | | | As Alexander Duyck pointed out that: struct tnode { ... struct key_vector kv[1]; } The kv[1] member of struct tnode is an arry that refernced by a null pointer will not crash the system, like this: struct tnode *p = NULL; struct key_vector *kv = p->kv; As such p->kv doesn't actually dereference anything, it is simply a means for getting the offset to the array from the pointer p. This patch make the code more regular to avoid making people feel odd when they look at the code. Signed-off-by: Firo Yang <firogm@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* wan: dscc4: use msecs_to_jiffies for conversionsNicholas Mc Guire2015-06-071-3/+3
| | | | | | | | | | | | | | | | | | API compliance scanning with coccinelle flagged: ./drivers/net/wan/dscc4.c:1036:1-33: WARNING: timeout (10) seems HZ dependent ./drivers/net/wan/dscc4.c:554:2-34: WARNING: timeout (10) seems HZ dependent ./drivers/net/wan/dscc4.c:599:2-34: WARNING: timeout (10) seems HZ dependent Numeric constants passed to schedule_timeout_*() make the effective timeout HZ dependent which does not seem to be the intent here. Fixed up by converting the constant to jiffies with msecs_to_jiffies(), passing 100ms (assuming HZ==100 in the original code). Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* cosa: use msecs_to_jiffies for conversionsNicholas Mc Guire2015-06-071-1/+1
| | | | | | | | | | | | | API compliance scanning with coccinelle flagged: ./drivers/net/wan/cosa.c:520:2-18: WARNING: timeout (30) seems HZ dependent Numeric constants passed to schedule_timeout() make the effective timeout HZ dependent which makes little sense in a device probe. Fixed up by converting the constant to jiffies with msecs_to_jiffies() Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/mlx5_core: Fix static checker warnings around system guid query flowMajd Dibbiny2015-06-073-3/+4
| | | | | | | | | Fix static checker warnings in the flow of system guid query. Fixes: 707c4602cda6 ('net/mlx5_core: Add new query HCA vport commands') Signed-off-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn/hisax: Convert use of __constant_cpu_to_le16 to cpu_to_le16Vaishali Thakkar2015-06-071-2/+2
| | | | | | | | | | | | | | | | | | | In big endian cases, macro cpu_to_le16 unfolds to __swab16 which provides special case for constants. In little endian cases, __constant_cpu_to_le16 and cpu_to_le16 expand directly to the same expression. So, replace __constant_cpu_to_le16 with cpu_to_le16 with the goal of getting rid of the definition of __constant_cpu_to_le16 completely. The semantic patch that performs this transformation is as follows: @@expression x;@@ - __constant_cpu_to_le16(x) + cpu_to_le16(x) Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ethernet: micrel: use time_is_before_eq_jiffiesAntonio Murdaca2015-06-071-1/+1
| | | | | | | use time_is_before_eq_jiffies macro for time comparison Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: fec: ptp: correct the ENET_ATCOR valueFugang Duan2015-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The current driver adjust freq formula is: fe * diff = ppb * pc Note: fe: ENET ref clock frequency in Hz diff = inc_corr - inc: difference between default increment and correction increment ppb: parts per billion adjustment from base pc: correction period (in number of fe clock cycles) The correction increment will be used after N cycles of regular increments, not every N cycles (with N being the correction period). For example, set ENET_ATCOR=4, INC=8, INC_CORR=9, there will be 4 increments of 8 (ENET_ATINC[INC]) , followed by 1 increment of 9 (ENET_ATINC[INC_CORR]). So, the correct formula is: fe * diff = ppb * (pc + 1) For ENET_ATCOR, a value 0 disables the correction counter and no corrections occur. So base on the origin formula, set pc = pc > 1 ? pc - 1 : pc. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Frank Li <Frank.Li@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ll_temac: Remove sparse warningsMichal Simek2015-06-071-6/+6
| | | | | | | | | | | | | | | | | | | Remove sparse warnings: drivers/net/ethernet/xilinx/ll_temac_main.c:65:16: warning: cast removes address space of expression drivers/net/ethernet/xilinx/ll_temac_main.c:70:9: warning: cast removes address space of expression drivers/net/ethernet/xilinx/ll_temac_main.c:127:16: warning: cast removes address space of expression drivers/net/ethernet/xilinx/ll_temac_main.c:137:9: warning: cast removes address space of expression drivers/net/ethernet/xilinx/ll_temac_main.c:409:3: warning: symbol 'temac_options' was not declared. Should it be static? drivers/net/ethernet/xilinx/ll_temac_main.c:590:6: warning: symbol 'temac_adjust_link' was not declared. Should it be static? Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: David S. Miller <davem@davemloft.net>