From: Olliver Schinagl <oliver@schinagl.nl>
This patch adds a bit-banging gpio PWM driver. It makes use of hrtimers,
to allow nano-second resolution, though it obviously strongly depends on
the switching speed of the gpio pins, hrtimer and system load.
Each pwm node can have 1 or more "pwm-gpio" entries, which will be
treated as pwm's as part of a pwm chip.
Change-Id: Idd42bf6d79f8ce52275a15965b02af470f28da7c
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
If the nvram variable is corrupted in a way that multiplying it by 1000 causes an integer overflow and wraps around to a number within or below the sanity check bounds, the check fails and capacity is reported incorrectly.
Change the sanity check calculation to not multiply the variable read from the rk817 nvram, preventing the overflow and resulting in all corrupt capacity values being detected.
Signed-off-by: Alexander Warnecke <awarnecke002@hotmail.com>
Just raise the interrupt. This avoids undervoltage shutdowns when
unplugging the USB PSU from USB keyboard. IP5209 stop supplying power
to VOUT during transition from pass-through mode until VOUT boost
is enabled. (about 30ms on the oscilloscope)
Somehow RK818 doesn't like this when EN_VABT_LOW_SHUT_DOWN is enabled
and PMIC shuts down. Emergency shutdown is implemented in keyboard
power manager driver.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
When the phone boots for the first time, we only want to react to
changes in charger power supply max current after the USB power supply
type detection finishes. This allows us to keep the limit set by
the bootloader, until we know better.
This is part of the workaround for Pinephone Pro boot loops on low battery.
The other part is bootloader raising the input current limit to 2A.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
PMIC does averaging, driver does averaging on top of that averaging,
and it's just too much averaging, and the speed suffers.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
The BSP driver is still used, but there is now a one device handling
the battery/charger properties, which should confuse the userspace
less. This also makes writing a power manager for the keyboard easier.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
It was bizarre anyway. Framebuffer is barely used on Linux anyway,
so this is not a great way to check for system inactivity.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
For now this driver is just meant to watch Type-C power supply
and apply current limits to RK818, to not overload the Type-C
partner.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
No longer use flexfb, fbtft_device that is deprecated since kernel 5.4.
Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: Iebd014360f90eab5210722102d54c6169be5e28e
No longer use flexfb, fbtft_device that is deprecated since kernel 5.4.
Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: Iae252c64b91b2eabe97eb3aace12d7c4b98801c5
Implement support for allocating a non-contiguous DMA region. The
implementation is based on the ma-iommu driver.
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
Passing V4L2_MEMORY_FLAG_NON_COHERENT from userspace significantly
improves video rendering performance on Exynos 5422 (Odroid XU4).
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
Cosmetic change to model and audio card name for HC1/XU3/XU4 to
put ODROID in capitals (as per Hardkernel branding).
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Using new implementation decreases Mali GPU performance significantly
(with both KBase and Panfrost drivers).
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
Mali T628r0p1 which may be found in Samsung Exynos 5422 SOC is
definitely not dma coherent, and it is not happy with PTE_SH_OS bit set
by default in commit 728da60da7 ("iommu/io-pgtable-arm: Support
coherency for Mali LPAE"). Use PTE_SH_IS by default for non dma
coherent Mali GPUs.
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>