Commit graph

1123800 commits

Author SHA1 Message Date
Jami Kettunen
524918c4a0 [SUBMITME] arm64: dts: qcom: msm8998-oneplus-common: Add fuel gauge
The OnePlus 5/5T feature a BQ27411 fuel gauge for reading the battery
stats.
2022-10-09 04:36:50 +03:00
Jami Kettunen
8c20231411 [TEMP] oneplus5: disable all speaker amp stuff
We don't want to blow this up while messing around with audio stuff
early on...
2022-10-09 04:36:50 +03:00
Jami Kettunen
7f93be845f arm64: dts: msm8998-oneplus-common: Add TFA9890 speaker amp bindings 2022-10-09 04:36:50 +03:00
Jami Kettunen
a71b180a60 [SUBMITME?] msm8998-oneplus-common: Configure Adreno 540 GPU 2022-10-09 04:36:50 +03:00
Jami Kettunen
2e5cc86524 [SUBMITME?] arm64: dts: msm8998-oneplus-*: Configure S6E3FA5 & S6E3FC1 panels
These Samsung DSI panels are used on the OnePlus 5/5T respectively.
Additionally disable simplefb until a proper handoff solution can be
found to avoid conflicts between it and the MSM DRM driver.
2022-10-09 04:36:50 +03:00
Jami Kettunen
168f40c64b msm8998-oneplus-common: Configure IPA for cellular data 2022-10-09 04:36:50 +03:00
Jami Kettunen
b7e921494f msm8998-oneplus-common: Configure CPUfreq scaling hardware 2022-10-09 04:36:50 +03:00
Jami Kettunen
5dcd4f1503 arm64: dts: msm8998-oneplus-cheeseburger: Configure RMI4 F1A buttons
This allows the capacitive buttons below the touchscreen to be used on
e.g. Android normally :)
2022-10-09 04:36:50 +03:00
Jami Kettunen
e6f6099187 [SUBMITME?] msm8998-oneplus-common: Add remoteproc configuration & enable WLAN 2022-10-09 04:36:50 +03:00
Jami Kettunen
df645b5390 [DROPME?] msm8998-oneplus-common: Configure blsp1_i2c5_sleep (TS) as no-pull 2022-10-09 04:36:50 +03:00
Jami Kettunen
5e644b35fd [SUBMITME?] dt-bindings: display: panel: Document Samsung S6E3FC1 display panel 2022-10-09 04:36:50 +03:00
Jami Kettunen
38f8de4c07 [SUBMITME?] drm/panel: Add panel driver for Samsung S6E3FC1
The S6E3FC1 is 6" 1080x2160 MIPI DSI command mode AMOLED LCD display
found on OnePlus 5T (2017) smartphones.

The panel needs to be enabled from a device tree using the
"samsung,s6e3fc1" compatible.

This driver was generated using the following & includes some minor
cleanup (such as s/to_s6e3fc1/to_s6e3fc1_panel/g):
$ python3 lmdpdg.py dumpling.dtb -r vddio
2022-10-09 04:36:50 +03:00
Jami Kettunen
e79c52657e [SQUASHME?] drm/panel: s6e3fa5: Read panel orientation
The panel is mounted upside down on the OnePlus 5, so we need to handle
this in the driver.
2022-10-09 04:36:50 +03:00
Jami Kettunen
be6e4b9fac [SUBMITME?] dt-bindings: display: panel: Document Samsung S6E3FA5 display panel 2022-10-09 04:36:50 +03:00
Jami Kettunen
34fc395e46 [SUBMITME?] drm/panel: Add panel driver for Samsung S6E3FA5
The S6E3FA5 is 5.5" 1080x1920 MIPI DSI command mode AMOLED LCD display
found on OnePlus 5 (2017) smartphones.

The panel needs to be enabled from a device tree using the
"samsung,s6e3fa5" compatible.

This driver was generated using the following & includes some minor
cleanup (such as s/to_s6e3fa5/to_s6e3fa5_panel/g):
$ python3 lmdpdg.py cheeseburger.dtb -r vddio

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
2022-10-09 04:36:50 +03:00
Jami Kettunen
622b4bd343 arm64: dts: qcom: msm8998-oneplus-common: Enable PMI8998 LPG leds
Now the RGB notification LEDs can each be controlled individually :)
2022-10-09 04:36:50 +03:00
Jami Kettunen
c6052d14fb [ANNOTATION] Apply some F(x)tec Pro1 patches 2022-10-09 04:35:40 +03:00
Danct12
1a684853e0 arm64: dts: msm8998-fxtec-pro1: Add remoteproc configuration 2022-10-09 04:35:39 +03:00
Danct12
90063f64a8 arm64: dts: msm8998-fxtec-pro1: Enable PMI8998 haptics 2022-10-09 04:35:39 +03:00
Danct12
64b68c5eb5 arm64: dts: msm8998-fxtec-pro1: Configure PMI8998 fuel gauge
This will account for battery statistics reporting on the Fxtec Pro1 (QX1000)
2022-10-09 04:35:39 +03:00
Jami Kettunen
753a79b9bd pinctrl: Fix compilation of Awinic AW9523/B I2C GPIO Expander
Fixes the following link-time error:

    LD      .tmp_vmlinux.kallsyms1
  aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected!
  aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected!
  aarch64-linux-gnu-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_probe':
  .../drivers/pinctrl/pinctrl-aw9523.c:1004: undefined reference to `__devm_regmap_init_i2c'
  make[1]: *** [.../Makefile:1155: vmlinux] Error 1

Fixes: 96e86abbb4 ("pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander")
2022-10-09 04:35:39 +03:00
Jami Kettunen
2ffcea395d [HACK] pinctrl: aw9523: Add workaround for F(x)tec Pro1 keyboard
This is a hack because the correct interrupt type(s) should should be
defined in msm8998-fxtec-pro1.dts instead of the driver.

(originally from Danct12)

This is a workaround for keyboard not working on Fxtec Pro1.

  genirq: Setting trigger mode 12 for irq 123 failed (aw9523_gpio_irq_type+0x0/0x20)
  gpio-fastmatrix-keyboard gpio-keyboard: Cannot get IRQ for gpio302
2022-10-09 04:35:39 +03:00
Jami Kettunen
412c784fe9 [ANNOTATION] Apply miscellaneous hacks and patches 2022-10-09 04:35:37 +03:00
Jami Kettunen
bbc8d3d486 [HACK] drm/msm: Always report CTL status as started for MSM8998
This register always appears to read 0 on <SDM845 generations so simply
ignore it to avoid refreshing at ~3 Hz as seen on OnePlus 5 with a
command-mode panel with the following spammed in dmesg every time the
screen refreshes:

  [drm:_dpu_encoder_phys_cmd_wait_for_ctl_start:660] [dpu error]enc31 intf1 ctl start interrupt wait failed
  [drm:dpu_kms_wait_for_commit_done:525] [dpu error]wait for commit done returned -22
  ...
2022-10-09 04:35:36 +03:00
Jami Kettunen
4d39479eda module: demote invalid ELF header magic error message to pr_debug
This happens anytime busybox modprobe loads a compressed module and
looks especially ugly on postmarketOS for example (or basically any
initramfs); this error is rather pointless since the module is loaded
anyway afterwards.

Upstream (busybox) has no plans to do anything about this error getting
spammed:
https://www.mail-archive.com/busybox@busybox.net/msg27078.html
2022-10-09 04:35:36 +03:00
Jami Kettunen
e3d51f86d9 [SUBMITME?] Input: synaptics-rmi4 - add support for F1A
RMI4 F1A supports the simple capacitive buttons function, it's used for
example on embedded devices such as smartphones for capacitive Android
back and recents buttons.
2022-10-09 04:35:36 +03:00
Jami Kettunen
801f2b822d arm64: dts: qcom: msm8998: add IPA information
Add support for the MSM8998 SoC, which includes IPA version 3.1.
2022-10-09 04:35:36 +03:00
Jami Kettunen
465fec4707 [HACK] net: ipa: Disable automatic suspend
1aac309d32 ("net: ipa: use autosuspend") currently causes my device to
enter 900E crashdump mode as soon as IPA is probed :/

With this we at least can run ModemManager once again...
2022-10-09 04:35:36 +03:00
Jami Kettunen
8b6010d8fa [HACK] [SUBMITME?] ath10k: Fake MSA ready event after event server arrival
This finally allowed me to get past the 2 ath10k_info()'s in qmi.c!

However, this doesn't fix everything; it seems you *have* to run
diag-router from https://github.com/andersson/diag to calm the firmware
down and stop constantly crashing; need to look into a way to get Wi-Fi
working later without needing this debug crap to be running.

This should possible be submitted as a quirk to the ath10k driver as
modem on mainline 8998 should be running now as well...
2022-10-09 04:35:36 +03:00
Jami Kettunen
28cdd600de [SUBMITME] drm/msm: add missing a540 MODULE_FIRMWARE declarations 2022-10-09 04:35:36 +03:00
Jami Kettunen
b4f2628458 [SUBMITME?] drm/msm: Mention DSI 10nm PHY support for MSM8998 2022-10-09 04:35:36 +03:00
Jami Kettunen
8c62aecb1b [HACK] scripts: Stop appending "+" to localversion
This always gets added and doesn't look nice in the version string, so
it's purely for aesthetic reasons :p
2022-10-09 04:35:36 +03:00
Caleb Connolly
4ca20b9bb5 arm64: dts: qcom: pmi8998: add charger node
Add a node for the smb2 charger hardware found on the pmi8998.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2022-10-09 04:35:36 +03:00
Caleb Connolly
9c3e438d6e arm64: dts: qcom: pmi8998: add rradc node
Add a DT node for the Round Robin ADC found in the PMI8998 PMIC.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2022-10-09 04:35:36 +03:00
Jami Kettunen
5f6731510b [ANNOTATION] Import WIP "Qualcomm SPMI Fuel Gauge" driver
https://gitlab.com/sdm845-mainline/linux/-/commits/driver/pmi8998_fg/
+ drop pmi8994 DTS changes though.
+ random pieces from https://gitlab.com/sdm845-mainline/linux/-/commits/sdm845/5.19-release :/
2022-10-09 04:35:32 +03:00
Jami Kettunen
43f63d4a7b power: supply: qcom_fg: Report online property 2022-10-09 04:35:20 +03:00
Yassine Oudjana
17fd6877b7 power: pmi8998_fg: Rename to qcom_fg and add support for PMI8994/6
This adds support for accessing SRAM. That includes requesting and releasing
access to SRAM by setting some registers and handling the mem-avail IRQ,
configuring access, and reading from/writing to it.

Pre-gen3 fuel gauges require reading from SRAM to get voltage, current
and temperature data. Getting capacity is identical to gen3.

Tested on Xiaomi Mi Note 2 with PMI8996.
2022-10-09 04:35:18 +03:00
Yassine Oudjana
46ca37f546 power: pmi8998_fg: Remove some trailing spaces and tabs
This should be squashed.
2022-10-09 04:34:52 +03:00
Joel Selvaraj
d19331bf86 fg: clean and read charge full and max voltage from dts 2022-10-09 04:34:52 +03:00
Joel Selvaraj
a5eb12fa03 power: supply: add battery charging status feature 2022-10-09 04:34:52 +03:00
Caleb Connolly
815b4a0782 arm64: dts: qcom: pmi8998: Add fuel gauge
Add a node for qcom,pmi8998-fg.
2022-10-09 04:34:52 +03:00
Joel Selvaraj
ec2fe7e476 power: supply: introduce pmi8998 fuel guage driver 2022-10-09 04:34:51 +03:00
Jami Kettunen
7b272184c5 [ANNOTATION] Import Qualcomm smb2 charger driver v6 (2022-10-09)
Link: https://patchwork.kernel.org/project/linux-arm-msm/cover/20221008183753.249514-1-caleb.connolly@linaro.org/
2022-10-09 04:31:22 +03:00
Caleb Connolly
d162b3db61 dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver
Add devicetree bindings for the Qualcomm PMI8998/PM660 SMB2 charger
driver.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2022-10-09 04:30:58 +03:00
Caleb Connolly
df99176b63 power: supply: add Qualcomm PMI8998 SMB2 Charger driver
Add a driver for the SMB2 charger block found in the Qualcomm PMI8998
and PM660.
This driver adds initial support for detecting USB cables and managing
basic battery charging.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2022-10-09 04:30:58 +03:00
Jami Kettunen
df153d80ef [ANNOTATION] Import SPMI haptics driver v4 (2022-04-03)
Drop SDM845 DTS changes though and s/qcom,pmi8998-haptics/qcom,spmi-haptics/
in pmi8998.dtsi to fix probe of the driver.

Link: https://patchwork.kernel.org/project/linux-arm-msm/cover/20211210022639.2779173-1-caleb@connolly.tech/
2022-10-03 18:40:15 +03:00
Jami Kettunen
25e0f361ed arm64: dts: qcom: msm8998-oneplus-common: Enable PMI8998 haptics
The OnePlus 5 and 5T both have a haptics engine connected to PMI8998.

Signed-off-by: Jami Kettunen <jami.kettunen@somainline.org>
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2022-10-03 18:40:14 +03:00
Caleb Connolly
ff634d94de arm64: dts: qcom: pmi8998: introduce spmi haptics
Add bindings for Qualcomm SPMI haptics on platforms using pmi8998.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
(JAMI: fixup for v6.0-rc2)
2022-10-03 18:40:14 +03:00
Caleb Connolly
139c66869d input: add Qualcomm SPMI haptics driver
Add support for the haptics found in pmi8998 and related PMICs.
Based on the ff-memless interface. Currently this driver provides
a partial implementation of hardware features.

This driver only supports LRAs (Linear Resonant Actuators) in the "buffer"
mode with a single wave pattern.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2022-10-03 18:40:14 +03:00
Caleb Connolly
60f97a5783 dt-bindings: input: add Qualcomm SPMI haptics driver
Add bindings for qcom PMIC SPMI haptics driver.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2022-10-03 18:40:14 +03:00