mbox series

[v3,00/23] This is continued work on Samsung S9(SM-9600) starqltechn

Message ID 20240618-starqltechn_integration_upstream-v3-0-e3f6662017ac@gmail.com
Headers show
Series This is continued work on Samsung S9(SM-9600) starqltechn | expand

Message

Dzmitry Sankouski June 18, 2024, 1:59 p.m. UTC
Add support for new features:
- sound (headphones and mics only)
- gpu
- panel
- buttons
- MAX77705 MFD:
  - charger
  - fuelgauge
  - haptic
  - led

Changes in version 2:
- s2dos05 regulator:
  - hex to decimal in regulator values
  - fix compatible value
  - remove interrupt specific code, because it's
    empty in vendor kernel, and I cannot test it on
    available hardware anyway.

Changes in version 3:
Version 3 has significant changes:
- more drivers added
- s2dos05 driver converted to MFD
- disable crypto patch removed(disabled on distro level)
- dts framebuffer node along with related patches removed,
because panel driver added
- fix 'make O=.output_arm64 CHECK_DTBS=y qcom/sdm845-samsung-starqltechn.dtb'
errors, but it still complains on 'monitored-battery' and
'power-supplies' though I have 'power-supply.yaml' link in charger
and fuel gauge bindings.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
Dzmitry Sankouski (23):
      power: supply: add undervoltage health status property
      gcc-sdm845: Add rates to the GP clocks
      dt-bindings: panel: add Samsung s6e3ha8
      dt-bindings: mfd: add maxim,max77705
      dt-bindings: input: add maxim,max77705-haptic
      dt-bindings: power: supply: add maxim,max77705 charger
      dt-bindings: power: supply: add maxim,max77705
      dt-bindings: led: add maxim,max77705-leds
      dt-bindings: mfd: add samsung,s2dos05
      dt-bindings: regulator: add samsung,s2dos05
      drm/panel: Add support for S6E3HA8 panel driver
      mfd: Add new driver for MAX77705 PMIC
      input: add max77705 haptic driver
      power: supply: max77705: Add charger driver for Maxim 77705
      power: supply: max77705: Add fuel gauge driver for Maxim 77705
      leds: max77705: Add LEDs support
      mfd: add s2dos series core driver
      regulator: add s2dos05 regulator support
      power: supply: s2dos05: Add fuel gauge driver for s2dos05
      arm64: dts: qcom: starqltechn: remove wifi
      arm64: dts: qcom: starqltechn: remove framebuffer
      arm64: dts: qcom: starqltechn: fix usb regulator mistake
      arm64: dts: qcom: starqltechn: add new features

 .../bindings/display/panel/samsung,s6e3ha8.yaml    |  76 ++
 .../devicetree/bindings/input/maxim,max77705.yaml  |  31 +
 .../devicetree/bindings/leds/maxim,max77705.yaml   |  45 ++
 .../devicetree/bindings/mfd/maxim,max77705.yaml    | 112 +++
 .../devicetree/bindings/mfd/samsung,s2dos05.yaml   |  89 +++
 .../power/supply/maxim,max77705-charger.yaml       |  30 +
 .../bindings/power/supply/maxim,max77705-fg.yaml   |  35 +
 .../bindings/regulator/samsung,s2dos05.yaml        |  36 +
 MAINTAINERS                                        |  15 +
 .../boot/dts/qcom/sdm845-samsung-starqltechn.dts   | 607 +++++++++++++++-
 drivers/clk/qcom/gcc-sdm845.c                      |  14 +
 drivers/gpu/drm/panel/Kconfig                      |   7 +
 drivers/gpu/drm/panel/Makefile                     |   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c      | 426 ++++++++++++
 drivers/input/misc/Kconfig                         |  11 +
 drivers/input/misc/Makefile                        |   1 +
 drivers/input/misc/max77705-haptic.c               | 378 ++++++++++
 drivers/leds/Kconfig                               |   6 +
 drivers/leds/Makefile                              |   1 +
 drivers/leds/leds-max77705.c                       | 166 +++++
 drivers/mfd/Kconfig                                |  25 +
 drivers/mfd/Makefile                               |   3 +
 drivers/mfd/max77705-core.c                        | 278 ++++++++
 drivers/mfd/max77705-irq.c                         | 299 ++++++++
 drivers/mfd/s2dos-core.c                           | 141 ++++
 drivers/power/supply/Kconfig                       |  21 +
 drivers/power/supply/Makefile                      |   3 +
 drivers/power/supply/max77705_charger.c            | 772 +++++++++++++++++++++
 drivers/power/supply/max77705_fuelgauge.c          | 624 +++++++++++++++++
 drivers/power/supply/s2dos05-fg.c                  | 427 ++++++++++++
 drivers/regulator/Kconfig                          |   8 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/s2dos05-regulator.c              | 362 ++++++++++
 include/linux/mfd/max77705-private.h               | 281 ++++++++
 include/linux/mfd/max77705.h                       |  20 +
 include/linux/mfd/max77705_charger.h               | 225 ++++++
 include/linux/mfd/s2dos05.h                        | 123 ++++
 include/linux/mfd/samsung/s2dos-core.h             |  21 +
 include/linux/mfd/samsung/s2dos05.h                | 115 +++
 include/linux/power/max77705_fuelgauge.h           | 107 +++
 include/linux/power_supply.h                       |   1 +
 41 files changed, 5927 insertions(+), 17 deletions(-)
---
base-commit: 6906a84c482f098d31486df8dc98cead21cce2d0
change-id: 20240617-starqltechn_integration_upstream-bc86850b2fe3

Best regards,

Comments

Konrad Dybcio June 18, 2024, 2:07 p.m. UTC | #1
On 6/18/24 15:59, Dzmitry Sankouski wrote:
> Usb regulator was wrongly pointed to vreg_l1a_0p875.
> However, on starqltechn it's powered from vreg_l5a_0p8.
> 
> Fixes: d711b22eee55 ("arm64: dts: qcom: starqltechn: add initial device tree for starqltechn")
> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---

How did you confirm that?

Konrad
Konrad Dybcio June 18, 2024, 2:12 p.m. UTC | #2
On 6/18/24 15:59, Dzmitry Sankouski wrote:
> Add support for new features:
> - sound (headphones and mics only)
> - gpu
> - panel
> - buttons
> - MAX77705 MFD:
>     - charger
>     - fuelgauge
>     - haptic
>     - led
> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---

Please split this up

>   .../boot/dts/qcom/sdm845-samsung-starqltechn.dts   | 593 ++++++++++++++++++++-
>   1 file changed, 592 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> index bad154b1e894..28a5210e22fb 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> @@ -7,15 +7,40 @@
>   
>   /dts-v1/;
>   
> +#include <dt-bindings/input/linux-event-codes.h>
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include <dt-bindings/sound/qcom,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
> +
>   #include "sdm845.dtsi"
> +#include "pm8998.dtsi"
> +#include "sdm845-wcd9340.dtsi"
> +
> +/delete-node/ &rmtfs_mem;
> +/delete-node/ &adsp_mem;
> +/delete-node/ &slpi_mem;
> +/delete-node/ &spss_mem;
>   
>   / {
>   	chassis-type = "handset";
>   	model = "Samsung Galaxy S9 SM-G9600";
>   	compatible = "samsung,starqltechn", "qcom,sdm845";
>   
> +	aliases {
> +		serial0 = &uart9;
> +	};
> +
> +	battery: battery {
> +		compatible = "simple-battery";
> +		constant-charge-current-max-microamp = <2150000>;
> +		charge-full-design-microamp-hours = <3000000>;
> +
> +		over-voltage-threshold-microvolt = <4500000>;
> +		voltage-min-design-microvolt = <3400000>;
> +		voltage-max-design-microvolt = <4350000>;
> +	};
> +
>   	chosen {
>   		#address-cells = <2>;
>   		#size-cells = <2>;
> @@ -59,9 +84,199 @@ memory@a1300000 {
>   			ftrace-size = <0x40000>;
>   			pmsg-size = <0x40000>;
>   		};
> +
> +		/* The rmtfs_mem needs to be guarded due to "XPU limitations"
> +		 * it is otherwise possible for an allocation adjacent to the
> +		 * rmtfs_mem region to trigger an XPU violation, causing a crash.
> +		 */
> +		rmtfs_lower_guard: memory@fde00000 {
> +			no-map;
> +			reg = <0 0xfde00000 0 0x1000>;
> +		};

qcom,use-guard-pages instead


> +
> +		rmtfs_mem: rmtfs-mem@fde01000 {
> +			compatible = "qcom,rmtfs-mem";
> +			reg = <0 0xfde01000 0 0x200000>;
> +			no-map;
> +
> +			qcom,client-id = <1>;
> +			qcom,vmid = <15>;

QCOM_SCM_VMID_MSS_MSA

[...]

> +		/*
> +		 * It seems like reserving the old rmtfs_mem region is also needed to prevent
> +		 * random crashes which are most likely modem related, more testing needed.
> +		 */
> +		removed_region: removed-region@88f00000 {
> +			no-map;
> +			reg = <0 0x88f00000 0 0x1c00000>;

Please keep no-map below reg for consistency

[...]

> +
> +&gmu {
> +	status = "okay";
> +};

Drop this and remove the disablement in 845.dtsi, gmu is only probed when
GPU is

[...]

>   	gpio-reserved-ranges = <0 4>, <27 4>, <81 4>, <85 4>;

Do you know what these are for?

Konrad
Dzmitry Sankouski June 18, 2024, 2:16 p.m. UTC | #3
вт, 18 июн. 2024 г. в 17:08, Konrad Dybcio <konrad.dybcio@linaro.org>:
>
>
>
> On 6/18/24 15:59, Dzmitry Sankouski wrote:
> > Usb regulator was wrongly pointed to vreg_l1a_0p875.
> > However, on starqltechn it's powered from vreg_l5a_0p8.
> >
> > Fixes: d711b22eee55 ("arm64: dts: qcom: starqltechn: add initial device tree for starqltechn")
> >
> > Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> > ---
>
> How did you confirm that?
Vendor kernel source code:
https://github.com/klabit87/twrp_android_samsung_kernel_sdm845/blob/e8bb63039008e1704a2f1bde68d39ded9c16ea88/arch/arm64/boot/dts/samsung/sdm845-sec-starqlte-chnhk-r14_v2.1.dts#L10242
https://github.com/klabit87/twrp_android_samsung_kernel_sdm845/blob/e8bb63039008e1704a2f1bde68d39ded9c16ea88/arch/arm64/boot/dts/samsung/sdm845-sec-starqlte-chnhk-r14_v2.1.dts#L23401
>
> Konrad
Dzmitry Sankouski July 8, 2024, 3:54 p.m. UTC | #4
вт, 18 июн. 2024 г. в 17:12, Konrad Dybcio <konrad.dybcio@linaro.org>:
>
>
...
>
> >       gpio-reserved-ranges = <0 4>, <27 4>, <81 4>, <85 4>;
>
> Do you know what these are for?
>
> Konrad

<85 4> is spi for fingerprint.
<27 4> is spi for eSE(embedded Secure Element)
The rest shouldn't be reserved.
Konrad Dybcio July 8, 2024, 6:08 p.m. UTC | #5
On 8.07.2024 5:54 PM, Dzmitry Sankouski wrote:
> вт, 18 июн. 2024 г. в 17:12, Konrad Dybcio <konrad.dybcio@linaro.org>:
>>
>>
> ...
>>
>>>       gpio-reserved-ranges = <0 4>, <27 4>, <81 4>, <85 4>;
>>
>> Do you know what these are for?
>>
>> Konrad
> 
> <85 4> is spi for fingerprint.
> <27 4> is spi for eSE(embedded Secure Element)
> The rest shouldn't be reserved.

Thanks for digging this up!

Please add a comment for it, like in x1e80100-crd.dts

Konrad