summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2020-02-09iio: stmpe-adc: Use wait_for_completion_timeoutPhilippe Schenker
Use wait_for_completion_timeout instead of wait_for_completion_interuptible_timeout. The interruptible variant gets constantly interrupted if a user program is compiled with the -pg option. The killable variant was not used due to the fact that a second program, reading on this device, that gets killed is then also killing that wait. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit e813dde6f83343012239a44e433eacc22de1079c)
2020-02-09iio: stmpe-adc: Enable all stmpe-adc interrupts just oncePhilippe Schenker
This commit will enable the interrupts of all channels handled by this driver only once in the probe function. This will improve performance because one byte less has to be written over i2c on each read out of the adc. On the fastest ADC mode this will improve read out speed by 15%. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit 4bd44bb2b470459d795c4bac328ed8edb7ebd132)
2020-02-09iio: stmpe-adc: Reinit completion struct on begin conversionPhilippe Schenker
In some cases, the wait_completion got interrupted. This caused the error-handling to mutex_unlock the function. The before turned on interrupt then got called anyway. In the ISR then completion() was called causing wrong adc-values returned in a following adc-readout. Reinitialise completion struct to make sure the counter is zero when beginning a new adc-conversion. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit 263d21cd5e85eb4d96fd560eee814d98c5b89546)
2020-02-09iio: stmpe-adc: Add compatible namePhilippe Schenker
Add the compatible name to the driver so it gets loaded when the proper node in DT is detected. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit 2abd293703ebafe8ae64876936ad345c6716cd9a)
2020-02-09iio: stmpe-adc: Remove unnecessary assignmentPhilippe Schenker
Remove unnecessary assignment. This could potentially cause an issue, if the wait function runs into a timeout. Furthermore is this assignment also not there in stmpe_read_temp() Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit b1f4c9a3c78c70b05b2d844cc72c17d3620ba543)
2020-02-09iio: adc: add STMPE ADC driver using IIO frameworkStefan Agner
This adds an ADC driver for the STMPE device using the industrial input/output interface. The driver supports raw reading of values. The driver depends on the MFD STMPE driver. If the touchscreen block is enabled too, only four of the 8 ADC channels are available. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 9f3d084965a5544f096d4f769e274d4c2892079b)
2020-02-09Input: stmpe-ts: preparations for STMPE ADC driverPhilippe Schenker
This patch removes common ADC settings in favor to use stmpe811_adc_common_init that is present in MFD. This is necessary in preparation for the stmpe-adc driver, because those two drivers have common settings for the ADC. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 88f29d0f2c8f0d8097dfca9fc3619dfe893e0b15)
2020-02-09mfd: stmpe: Preparations for STMPE ADC driverStefan Agner
This prepares the MFD for the STMPE ADC driver. This commit introduces devicetree settings that are used by the ADC and adds an init function. Common ADC settings that are shared with the touchscreen driver can now reside in the overlying MFD. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 6377cfa3b857ced301f2079ac97de6c19057ab65)
2020-02-09mfd: stmpe: Move ADC related defines to MFD headerPhilippe Schenker
Move defines that are ADC related to the header of the overlying MFD, so they can be used from multiple sub-devices. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 063755ab1d1c1127adc09703185967862584935b)
2020-02-09net: can: flexcan: Add pinmuxing in runtime_supsendPhilippe Schenker
Due to the nature of CAN Tx/Rx pins have to be high when they are idle. After boot, CAN is put into runtime_suspend state. When using xceiver-supply in DT the power to the transceiver is turned off in this state. The Tx/Rx pins are then causing backfeeding. This patch adds selection of the sleep-state pins during runtime_suspend, so someone is able to define another muxing in this sate. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09imx_thermal.c: Use new temperature trip point valuesPhilippe Schenker
Use the max. junction temperature read from fusing for critical shutdown temperature. Passive temperature is set 10C lower. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09imx_thermal.c: Use old trip point values from BSP 2.7Philippe Schenker
In kernel upgrade from 4.1 -> 4.9 trip point values have been changed by NXP. These new values caused a lot of modules to critical shut-down during validation and verification. This commit changes the new imx_thermal.c code to use the old, well verified values. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 308edefe57c5c96fad196b6e65fa159857e969f3)
2020-02-09phy: 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> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit a76182f34d2963ee5dca3bc026cbddb44b19be7c)
2020-02-09net: phy-micrel: check return code in flp center functionMax Uvarov
Fix obvious typo that first return value is set but not checked. Signed-off-by: Max Uvarov <muvarov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit a0da456bbf95d2a9294799bb05c61bfb24736bb7) Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 5f0a65495d895df2be2ddd681662f877f1a05b7f)
2020-02-09Input: atmel_mxt_ts - fix reset-gpio for level based irqsSebastian Reichel
The current reset-gpio support triggers an interrupt storm on platforms using the maxtouch with level based interrupt. The Motorola Droid 4, which I used for some of the tests is not affected, since it uses a edge based interrupt. This change avoids the interrupt storm by enabling the device while its interrupt is disabled. Afterwards we wait 100ms. This is important for two reasons: The device is unresponsive for some time (~22ms for mxt224E) and the CHG (interrupt) line is not working properly for 100ms. We don't need to wait for any following interrupts, since the following mxt_initialize() checks for bootloader mode anyways. This fixes a boot issue on GE PPD (watchdog kills device due to interrupt storm) and does not cause regression on Motorola Droid 4. Fixes: f657b00df22e ("Input: atmel_mxt_ts - add support for reset line") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> (cherry picked from commit ca1cd36cef00260db6b35b32d863e0c580c0488d) (cherry picked from commit 6d7ffbea51c1f314a4435065147b36159169571f)
2020-02-09Revert "MLK-16769-5: mtd: gpmi-nand runtime pm code change"Marcel Ziswiler
This reverts commit 6df9c073cb10a0f10d2fc2bea28f8133b5a89a66. This fixes gpmi-nand being defunct on i.MX 6ULL and i.MX 7S/D just hanging the ubifs background task during DMA. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09Revert "MLK-18724-3 clk: imx7d: remove IMX7D_NAND_USDHC_BUS_ROOT_CLK out ↵Marcel Ziswiler
from clks_init_on[]" This reverts commit 04b647fe39e7b1f2ccbcde2e9eccc596b5f2b9da. This fixes eMMC on sdhci3 being defunct just erroring out with -110. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09video: mxsfb: simplify parsingStefan Agner
Use the timing count from the parsed struct display_timings instead of looping through the device tree again. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 65be28e2a2b3761d088b20c43994be97d74c342f)
2020-02-09video: fbdev: mxsfb: fix pixelclock polarityStefan Agner
The PIXDATA flags of the display_flags enum are controller centric, e.g. NEGEDGE means the controller shall drive the data signals on pixelclocks negative edge. However, the drivers flag is display centric: Sample the data on negative (falling) edge. Therefore, change the if statement to check for the POSEDGE flag (which is typically not set): Drive on positive edge => sample on negative edge Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 5652dc1ad78303fb246f050ba23c563319d823cf)
2020-02-09tty: serial: imx: fix merge inconsistencyMarcel Ziswiler
Missing commit 688f897ddd96 ("Merge remote-tracking branch 'linux-fslc/4.9-1.0.x-imx' into toradex_4.9-1.0.x-imx-next"). Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-02-09Revert "PCI: Do not allocate more buses than available in parent"Marcel Ziswiler
This reverts commit 9a4bf05126f42c2632729ab0da503021d74ed454. With this commit the PCIe enumaration fails. A follow up commit further addresses the issue. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-02-09serial: imx: add RS-485 device tree propertiesStefan Agner
Add device tree properties to influence RTS polarity and whether the receiver is enabled during transmission (rs485-rts-active-low, rs485-rx-during-tx). This aligns with behavior with upstream Linux, where RTS is active high by default (SER_RS485_RTS_AFTER_SEND) and the receiver is disabled by default when using RS485 (SER_RS485_RX_DURING_TX). Note that for Toradex hardware both properties are required, hence using RS-485 on Toradex Carrier Boards requires the following properties being specified in the device tree: linux,rs485-enabled-at-boot-time; rs485-rts-active-low; rs485-rx-during-tx; Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 72919eb5f9e7a9aeb5fc1c2aa694b07994fb5a8d) Conflicts: drivers/tty/serial/imx.c
2020-02-09rpmsg: imx: Disable character echoing by defaultAndri Schmidt
Signed-off-by: Andri Schmidt <a.schmidt@scewo.ch> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2020-02-09Revert "MLK-14498-2 ARM: imx7d: clk: select uart clock parent and rate"Stefan Agner
This seems to limit possible baud rates due to lower input clock. Since Toradex modules do not use UART5/6 as console, do not set clock explicitly. This reverts commit 4f447cb8bccb1d40973e46478d7b11aa61961c90. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2020-02-09Revert "MLK-15120 ARM: imx7d: clk: select uart3 clock parent and set rate"Stefan Agner
This seems to limit possible baud rates due to lower input clock. Since Toradex modules do not use UART3 as console, do not set clock explicitly. This reverts commit 89869792e2f59c81354f9a53280c4eb6e95f4a9a. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2020-02-09video: fbdev: mxsfb: allow setting display timings via kernel command lineBhuvanchandra DV
Add support to allow configuring the display timings via kernel command line. e.g.: video=mxsfb:800x480M-16@60,pixclockpol=1,outputen=1 Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 22db6beb45cba5a67cab9e9a55cd60d7471591d9) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Conflicts: drivers/video/fbdev/mxsfb.c
2020-02-09imx_thermal.c: unregister all ressources in error pathMax Krummenacher
This was seen in code inspection. While at it, fix error text. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 4f01669410997d2536722c082288ca466ee2031e) Conflicts: drivers/thermal/imx_thermal.c Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09ARM: imx7d: clk: make sure OCOTP clock is always onStefan Agner
Some device make use of the OCOTP via syscon. While the OCOTP node specifies a clock, in newer kernels the access via syscon does not enable the clock! During the main boot phase this is not usually a problem since the clock is initially on. However, after unused clocks get disabled, any access leads to a freeze. This has been observed when the i.MX Thermal driver probe has been deferred: The driver tried to read the calibration data from OCOTP via syscon and caused a system freeze. In upstream Linux this has recently been resolved using the NVMEM framework, see: Commit ae6215576d6b ("thermal: imx: Add support for reading OCOTP through nvmem") Commit a6c856e9a8cd ("ARM: dts: imx6sx: Use nvmem-cells for tempmon") Use a simpler work around by just adding the clock to the list of clocks which should kept on. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-02-09cpufreq: imx7s: add i.MX 7SoloStefan Agner
The i.MX 7Solo currently does not have multiple operating points, however, in order for the i.MX Thermal driver to successfully probe a cpufreq device is required. Add i.MX 7Solo to the devices which use the generic device tree cpufreq driver. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-02-09rpmsg: imx: return ENOTTY if no tty connectedStefan Agner
Return ENOTTY if no reader is using the TTY. Note that the VirtIO transport used by RPmsg currently does not use the return value of this callback, hence currently will not influence operation in any way. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2020-02-09ARM: imx: clk: enable OCOTP clock by defaultStefan Agner
For some reason USDHC and USB access crashes the kernel if the OCOTP clock is not enabled. It seems not to be software related since there is no direct access from the USDHC/Chipidea USB driver to the OCOTP IP. It might be that the hardware checks the fuses to determine if the particular SoC is supposed to let user access a certain peripheral... Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit bce5146373372651052654b84cd3b773ac4d1882)
2020-02-09mtd: gpmi: fsl,legacy-bch-geometry independent of nand-on-flash-bbtMax Krummenacher
The device tree property fsl,legacy-bch-geometry was only evaluated when nand-on-flash-bbt was also defined. This looks wrong. In mainline (as of 4.12) fsl,legacy-bch-geometry doesn't exist, its functionality seems to be taken over by the fsl,use-minimum-ecc property and it is used independent of nand-on-flash-bbt. The move of code gets also rid of the following compiler warning: drivers/mtd/nand/gpmi-nand/gpmi-nand.c:2274:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (of_property_read_bool(this->dev->of_node, ^~ drivers/mtd/nand/gpmi-nand/gpmi-nand.c:2278:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (of_property_read_bool(this->dev->of_node, ^~ Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit c8f0033be80ccb23230b6b572c328d1c02e4ad04)
2020-02-09regulator: pfuze100: Apalis iMX6: Fix poweroff does not release ↵Sanchayan Maity
POWER_ENABLE_MOCI Poweroff failed powering off the carrier board side of things and did not deassert POWER_ENABLE_MOCI on poweroff. Fix this. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 090138a21869fe2a4b1efa725e6f962ecdff86e5)
2020-02-09mxc_ipuv3_fb: Use the mode_string from command line as isBhuvanchandra DV
Using the mode_str passed via device tree as default fall back, fb_find_mode fails while finding the mode, so avoid using the non standard mode_str passed via device tree and use the mode_str from command line as is. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 50e26af30f04d24f4783dae15206c5dba889fd2b)
2020-02-09tty: serial: imx: Add support for enabling RS485 via device treeBhuvanchandra DV
Add support to enable RS485 via device tree Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit b8e5d21a1351bc0e45ae1762f0799b428d9993ea) (cherry picked from commit d0fa202ec506027902b3a2a427db4a494df8d64c) Conflicts: drivers/tty/serial/imx.c Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09net: can: flexcan: Fix wakeup on CAN from suspend issueSanchayan Maity
Do not disable peripheral while entering suspend mode. Disabling the peripheral does not allow waking up from suspend on a CAN frame reception. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit f972815d2a4db5c93ded76bd11b660261e41f28c)
2020-02-09apalis-imx6: use stopmode for poweroffMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 051ee1a1c24058db62f10a177b1271daebbd2ebe)
2020-02-09colibri-imx6: use stopmode for poweroffMax Krummenacher
After the system has been shutdown with PMIC_ON_REQ and VCC_BATT is supplied from a battery it will never restart either by RESET or power cycle. So use the PMIC_STBY_REQ after shutdown to switch off power rails. Conflicts: arch/arm/mach-imx/pm-imx6.c drivers/regulator/pfuze100-regulator.c (cherry-picked from commit c8b186404065c4502b485820ad4a51515924795c) (cherry-picked from commit ee4c5c4da3b32f65528a2d523ca4bce574dee3c5) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 29ff2389ecf7cb4e30924c80b8d42165cf306936)
2020-02-09ARM: imx: clk: do not force clock frequency of M4Stefan Agner
Let the M4 handle the clock frequency by itself. We also don't need to take care to make sure clocks stay on, the per domain CCM clock gate control registers can be used to let the CCM know that the M4 runs on that PLL: CCM_ControlGate(CCM, ccmPllGateSysDiv2, ccmClockNeededRun); Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 98adbbaef78b8a401350a0bf27c3ddc1881ec34d)
2020-02-09video: fbdev: mxsfb: make sure runtime PM is suspended in system suspendStefan Agner
Use force suspend/resume to trigger runtime PM when entering system suspend. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit ebf45652f2e9ec2ab19831d852363deadeb6407e)
2020-02-09net: fec: make sure runtime PM is suspended in system suspendStefan Agner
Use force suspend/resume to trigger runtime PM when entering system suspend. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit a2ccbd22f2b1da9b152039538fb3b5cb2cfc55c7)
2020-02-09drivers: soc: Add new sysfs attribute to expose SoC unique IDBhuvanchandra DV
Add new 'unique_id' sysfs attribute to expose SoC unique ID Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 8a098f2f1b8ae277a38ee0c5e0b974d5baa8dd01) (cherry picked from commit fb67fb4b277c6df9b5032564d6ae6756c905206d) Conflicts: include/linux/sys_soc.h Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-02-09rpmsg: imx: do not push data when no reader is availableStefan Agner
Pushing data while there is no reader seems to lock/crash the TTY layer in some way. Especially when a reader gets attached again, the kernel crashes with Unable to handle kernel paging request at virtual address 00002248 Also use tty_insert_flip_string which handels the copying and TTY buffer resizing if necessary. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 5aba75e2c61d4044bed21730b7c471822860fac1)
2020-02-09gpio: mxc: clear interrupt mask/status optionallyStefan Agner
Add a kernel parameter ("gpio-mxc.noclearirq") to disable unconditional interrupt mask/clearing. This is useful when a second CPU (the Cortex-M4) is accessing the same GPIO bank. Using the same GPIO bank from the Cortex-A7 and M4 sounds risky, but it seems to work quite well. Most registers are write only (e.g. interrupt status register can be cleared with a single write), which makes them safe for concurrent access. However, sharing a single GPIO bank between two cores does not allow to use the Resource Domain Controller. Hence for secure applications assigning a dedicated GPIO bank is still preferable. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 4cfa939c693b20ca213f054c1dfe5583d966beb4)
2020-02-09video: mxc: ldb: Add support for LVDS configuration via kernel boot argumentsBhuvanchandra DV
Add support for LVDS frame buffer configuration via kernel boot arguments. Fix use of the device tree native-mode property. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 122acb64708ac40faa8c5755624a0bcfbebcb9e8) (cherry picked from commit 735d4f8addae71ef4a70eb16a9639bd6204fd2b9)
2020-02-09media: Add support for ADV7280 decoder driverSanchayan Maity
Add support for ADV7280 decoder found on Toradex Analogue Camera Adapter V2.0A Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 481bf320816c56c726197d6155341c2f94aeb6be) (cherry picked from commit 7df8a0f4065f1085ec1765ddfc65b0106ba3faad)
2020-02-09mxc_v4l2_capture: Change error message to print on debugSanchayan Maity
Change the "unsupported ioctrl" message to print only on debug. This otherwise results in an error message ERROR: v4l2 capture: unsupported ioctrl! which does not seem to effect the gstreamer pipeline or rendering of video. >From debugging, root@apalis-imx6:~# gst-launch-1.0 imxv4l2videosrc ! imxeglvivsink Setting pipeline to PAUSED ... [ 385.174543] ERROR: v4l2 capture: unsupported ioctrl 9a091b! Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock >From v4l2-controls.h V4L2_CTRL_CLASS_CAMERA 0x009a0000 V4L2_CID_CAMERA_CLASS_BASE V4L2_CTRL_CLASS_CAMERA | 0x900 V4L2_CID_3A_LOCK V4L2_CID_CAMERA_CLASS_BASE + 27 So the ioctrl requested seems to be V4L2_CID_3A_LOCK. "The V4L2_CID_3A_LOCK bitmask control allows applications to pause or resume the automatic exposure, focus and wite balance adjustments. It can be used, for example, to lock the 3A adjustments right before a still image is captured, for pre-focus, etc. The applications can control each of the algorithms independently, through a corresponding control bit, if driver allows that." https://patchwork.linuxtv.org/patch/10719/ Since we have no such feature available we can safely disable the error message. Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit f1b52e225091711d60704717af34c2f321c032b3) (cherry picked from commit 358a46afbf83035dc02d7b017088d5644ef9a74e)
2020-02-09mxc_v4l2_capture: Allow clock setting for de-interlaced video inputSanchayan Maity
Make provision for a decoder driver to specify clock mode for progressive in case the decoder provides deinterlaced output. This is required for ADV7280 decoder where we can use the hardware deinterlace capabity of ADV7280. Without setting the clock mode to progressive but having hardware deinterlace on for ADV7280 results in a non working setup. Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 0368155fc985c8e2bf6334fc5b56ff2ac6082908) (cherry picked from commit 80aae0b2253258df3bd056a719de3b1b1c5b223a)
2020-02-09tty: serial: imx: disable DCD and RI interruptsStefan Agner
If the UART is in DTE mode, the signals DCD and RI are inputs. In this case, the control bits in UCR3_DCD and UCR3_RI control the interrupt of those two inputs. The two bits are 1 on reset, hence leading to an interrupt if one of those signal changes... However, as of now the interrupt handler does not handle these interrupts, leading to a interrupt strom. Solve the issue by explicitly disabling the two interrupts during initialization. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 2d027fec8264daa4cda1bcc81cabb91bd97cde0b) (cherry picked from commit 0d85191ac6663ea3e2ff84d96f20c62144549f27)
2020-02-09PCI: Apalis GEN1 forcing quirkMarcel Ziswiler
The Apalis evaluation board needs to set the link speed to 2.5 GT/s (GEN1). The default link speed setting is 5 GT/s (GEN2). 0x98 is the Link Control 2 PCIe Capability Register of the PEX8605 PCIe switch. The switch supports link speed auto negotiation, but falsely sets the link speed to 5 GT/s. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 408da680a57dfa782b4f70c77616ff765a87823f) (cherry picked from commit 8ddc702c57a79cf0f4e8334ba6a593b472cfd44a)