summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* usb: Drop usb_disable_asynch()Andrey Smirnov2019-03-112-33/+7
| | | | | | | | | | There are no users of usb_control_msg() in the codebase that pass timeout of 0, so it doesn't look like usb_disable_asynch() has any effect on USB operation. Drop that function and remove all of its uses to simplify things. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Use put_unaligned_be* helpersAndrey Smirnov2019-03-111-11/+7
| | | | | | | Replace explicit endianness casts with put_unaligned_be* helpers. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Introduce usb_stor_transport()Andrey Smirnov2019-03-111-96/+117
| | | | | | | | | Move retry logic found in all of the low-level usb_stor_* functions into a standalone subroutine and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Drop unused us_blkdev_listAndrey Smirnov2019-03-111-3/+0
| | | | | | | There are no users of us_blkdev_list in the file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Drop unused fields in struct us_dataAndrey Smirnov2019-03-112-16/+2
| | | | | | | | | | Only bulk-only transport is supported by the currennt codebase, so ep_bInterval and recv_intr_ep are not really used. Remove them and all related code. While at it remove flags and subclass as well since they are not really used anywhere in the codebase. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ata: ahci: Do not include <scsi.h>Andrey Smirnov2019-03-111-1/+0
| | | | | | | No symbols found in <scsi.h> are used in this file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: hub: Do not include <scsi.h>Andrey Smirnov2019-03-111-1/+0
| | | | | | | No symbols found in <scsi.h> are used in this file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Drop struct SCSI_cmd_blockAndrey Smirnov2019-03-114-75/+65
| | | | | | | | | | | All the info we need to pass to transport function can be captured in a struct us_blk_dev and two byte arrays, so having a dedicated struct with many unused fields doesn't really buy us anything. Drop the struct and convert the rest of the code to pass needed data explicitly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Remove unused variablesAndrey Smirnov2019-03-111-8/+0
| | | | | | | Drop a number of variables no longer used in the code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_request_sense() a standalone functionAndrey Smirnov2019-03-111-15/+18
| | | | | | | | | Don't try to re-use caller's "ccb" and instead convert usb_stor_request_sense() to use its own for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Share code for READ(10) and WRITE(10)Andrey Smirnov2019-03-111-51/+9
| | | | | | | | | Both usb_stor_read_10() and usb_stor_write_10() do almost exactly the same thing, so merge them into a signle routine and adjust all of the users accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Drop extra call to transport in usb_stor_write_10()Andrey Smirnov2019-03-111-1/+1
| | | | | | | | | There doesn't seem to be a particularly good reason to call ->trasport() one last time after 2 failures. Drop the call so allow sharing this code with usb_stor_read_10() in the following commit. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_write_10() a standalone functionAndrey Smirnov2019-03-111-18/+25
| | | | | | | | | Move special preparation steps done before the call to usb_stor_write_10() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_read_10() a standalone functionAndrey Smirnov2019-03-111-16/+25
| | | | | | | | | Move special preparation steps done before the call to usb_stor_read_10() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_test_unit_ready() a standalone functionAndrey Smirnov2019-03-111-12/+16
| | | | | | | | | Move special preparation steps done before the call to usb_stor_test_unit_ready() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_inquiry() a standalone functionAndrey Smirnov2019-03-111-22/+30
| | | | | | | | | Move special preparation steps done before and after call to usb_stor_inquiry() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Make usb_stor_read_capacity() a standalone functionAndrey Smirnov2019-03-111-22/+31
| | | | | | | | | Move special preparation steps done before and after call to usb_stor_read_capacity() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Don't use "unsigned long" for 32-bit valuesAndrey Smirnov2019-03-111-3/+3
| | | | | | | | | | Unsignled long will expand to 64-bit unsigned integer on 64-bit CPUs. This will break current code using it to read out two 32-bit values returned by READ_CAPACITY. Fix the proble by using "u32" explicitly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Replace custom debug tracing with dev_dbgAndrey Smirnov2019-03-113-90/+94
| | | | | | | | Replace custom debug tracing macros with a call to dev_dbg to simplify code and add device info into degug output. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: storage: Simplify memory allocation in usb_stor_probe()Andrey Smirnov2019-03-111-4/+1
| | | | | | | | Replace explicit malloc() + OOM check and memset() with a single call to xzalloc(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spd'Sascha Hauer2019-03-072-3/+3
|\
| * crc: import crc_itu_t() from kernelSascha Hauer2019-03-042-3/+3
| | | | | | | | | | | | | | | | Our cyc_crc16() function is the same function as crc_itu_t() in the Linux kernel. Import and use crc_itu_t() from the Kernel for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rpi'Sascha Hauer2019-03-077-7/+71
|\ \
| * | mci: bcm2835: parse other device tree properties.Tomaz Solc2019-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | The driver was missing a call to mci_of_parse() which fills in properties such as "bus-width", "no-sd" into the mci_host struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: bcm2835: use device_initcall(), not coredev.Tomaz Solc2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pinctrl driver needs to be initialized before mci driver on Raspberry Pi. Otherwise the pinctrl device tree properties in the mci node are ignored. pinctrl is initialized by coredevice_initcall(), so moving mci-bcm2835 to device_initcall() ensures that it is initialized later. There is no reason for mci-bcm2835 to use coredevice_initcall(). Other mci drivers already use device_initcall(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pinctrl: bcm2835: register the pin controller.Tomaz Solc2019-02-191-1/+51
| | | | | | | | | | | | | | | | | | | | | This adds hooks for the pin controller driver to the existing bcm2835_set_function(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pinctrl: bcm2835: move existing code from gpio.Tomaz Solc2019-02-195-5/+7
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Kconfig: add pin controllers submenu.Tomaz Solc2019-02-191-0/+4
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: bcm2835: set timeout_max.Tomaz Solc2019-02-181-0/+5
| | | | | | | | | | | | | | | | | | BCM2835 watchdog timeout can be set to maximum 15 seconds (0xffffff >> 16). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/nvme'Sascha Hauer2019-03-0713-24/+1491
|\ \ \
| * | | drivers: Import a very basic NVME implementation from LinuxAndrey Smirnov2019-02-189-0/+1487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import a very abridged NVME implementation from Linux kernel in order to be able to access NVME storage attached via PCIe. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers: Make use of device_pci_driver()Andrey Smirnov2019-02-184-24/+4
| |/ / | | | | | | | | | | | | | | | | | | Replace all of the generic PCI boilerplate with device_pci_driver(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2019-03-073-8/+2
|\ \ \
| * | | PCI: dwc: tune down link up messagesLucas Stach2019-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function may be called repeatedly while establishing the link, so printing a message each time a working link is found can add quite a bit of noise. Tune those messages down to the debug level. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers: Drop dummy_probe()Andrey Smirnov2019-02-271-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop dummy_probe() due to lack of users in the tree. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | watchdog: fix WATCHDOG_POLLER menuconfigOleksij Rempel2019-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | make it properly represented by menuconfig Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/imx8-usb'Sascha Hauer2019-03-0723-236/+4105
|\ \ \ \
| * | | | usb: usb251xb: add usb data lane port swap featureAndrey Smirnov2019-02-221-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of Linux patch https://patchwork.kernel.org/patch/10766235/ The HW can swap the USB differential-pair (D+/D-) for each port separately. So the USB signals can be re-aligned with a misplaced USB connector on the PCB. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: Port Microchip USB251x USB hub driver from LinuxAndrey Smirnov2019-02-225-0/+695
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port Microchip USB251x USB hub driver from Linux. Needed by ZII's i.MX8MQ boards. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: Import DWC3 USB controller driver from LinuxAndrey Smirnov2019-02-229-0/+2783
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import DWC3 USB controller driver from Linux. This is a bare minimum port of the code needed to support USB host functionality on i.MX8MQ. No other use-case is explicitly supported. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | clk: Import a subset of clk_bulk API from LinuxAndrey Smirnov2019-02-222-1/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import a subset of clk_bulk API from Linux to support porting kernel code that uses it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | clk: Drop separate definitions of clk_put()Andrey Smirnov2019-02-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regardless of the value of CONFIG_HAVE_CLK, clk_put() implementation is always a no-op. Move the definition to linux/clk.h and drop the rest of the code implementing it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | phy: Port i.MX8MQ USB PHY driver from LinuxAndrey Smirnov2019-02-225-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port i.MX8MQ USB PHY driver from Linux. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | phy: core: Assume EPROBE_DEFER in of_phy_provider_lookup()Andrey Smirnov2019-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support PHY driver probe deferral change the code to assume EPROBE_DEFER instead of ENODEV when requested PHY is missing from phy_provider_list. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Make use of lo_hi_readq/writeq()Andrey Smirnov2019-02-221-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of lo_hi_readq/writeq() to implement xhci_read/write_64() helpers, same as it is done in the Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Simplify route string building loopAndrey Smirnov2019-02-221-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify route string building loop by avoiding checking top_dev->parent->descriptor->bDeviceClass twice. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Initialize TRT flag for xHCI >= 1.0Andrey Smirnov2019-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize TRT flag for xHCI >= 1.0, not just == 1.0. This is what Linux xHCI driver does. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Check usb_pipein(pipe) only once in xhci_submit_normal()Andrey Smirnov2019-02-221-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplfy xhci_submit_normal()'s logic a bit by using helper variables and making sure that usb_pipein(pipe) is only called once. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Drop 'dma' field from struct xhci_hcdAndrey Smirnov2019-02-222-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop 'dma' field from struct xhci_hcd since it is not really used anywhere. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: xhci-hcd: Simplify TRB initialization codeAndrey Smirnov2019-02-221-50/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current TRB initialization code in xHCI driver is: a) Somewhat inconsistent in endianness correctness: LE is insured in some places whereas in some places it isn't b) Somewhat inconsistent in how DMA buffer address is being written: some places utilize xhci_write_64, whereas others just assing cmd_trb field directly c) A bit wasetful since in a number of codepaths where TRB is used it is memset to zero first only to have 80+% of its fields changed to something else right after. To fix all of the above introduce xhci_init_event_cmd_trb(), that will initialize all of the fileds to desired values only once as well as taking care of endianness. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>