100 Commits
Author SHA1 Message Date
Marek Vasut 3e62aba828 media: imx-mipi-csis: Check csis_fmt validity before use
The find_csis_format() may return NULL in case supported format is not
found, check the return value of find_csis_format() before using the
result to avoid NULL pointer dereference.

Fixes: 11927d0fd0 ("media: imx-mipi-csis: Use V4L2 subdev active state")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-26 11:21:33 +01:00
Marek Vasut d065155ec8 clk: rs9: Drop unused pin_xin field
The pin_xin field in struct rs9_driver_data is unused, drop it.

Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Alexander Stein <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2023-02-17 20:46:04 -08:00
Marek Vasut 3f6c02fa71 serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
Requesting an interrupt with IRQF_ONESHOT will run the primary handler
in the hard-IRQ context even in the force-threaded mode. The
force-threaded mode is used by PREEMPT_RT in order to avoid acquiring
sleeping locks (spinlock_t) in hard-IRQ context. This combination
makes it impossible and leads to "sleeping while atomic" warnings.

Use one interrupt handler for both handlers (primary and secondary)
and drop the IRQF_ONESHOT flag which is not needed.

Fixes: e359b4411c ("serial: stm32: fix threaded interrupt handling")
Reviewed-by: Sebastian Andrzej Siewior <[email protected]>
Tested-by: Valentin Caron <[email protected]> # V3
Signed-off-by: Marek Vasut <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-01-31 11:15:01 +01:00
Marek Vasut 015d44c2b7 media: uvcvideo: Add GUID for BGRA/X 8:8:8:8
The Cypress EZUSB FX3 UVC example can be configured to report pixel
format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for
BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420.
This seems to be an extension documented in the Microsoft Windows Media
Format SDK[2]. This Media Format SDK defines this GUID as corresponding
to `MEDIASUBTYPE_RGB32`, which is confirmed by [4] as `MEDIASUBTYPE_ARGB32`
has different GUID.

Note that in my case, the FX3 UVC can output either channel order,
BGR or RGB or any other mix for that matter. Since Linux commit
1b8dc32286 ("[media] uvcvideo: Add GUID for BGR 8:8:8")
defined a GUID for `MEDIASUBTYPE_RGB24` channel order as BGR, keep
this change consistent and define `MEDIASUBTYPE_RGB32` as BGR as well.
Document [3] also indicates the channel order is BGR.

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Ricardo Ribalda <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-01-31 09:40:42 +01:00
Marek Vasut 21d64f6f63 ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding
Get rid of the vf610 sai special case, instead update the vfxxx.dtsi
DT to use the same DMA channel ordering as all the other devices. The
sai DMA channel ordering has not been aligned with other IP DMA channel
ordering in the vfxxx.dtsi anyway.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2023-01-30 13:35:13 +00:00
Marek Vasut a51e4facca arm64: dts: imx8mp: Drop sd-vsel-gpios from i.MX8M Plus DHCOM SoM
The VSELECT pin is configured as MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT
and not as a GPIO, drop the bogus sd-vsel-gpios property as the eSDHC
block handles the VSELECT pin on its own.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut 7364fbba55 arm64: dts: imx8mp: Drop sd-vsel-gpios from i.MX8M Plus Verdin SoM
The VSELECT pin is configured as MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT
and not as a GPIO, drop the bogus sd-vsel-gpios property as the eSDHC
block handles the VSELECT pin on its own.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut 8bad8c923f arm64: dts: imx8mm: Drop sd-vsel-gpios from i.MX8M Mini Verdin SoM
The VSELECT pin is configured as MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT
and not as a GPIO, drop the bogus sd-vsel-gpios property as the eSDHC
block handles the VSELECT pin on its own.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut ab15670727 arm64: dts: imx8mp: Improve bluetooth UART on DH electronics i.MX8M Plus DHCOM
Use PLL1_80M instead of PLL3 to drive UART2 clock divided down to 80 MHz
instead of 64 MHz to obtain suitable block clock for exact 4 Mbdps, which
is the maximum supported baud rate by the muRata 2AE BT UART.

The difference here is that at 64 MHz UART block clock, the clock with are
divided by 16 (due to oversampling) to 4 MHz and the baud rate generator
then needs to be set to UBIR+1/UBMR+1 = 1/1 to yield 4 Mbdps . In case of
80 MHz UART block clock divided by 16 to 5 MHz, the baud rate generator
needs to be set to UBIR+1/UBMR+1 = 4/5 to yield 4 Mbdps .

Both options are valid and yield the same result, except using the PLL1_80M
output requires fewer clock tree changes, since the PLL1 already generates
the 80 MHz usable for UART, which frees the PLL3 for other uses.

Suggested-by: Christoph Niedermaier <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut bae293e9e7 arm64: dts: imx8mp: Reorder clock to match fsl,imx6q-pcie.yaml
Reorder the PCIe clock in DT to match YAML DT schema. No functional change.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Richard Zhu <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut 1a9629f78a arm64: dts: imx8mq: Deduplicate PCIe clock-names property
Move the PCIe clock-names property from various DTs into SoC dtsi to
reduce duplication. In case of a couple of boards, reorder the clock
so they match the order in yaml DT bindings.

Reviewed-by: Alexander Stein <[email protected]> # imx8mq.dtsi, imx8mq-tqma8mq-mba8mx.dts
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Richard Zhu <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut 3c033fb139 arm64: dts: imx8mm: Deduplicate PCIe clock-names property
Move the PCIe clock-names property from various DTs into SoC dtsi to
reduce duplication. In case of a couple of boards, reorder the clock
so they match the order in yaml DT bindings.

Reviewed-by: Alexander Stein <[email protected]> # imx8mm.dtsi, imx8mm-tqma8mqml-mba8mx.dts
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Richard Zhu <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 16:37:57 +08:00
Marek Vasut 5bd9ffed9e ARM: dts: vfxxx: Swap SAI DMA order
Swap the SAI dmas and dma-names to match the order documented in
Documentation/devicetree/bindings/sound/fsl,sai.yaml
No functional change.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-26 07:57:06 +08:00
Marek Vasut de65538684 media: dt-bindings: media: imx7-csi: Document i.MX8M power-domains property
The power-domains property is mandatory on i.MX8M Quad and Mini.
Document the property and mark it as required on the aforementioned
variants of the IP, present in those SoCs.

Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Alexander Stein <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-01-22 09:25:55 +01:00
Marek Vasut f24771b62a serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
Requesting an interrupt with IRQF_ONESHOT will run the primary handler
in the hard-IRQ context even in the force-threaded mode. The
force-threaded mode is used by PREEMPT_RT in order to avoid acquiring
sleeping locks (spinlock_t) in hard-IRQ context. This combination
makes it impossible and leads to "sleeping while atomic" warnings.

Use one interrupt handler for both handlers (primary and secondary)
and drop the IRQF_ONESHOT flag which is not needed.

Fixes: e359b4411c ("serial: stm32: fix threaded interrupt handling")
Reviewed-by: Sebastian Andrzej Siewior <[email protected]>
Tested-by: Valentin Caron <[email protected]> # V3
Signed-off-by: Marek Vasut <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-01-19 14:55:00 +01:00
Marek Vasut 01338bb82f drm/bridge: tc358767: Set default CLRSIPO count
The current CLRSIPO count is still marginal and does not work with high
DSI clock rates in burst mode. Increase it further to allow the DSI link
to work at up to 1Gbps lane speed. This returns the counts to defaults
as provided by datasheet.

Fixes: ea6490b022 ("drm/bridge: tc358767: increase CLRSIPO count")
Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-01-16 13:47:30 +01:00
Marek Vasut 8e88a0feeb gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
Always configure GPIO pins which are used as interrupt source as INPUTs.
In case the default pin configuration is OUTPUT, or the prior stage does
configure the pins as OUTPUT, then Linux will not reconfigure the pin as
INPUT and no interrupts are received.

Always configure the interrupt source GPIO pin as input to fix the above case.

Reviewed-by: Linus Walleij <[email protected]>
Fixes: 07bd1a6cc7 ("MXC arch: Add gpio support for the whole platform")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-01-16 10:55:05 +01:00
Marek Vasut e546427762 gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
The driver currently performs register read-modify-write without locking
in its irqchip part, this could lead to a race condition when configuring
interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
the register read-modify-write.

Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Marc Zyngier <[email protected]>
Fixes: 07bd1a6cc7 ("MXC arch: Add gpio support for the whole platform")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-01-16 10:54:45 +01:00
Marek Vasut c7b5e7f002 dt-bindings: arm: Move i.MX8MM Cloos PHG Board to TQM entry
The i.MX8MM Cloos PHG Board is based on TQ-Systems GmbH i.MX8MM TQMa8MQML SOM,
which results in compatible string in the form:
"vendor,custom-board", "tqm,som", "fsl,soc"
Move the binding entry so this triplet can be matched on.

Acked-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Alexander Stein <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-09 17:51:47 +08:00
Marek Vasut a071fc9d55 dt-bindings: arm: Split i.MX8M Plus DHCOM based boards
The i.MX8M Plus DHCOM based boards have compatible string in the form:
"vendor,custom-board", "dh,som", "fsl,soc"
or
"dh,carrier-board", "dh,som", "fsl,soc"
Split the binding entry so this triplet can be matched on.

Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-09 17:51:44 +08:00
Marek Vasut 7342b6f90e dt-bindings: arm: Split i.MX8M Mini NITROGEN SoM based boards
The NITROGEN SoM based boards have compatible string in the form:
"vendor,custom-board", "boundary,som", "fsl,soc"
Split the binding entry so this triplet can be matched on.

Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-09 17:51:41 +08:00
Marek Vasut d0a6eb3880 dt-bindings: arm: Move MX8Menlo board to i.MX8M Mini Toradex Verdin SoM entry
The MX8Menlo board is based on i.MX8M Mini Toradex Verdin SoM
which results in compatible string in the form:
"vendor,custom-board", "toradex,som-nonwifi", "toradex,som", "fsl,soc"
Move the binding entry so this quadruplet can be matched on.

Acked-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Rob Herring <[email protected]>
Reviewed-by: Francesco Dolcini <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-09 17:51:28 +08:00
Marek Vasut 2f440c4f04 arm64: dts: imx8mm: Reinstate GPIO watchdog always-running property on eDM SBC
The GPIO watchdog property name is 'always-running', not 'always-enabled'.
Use the correct property name and reinstate it into the DT.

Fixes: eff6b33c9c ("arm64: dts: imx8mm: Remove watchdog always-enabled property from eDM SBC")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-09 15:19:23 +08:00
Marek Vasut a4b2e6063c firmware: xilinx: Clear IOCTL_SET_SD_TAPDELAY using PM_MMIO_WRITE
In case the tap delay required by Arasan SDHCI is set to 0, the current
embeddedsw firmware unconditionally writes IOU_SLCR SD_ITAPDLY to 0x100
(SD0_ITAPDLYENA=1, SD0_ITAPDLYSEL=0). Previous behavior was to keep the
IOU_SLCR SD_ITAPDLY set to 0x0. There is some sort of difference in the
behavior between SD0_ITAPDLYENA=1/0 with the same SD0_ITAPDLYSEL=0, even
though the behavior should be identical -- zero delay added to rxclk_in
line. The former breaks HS200 training in low temperature conditions.

Write IOU_SLCR SD_ITAPDLY register to 0 using PM_MMIO_WRITE which seem
to allow unrestricted WRITE access (and PM_MMIO_READ which allows read
access) to the entire address space. This way, it is possible to work
around the defect in IOCTL_SET_SD_TAPDELAY design which does not permit
clearing SDx_ITAPDLYENA bit.

Note that the embeddedsw firmware does not permit clearing the SD_ITAPDLY
SD0_ITAPDLYENA bit, this bit can only ever be set by the firmware and it
is often impossible to update the possibly broken firmware.

Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
2023-01-05 10:18:07 +01:00
Marek Vasut c688e0c436 power: supply: bq25890: Add HiZ mode support
The bq25890 is capable of disconnecting itself from the external supply,
in which case the system is supplied only from the battery. This can be
useful e.g. to test the pure battery operation, or draw no power from
USB port.

Implement support for this mode, which can be toggled by writing 0 or
non-zero to sysfs 'online' attribute, to select either offline or online
mode.

The IRQ handler has to be triggered to update chip state, as switching
to and from HiZ mode does not generate an interrupt automatically.

The IRQ handler reinstates the HiZ mode in case a cable is replugged by
the user, the chip itself clears the HiZ mode bit when cable is plugged
in by the user and the chip detects PG bad-to-good transition.

Signed-off-by: Marek Vasut <[email protected]>
[[email protected]: Replace "&" with "&&" in a boolean check]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2023-01-03 00:04:26 +01:00
Marek Vasut d1b25092b3 power: supply: bq25890: Factor out chip state update
Pull the chip state and ADC conversion update functionality out into
separate function, so it can be reused elsewhere in the driver. This
is a preparatory patch, no functional change.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2023-01-03 00:04:26 +01:00
Marek Vasut e9b751ca25 arm64: dts: imx8mp: Add Hantro G1, G2 DT nodes
Add DT nodes for the Hantro VPU found in i.MX8MP SoC.

Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Tested-by: Adam Ford <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 12:53:56 +08:00
Marek Vasut 3d6e48e87b arm64: dts: imx8mn: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:34:14 +08:00
Marek Vasut ed445e486e arm64: dts: imx8mm: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:34:06 +08:00
Marek Vasut 9928f0a9e7 ARM: dts: imx7s: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:33:02 +08:00
Marek Vasut f97f635395 ARM: dts: imx6ul: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:32:59 +08:00
Marek Vasut 16d194d200 ARM: dts: imx6sx: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:32:56 +08:00
Marek Vasut 5dd1cf3a77 ARM: dts: imx6qdl: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:32:53 +08:00
Marek Vasut b0bb79339a ARM: dts: mxs: Drop dma-apb interrupt-names
Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:32:41 +08:00
Marek Vasut 2314515e9c arm64: dts: imx8mm: Update i.MX8M Mini Toradex Verdin based Menlo board compatible string
Update the board compatible string such that it matches the YAML DT
schema for validation, add the "toradex,verdin-imx8mm-nonwifi" entry.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Francesco Dolcini <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 11:17:39 +08:00
Marek Vasut c10a585548 arm64: dts: imx8mm: Drop xtal clock specifier from eDM SBC
The clk_xtal32k have clock-cells = <0>, drop the bogus specifier.

Fixes: 9509593f32 ("arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 10:33:20 +08:00
Marek Vasut e7e99f19b7 arm64: dts: imx8mn: Add LDO5 regulator-name to Variscite VAR-SOM-MX8MN
The PMIC on this Variscite SOM and its MX8MM variant lists regulator-name
for all LDOs except this LDO5, add the regulator-name property to avoid
this omission.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 10:28:50 +08:00
Marek Vasut fd44be72cc arm64: dts: imx8mn: Drop deprecated regulator-compatible from Variscite VAR-SOM-MX8MN
The "regulator-compatible" property is deprecated and unused, as the
match happens on the node name in Linux of_regulator_match() in case
the property is not present. Drop the deprecated property from DT.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 10:26:55 +08:00
Marek Vasut 9a53e97832 arm64: dts: imx8mm: Drop deprecated regulator-compatible from Variscite VAR-SOM-MX8MM
The "regulator-compatible" property is deprecated and unused, as the
match happens on the node name in Linux of_regulator_match() in case
the property is not present. Drop the deprecated property from DT.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 10:26:43 +08:00
Marek Vasut db9dd598b4 arm64: dts: imx8mp: Drop deprecated regulator-compatible from i.MX8M Plus DHCOM
The "regulator-compatible" property is deprecated and unused, as the
match happens on the node name in Linux of_regulator_match() in case
the property is not present. Drop the deprecated property from DT.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2023-01-01 10:26:12 +08:00
Marek Vasut 105b9bb84f arm64: dts: imx8m: Add TMU phandle to calibration data in OCOTP
The TMU TASR, TCALIVn, TRIM registers must be explicitly programmed with
calibration values in OCOTP. Add the OCOTP calibration values phandle so
the TMU driver can perform this programming.

The MX8MM/MX8MN TMUv1 uses only one OCOTP cell, while MX8MP TMUv2 uses 4.

Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-12-31 20:35:01 +08:00
Marek Vasut 5b81a87ddd arm64: dts: imx8m: Document the fuse address calculation
The mapping from OCOTP reg DT property to Fusemap Descriptions Table in
the datasheet is often unclear. Add a comment to make it easier to find
out how it works. No functional change.

Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-12-31 20:34:52 +08:00
Marek Vasut ee0d68f219 arm64: dts: imx8m: Align SoC unique ID node unit address
Align the SoC unique ID DT node unit address with its reg property.

Reviewed-by: Peng Fan <[email protected]>
Fixes: cbff23797f ("arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-12-31 20:34:43 +08:00
Marek Vasut 0642b3f47c dt-bindings: dma: fsl-mxs-dma: Convert MXS DMA to DT schema
Convert the MXS DMA binding to DT schema format using json-schema.

Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c
in Linux kernel does not use it, the property contains duplicate array entries
in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get
rid of that optional property altogether.

Update example node names to be standard dma-controller@ ,
add global interrupt-parent property into example.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2022-12-28 11:59:56 +05:30
Marek Vasut e21a77d8da dt-bindings: watchdog: gpio: Convert bindings to YAML
Convert the gpio-wdt bindings from text to YAML ones, to permit DT validation.

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[robh: add missing 'always-running']
Signed-off-by: Rob Herring <[email protected]>
2022-12-16 11:41:49 -06:00
Marek Vasut 1a2cead15b dt-bindings: imx6q-pcie: Handle more resets on legacy platforms
The i.MX6 and i.MX7D does not use block controller to toggle PCIe
reset, hence the PCIe DT description contains three reset entries
on these older SoCs. Add this exception into the binding document.

Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
2022-12-16 11:41:49 -06:00
Marek Vasut 8b8161edf1 dt-bindings: imx6q-pcie: Handle various PD configurations
The i.MX SoCs have various power domain configurations routed into
the PCIe IP. MX6SX is the only one which contains 2 domains and also
uses power-domain-names. MX6QDL do not use any domains. All the rest
uses one domain and does not use power-domain-names anymore.

Document all those configurations in the DT binding document.

Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
2022-12-16 11:41:48 -06:00
Marek Vasut 22c9f19002 dt-bindings: imx6q-pcie: Handle various clock configurations
The i.MX SoCs have various clock configurations routed into the PCIe IP,
the list of clock is below. Document all those configurations in the DT
binding document.

All SoCs: pcie, pcie_bus
6QDL, 7D: + pcie_phy
6SX:      + pcie_phy          pcie_inbound_axi
8MQ:      + pcie_phy pcie_aux
8MM, 8MP: +          pcie_aux

Reviewed-by: Rob Herring <[email protected]>
Acked-by: Alexander Stein <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
2022-12-16 11:41:48 -06:00
Marek Vasut f62678a77d dt-bindings: mxsfb: Document i.MX8M/i.MX6SX/i.MX6SL power-domains property
The power-domains property is mandatory on i.MX8M Mini, Nano, Plus
and i.MX6SX, i.MX6SL. Document the property and mark it as required
on the aforementioned variants of the IP, present in those SoCs.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Liu Ying <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
2022-12-16 11:41:48 -06:00
Marek Vasut 4032916488 thermal/drivers/imx: Add support for loading calibration data from OCOTP
The TMU TASR, TCALIVn, TRIM registers must be explicitly programmed with
calibration values in OCOTP. Add support for reading the OCOTP calibration
data and programming those into the TMU hardware.

The MX8MM/MX8MN TMUv1 uses only one OCOTP cell, while MX8MP TMUv2 uses 4,
the programming differs in each case.

Based on U-Boot commits:
70487ff386c ("imx8mm: Load fuse for TMU TCALIV and TASR")
ebb9aab318b ("imx: load calibration parameters from fuse for i.MX8MP")

Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
2022-12-14 15:25:40 +01:00
Marek Vasut 8848c0d7a0 dt-bindings: thermal: imx8mm-thermal: Document optional nvmem-cells
The TMU TASR, TCALIVn, TRIM registers must be explicitly programmed with
calibration values from OCOTP. Document optional phandle to OCOTP nvmem
provider.

Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
2022-12-14 15:25:40 +01:00
Marek Vasut 02d056a340 Bluetooth: hci_bcm: Add CYW4373A0 support
CYW4373A0 is a Wi-Fi + Bluetooth combo device from Cypress.
This chip is present e.g. on muRata 2AE module.

This chip has additional quirk where the HCI command 0xfc45, used on
older chips to switch UART clock from 24 MHz to 48 MHz, to support
baudrates over 3 Mbdps, is no longer recognized by this newer chip.
This newer chip can configure the 4 Mbdps baudrate without the need
to issue HCI command 0xfc45, so add flag to indicate this and do not
issue the command on this chip to avoid failure to set 4 Mbdps baud
rate.

It is not clear whether there is a way to determine which chip does
and which chip does not support the HCI command 0xfc45, other than
trial and error.

Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
2022-12-12 14:19:24 -08:00
Marek Vasut 892913f0f2 dt-bindings: net: broadcom-bluetooth: Add CYW4373A0 DT binding
CYW4373A0 is a Wi-Fi + Bluetooth combo device from Cypress.
This chip is present e.g. on muRata 2AE module. Extend the
binding with its DT compatible.

Acked-by: Rob Herring <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
2022-12-12 14:19:24 -08:00
Marek Vasut 3e39f7971d dt-bindings: rtc: m41t80: Convert text schema to YAML one
Convert the m41t80 text schema to YAML schema.

Add "#clock-cells" requirement, which is required by clock-output-names.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
2022-12-12 10:23:46 +01:00
Marek Vasut e85b1f5a97 ASoC: dt-bindings: fsl-sai: Reinstate i.MX93 SAI compatible string
The ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings
dropped i.MX93 SAI compatible string, reinstate it.

Fixes: 81b6c043e7 ("ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings")
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-12-08 11:46:36 +00:00
Marek Vasut 2ab441f9c2 dt-bindings: mmc: arm,pl18x: Document interrupt-names is ignored
Due to inconsistency of existing DTs regarding the content of this IP
interrupt-names DT property, document this such that interrupt-names
is not used by this IP bindings.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
2022-12-07 13:22:32 +01:00
Marek Vasut 0958944a93 media: mt9p031: Increase post-reset delay
The MT9P006 sensor driver sporadically fails to probe because the sensor
responds with a NACK condition to I2C address on the bus during an attempt
to read the sensor MT9P031_CHIP_VERSION register in mt9p031_registered().

Neither the MT9P006 nor MT9P031 datasheets are clear on reset signal timing.
Older MT9M034 [1] datasheet provides those timing figures in Appendix-A and
indicates it is necessary to wait 850000 EXTCLK cycles before starting any
I2C communication.

Add such a delay, which does make the sporadic I2C NACK go away, so it is
likely similar constraint applies to this sensor.

[1] https://www.onsemi.com/pdf/datasheet/mt9m034-d.pdf

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25 08:42:24 +00:00
Marek Vasut e208ad015f media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from mt9p031_init_cfg()
The mt9p031_init_cfg() already calls __mt9p031_get_pad_crop(), which
correctly calls v4l2_subdev_get_try_crop() on V4L2_SUBDEV_FORMAT_TRY
or returns &mt9p031->crop on V4L2_SUBDEV_FORMAT_ACTIVE. No need to
call v4l2_subdev_get_try_crop() in mt9p031_init_cfg() again in case
of both V4L2_SUBDEV_FORMAT_TRY and V4L2_SUBDEV_FORMAT_ACTIVE.

This also fixes a splat generated by this call since commit
2ba3e38517 ("media: v4l: subdev: Fail graciously when getting try data for NULL state")
because v4l2_subdev_get_try_crop() is called with sd_state = NULL
in mt9p031_init_cfg().

Fixes: 69681cd041 ("media: mt9p031: Move open subdev op init code into init_cfg")
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25 08:41:27 +00:00
Marek Vasut 581c848b61 extcon: usbc-tusb320: Update state on probe even if no IRQ pending
Currently this driver triggers extcon and typec state update in its
probe function, to read out current state reported by the chip and
report the correct state to upper layers. This synchronization is
performed correctly, but only in case the chip indicates a pending
interrupt in reg09 register.

This fails to cover the situation where all interrupts reported by
the chip were already handled by Linux before reboot, then the system
rebooted, and then Linux starts again. In this case, the TUSB320 no
longer reports any interrupts in reg09, and the state update does not
perform any update as it depends on that interrupt indication.

Fix this by turning tusb320_irq_handler() into a thin wrapper around
tusb320_state_update_handler(), where the later now contains the bulk
of the code of tusb320_irq_handler(), but adds new function parameter
"force_update". The "force_update" parameter can be used by the probe
function to assure that the state synchronization is always performed,
independent of the interrupt indicated in reg09. The interrupt handler
tusb320_irq_handler() callback uses force_update=false to avoid state
updates on potential spurious interrupts and retain current behavior.

Fixes: 06bc4ca115 ("extcon: Add driver for TI TUSB320")
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Alvin Šipraga <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22 17:31:09 +01:00
Marek Vasut 2d0b08c157 MAINTAINERS: mark rsi wifi driver as orphan
Neither Redpine Signals nor Silicon Labs seem to care about proper
maintenance of this driver, nor is there any help, documentation or
feedback on patches. The driver suffers from various problems and
subtle bugs. Mark it as orphaned.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-11-22 11:19:48 +02:00
Marek Vasut 6a11d3a00d clk: imx: pll14xx: Add 320 MHz and 640 MHz entries for PLL146x
The PLL146x is used to implement SYS_PLL3 on i.MX8MP and can be used
to drive UARTn_ROOT clock. By setting the PLL3 to 320 MHz or 640 MHz,
the PLL3 output can be divided down to supply UARTn_ROOT clock with
precise 64 MHz, which divided down further by 16x oversampling factor
used by the i.MX UART core yields 4 Mbdps baud base for the UART IP.
This is useful e.g. for BCM bluetooth chips, which can operate up to
4 Mbdps.

Add 320 MHz and 640 MHz entries so the PLL can be configured accordingly.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Abel Vesa <[email protected]>
Signed-off-by: Abel Vesa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-11-22 00:04:49 +02:00
Marek Vasut d8515330a6 ARM: dts: stm32: Rename mdio0 to mdio on DHCOR Testbench board
Replace "mdio0" node with "mdio" to match mdio.yaml DT schema.

Fixes: c8ce0dd755 ("ARM: dts: stm32: Add DHCOR based Testbench board")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-11-17 11:16:05 +01:00
Marek Vasut 04c439b367 dt-bindings: nvmem: snvs-lpgpr: Fix i.MX8M compatible strings
The compatible strings for "fsl,imx8m*-snvs-lpgpr" always contain
the fallback "fsl,imx7d-snvs-lpgpr" compatible in DTs too, since
the fallback compatible is what the driver matches on, this way:
  compatible = "fsl,imx8mm-snvs-lpgpr", "fsl,imx7d-snvs-lpgpr"
The older "fsl,imx7d-snvs-lpgpr" and "fsl,imx6*-snvs-lpgpr" used
only that single compatible string.

Document both options in the binding document.

Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Alexander Stein <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 14:23:58 +08:00
Marek Vasut eff6b33c9c arm64: dts: imx8mm: Remove watchdog always-enabled property from eDM SBC
There is no such always-enabled property supported by gpio-watchdog
driver or described in its bindings, remove it.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 14:17:20 +08:00
Marek Vasut 0c068a364a arm64: dts: imx8mm: imx8mn: imx8mp: imx8mq: Replace opp-xM with opp-x000000
Fix the following dtbs_check warning on all of i.MX8M variants:
"
opp-table: Unevaluated properties are not allowed ('opp-25M', 'opp-100M', 'opp-750M' were unexpected)
"
Using the following command:
"
$ sed -i '/opp-[0-9]\+M/ s@M {@000000 {@' arch/arm64/boot/dts/freescale/imx8m*
"

The Documentation/devicetree/bindings/opp/opp-v2-base.yaml expects the OPP
subnode names to be full frequency listings in Hz without unit suffixes.
Only the i.MX8M DTs are affected per "git grep 'opp-[0-9]\+M'", so fix them.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 14:17:11 +08:00
Marek Vasut 5468e93b5b arm64: dts: imx8mn: Fix NAND controller size-cells
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"

Fixes: 6c3debcbae ("arm64: dts: freescale: Add i.MX8MN dtsi support")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 13:53:57 +08:00
Marek Vasut 1610233bc2 arm64: dts: imx8mm: Fix NAND controller size-cells
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"
Fix the missing space in node name too.

Fixes: a05ea40eb3 ("arm64: dts: imx: Add i.mx8mm dtsi support")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 13:53:52 +08:00
Marek Vasut 753395ea1e ARM: dts: imx7: Fix NAND controller size-cells
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
"
Fix the missing space in node name too.

Fixes: e7495a45a7 ("ARM: dts: imx7: add GPMI NAND and APBH DMA")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 13:53:42 +08:00
Marek Vasut 12bd480018 arm64: dts: imx8mm-data-modul: Rename /watchdog-gpio to plain /watchdog
The DT bindings checker is confused by the -gpio node suffix,
drop it to fix the following warning:
"
imx8mm-data-modul-edm-sbc.dtb: /: watchdog-gpio: {'pinctrl-names': ['default'], 'pinctrl-0': [[104]], 'compatible': ['linux,wdt-gpio'], 'always-enabled': True, 'gpios': [[45, 8, 0]], 'hw_algo': ['level'], 'hw_margin_ms': [[1500]], 'status': ['disabled']} is not of type 'array'
"

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 13:49:43 +08:00
Marek Vasut a9404a8917 arm64: dts: imx8mp: Bind bluetooth UART on DH electronics i.MX8M Plus DHCOM
The i.MX8MP DHCOM SoM does contain muRata 2AE WiFi+BT chip, bind the
bluetooth to UART2 using btbcm and hci_bcm drivers. Use PLL3 to drive
UART2 clock divided down to 64 MHz to obtain suitable block clock for
exact 4 Mbdps, which is the maximum supported baud rate by the muRata
2AE BT UART.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-11-11 10:57:53 +08:00
Marek Vasut 3e4f964ddd ASoC: dt-bindings: fsl-sai: Sort main section properties
Sort main section properties, no functional change.

Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-11-10 17:52:45 +00:00
Marek Vasut ef55595548 ASoC: dt-bindings: fsl-sai: Use minItems 5 for i.MX8MN clock and similar
The i.MX8MN currently uses "bus", "mclk0", "mclk1", "mclk2", "mclk3"
clock, which adds up to 5 clock total. Use minItems 5 for this setup.

Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-11-10 17:52:44 +00:00
Marek Vasut 81b6c043e7 ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings
Describe existing used combinations of compatible strings on MX6UL
and MX7D, which are backward compatible with MX6SX. Add the missing
imx7d-sai compatible string which is used on i.MX7 .

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-11-10 17:52:43 +00:00
Marek Vasut fff61d4ccf dt-bindings: usb: usb251xb: Convert to YAML schema
Convert the usb251xb hub DT bindings from text to yaml schema so it is
possible to validate DTs against the schema.

Adjust the example to describe two different hubs at different I2C bus
addresses, to avoid I2C address collission in the example.

Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-09 11:43:21 +01:00
Marek Vasut e3cac8f774 drm: lcdif: Set and enable FIFO Panic threshold
In case the LCDIFv3 is used to drive a 4k panel via i.MX8MP HDMI bridge,
the LCDIFv3 becomes susceptible to FIFO underflows, these lead to nasty
flicker of the image on the panel, or image being shifted by half frame
horizontally every second frame. The flicker can be easily triggered by
running 3D application on top of weston compositor, like neverball or
chromium. Surprisingly glmark2-es2-wayland or glmark2-es2-drm does not
trigger this effect so easily.

Configure the FIFO Panic threshold register and enable the FIFO Panic
mode, which internally boosts the NoC interconnect priority for LCDIFv3
transactions in case of possible underflow. This mitigates the flicker
effect on 4k panels as well.

Fixes: 9db35bb349 ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Signed-off-by: Marek Vasut <[email protected]>
Tested-by: Liu Ying <[email protected]> # i.MX8mp EVK
Reviewed-by: Liu Ying <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-11-09 01:31:45 +01:00
Marek Vasut b8f6efccbb wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
When using wpa_supplicant v2.10, this driver is no longer able to
associate with any AP and fails in the EAPOL 4-way handshake while
sending the 2/4 message to the AP. The problem is not present in
wpa_supplicant v2.9 or older. The problem stems from HostAP commit
144314eaa ("wpa_supplicant: Send EAPOL frames over nl80211 where available")
which changes the way EAPOL frames are sent, from them being send
at L2 frames to them being sent via nl80211 control port.

An EAPOL frame sent as L2 frame is passed to the WiFi driver with
skb->protocol ETH_P_PAE, while EAPOL frame sent via nl80211 control
port has skb->protocol set to ETH_P_802_3 . The later happens in
ieee80211_tx_control_port(), where the EAPOL frame is encapsulated
into 802.3 frame.

The rsi_91x driver handles ETH_P_PAE EAPOL frames as high-priority
frames and sends them via highest-priority transmit queue, while
the ETH_P_802_3 frames are sent as regular frames. The EAPOL 4-way
handshake frames must be sent as highest-priority, otherwise the
4-way handshake times out.

Therefore, to fix this problem, inspect the skb control flags and
if flag IEEE80211_TX_CTRL_PORT_CTRL_PROTO is set, assume this is
an EAPOL frame and transmit the frame via high-priority queue just
like other ETH_P_PAE frames.

Fixes: 0eb42586cf ("rsi: data packet descriptor enhancements")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-11-08 09:41:02 +02:00
Marek Vasut 2f7fa366ba ARM: dts: qcom: Drop MMCI interrupt-names
The pl18x MMCI driver does not use the interrupt-names property,
the binding document has been updated to recommend this property
be unused, remove it.

Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-11-07 10:50:53 -06:00
Marek Vasut 79d0224f6b tty: serial: imx: Handle RS485 DE signal active high
The default polarity of RS485 DE signal is active high. This driver does
not handle such case properly. Currently, when a pin is multiplexed as a
UART CTS_B on boot, this pin is pulled HIGH by the i.MX UART CTS circuit,
which activates DE signal on the RS485 transceiver and thus behave as if
the RS485 was transmitting data, so the system blocks the RS485 bus when
it starts and until user application takes over. This behavior is not OK.
The problem consists of two separate parts.

First, the i.MX UART IP requires UCR1 UARTEN and UCR2 RXEN to be set for
UCR2 CTSC and CTS bits to have any effect. The UCR2 CTSC bit permits the
driver to set CTS (RTS_B or RS485 DE signal) to either level sychronous
to the internal UART IP clock. Compared to other options, like GPIO CTS
control, this has the benefit of being synchronous to the UART IP clock
and thus without glitches or bus delays. The reason for the CTS design
is likely because when the Receiver is disabled, the UART IP can never
indicate that it is ready to receive data by assering CTS signal, so
the CTS is always pulled HIGH by default.

When the port is closed by user space, imx_uart_stop_rx() clears UCR2
RXEN bit, and imx_uart_shutdown() clears UCR1 UARTEN bit. This disables
UART Receiver and UART itself, and forces CTS signal HIGH, which leads
to the RS485 bus being blocked because RS485 DE is incorrectly active.

The proposed solution for this problem is to keep the Receiver running
even after the port is closed, but in loopback mode. This disconnects
the RX FIFO input from the RXD external signal, and since UCR2 TXEN is
cleared, the UART Transmitter is disabled, so nothing can feed data in
the RX FIFO. Because the Receiver is still enabled, the UCR2 CTSC and
CTS bits still have effect and the CTS (RS485 DE) control is retained.

Note that in case of RS485 DE signal active low, there is no problem and
no special handling is necessary. The CTS signal defaults to HIGH, thus
the RS485 is by default set to Receive and the bus is not blocked.

Note that while there is the possibility to control CTS using GPIO with
either CTS polarity, this has the downside of not being synchronous to
the UART IP clock and thus glitchy and susceptible to slow DE switching.

Second, on boot, before the UART driver probe callback is called, the
driver core triggers pinctrl_init_done() and configures the IOMUXC to
default state. At this point, UCR1 UARTEN and UCR2 RXEN are both still
cleared, but UART CTS_B (RS485 DE) is configured as CTS function, thus
the RTS signal is pulled HIGH by the UART IP CTS circuit.

One part of the solution here is to enable UCR1 UARTEN and UCR2 RXEN and
UTS loopback in this driver probe callback, thus unblocking the CTSC and
CTS control early on. But this is still too late, since the pin control
is already configured and CTS has been pulled HIGH for a short period
of time.

When Linux kernel boots and this driver is bound, the pin control is set
to special "init" state if the state is available, and driver can switch
the "default" state afterward when ready. This state can be used to set
the CTS line as a GPIO in DT temporarily, and a GPIO hog can force such
GPIO to LOW, thus keeping the RS485 DE line LOW early on boot. Once the
driver takes over and UCR1 UARTEN and UCR2 RXEN and UTS loopback are all
enabled, the driver can switch to "default" pin control state and control
the CTS line as function instead. DT binding example is below:

"
&gpio6 {
  rts-init-hog {
    gpio-hog;
    gpios = <5 0>;
    output-low;
    line-name = "rs485-de";
  };
};

&uart5 { /* DHCOM UART2 */
  pinctrl-0 = <&pinctrl_uart5>;
  pinctrl-1 = <&pinctrl_uart5_init>;
  pinctrl-names = "default", "init";
  ...
};
pinctrl_uart5_init: uart5-init-grp {
  fsl,pins = <
...
    MX6QDL_PAD_CSI0_DAT19__GPIO6_IO05       0x30b1
  >;
};

pinctrl_uart5: uart5-grp {
  fsl,pins = <
...
    MX6QDL_PAD_CSI0_DAT19__UART5_CTS_B      0x30b1
  >;
};
"

Tested-by: Christoph Niedermaier <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-03 03:52:29 +01:00
Marek Vasut c62102165d drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
In case mipi_dsi_attach() fails, call drm_panel_remove() to
avoid memory leak.

Fixes: 849b2e3ff9 ("drm/panel: Add Sitronix ST7701 panel driver")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-11-01 23:12:06 +01:00
Marek Vasut 49ee766b36 drm/panel/panel-sitronix-st7701: Clean up CMDnBKx selection
There are two command register files, CMD1 and CMD2, where only the CMD2
contains additional register sub-files BK0..3 . Pull the register file
selection call into separate function instead of duplicating it all over
the driver. The CMD2BK2 file is undocumented in datasheet, and is used
for BIST. No functional change.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-11-01 23:10:23 +01:00
Marek Vasut c1cdee9b68 drm/panel/panel-sitronix-st7701: Fix RTNI calculation
The RTNI field is multiplied by 16 and incremented by 512 before being
used as the minimum number of pixel clock per horizontal line, hence
it is necessary to subtract those 512 bytes from htotal and then divide
the result by 16 before writing the value into the RTNI field. Fix the
calculation.

Fixes: de2b491784 ("drm/panel/panel-sitronix-st7701: Infer horizontal pixel count from TFT mode")
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-11-01 18:34:08 +01:00
Marek Vasut 02693e1161 clk: renesas: r9a06g032: Repair grave increment error
If condition (clkspec.np != pd->dev.of_node) is true, then the driver
ends up in an endless loop, forever, locking up the machine.

Fixes: aad03a66f9 ("clk: renesas: r9a06g032: Add clock domain support")
Reviewed-by: Ralph Siemsen <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Gareth Williams <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Geert Uytterhoeven <[email protected]>
2022-11-01 10:15:28 +01:00
Marek Vasut c2741cbe7f dt-bindings: media: st,stmipid02: Convert the text bindings to YAML
Convert the text STMIPID02 DT bindings to YAML DT format to permit
validation of DTs using this I2C CSI-2 to CPI bridge.

Reviewed-by: Benjamin Mugnier <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
2022-10-30 17:02:38 -05:00
Marek Vasut 14a3d159ab power: supply: bq25890: Add Vsys regulator
The chip is capable of reporting Vsys voltage supplied to the system.
Add regulator which represents the Vsys supply. This can be used e.g.
as a supply for system PMIC input.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:31 +02:00
Marek Vasut 85052e9000 power: supply: bq25890: Add get_voltage support to Vbus regulator
The chip is capable of reporting Vbus voltage, add .get_voltage
implementation to Vbus regulator to report current Vbus voltage.
This requires for the Vbus regulator to be registered always
instead of the current state where the regulator is registered
only in case USB PHY is not found.

Do not provide Vbus regulator enable/disable ops in case USB PHY
is present, as they would race with USB PHY notifier which is also
used to toggle OTG boost mode.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:31 +02:00
Marek Vasut 5f5c10ecaf power: supply: bq25890: Factor out regulator registration code
Pull the regulator registration code into separate function, so it can
be extended to register more regulators later. Currently this is only
moving ifdeffery into one place and other preparatory changes. The
dev_err_probe() output string is changed to explicitly list vbus
regulator failure, so that once more regulators are registered, it
would be clear which one failed.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:31 +02:00
Marek Vasut b63e60ebb3 power: supply: bq25890: Add support for setting user charge current and voltage limit
Let user set battery charge current and voltage limit via sysfs. This is
useful in case the user space needs to reduce charge current to keep the
system within thermal limits. The maximum charge current and voltage are
still limited to "ti,charge-current" and "ti,battery-regulation-voltage"
values to avoid damaging the hardware in case too high values are set by
user space.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:31 +02:00
Marek Vasut 7c85237519 power: supply: bq25890: Clean up POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE
Clean up misuse of POWER_SUPPLY_PROP_VOLTAGE,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
and POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE
and document what exactly each value means.

The POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE content is newly read
back from hardware, while POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
is reported as the maximum value set in DT.

The POWER_SUPPLY_PROP_VOLTAGE is newly used to report immediate value
of battery voltage V_BAT, which is what this property was intended to
report and which has been thus far misused to report the charger chip
output voltage V_SYS.

The V_SYS is no longer reported as there is currently no suitable
property to report V_SYS. V_SYS reporting will be reinstated in
subsequent patch.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:31 +02:00
Marek Vasut 8327a8abd4 power: supply: bq25890: Clean up POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT
Clean up misuse of POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT and
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX and document what
exactly each value means.

The POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT content is newly read
back from hardware, while POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX
is reported as the maximum value set in DT.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:30 +02:00
Marek Vasut ef1ca2102e power: supply: bq25890: Document POWER_SUPPLY_PROP_CURRENT_NOW
Document that POWER_SUPPLY_PROP_CURRENT_NOW really does refer to ADC-sampled
immediate battery charge current I_BAT , since the meaning is not clear with
all the currents which might be measured by charger chips.

Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
2022-10-29 01:40:30 +02:00
Marek Vasut e79d0a43e9 clk: stm32mp1: Staticize ethrx_src
Make ethrx_src array static, this is local to clk-stm32mp1.c

Fixes: e9ed1ef18a ("clk: stm32mp1: Add parent_data to ETHRX clock")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2022-10-27 17:01:16 -07:00
Marek Vasut 195583504b spi: stm32: Print summary 'callbacks suppressed' message
The original fix "spi: stm32: Rate-limit the 'Communication suspended' message"
still leads to "stm32h7_spi_irq_thread: 1696 callbacks suppressed" spew in the
kernel log. Since this 'Communication suspended' message is a debug print, add
RATELIMIT_MSG_ON_RELEASE flag to inhibit the "callbacks suspended" part during
normal operation and only print summary at the end.

Fixes: ea8be08cc9 ("spi: stm32: Rate-limit the 'Communication suspended' message")
Signed-off-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-10-24 12:40:39 +01:00
Marek Vasut d5d577e3d5 ARM: dts: stm32: Fix AV96 WLAN regulator gpio property
The WLAN regulator uses 'gpios' property instead of 'gpio' to specify
regulator enable GPIO. While the former is also currently handled by
the Linux kernel regulator-fixed driver, the later is the correct one
per DT bindings. Update the DT to use the later.

Fixes: 7dd5cbba42 ("ARM: dts: stm32: Enable WiFi on AV96")
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-10-24 11:18:09 +02:00
Marek Vasut 14778e3a86 ARM: dts: stm32: Drop MMCI interrupt-names
The pl18x MMCI driver does not use the interrupt-names property,
the binding document has been updated to recommend this property
be unused, remove it.

Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Yann Gautier <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-10-24 10:34:31 +02:00
Marek Vasut 375347575f arm64: dts: imx8mm: Drop QCA clk out setup on Data Modul i.MX8M Mini eDM SBC
The PHY clock output is not connected to anything, drop the clock output
configuration. This way, the PHY does not generate output clock.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-10-24 09:25:02 +08:00
Marek Vasut 9509593f32 arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC
The PMIC is the 32 kHz clock source for the RTC_XTALI input of the SoC
on this system. The RTC_XTALI input is used to supply 32 kHz clock to
the SVNS RTC per "i.MX 8M Mini Applications Processor Reference Manual,
Rev. 3, 11/2020" page 759 "The 32KHz XTAL module uses a different IP and
it is used as the clock source for the RTC, located in the SNVS." The
PMIC has its own dedicated 32 kHz XTAL on input.

Model the connection in DT.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-10-24 09:23:38 +08:00
Marek Vasut f23f1a1e84 arm64: dts: imx8mm: Enable CPLD_Dn pull down resistor on MX8Menlo
Enable CPLD_Dn pull down resistor instead of pull up to avoid
intefering with CPLD power off functionality.

Fixes: 510c527b4f ("arm64: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board")
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2022-10-23 20:20:05 +08:00
Marek Vasut c8ce0dd755 ARM: dts: stm32: Add DHCOR based Testbench board
Add DT for DHCOR Testbench board, which is a testbench for testing of
DHCOR SoM during manufacturing. This is effectively a trimmed down
version of AV96 board with CSI-2 bridge, HDMI bridge, WiFi, Audio and
LEDs removed and used as GPIOs instead. Furthermore, the PMIC Buck3
is always configured from PMIC NVM to cater for both 1V8 and 3V3 SoM
variant.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-10-21 11:17:25 +02:00
Marek Vasut 2129721244 dt-bindings: arm: stm32: Add compatible string for DH electronics DHCOR Testbench board
Add DT compatible string for DHCOR Testbench board, which is a testbench
for testing of DHCOR SoM during manufacturing. This is effectively a
trimmed down version of AV96 board with CSI-2 bridge, HDMI bridge, WiFi,
Audio and LEDs removed and used as GPIOs instead.

Signed-off-by: Marek Vasut <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-10-21 11:17:25 +02:00
Marek Vasut 0a5ebb1f33 ARM: dts: stm32: Replace SAI format with dai-format DT property
The dai-format and format are handled equally by sound-core.c , the
later is however the only documented property in audio-graph-port.yaml .
Switch to the later.

Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Olivier Moysan <[email protected]>
Signed-off-by: Alexandre Torgue <[email protected]>
2022-10-21 11:17:25 +02:00