summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2016-03-29tty: serial: fsl_lpuart: enable UART DMA by defaultStefan Agner
The new DMA implementation uses larger buffer sizes and avoids overflows in most situations. Enable DMA by default again. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-29tty: serial: fsl_lpuart: Fix broken 8m/s1 supportBhuvanchandra DV
Fix broken 8m/s1 support. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-29tty: serial: fsl_lpuart: Add support for RS-485Bhuvanchandra DV
Enable Vybrid's build-in support for RS-485 auto RTS for controlling line direction of RS-485 transceiver driver. Enable RS485 feature by either using ioctrl 'TIOCSRS485' or enable it in the device tree by setting 'linux,rs485-enabled-at-boot-time' property. e.g. &uart2 { status = "okay"; linux,rs485-enabled-at-boot-time; }; Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-29tty: serial: fsl-lpuart: Update suspend/resume for DMA modeBhuvanchandra DV
When DMA mode is enabled one need to make sure the DMA channels are idle before entering suspend mode especially when UART ports which are set as wakeup source and console port with no_console_suspend is set. This patch takes care of gracefully releasing DMA channels for the above two cases and start the DMA at resume. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-29tty: serial: fsl-lpuart: Use scatter/gather DMA for TxBhuvanchandra DV
Drop PIO to DMA switching and use scatter/gather DMA for Tx path to improve performance. Some part of the code is borrowed from imx serial driver. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-29tty: serial: fsl-lpuart: Use cyclic DMA for RxBhuvanchandra DV
The initial approach of DMA implementatin for RX is inefficient due to switching from PIO to DMA, this leads some times to overrun on lpuart ports with small FIFO. To address these issues this patch uses a cyclic DMA for receiver path. Some part of the code is borrowed from atmel serial driver. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> [updated DMA RX buffer size calculation] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-28Merge branch 'vf610-dcu-drm-4.4' into toradex_vf_4.4-nextStefan Agner
2016-03-28drm/fsl-dcu: simplify TCON driverStefan Agner
Since we are using the suspend helper now, the encoder gets disabled explicitly by the framework before entering suspend. Therefor we do not need to suspend/resume TCON seperately. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-28drm/fsl-dcu: use common clock framework for pixelclock dividerStefan Agner
Use the common clock framework to calculate the pixel clock dividier. The previous implementation rounded down the calculated factor. Thanks to the CLK_DIVIDER_ROUND_CLOSEST flag using the common clock framework divider implementation improves the pixel clock accuracy in some cases. Ontop of that it also allows to see the actual pixel clock in the sysfs clock summary. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-28drm/fsl-dcu: add extra clock for pixel clockStefan Agner
The Vybrid DCU variant has two independent clock inputs, one for the registers (IPG bus clock) and one for the pixel clock. Support this distinction in the DCU DRM driver while staying backward compatible with devices providing only a single clock (e.g. LS1021a SoC's). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-28drm/fsl-dcu: disable clock on initialization failure and removeStefan Agner
Fix error handling during probe by reordering initialization and adding a error path which disables clock again. Also disable the clock on remove. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-28ARM: imx: clk-vf610: fix DCU clock treeStefan Agner
Similar to an earlier fix for the SAI clocks, the DCU clock hierarchy mixes the bus clock with the display controllers pixel clock. Tests have shown that the gates in CCM_CCGR3/9 registers do not control the DCU pixel clock, but only the register access clock (bus clock). Fix this by defining the parent clock of VF610_CLK_DCUx to be the bus clock (ipg_bus). Since the clock has not been used far, there are no further changes needed. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-24phy: micrel: do not use power down modeStefan Agner
Some Micrel KSZ8041NL PHY chips exhibit continous RX errors after using the power down mode bit (0.11). If the PHY is taken out of power down mode in a certain temperature range, the PHY enters a weird state which leads to continously reporting RX errors. In that state, the MAC is not able to receive or send any Ethernet frames and the activity LED is constantly blinking. Since Linux is using the suspend callback when the interface is taken down, ending up in that state can easily happen during a normal startup. Micrel confirmed the issue, caused by abnormal clock recovery when using power down mode. Even the latest revision (A4, Revision ID 0x1513) seems to suffer that problem. Remove the suspend/resume callback to avoid using the power down mode completely. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-23spi: fsl-dspi: Set max_speed_hz for masterBhuvanchandra DV
Calculate and update max speed from bus clock for SoCs using DSPI IP. The bus clock factor's are taken from the data sheets of respective SoCs. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 9419b2006cf47c75985ea51d36ddc51346d29efd)
2016-03-11net: fec: use extended buffer descriptor for Vybrid tooStefan Agner
Vybrids (mvf600-fec) FEC controller supports the extended buffer descriptior format too. The controller also has the checksum capabilities as well as VLAN support. Set the appropriate flags. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-11usb: chipidea: ci_hdrc_imx: Introduce CI_HDRC_DUAL_ROLE_NOT_OTG for VybridSanchayan Maity
The Vybrid SoC has a dual role device which can be configured to act as a host or device through firmware interface, but, it is not a true OTG controller. Use the CI_HDRC_DUAL_ROLE_NOT_OTG in the platform flag, introduce a new platform data structure for Vybrid and match on the compatible string fsl,vf610-usb instead of the earlier fsl,imx27-usb. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-11usb: chipidea: Modify use of extcon framework to work for non OTG caseSanchayan Maity
The existing usage of extcon in Chipidea driver relies on fields of OTGSC register. In case of an SoC with dual role device but not a true OTG controller, this does not work. Use the existing flag CI_HDRC_DUAL_ROLE_NOT_OTG to detect this and in case of extcon being present, do the role switch without checking for the OTG registers. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> [fixed dupplicate pm_runtime_get_sync] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-10iio: dac: vf610_dac: Add IIO DAC driver for Vybrid SoCSanchayan Maity
Add driver support for DAC peripheral on Vybrid SoC. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org> (cherry picked from commit 1b983bf42fad73eb0a6368b3785d90486d68961f)
2016-03-09soc: Add SoC bus driver for Freescale Vybrid platformSanchayan Maity
This adds SoC driver to be used by the Freescale Vybrid SoC's. Driver utilises syscon and nvmem container API's to get the various register values needed and sysfs exposes the SoC specific properties. > cd /sys/devices/soc0 > ls family machine power revision soc_id subsystem uevent > cat family Freescale Vybrid VF610 > cat machine Freescale Vybrid > cat revision 00000013 > cat soc_id e302a4e9352371d4 Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> [added add_device_randomness] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-09mfd: syscon: Introduce syscon_regmap_read_from_offsetSanchayan Maity
Currently syscon does not provide an abstraction to access a register from syscon reference like below ocotp-cfg1 = <&ocotp 0x20> syscon_regmap_read_from_offset provides a generic abstraction to access a register from syscon reference as above. It allows to specify the node and node name of phandle reference, reading the offset from the node entry and providing the value from the offset in the register map. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2016-03-03fbcon: logo: allow easy integration of a custom Linux boot logoMarcel Ziswiler
This patch allows for easy integration of a custom Linux boot logo to replace the Tux' being shown by default. Use gimp or the like to create a raw PPM in your desired resolution. Reduce the number of colours in the image to 224: user@host:~$ ppmquant 224 Toradex-640x480.ppm > \ Toradex-640x480-224.ppm ppmquant: making histogram... ppmquant: 370 colors found ppmquant: choosing 224 colors... ppmquant: mapping image to new colors... Convert it from raw PPM to ASCII format: user@host:~$ pnmnoraw Toradex-640x480-224.ppm > \ Toradex-640x480-ascii-224.ppm Copy it into the Linux sources: cp Toradex-640x480-ascii-224.ppm linux-toradex/drivers/video/logo/\ logo_custom_clut224.ppm Activate exclusively custom Linux logo in the kernel configuration: Device Drivers -> Graphics support -> Bootup logo -> Custom 224-color Linux logo And re-compile the kernel. (cherry picked from commit fa2371bff9ac03581881849d8f95678ef3992719) Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-03touchscreen: fusion_F0710A: Reset controller if clear interrupt operation failsSanchayan Maity
Add support for resetting the controller using the gpio reset pin if interrupt could not be cleared. If clearing the interrupt fails, the interrupt line stays high and no further interrupts are generated resulting in a non functioning touchscreen until next reboot, when we reset the controller again in probe. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2016-03-02input: touchscreen: fusion: implement multitouch with slot handlingStefan Agner
According to multi-touch-protocol.txt the kernel knows two type of devices: - Type A: devices which provide anonymous contacts - Type B: devices which are capable of tracking individual contacts The Fusion touch screen is a Type B device: The Touch ID field allows to differentiate between 2 different fingers. This updates the driver to properly allocate a slot for each identified contact and use the helper functions available from the input core system. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2016-03-02input: touchscreen: fusion: use level triggered interruptStefan Agner
Use level triggered interrupt which makes sure that even we miss a rising edge (due to latencies in the kernel), the interrupt still will be handled later, and doesn't freeze the input device. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: fusion: add device tree integrationMax Krummenacher
Add device tree integration and add the device to the dtb. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> [Add devicetree binding documentation] Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2016-03-02input: touchscreen: fusion: platform independent GPIO descriptionStefan Agner
Use platform independent description for requested GPIOs. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: fusion: fix error handlingStefan Agner
Fix chip reset by sleeping long enought after reset. Do proper error handling (free GPIO on failure). Use dev_* for message logging to get similar messages for all fusion driver related errors and warnings. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: fusion: use new I2C PM functionsStefan Agner
To avoid warnings use the new I2C power management function for suspend and resume. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [Use __maybe_unsed instead of ifdefs] Signed-off-by: Bhuvanchandr DV <bhuvanchandra.dv@toradex.com>
2016-03-02input: touchscreen: added platform data for Fusion touchscreenStefan Agner
Added platform data struct to define interrupt and reset GPIO. This allows to initialize the touchscreen controller inside the driver rather than in each platform and use the driver as a module. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: fix race condition in Fusion driverStefan Agner
When the next interrupt request apeares between the confirmation of the previous (a write via I2C, fusion_F0710A_write_complete) and the reenable of the GPIO interrupt, the driver hangs and no more touch inputs are reported. This patch moves the confirmation after the reenabling of the GPIO interrupt. Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: add ABS_X/ABS_Y axis for Fusion touchscreenStefan Agner
Recent evdev X-Server input driver implementation complain when only multitouch axes have been reported ("found only multitouch-axes. That shouldn't happen."). Therefor also report the primary touch detection with default axis. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-03-02input: touchscreen: add Fusion 7 and 10 multi-touch driverMax Krummenacher
This patch adds the multi-touch input driver for the TouchRevolution Fusion 7 and 10 panels (See Fusion 7 and 10 drivers for Linux.pdf and Linux Drivers Fusion 10.zip) as downloaded in 07.2014 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2016-02-24ASoC: fsl_sai_clk: clock driver for SAIStefan Agner
This adds a clock driver to use the bitclock (TX_BCLK) as a master clock. [4.4: added clk_prepare_enable call for mclk1] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-23tty: serial: fsl_lpuart: implement module parameter to disable DMAStefan Agner
The DMA implementation has been and is still affected by bugs and race conditions. To bridge the time until those have been addressed, add fsl-lpuart.nodma module parameter which allows to disable the UART DMA using a kernel argument. Let the DMA to be disabled by default. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-23tty: serial: fsl_lpuart: fix clearing of receive flagStefan Agner
Commit 8e4934c6d6c6 ("tty: serial: fsl_lpuart: clear receive flag on FIFO flush") implemented clearing of the receive flag by reading the status register only. It turned out that even though we flush the FIFO afterwards, a explicit read of the data register is still required. This leads to a FIFO underrun. To avoid this, follow the advice in the overrun "Operation section": Unconditionally clear RXUF after using RXFLUSH. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-23tty: serial: fsl_lpuart: consider TX FIFO too in tx_emptyStefan Agner
Currently the tx_empty callback only considers the Transmit Complete Flag (TC). The reference manual is not quite clear if the TC flag covers the TX FIFO too. Debug prints on real hardware have shown that from time to time the TC flag is asserted (indicating Transmitter idle) while there are still data in the TX FIFO. Hence, in this case the serial core will call the shutdown callback even though there are data remaining in the TX FIFO buffers. Avoid early shutdowns by considering the TX FIFO empty flag too. Also avoid theoretical race conditions between DMA and the driver by checking whether the TX DMA is in progress too. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-17pinctrl: freescale: imx: implement gpio_disable_free for VybridStefan Agner
The Freescale Vybrid SoC has GPIO capabilities as part of the IOMUXC. To enable GPIO's, the gpio_request_enable callback has been implemented, however the corsponding gpio_disable_free callback is missing. So far, disabling (unexporting) a GPIO left the pin in its last state. Implement a proper gpio_disable_free function which clears the three enable bits which influence the state (IBE, OBE and PUE). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-17clocksource: vf_pit_timer: Fix suspend resumeSanchayan Maity
Specify suspend resume functions for the PIT block. Without these functions which take care of enabling the PIT block and restoring the clock value, suspend resume does not work when using PIT as the clocksource instead of the ARM Global Timer. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-16regulator: core: avoid unused variable warningArnd Bergmann
The second argument of the mutex_lock_nested() helper is only evaluated if CONFIG_DEBUG_LOCK_ALLOC is set. Otherwise we get this build warning for the new regulator_lock_supply function: drivers/regulator/core.c: In function 'regulator_lock_supply': drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable] To avoid the warning, this restructures the code to make it both simpler and to move the 'i++' outside of the mutex_lock_nested call, where it is now always used and the variable is not flagged as unused. We had some discussion about changing mutex_lock_nested to an inline function, which would make the code do the right thing here, but in the end decided against it, in order to guarantee that mutex_lock_nested() does not introduced overhead without CONFIG_DEBUG_LOCK_ALLOC. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 9f01cd4a915 ("regulator: core: introduce function to lock regulators and its supplies") Link: http://permalink.gmane.org/gmane.linux.kernel/2068900 Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit fa731ac7ea04a7d3a5c6d2f568132478c02a83b3) Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-16usb: chipidea: imx: avoid EPROBE_DEFER printed as errorStefan Agner
Avoid printing an error if adding the device failes with return value EPROBE_DEFFER. This may happen e.g. due to missing GPIO for the vbus-supply regulator. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-02-15pwm: fsl-ftm: Fix clock enable/disable when using PMStefan Agner
A FTM PWM instance enables/disables three clocks: The bus clock, the counter clock and the PWM clock. The bus clock gets enabled on pwm_request, whereas the counter and PWM clocks will be enabled upon pwm_enable. The driver has three closesly related issues when enabling/disabling clocks during suspend/resume: - The three clocks are not treated differently in regards to the individual PWM state enabled/requested. This can lead to clocks getting disabled which have not been enabled in the first place (a PWM channel which only has been requested going through suspend/resume). - When entering suspend, the current behavior relies on the FTM_OUTMASK register: If a PWM output is unmasked, the driver assumes the clocks are enabled. However, some PWM instances have only 2 channels connected (e.g. Vybrid's FTM1). In that case, the FTM_OUTMASK reads 0x3 if all channels are disabled, even if the code wrote 0xff to it before. For those PWM instances, the current approach to detect enabled PWM signals does not work. - A third issue applies to the bus clock only, which can get enabled multiple times (once for each PWM channel of a PWM chip). This is fine, however when entering suspend mode, the clock only gets disabled once. This change introduces a different approach by relying on the enable and prepared counters of the clock framework and using the frameworks PWM signal states to address all three issues. Clocks get disabled during suspend and back enabled on resume regarding to the PWM channels individual state (requested/enabled). Since we do not count the clock enables in the driver, this change no longer clears the Status and Control registers Clock Source Selection (FTM_SC[CLKS]). However, since we disable the selected clock anyway, and we explicitly select the clock source on reenabling a PWM channel this approach should not make a difference in practice. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Thierry Reding <thierry.reding@gmail.com> (cherry picked from commit 816aec2325e620b6454474372a21f90a8740cb28)
2016-02-11Merge branch 'vf610-suspend-4.4-lpstop2' into toradex_vf_4.4-nextStefan Agner
2016-02-11drm/fsl-dcu: implement suspend/resume using atomic helpersStefan Agner
Use the drm_atomic_helper_suspend() and drm_atomic_helper_resume() helpers to implement subsystem-level suspend/resume. This replaces the (non-functional) regmap cache based suspend resume functionality.
2016-02-11drm/fsl-dcu: implement fsl_dcu_fbdev_suspend/resume helpersStefan Agner
This helpers suspend and resume the framebuffer device to avoid concurrency issues.
2016-02-11drm/fsl-dcu: use clk helpersStefan Agner
Use clk_prepare_enable and clk_disable_unprepare helpers. This also fixes a sequence issue in the enable path (which leads to a warning on resume).
2016-02-11drm/fsl-dcu: move layer initialization to plane fileStefan Agner
Move the initialization code for layers into a seperate function in the plane file. This allows to reuse the function on resume.
2016-02-11drm/fsl-dcu: store layer registers in soc_dataStefan Agner
Store the number of registers per layer in soc_data. This is more consistent with the rest of the SoC specific data.
2016-02-11Revert "drm/fsl-dcu: use flat regmap cache"Stefan Agner
This reverts commit bf91711ee5661c8cdc516423f32573707703614f.
2016-02-11drm: add drm_fbdev_cma_get_helperStefan Agner
Add helper to get the drm_fb_helper struct of a CMA framebuffer object (struct drm_fbdev_cma). This is useful to use other fb_helper functions like drm_fb_helper_set_suspend.
2016-02-11drm/atomic-helper: Implement subsystem-level suspend/resumeThierry Reding
Provide subsystem-level suspend and resume helpers that can be used to implement suspend/resume on atomic mode-setting enabled drivers. v2: simplify locking, enhance kerneldoc comments v3: pass lock acquisition context by parameter, improve kerneldoc v4: - remove redundant code (already provided by atomic helpers) (Maarten Lankhorst) - move backoff dance from drm_modeset_lock_all_ctx() into suspend helper (Daniel Vetter) v5: handle potential EDEADLK from drm_atomic_helper_duplicate_state() and drm_atomic_helper_disable_all() (Daniel Vetter) Signed-off-by: Thierry Reding <treding@nvidia.com> Link: http://patchwork.freedesktop.org/patch/msgid/1449075005-13937-2-git-send-email-thierry.reding@gmail.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 1494276000db789c6d2acd85747be4707051c801)