- May 21, 2023
-
-
Evangelos Ribeiro Tzaras authored
Enabling autorepeat lets userspace more easily handle increasing or decreasing volume continuously. Signed-off-by:
Evangelos Ribeiro Tzaras <evangelos.tzaras@puri.sm>
-
- May 12, 2023
-
-
Martin Kepplinger authored
-
Martin Kepplinger authored
-
Martin Kepplinger authored
Merge branches '6.3.2/librem5_cam', '6.3.2/librem5_cpuidle', '6.3.2/librem5_deb', '6.3.2/librem5_devfreq', '6.3.2/librem5_hdmi_dp' and '6.3.2/librem5_redpine' into 6.3.2/librem5__integration
-
Following CDP timing requirements defined by USB BC 1.2 specification and section 3.2.4 Detection Timing CDP. During Primary Detection iMX device should turn on VDP_SRC and IDM_SINK for a minimum of 40ms (TVDPSRC_ON). After a time of TVDPSRC_ON, iMX device is allowed to check the status of the D- line. Current implementation is waiting between 1ms and 2ms, and certain BC 1.2 complaint USB HUBs cannot be detected. Increase delay to 40ms allowing enough time for primary detection. During secondary detection the i.MX is required to disable VDP_SRC and IDM_SNK, and enable VDM_SRC and IDP_SINK for at least 40ms (TVDMSRC_ON). This an equivalent patch of BC1.2 fix on USB2 PHY: commit c6d580d9 ("usb: chipidea: imx: Fix Battery Charger 1.2 CDP detection") Reviewed-by:
Xu Yang <xu.yang_2@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com>
-
-
This workarounds issues with circular dependencies on TPS65982.
-
Otherwise usb phy doesn't have a chance to react to a cable being plugged in, since the default role when unplugged is a device mode already.
-
usb phy with charger detection as power supply consumer can't hold power supply use count when there is no interaction with it, otherwise, if we unregister the power supply provider, there will be kernel warning, to resolve this, we put the power supply after use it. Reviewed-by:
Peter Chen <peter.chen@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com>
-
imx8mq and imx8mp USB PHY have battery charging detection function, do it when set phy mode for usb device as this should be done before host start enumeration. Link the detection result to power supply (e.g. typec port manager). Reviewed-by:
Peter Chen <peter.chen@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com>
-
GENMASK(h, l) is creating a contiguous bitmask starting at bit position @l and ending at position @h. Reviewed-by:
Peter Chen <peter.chen@nxp.com> Reviewed-by:
Peng Fan <peng.fan@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com> (cherry picked from commit 56075f3d8b4da4ddf90f699832bbc3a6c14e381f)
-
As we use internal MPLL clocks instead of alternate clocks, so disable alternate clock to save the PHY power when SS PHY at P3. Reviewed-by:
Peter Chen <peter.chen@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com>
-
According to IC engineer suggestion, set ssc_range as -4003 ppm will have more tolerence for EMI, and suitable for more boards. Besides, one customer board needs to set this value to pass TX SSC test. Signed-off-by:
Peter Chen <peter.chen@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com> (cherry picked from commit a48a65a40113b9b5d40114d02a5877d089f523a9)
-
This is to resolve the problem of wakeup system by USB3 device insertion if hsiomix on, in that case, the USB3 device detects rx term on so doesn't donwgrade to USB2, so DP/DM wakeup can't happen, with this override bit we can force the rx term off when enters system suspend, and disable the override after system resume. Reviewed-by:
Peter Chen <peter.chen@nxp.com> Signed-off-by:
Li Jun <jun.li@nxp.com>
-
This new API version is required for at least the BCM4387 firmware. Add support for it, with a fallback to the v1 API. Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by:
Hector Martin <marcan@marcan.st>
-
With AP6275S and imx8mq's usdhc it's pretty common for the loop in brcmf_sdio_kso_control to recover after ~5-7 read tries, with the highest value of try_cnt seen so far being 12. Bump it up a bit to avoid "error while changing bus sleep state" being spammed with power_save enabled. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
Although bcmdhd driver appears to use it for this chipset, it leads to troubles with runtime PM in brcmfmac. Disabling it fixes "failed backplane access" errors and makes the driver more stable in general when power_save is being used. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
In sleep, the card gets powered off. In order to prevent SDIO host from considering the card gone, mark it as non-removable - but only during sleep, as doing so unconditionally will break hotswap. Also, since removing the flag alone doesn't necessarily trigger the detection, force it in a case of error, as it's likely that the error was caused by trying to communicate with already gone card. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
The L5 has a HKS that removes power from the SDIO slot efectively doing a removal of the card. If the removable property gets blocked then the card does not get re-enabled when it powers back up. Signed-off-by:
Angus Ainslie <angus@akkea.ca>
-
add .shutdown hook in caam_jr driver to support kexec boot Signed-off-by:
Gaurav Jain <gaurav.jain@nxp.com>
-
Issues: - Job ring device is busy when do kexec reboot - Failed to flush job ring when do system suspend-resume Fix: Flush the job ring to stop the running jobs. Signed-off-by:
Horia Geanta <horia.geanta@nxp.com> Signed-off-by:
Franck LENORMAND <franck.lenormand@nxp.com> Reviewed-by:
Pankaj Gupta <pankaj.gupta@nxp.com>
-
The SND_SOC_DAPM_POST_REG event is called when the headphone output path is being (de)configured, which is a good place to hack trigger detection in until we get a dedicated card driver.
-
-
On platforms where IRQ line isn't connected, it may be desirable to trigger a one-shot microphone detection on specific events. This makes the detection code work in both cases: a one-shot trigger, and listening for interrupts from the codec.
-
The default values are fine, and MICDET_ENA is handled by the driver on its own anyway.
-
Only some bits of that register are actually volatile, so to prevent issues with caching let's simply bypass the cache explicitly when we access these particular bits. This fixes mic-cfg value not being reapplied after runtime resume.
-
This usually means that a TRS plug with no microphone pin has been plugged into a TRRS socket. Cases where a user is plugging in a microphone while pressing a button will be handled via incoming interrupt after the user releases the button, so the microphone will still be detected once it becomes usable.
-
If SYSCLK pin is enabled via DAPM, wm8962_configure_bclk may turn it off behind DAPM's back, making it assume that the clock is still enabled even if it actually isn't, which can end up with it not being enabled for playback or capture when it's needed.
-
This bit is handled by a separate control.
-
Otherwise USB2642 goes into reset and USB devices require reenumeration on resume from suspend. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
Although imx8mq doesn't support system wakeup from USB, we still want to use it on Librem 5 in order to keep USB link on during suspend, as otherwise BM818 loses its QMI state. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
Although imx8mq doesn't support system wakeup from USB, we still want to use it on Librem 5 in order to keep USB link on during suspend, as otherwise BM818 loses its QMI state. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
Martin Kepplinger authored
For boards that use power-domains' power-supplies that need interrupts to work (like regulator over i2c), set GENPD_FLAG_IRQ_ON. This will tell genpd to adjust accordingly. Currently it "only" sets the correct suspend/resume callbacks. This fixes suspend/resume on imx8mq-librem5 boards (tested) and imx8mq-evk (by looking at dts) and possibly more. Signed-off-by:
Martin Kepplinger <martin.kepplinger@puri.sm>
-
Martin Kepplinger authored
If for example the power-domains' power-supply node (regulator) needs interrupts to work, the current setup with noirq callbacks cannot work; for example a pmic regulator on i2c, when suspending, usually already times out during suspend_noirq: [ 41.024193] buck4: failed to disable: -ETIMEDOUT So fix system suspend and resume for these power-domains by using the "outer" suspend/resume callbacks instead. Tested on the imx8mq-librem5 board, but by looking at the dts, this will fix imx8mq-evk and possibly many other boards too. This is designed so that genpd providers just say "this genpd needs interrupts" (by setting the flag) - without implying an implementation. Initially system suspend problems had been discussed at https://lore.kernel.org/linux-arm-kernel/20211002005954.1367653-8-l.stach@pengutronix.de/ which led to discussing the pmic that contains the regulators which serve as power-domain power-supplies: https://lore.kernel.org/linux-pm/573166b75e524517782471c2b7f96e03fd93d175.camel@puri.sm/T/ Signed-off-by:
Martin Kepplinger <martin.kepplinger@puri.sm>
-
This can be very useful for in field debugging as different TI firmwares have different bugs. The TI firmware version TPS65981_2_6_v0001_12_09.bin ends up as: $ cat /sys/kernel/debug/tps6598x/0-003f/code_version 0001.12.09 It's decoded according to "1.3.2 Unique Address Interface Registers" of the TPS5986's reference manual. Signed-off-by:
Guido Günther <agx@sigxcpu.org>
-
The word is called customer_use not customer_user. Signed-off-by:
Guido Günther <agx@sigxcpu.org>
-
This allows us to shut down the mipi power domain on the SOC. The alternative would be to drop the dphy from the mipi power domain in the SOCs device tree and only have the DSI host controller visible there (and rely on the phy layer's built in runtime pm handling) but this would make the power domain dependency less explicit. Currently the pm domain can't be shut off when blanking the panel: pm_genpd_summary domain status slaves /device runtime status ---------------------------------------------------------------------- mipi on /devices/platform/soc@0/soc@0:bus@30800000/30a00300.dphy unsupported /devices/platform/soc@0/soc@0:bus@30800000/30a00000.mipi_dsi suspended while with this change we can shut down the power domain on panel blank: mipi off-0 /devices/platform/soc@0/soc@0:bus@30800000/30a00300.dphy suspended /devices/platform/soc@0/soc@0:bus@30800000/30a00000.mipi_dsi suspended Signed-off-by:
Guido Günther <agx@sigxcpu.org>
-
Martin Kepplinger authored
marked as "hack" because we don't yet know what exactly broke the shutdown callback. For Linux v5.18-rc1 and later, the below regulator underflows happen when shutting down. Remove the shutdown callback from the driver to work around this. [ 1584.383268] ------------[ cut here ]------------ [ 1584.388285] unbalanced disables for LCD_AVEE [ 1584.392955] WARNING: CPU: 2 PID: 1 at drivers/regulator/core.c:2852 _regulator_disable+0xdc/0x194 [ 1584.619168] Call trace: [ 1584.621656] _regulator_disable+0xdc/0x194 [ 1584.625797] regulator_disable+0x48/0x8c [ 1584.629733] mantix_unprepare+0x50/0x94 [ 1584.633637] drm_panel_unprepare+0x34/0x50 [ 1584.637794] mantix_shutdown+0x2c/0x44 [ 1584.641579] mipi_dsi_drv_shutdown+0x2c/0x40 [ 1584.645895] device_shutdown+0x160/0x340 [ 1584.649881] __do_sys_reboot+0x1d8/0x25c [ 1584.653865] __arm64_sys_reboot+0x30/0x40 [ 1584.657937] invoke_syscall+0x50/0x120 [ 1584.661723] el0_svc_common.constprop.0+0x4c/0xf4 [ 1584.666494] do_el0_svc+0x28/0x3c [ 1584.669818] el0_svc+0x2c/0x84 [ 1584.672965] el0t_64_sync_handler+0x1a4/0x1b0 [ 1584.677331] el0t_64_sync+0x18c/0x190 [ 1584.681072] ---[ end trace 0000000000000000 ]--- [ 1584.685990] ------------[ cut here ]------------ [ 1584.690650] unbalanced disables for LCD_AVDD [ 1584.694990] WARNING: CPU: 2 PID: 1 at drivers/regulator/core.c:2852 _regulator_disable+0xdc/0x194 [ 1584.920444] Call trace: [ 1584.922922] _regulator_disable+0xdc/0x194 [ 1584.927054] regulator_disable+0x48/0x8c [ 1584.931013] mantix_unprepare+0x58/0x94 [ 1584.934912] drm_panel_unprepare+0x34/0x50 [ 1584.939021] mantix_shutdown+0x2c/0x44 [ 1584.942806] mipi_dsi_drv_shutdown+0x2c/0x40 [ 1584.947112] device_shutdown+0x160/0x340 [ 1584.951070] __do_sys_reboot+0x1d8/0x25c [ 1584.955029] __arm64_sys_reboot+0x30/0x40 [ 1584.959072] invoke_syscall+0x50/0x120 [ 1584.962859] el0_svc_common.constprop.0+0x4c/0xf4 [ 1584.967627] do_el0_svc+0x28/0x3c [ 1584.970952] el0_svc+0x2c/0x84 [ 1584.974042] el0t_64_sync_handler+0x1a4/0x1b0 [ 1584.978433] el0t_64_sync+0x18c/0x190 [ 1584.982130] ---[ end trace 0000000000000000 ]--- [ 1584.993964] LCD_1V8: Underflow of regulator enable count
-
In cases where USB global suspend has been used instead of selectively suspending the port, there's no need to TRSMRCY delay since there was no resume request sent to the hub in the first place. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-
This can be useful when wanting to rely on global suspend instead for improved wakeup latency and/or reliability. Kernel's logical devices are still tracking PM status as usual so we know when to suspend the upstream hub. Special care needs to be taken in order to still support remote wakeup functionality. When the port isn't being actually suspended, we have no idea which port has generated a wakeup request after resuming its hub because there's no change reported in port's status, so we force every port marked with this quirk to be resumed. Also, there's no way for the device to send remote wakeup request while it's not actually suspended, so we need to take care not to logically suspend such devices while a sibling port is active. This code is likely to break on different USB topologies than the one present on the Librem 5's internal bus, where we want to use this quirk on modem's and hub's upstream ports in order to avoid resets happening when the modem sends remote wakeup request while the hub is being suspended. Signed-off-by:
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
-