Add new default_current_limit param in DT.
Formerly used input_current_limit_chgin and input_current_limit_wcin params
given in DT is now used as an absolute max input current limit, in the new
dynamic max current adjustment scheme.
In order to reduce the overhead as much as possible in the wait loop, the
PGOOD GPIO is used if given in devicetree. If not, the wait loop reads the
FAULT FLAG register to obtain the PGOOD status.
Tune JEITA configuration (mainly) and other settings, FGCC mode seems to work
as expected.
Disable regulator definition for SAFEOUT signals, thus leave the SAFEOUT
config as default, following CHGIN charger presence.
Add required pinctrl config for GPIO based connection status read from charger
device when this is offline from the I2C bus (100K PU).
Fix devicetree bug (params not being written as expected)
- New JEITA config parameters were configured with incorrect DT property name,
and were thus reset to default or written as 0 depending on driver version.
Add support for required extra parameters in devicetree:
TAlrtTh
TAlrtTh2
JEITA_Curr
JEITA_Volt
ChargeState0..7
Set decent default parameters required for smart charge:
Enable FGCC (CONFIG register)
Set T1=disabled (TAlrtTh2 register)
Set T2=10 deg (TAlrtTh register)
Set T3=40 deg (TAlrtTh register)
Set T4=50 deg (TAlrtTh2 register)
Set JEITA_Curr = 50%/100%/81.25%
Set JEITA_Volt = 4.15V/4.2V/4.15V
Add ChargeState0..7 to be adjusted later if required (use default values)
It enables WoWLAN support by adding WIFI_HOST_WAKE interrupt pin and
'wakeup-source' property for SDIO interface.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
For WoWLAN testing purpose, let's add keep-power-in-suspend for wifi
SDIO interface, so that WLAN power will be retained during 'standby'
sleep.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
To support system suspend during idle, we define 'standy' as sleep
without LPSR, while 'mem' as LPSR sleep. In this case, DT property
"fsl,enable-lpsr" is not needed any more, as lpsr_enabled should always
be true to support 'mem' sleep.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The following peripherals are not used on reMarkable device.
- Messaging Unit (MU)
- APBH-Bridge-DMA
- Cryptographic Acceleration and Assurance Module (CAAM)
Let's disable them, so that Linux kernel driver will not probe these
devices and turn on their clocks.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The memory size should be 1G rather than 2G. It explodes after we have
DDRC configuration fixed in plugin, in case that we launch kernel image
with fastboot where the memory size in device tree gets passed to
kernel.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Aen bit of CONFIG register needs to be set for enabling alert on
fuel-gauge outputs like low SOC interrupt. This is a missing piece from
the original low battery alert commit.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Suspend code will check this 'fsl,enable-lpsr' to determine if it needs
to go into LPSR mode for sleep.
Because WiFi driver doesn't support suspend with power shutdown, we need
to remove WiFi module in sleep and reinstall it when system wakes up.
In this case, property 'keep-power-in-suspend' needs to be dropped to
get MMC stack be aware of power losing in LPSR sleep. The command
sequence looks like:
$ rmmod brcmfmac
$ echo mem >| /sys/power/state
system suspends, and wakes up
$ insmod brcmfmac.ko
$ dhcpcd wlan0
WiFi should be back to work then.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
As confirmed by Bent, 100 ms delay should be good enough for digitizer
power control. So let's decrease it to 100 ms to avoid unnecessary
longer delay.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Rather than relying on U-Boot to turn on power to digitizer and touch,
let's add regulator for the devices to control power via GPIOs.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
With LPSR sleep support coming, cyttsp5 will lose power completely
during system sleeps. To get cyttsp5 driver support the power state
better, we should add CY_CORE_FLAG_POWEROFF_ON_SLEEP flag for cyttsp5
core device. See enum cyttsp5_core_platform_flags in
include/linux/platform_data/cyttsp5.h for full list of flags.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
During LPSR sleep, all IOMUXC settings will be lost because of power
down of the block. To restore the IOMUXC settings in LPSR wake-up,
drivers will select 'sleep' state pinctrl in suspend, and later select
'default' state pinctrl when system resumes. To cope with that, we need
to have both pinctrl states in device tree. A simple approach would be
have both states point to the 'default' pinctrl, since IOMUXC block will
be completely powered down in LPSR mode anyway.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
BD71815 device uses GPIO6_IO16 as the PMIC_INT_B interrupt line. Even
though we are currently not using the interrupt from the device, there
should be a pinctrl for PMIC_INT_B to make the hardware description more
complete and correct.
While at it, rename the device node to bd71815 for an explicit naming.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
There is a 2 cycles (32K clock) delay required between WIFI_PWR_EN and
WL_REG_ON assertion. Let's use 'startup-delay-us' of WIFI_PWR_EN
regulator to add that delay. We increase the delay from required 61 us
to 150 us for some margin.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Besides WIFI_REG_ON handled by wifi_pwrseq, we need to deal with
WIFI_PWR_EN as well to get BCM43455 WiFi chip powered properly. This
WIFI_PWR_EN is currently handled in U-Boot. As we have fixed-regulator
infrastructure in kernel which can handle this nicely, let's use it, so
that we can drop the code from U-Boot.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The pinctrl_wifi is all about configuring pins used by wifi_pwrseq,
including the 32K clock and WIFI_PWR_EN. So let's move the pinctrl
into wifi_pwrseq device.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The standard pwrseq bindings (bindings/mmc/mmc-pwrseq-simple.txt) has
an 'ext_clock' which can be used to handle BCM43455 32K clock. Let's
use it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
With recent kernel version, there is no need for a container node in
iomuxc nodes. Let's drop them to save one level of indentation.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
It's a bit easier for checking pinctrl configurations to put omuxc_lpsr
together with iomuxc node.
While at it, drop the unneeded pinctrl-names from both nodes.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The usdhc1 device is disabled by default in imx7s.dtsi, and there is no
need to flip the 'status' to disable it. So let's drop it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The pinctrl_wifi is a pinctrl configuration for particular client
device, so it shouldn't be a 'hog' pinctrl for iomuxc node. Let's
follow imx7d-sdb board to put pinctrl_wifi to usdhc pinctrl entry.
While at it, clean up the commented pinctrl entry of wifi usdhc,
since we can easily add them back if needed later.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>