aboutsummaryrefslogtreecommitdiffstats
path: root/drivers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-05Bluetooth: btbcm: Send HCI Reset before sending Apple specific commandsMarcel Holtmann1-2/+8
The commit 7bee8b08c428 allows the Read Verbose Config Info to fail gracefully and not cause the controller setup to abort. It seems the reason that command failed in the first place was the missing HCI Reset to bring the controller in full Bluetooth mode. Apple Bluetooth controllers start out in HID mode and when in that mode the Read Verbose Config Info command is not allowed. Sending HCI Reset switches the controller into full HCI mode. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-03Bluetooth: btintel: Add iBT register access over HCI supportLoic Poulain3-0/+206
Add regmap ibt to support Intel Bluetooth silicon register access over HCI. Intel BT/FM combo chip allows to read/write some registers (e.g. FM registers) via its HCI interface. Read/Write operations are performed via a HCI transaction composed of a HCI command (host->controller) followed by a HCI command complete event (controller->host). Read/Write Command opcodes can be specified to the regmap init function. We define data formats which are intel/vendor specific. Register Read/Write HCI command payload (Host): Field: | REG ADDR | MODE | DATA_LEN | DATA... | size: | 32b | 8b | 8b | 8b* | Register Read HCI command complete event payload (Controller): Field: | CMD STATUS | REG ADDR | DATA... | size: | 8b | 32b | 8b* | Register Write HCI command complete event payload (Controller): Field: | CMD_STATUS | size: | 8b | Since this payload is HCI encapsulated, Little Endian byte order is used. Write/Read Example: If we write 0x0000002a at address 0x00008c04, with opcode_write 0xfc5d, The resulting transaction is (btmon trace): < HCI Command (0x3f|0x005d) plen 10 [hci0] 04 8c 00 00 02 04 2a 00 00 00 > HCI Event (0x0e) plen 4 Unknown (0x3f|0x005d) ncmd 1 00 Then, if we read the same register with opcode_read 0xfc5e: < HCI Command (0x3f|0x005e) plen 6 [hci0] 04 8c 00 00 02 04 > HCI Event (0x0e) plen 12 [hci0] Unknown (0x3f|0x005e) ncmd 1 00 04 8c 00 00 2a 00 00 00 Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Do not test ACPI companion in bcm_acpi_probe()Jarkko Nikula1-6/+2
This device has always ACPI companion because driver supports only ACPI enumeration. Therefore there is no need to test it in bcm_acpi_probe() and we can pass it directly to acpi_dev_get_resources() (which will return -EINVAL in case of NULL argument is passed). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Remove needless looking codeJarkko Nikula1-10/+3
Tree wide grep for "hci_bcm" doesn't reveal there is any code registering this platform device and "struct acpi_device_id" use for passing the platform data looks a debug/test code leftover to me. I'm assuming this driver effectively supports only ACPI enumeration and thus test for ACPI_HANDLE() and platform data can be removed. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Remove needless acpi_match_device() callJarkko Nikula1-5/+0
There is no need to call acpi_match_device() in driver's probe path and verify does it find a match to given ACPI _HIDs in .acpi_match_table as driver/platform/acpi core code has found the match prior calling the probe. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Handle possible error from acpi_dev_get_resources()Jarkko Nikula1-1/+3
Driver doesn't handle possible error from acpi_dev_get_resources(). Test it and return the error code in case of error. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Add missing acpi_dev_free_resource_list()Jarkko Nikula1-0/+1
Caller of acpi_dev_get_resources() should free the constructed resource list by calling the acpi_dev_free_resource_list() in order to avoid memory leak. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_intel: Cleanup the device probe codeJarkko Nikula1-24/+0
There is some unneeded code in "hci_intel" probing. First acpi_match_device() call is needless as driver/platform/acpi core code has already done the matching before calling the probe and the driver does not use the returned pointer to matching _HID other than checking is it NULL. Then tree wide grep for "hci_intel" doesn't reveal that there is any code registering this platform device so it looks this device is always backed with ACPI companion so also ACPI_HANDLE() test can be removed. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-30Bluetooth: hci_h5: clean up hci_h5 codePrasanna Karthik1-5/+5
This patch fixes checkpatch warnings: - Comparison to NULL could be re-written - no space required after a cast Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-30Bluetooth: btuart_cs: remove obsolete headerPrasanna Karthik1-1/+1
Use <linux/io.h> instead of <asm/io.h>, fixes checkpatch Warning; Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-28Bluetooth: hci_qca: Changed unsigned long to boolPrasanna Karthik1-2/+2
'retransmit' being set in HCI_IBS_TX_WAKING case, using bool would be efficient. Initialize local bool to false. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-25Bluetooth: btmrvl: Comparison to NULL re-writtenPrasanna Karthik2-2/+2
NOT NULL comparison modified to be readable, reported by checkpatch. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-25Bluetooth: btuart_cs: Comparison to NULL re-writtenPrasanna Karthik1-1/+1
NOT NULL comparison modified to be readable, reported by checkpatch. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-25Bluetooth: bt3c_cs: Comparison to NULL re-writtenPrasanna Karthik1-1/+1
NOT NULL comparison modified to be readable, reported by checkpatch. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-25Bluetooth: bluecard: Comparison to NULL could be re-writtenPrasanna Karthik1-1/+1
replaced 'not null' comparison that is readable, reported by checkpatch. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24mrf24j40: remove trailing semicolonAlexander Aring1-1/+1
This patch removes a trailing semicolon which was introduced by commit d3f1bc3 ("mrf24j40: add cca mode support") and reported by kbuild test robot. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Add suspend/resume runtime PM functionsFrederic Danis1-4/+56
Adds autosuspend runtime functionality to BCM UART driver. Autosuspend is enabled at end of bcm_setup. bcm_device_lock is used for system sleep functions as they can be called at any time. bcm_device_lock is not held for runtime suspend functions as this is only enabled as long as platform device is opened. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: Remove useless rx_lock spinlockFrederic Danis2-6/+3
rx_lock spinlock is only used in hci_uart_tty_receive() which is the receive_buf ldisc callback. hci_uart_tty_receive() is protected from re-entrance by its only caller (flush_to_ldisc() in drivers/tty/tty_buffer.c) which held a mutex (buf->lock) for this section. This lock allows "safe use of the line discipline's receive_buf() method by excluding the buffer work and any pending flush from using the flip buffer." (comments from tty_buffer_lock_exclusive() in drivers/tty/tty_buffer.c) So, no need to double protect this resource with rx_lock. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Prepare PM runtime supportFrederic Danis1-28/+60
Change some CONFIG_PM_SLEEP to CONFIG_PM as hu and is_suspended parameters will be used during PM runtime callbacks. Add bcm_suspend_device() and bcm_resume_device() which performs link management for PM callbacks. These functions will be used for runtime management. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Fix IRQ polarity for T100Frederic Danis1-0/+25
ACPI table for BCM2E39 of T100TA is not correct. Set correct irq_polarity for this device. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22Bluetooth: btmrvl: add sd8997 chipset supportAmitkumar Karwar2-2/+38
This patch adds support for Marvell's new chipset SD8997. Register offsets and supported feature flags are updated. Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22Bluetooth: btmrvl: remove extra space in castAmitkumar Karwar1-5/+5
Coding style fix, extra spaces are removed to make casting consistent. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: replace magic numbersAlexander Aring1-38/+98
This patch replaces some magic numbers with defines for register bits, mask and shifts. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: change irq trigger type behaviourAlexander Aring1-3/+28
This patch changes the irq trigger type value while calling devm_request_irq by using IRQF_TRIGGER_LOW when no irq type was given. Additional we add support for change the irq polarity while hw init if high level or low level triggered irq type are given. For rising edge triggered irq's the mrf24j40 can't deal with that, this races at position of tx completion irq, while the irq is disabled we readout the irq status registers. This will resets the irq line so other irq's can occur. Wile readout the irq status register the irq is still disabled and edge triggered interrupts will be ignored. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add promiscuous mode supportAlexander Aring1-1/+21
This patch adds support for promiscuous mode by setting promiscuous (no frame filtering), disable automatic ack handling and not filtering frames where the crc is invalid. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add tx power supportAlexander Aring1-0/+71
This patch supports setting of transmit power for the mrf24j40ma transceiver only. The mrf24j40mc has some amplifier to change the transmit power, I am currently not sure how the mapping for this amplifier looks like. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add cca ed level supportAlexander Aring1-1/+49
This patch supports handling to set the cca energy detection level for the mrf24j40 transceiver. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add cca mode supportAlexander Aring1-0/+40
This patch supports cca mode handling for mrf24j40. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add csma params supportAlexander Aring1-1/+26
This patch adds supports to change the CSMA parameters. The datasheet doesn't say anything about max_be value. Seems not configurable and we assume the 802.15.4 default. But this value must exists because there is a min_be value. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: async interrupt handlingAlexander Aring1-53/+40
This patch removes the threaded irq handling and do a hardirq instead. We need to switch to spi_async for this step for getting the irq status register. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: rework rx handling to async rx handlingAlexander Aring1-164/+118
This patch prepares that we can do the receive handling inside interrupt context by using spi_async. This is necessary for introduce a non-threaded irq handling. Also we drop the bit setting for "RXDECINV" at register "BBREG1", we do a driectly full write of register "BBREG1", because it contains the bit RXDECINV only. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: rework tx handling to async tx handlingAlexander Aring1-83/+78
This patch reworks the current transmit API to spi_async handling. We removed the error handling check, because mac802154 has no chance to report it. Also the transmit timeout handling can't be handled by xmit async handling, for this usecase we need to implement the netdev watchdog. These are all unlikely cases which we drop now and should be provided by netdev watchdog. We also drop the bit setting for TXNACKREQ at register TXNCON, this is not necessary. The TXNCON register should set only once for each frame, previous settings doesn't matter. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: change to frame delivery with crcAlexander Aring1-4/+1
This patch changes the frame delivery to mac802154 with crc. This is useful for monitor interface types which deliver the crc to userspace. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: use regmap for register accessAlexander Aring1-97/+50
This patch uses the regmap functions for transceiver register settings where it's possible. This means everything except the hotpaths like receive/transmit handling. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add regmap supportAlexander Aring2-0/+313
This patch introduce regmap support for short and long address space of mrf24j40. It's only possible to use regmap_read/write/update_bits for long address range. This is because I added lowlevel bus operation because the write operation need to set the 12th bit to mark a register write, but regmap only supports to set bits for register write access in the first byte. We use other regmap register functions than read/write/update_bits, so this should be fine. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add more register definesAlexander Aring1-0/+68
For supporting regmap, this patch will add more register defines to prepare a full register dump by regmap debugfs. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add random extended addr generationAlexander Aring1-0/+1
The mrf24j40 has no source to get a permanent extended address. This patch will add a random generated permanent extended address source. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add default channel settingAlexander Aring1-0/+7
Per default mrf24j40 has the channel 11 after reset. This patch adds the right phy default value for the channel setting. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: add device-tree supportAlexander Aring1-0/+9
This patch adds devicetree support to mrf24j40 with proper devicetree compatible strings. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: remove spi settings overwriteAlexander Aring1-3/+5
This patch removes spi settings while mrf24j40 probing. These settings cannot be overwrite while device probing where spi controller should be already configured. These settings need to be setup by device tree or platform data. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: calling ieee802154_register_hw at lastAlexander Aring1-10/+7
The function ieee802154_register_hw should always called at last. Currently we do hardware init and such things after register hardware into the subsystem. It could be that the subsystem already call driver operations while running hardware init. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: use ieee802154_alloc_hw for private dataAlexander Aring1-16/+15
This patch removes the own private dataroom allocation by calling devm_kzalloc for devrec and assign this pointer to "devrec->hw->priv". Instead we using like all other drivers ieee802154_alloc_hw and give the size for the private driver dataroom at the first argument. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22mrf24j40: cleanup define identationAlexander Aring1-38/+38
This patch replaces the spaces after define by a tab. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22at86rf230: support edge triggered irqAlexander Aring1-122/+89
This patch adds support for edge triggered irq types. We remove the locking for irq resources by enable/disable irq and allocate directly some heap buffer at isr. We have still a enable/disable irq path but this is for level-triggered irq's which need to be disabled until spi_async clear the irq line. There is usually a little race condition between "irq line cleared" and "enable_irq". When in this time a edge triggered irq arrived, we will not recognize this interrupt. This case can't happend at at86rf230. The reason is that we unmask TRX_END irq's only which indicates a transmit or receive completion, which depends on the current state. On Transmit: TRX_END arrived and transceiver is in TX_ARET_ON state again, in this state no other TRX_END can happen until we leave the state. On Receive: This is protected with the RX_SAFE_MODE bit which leaves the transceiver in RX_AACK_BUSY until we readed the framebuffer. In this state no other TRX_END can happen. Tested with RPi where I first detected issues between edge/level irq's. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-22Bluetooth: btmrvl: fix firmware dump issueNachiket Kukade1-0/+6
First firmware dump attempt from user works fine, but firmware goes into bad state after this. Subsequent attempts fails. As required by the firmware dump implementation, this change writes FW_DUMP_READ_DONE value to dump ctrl register to address this issue. Signed-off-by: Nachiket Kukade <kukaden@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-21drivers/net/ieee802154/at86rf230.c: seq_printf() now returns NULLStephen Rothwell1-25/+10
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Alexander Aring <alex.aring@gmail.com> Cc: Stefan Schmidt <stefan@osg.samsung.com> Cc: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-21drivers: net: cpsw-common: add support for reading mac address for dra7 and am437x platformsMugunthan V N1-0/+6
Adding support for reading mac address using syscon driver for dra7 and am437x platforms Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-21drivers: net: cpsw: davinci_emac: move reading mac id to common fileMugunthan V N4-59/+57
Moving mac address reading from ethernet driver to common file for better maintenance and for code reusable. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-21Merge tag 'linux-can-next-for-4.4-20150921' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-nextDavid S. Miller1-105/+92
Marc Kleine-Budde says: ==================== pull-request: can-next 2015-09-17 this is a pull request of 8 patches for net-next/master. All 8 patches are by me and cleanup the flexcan driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-21net: bcmgenet: Remove duplicate test for tx_coalesce_usecs_highFlorian Fainelli1-2/+1
We were checking twice for ec->tx_coalesce_usecs_high, remove the duplicate test. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Reported-by: kbuild-all@01.org Fixes: 2f9130709d2c19 ("net: bcmgenet: Implement TX coalescing control knobs") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>