* In Android 13, Xiaomi changed the measuring unit of this property in firmware to minutes instead of seconds, revert that behavior back by intercepting the property value and multiplying it by 60 before setting the node, as userspace expects the unit to be seconds.
* Then make sure the final value doesn't exceed 65535.
Change-Id: I9d8accbe48d743b8b071cba4253e017068b8e766
Previously the charge counter was not reported in uAh while the
charge full capacity was. The charge counter used to go down to
1000 times as low as the max battery capacity is in uAh.
Frameworks use this property to set the battery state and
expects it to be in uAh. Refer to [1] and [2].
Since commit "Use getUahDischarge when available" [3] AOSP
uses the getUahDischarge method to determine the amount of
discharge. Without this patch the value used to be 1000 times
too low leading to the consumed power of
AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE becoming very low
so that the relative consumption of all consumers got very
high.
[1]: d42ec4c0e5/services/core/java/com/android/server/BatteryService.java (L579)
[2]: d42ec4c0e5/services/core/java/com/android/server/am/BatteryStatsService.java (L2079)
[3]: LineageOS/android_frameworks_base@9f08c60
Change-Id: I64dff6478588d991971b60bad61652f5c9f581b0
Taken and modified from garnet-t-oss' fsa4480-msm54 driver.
Change-Id: Ia5056525cd7f2e9f5e203399f39836218511f14b
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Xiaomi's remote controller app uses frequency up to 60kHz and
transmit buffer up to 64kB (32768 of 16bit words).
Signed-off-by: Ivan Vecera <ivan@cera.cz>
Change-Id: I9b1da638fc981b09e0208d06f82ce0c5cf159654
This requires switching to the panel notifier API from the mi disp
notifier.
Change-Id: I4158f9d61241eec57d1a44da4811c62077cf9814
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This is missing Xiaomi touchfeature. The code related to it does not
seem to match our existing drivers a whole lot and is rather complicated
and highly inlined in the binary.
We will manually add the parts we are interested in.
Change-Id: I6fde6485026b2739895bcc5380f4495d13ae13f2
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Some devices ship a firmware which enables host based touch
processing (proprietary userspace binary). Since we don't
want to use that but still use the stock firmware, we need
to disable the rawdata mode and enable the coor mode on init
and each resume. To enable this, add the goodix,support-thp-fw
property to devicetree.
Change-Id: I55c606a6c468663cadc9506cb7d08e5cf2965bc7
To avoid blocking the system wide resume for too long while sending
commands and waiting for the touchscreen.
Change-Id: I8ac0ca80c359cc65613245abe2c32de81b459ae0
disable_irq ensures existing instances of the IRQ handler have
completed before returning which may create a deadlock if the handler
doesn't find the resource.
Change-Id: I7010d2a415f97de5ece8119b855c169ffba665b7
Signed-off-by: Simranjeet Thind <quic_sthind@quicinc.com>
It is found there might be some i2c NACK error after
power on and reset operation, from goodix datasheet
it is required to wait 100ms after reset operation
before I2C communication, so put a 100ms sleep after
reset.
Change-Id: I2601085f85c83a57bc895915506eaf0c29442678
Signed-off-by: Yu Wu <quic_zwy@quicinc.com>