Commit graph

1137018 commits

Author SHA1 Message Date
Caleb Connolly
dae71dc9a5 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-31 02:02:14 +02:00
Caleb Connolly
119430dc18 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-31 02:02:14 +02:00
Caleb Connolly
e2c631ebcf 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 & v7 of driver patches)
2022-10-31 02:02:14 +02:00
Jami Kettunen
4b341bc463 [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-31 02:02:14 +02:00
Jami Kettunen
1918745f5f power: supply: qcom_fg: Report online property 2022-10-31 02:02:14 +02:00
Yassine Oudjana
f96cfaff29 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-31 02:02:14 +02:00
Yassine Oudjana
cf062a5c35 power: pmi8998_fg: Remove some trailing spaces and tabs
This should be squashed.
2022-10-31 02:02:14 +02:00
Joel Selvaraj
6ab2aa8358 fg: clean and read charge full and max voltage from dts 2022-10-31 02:02:14 +02:00
Joel Selvaraj
e5f8763d74 power: supply: add battery charging status feature 2022-10-31 02:02:14 +02:00
Caleb Connolly
7214b14a7b arm64: dts: qcom: pmi8998: Add fuel gauge
Add a node for qcom,pmi8998-fg.
2022-10-31 02:02:14 +02:00
Joel Selvaraj
f74131008a power: supply: introduce pmi8998 fuel guage driver 2022-10-31 02:02:14 +02:00
Jami Kettunen
aadef46ad8 [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-31 02:02:14 +02:00
Caleb Connolly
ea0538d030 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-31 02:02:14 +02:00
Caleb Connolly
15864e39c0 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-31 02:02:14 +02:00
Jami Kettunen
e5788ea5dd [ANNOTATION] Import SPMI haptics driver v7 (2022-10-18)
Link: https://patchwork.kernel.org/project/linux-arm-msm/cover/20221015172915.1436236-1-caleb@connolly.tech/
2022-10-31 02:02:14 +02:00
Caleb Connolly
80b7e7d1a0 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-31 02:02:14 +02:00
Caleb Connolly
cd56ff1567 dt-bindings: input: document Qualcomm PMI8998 haptics driver
Add bindings for qcom PMIC PMI8998 haptics driver.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2022-10-31 02:02:14 +02:00
Jami Kettunen
6a627ac6b7 [ANNOTATION] Base @ angelo/5.14-msm8998-audio-working
I also rebased this tree on the linus/v5.18-rc1 tag and while at it
finally dropped changes irrelevant to msm8998.
2022-10-31 02:02:13 +02:00
AngeloGioacchino Del Regno
b1953b7b81 adreno 5xx: TTBR1 extravaganza on MSM8998
(JAMI: fixup for 5.16)
2022-10-31 02:02:13 +02:00
Jami Kettunen
2c83fb4bc9 arm64: dts: qcom: msm8998-xperia: various tests
Originally from: c215a022
2022-10-31 02:02:13 +02:00
Jami Kettunen
a3e55d753a ASoC: wcd9335: various tests
Originally from: c215a022
2022-10-31 02:02:13 +02:00
AngeloGioacchino Del Regno
8720300aa3 iommu/arm-smmu-qcom: Add MSM8998 and SDM660 mss compatibles for identity
Add MSM8998 and SDM660's mss-pil compatibles to switch the default
iommu domain type to IDENTITY, as similarly required by SDM845 and
others.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: fixup for 6.0-rc2)
2022-10-31 02:02:13 +02:00
AngeloGioacchino Del Regno
1d7018b903 iommu/arm-smmu-qcom: Skip the TTBR1 quirk for MSM8998 and SDM630
Similarly to MSM8996 DragonBoard 820c, MSM8998 and SDM630 are equipped
with Adreno 5xx series, which doesn't have separate pagetables support
at the moment of writing.
Skip the TTBR1 quirk for these two SoCs as to get Adreno in a usable
state.
2022-10-31 02:02:13 +02:00
AngeloGioacchino Del Regno
f2e1fd09d4 arm64: dts: qcom: AUDIO WORKS oon MSM8998 Sony Yoshino platform!!! 2022-10-31 02:02:13 +02:00
AngeloGioacchino Del Regno
e0bb18b783 ASoC: codecs: wcd9335: Fix headphone jack commit for new upstream kernel 2022-10-31 02:02:13 +02:00
Srinivas Kandagatla
c97a787623 ASoC: wcd9335: add mbhc support
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
2022-10-31 02:02:13 +02:00
Jami Kettunen
6944fd8b93 arm64: dts: qcom: Enable audio on MSM8998 Sony Yoshino platform
Originally from: d95b982a
(JAMI: fixup for 6.0-rc2)
2022-10-31 02:02:13 +02:00
Jami Kettunen
df09ff004c arm64: dts: qcom: msm8998: More audio related node changes
Originally from: d95b982a
2022-10-31 02:02:13 +02:00
Jami Kettunen
88f9d846d6 [DROPME?] fixup! arm64: dts: qcom: msm8998: Configure Adreno GPU and related IOMMU 2022-10-31 02:02:08 +02:00
Jami Kettunen
83b748720a mfd: wcd9335: Add support to wcd9335 codec
Qualcomm WCD9335 Codec is a standalone Hi-Fi audio codec IC.

This codec has integrated SoundWire controller, pin controller and
interrupt controller.

Originally from: d95b982a
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
a92cc30ae8 arm64: dts: qcom: msm8998: Add disabled slimbus support
Add generic slimbus configuration to MSM8998 and keep it disabled.
It is expected that this will be enabled in board-specific device
trees when supported, along with the right audio codec.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
Jami Kettunen
ad7c17af90 ASoC: qcom: lpass-msm8998: Add platform driver for lpass audio
Add platform driver for configuring msm8998 lpass core I2S and
DMA configuration to support playback & capture to external codecs
connected over primary & secondary MI2S interfaces.

(driver originally split from 4d7e1ead3b ("fastmatrix yaml fix"))
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
5be5c146c2 ASoC: qcom: Add MSM8998 sound card support
Add MSM8998 sound support: this driver supports basic functionality
and headphone jack.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: fixup for 5.17 & 6.0-rc2)
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
08f802d982 arm64: dts: qcom: msm8998-xperia: Enable lpass smmu
To support audio dsp functionality, enable the lpass smmu.
The firmware distributed with the MSM8998 Sony Xperia smartphones
requires us to skip resetting CB12 of this SMMU and to use CB11
as a context bank to emulate bypass streams.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: fixed up for v5.16-rc1)
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
b32ea4a02e arm64: dts: qcom: msm8998: Add APR services configuration
Add the standard APR Q6 services configuration for MSM8998, used by
boards supporting the audio dsp.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
327e8d1483 arm64: dts: qcom: msm8998: Define fastrpc ADSP compute context banks
If the target board supports ADSP, it is essential to have fastrpc
compute context banks defined. This commit adds the always usable
unsecured context banks only.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
d5b12139e6 arm64: dts: qcom: msm8998: Add disabled support for lpass iommu for q6
Add support for the LPASS (Q6) SMMU and keep it disabled as this is
used only when the audio DSP is present and used, which is not
mandatory to have.
It is expected for board-specific device-trees to enable this node
if supported.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
f2386073b9 clk: qcom: gcc-msm8998: Add LPASS adsp and core GDSCs
As a final step to entirely enable the required clock tree for the
lpass iommu and audio dsp, add the lpass core/adsp GDSCs.

As a side note, it was found out that disabling the lpass core GDSC
at any time would cause a system lockup (and reboot): disabling
this GDSC will leave the lpass iommu completely unclocked, losing
its state entirely - including the secure contexts that have been
previously set-up from the bootloader/TrustZone.
Losing this IOMMU configuration will trigger a hypervisor fault,
which will reboot the system; the only workaround for this issue
is to declare the lpass core gdsc as always-on.

It should also not be forgotten that this is all about firmware and
there may be a version of it that doesn't enable this GDSC at all
before booting Linux, which is the reason why this specific declaration
wasn't simply omitted.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
03cf81d3a0 dt-bindings: clock: gcc-msm8998: Add LPASS adsp/core GDSCs definitions
Add the GDSC definitions for the LPASS_ADSP_GDSC and LPASS_CORE_GDSC
as a final step to enable the required clock tree for the lpass iommu
and for the audio dsp itself.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
190a5aaae0 clk: qcom: gcc-msm8998: Add q6 bimc and lpass core, adsp SMMU clocks
Add the Q6 BIMC, LPASS core/adsp SMMU clocks to support audio related
functionality on MSM8998 and APQ variants. Please note that the Q6 and
the lpass iommu also need GDSCs to be enabled in order to initialize,
which are going to be added in a later commit.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: fixup for 6.0-rc2)
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
051c715c75 dt-bindings: clock: gcc-msm8998: Add Q6 and LPASS clocks definitions
Add definitions for the Q6 BIMC, LPASS core and adsp smmu clocks,
required to enable audio functionality on MSM8998.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: merge with e122a6a4 for 5.17 & fixup for 6.0-rc1)
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
695a65ac50 arm64: dts: qcom: msm8998: Add imem pil-reloc-info for firmware loading
Firmware loading (mainly the modem) may require IMEM PIL relocation
informations: specify this imem region in dt for qcom_pil_info to
use it.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
0eec71b3b3 arm64: dts: qcom: msm8998: Add qcom,adreno-smmu compatible 2022-10-31 01:55:33 +02:00
Jami Kettunen
4dbc2501ff regulator: qcom-labibb: Always disable interrupts during OCP & SC
Originally from: cd95ecae
2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
2633780796 yoshino: Fix too high overheating backlight, enable all wled strings maple 2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
707f3fc86f drm/msm/dsi_phy_10nm: Fix bad VCO rate calculation 2022-10-31 01:55:33 +02:00
AngeloGioacchino Del Regno
878adc3107 clk: qcom: mmcc-msm8998: Set CLK_GET_RATE_NOCACHE to pixel/byte clks
The pixel and byte clocks rate should not be cached, as a VCO shutdown
may clear the frequency setup and this may not be set again due to the
cached rate being present.
This will also be useful when shadow clocks will be implemented in
the DSI PLL for seamless timing/resolution switch.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:32 +02:00
AngeloGioacchino Del Regno
59798e0590 clk: qcom: gcc-msm8998: Set MISC flags, mark hmss/gpu-ahb critical
It is being evaluated whether this commit is really needed.
DONOTUPSTREAM.

(JAMI: fixed up for v5.16-rc1)
2022-10-31 01:55:32 +02:00
AngeloGioacchino Del Regno
0dbc76cebe input: keyboard: Add Fast GPIO-driven keyboard/keypad matrix driver
This driver is a reimplementation of matrix_keyboard, on which it
is heavily based: the former was made back in 2009 and then
lightly updated in 2012 to add some support for device-tree / OF.

It turns out that this is not enough, nor OF is fully supported,
as the global (or "clustered") interrupt is never probed, nor it
made usage of the GPIOD API which, nowadays, really simplifies
the job - but not only: it also provides means to set GPIO arrays
for controllers that are supporting this.
The latter is very important when dealing with slow GPIOs such as
I2C and/or SPI expanders (and, again, not only); by using the new
APIs everything fits the new systems, from simplifications of the
probe/remove functions to opening possibility of using expanders
to drive key matrices with or without protection diodes.

But then, why wasn't the old matrix_keyboard driver modified
instead of creating a new one?
The problem there is that the old driver is made to support the
old platform_device style and it's currently still being used by
some PXA boards that are not (yet?) ported to device-tree, so it
would be impossible to modernize it for good, which means that to
support GPIOD (which is - really - required for the aforementioned
reasons) and to fully support DT it would be necessary to wrap the
old GPIO API around the new GPIOD one, creating overhead and also
probably unnecessary memory usage, other than a very big driver
which, at least on embedded devices (having limited resources),
would be simply bad. Leaving the fact that I haven't got any old
board so it's impossible for me to analyze and optimize for them.

Since 98% of the users of the old driver are infact platforms that
have been ported to (or are born with) DT, the introduction of a
new driver that's purely made for them seemed to be the best
choice, also because the expectations are (I think) that all of
the old ARM-based boards will be ported to DT anyway, which will
actually deprecate the good old matrix_keyboard driver.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
2022-10-31 01:55:32 +02:00
AngeloGioacchino Del Regno
f9a159ad15 dt-bindings: input: Add binding for gpio-fastmatrix-keyboard
Add documentation for the gpio-fastmatrix-keyboard driver.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
(JAMI: merge with e7aa905a for 5.17)
2022-10-31 01:55:32 +02:00