This is continued work on Samsung S9(SM-9600) starqltechn
Subsystems (19)
Dzmitry Sankouski
maintainerv4 cover This is continued work on Samsung S9(SM-9600) starqltechn
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.
---
Changes in v4:
- Rewrite max77705, max77705_charger, max77705_fuel_gauge from scratch
- Reorder patches:
- squash max77705 subdevice bindings in core file because
no resources there
- split device tree changes
- Use _ as space for filenames in power/supply like the majority
- Replace gcc-845 freq_tbl frequencies patch with new approach,
based on automatic m/n/pre_div value generation
- Link to v3: https://lore.kernel.org/r/20240618-starqltechn_integration_upstream-v3-0-e3f6662017ac@gmail.com
---
Dzmitry Sankouski (27):
power: supply: add undervoltage health status property
clk: qcom: clk-rcg2: name refactoring
gcc-sdm845: Add general purpose clock ops
dt-bindings: panel: add Samsung s6e3ha8
dt-bindings: mfd: add maxim,max77705
dt-bindings: mfd: add samsung,s2dos05
drm/panel: Add support for S6E3HA8 panel driver
mfd: max77693: remove unused declarations
mfd: Add new driver for MAX77705 PMIC
input: max77693: add max77705 haptic support
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: sec-core: add s2dos05 support
regulator: add s2dos05 regulator support
arm64: dts: qcom: sdm845: enable gmu
arm64: dts: qcom: starqltechn: remove wifi
arm64: dts: qcom: starqltechn: fix usb regulator mistake
arm64: dts: qcom: starqltechn: refactor node order
arm64: dts: qcom: starqltechn: remove excess reserved gpios
arm64: dts: qcom: starqltechn: add gpio keys
arm64: dts: qcom: starqltechn: add max77705 PMIC
arm64: dts: qcom: starqltechn: add display PMIC
arm64: dts: qcom: starqltechn: add touchscreen support
arm64: dts: qcom: starqltechn: add initial sound support
arm64: dts: qcom: starqltechn: add graphics support
arm64: dts: qcom: starqltechn: add modem support
.../bindings/display/panel/samsung,s6e3ha8.yaml | 75 +++ .../devicetree/bindings/mfd/maxim,max77705.yaml | 169 ++++++ .../devicetree/bindings/mfd/samsung,s2dos05.yaml | 99 ++++ MAINTAINERS | 12 + arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 4 - arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4 - arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 4 - .../arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 - .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 573 +++++++++++++++++++- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 4 - .../boot/dts/qcom/sdm845-sony-xperia-tama.dtsi | 4 - .../dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 4 - arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 - arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 - drivers/clk/qcom/clk-rcg.h | 1 + drivers/clk/qcom/clk-rcg2.c | 243 ++++++++- drivers/clk/qcom/gcc-sdm845.c | 21 +- drivers/gpu/drm/panel/Kconfig | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 350 ++++++++++++ drivers/input/misc/Kconfig | 4 +- drivers/input/misc/Makefile | 1 + drivers/input/misc/max77693-haptic.c | 15 +- drivers/leds/Kconfig | 6 + drivers/leds/Makefile | 1 + drivers/leds/leds-max77705.c | 158 ++++++ drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 2 + drivers/mfd/max77705.c | 248 +++++++++ drivers/mfd/sec-core.c | 11 + drivers/power/supply/Kconfig | 13 + drivers/power/supply/Makefile | 2 + drivers/power/supply/max77705_charger.c | 585 +++++++++++++++++++++ drivers/power/supply/max77705_fuel_gauge.c | 348 ++++++++++++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/s2dos05-regulator.c | 176 +++++++ include/linux/mfd/max77693-common.h | 6 +- include/linux/mfd/max77693-private.h | 11 - include/linux/mfd/max77705-private.h | 180 +++++++ include/linux/mfd/max77705_charger.h | 215 ++++++++ include/linux/mfd/samsung/core.h | 1 + include/linux/power/max77705_fuelgauge.h | 65 +++ include/linux/power_supply.h | 1 + include/linux/regulator/s2dos05.h | 73 +++ 45 files changed, 3627 insertions(+), 101 deletions(-)
---
base-commit: 5acd9952f95fb4b7da6d09a3be39195a80845eb6
change-id: 20240617-starqltechn_integration_upstream-bc86850b2fe3
Best regards,
Signature · 1 line
Dzmitry Sankouski <[email protected]>
Dzmitry Sankouski
maintainerPATCH v4 1/27 power: supply: add undervoltage health status property
Add POWER_SUPPLY_HEALTH_UNDERVOLTAGE status for power supply to report under voltage lockout failures.
--- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+)
include/linux/power_supply.h +1 -0
@@ -58,6 +58,7 @@ enum {POWER_SUPPLY_HEALTH_OVERHEAT ,POWER_SUPPLY_HEALTH_DEAD ,POWER_SUPPLY_HEALTH_OVERVOLTAGE , +POWER_SUPPLY_HEALTH_UNDERVOLTAGE ,POWER_SUPPLY_HEALTH_UNSPEC_FAILURE ,POWER_SUPPLY_HEALTH_COLD , POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 2/27 clk: qcom: clk-rcg2: name refactoring
In reply to Dzmitry Sankouskiclk-rcg2.c uses 2 variable names for pre divisor register value:pre_div and hid_div.
Replace hid_div with pre_div. Update calc_rate docs to reflect, that pre_div is not pure divisor, but a register value, and requires conversion.
--- drivers/clk/qcom/clk-rcg2.c | 51 ++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 22 deletions(-)
drivers/clk/qcom/clk-rcg2.c +29 -22
@@ -153,13 +153,20 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)* * parent_rate m * rate = ----------- x --- -* hid_div n +* pre_div_pure n +* +* @param rate - Parent rate. +* @param m - Multiplier. +* @param n - Divisor. +* @param mode - Use zero to ignore m/n calculation. +* @param pre_div - Pre divisor register value. Pure pre divisor value +* related to pre_div as pre_div_pure = (pre_div + 1) / 2 */ static unsigned long -calc_rate (unsigned long rate,u32 m,u32 n,u32 mode,u32 hid_div) +calc_rate (unsigned long rate,u32 m,u32 n,u32 mode,u32 pre_div) { -if (hid_div) - rate =mult_frac (rate,2 , hid_div +1 ); +if (pre_div) + rate =mult_frac (rate,2 , pre_div +1 );if (mode) rate =mult_frac (rate, m, n);
@@ -171,7 +178,7 @@ static unsigned long __clk_rcg2_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, u32 cfg) { struct clk_rcg2 *rcg = to_clk_rcg2(hw); -u32 hid_div, m =0 , n =0 , mode =0 , mask; +u32 pre_div, m =0 , n =0 , mode =0 , mask;if (rcg->mnd_width) { mask =BIT (rcg->mnd_width) -1 ;
@@ -186,10 +193,10 @@ __clk_rcg2_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, u32 cfg) } mask =BIT (rcg->hid_width) -1 ; - hid_div = cfg >>CFG_SRC_DIV_SHIFT ; - hid_div &= mask; + pre_div = cfg >>CFG_SRC_DIV_SHIFT ; + pre_div &= mask; -return calc_rate (parent_rate, m, n, mode, hid_div); +return calc_rate (parent_rate, m, n, mode, pre_div); } static unsigned long
@@ -715,7 +722,7 @@ static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate,s64 src_rate = parent_rate;s64 request;u32 mask =BIT (rcg->hid_width) -1 ; -u32 hid_div; +u32 pre_div;if (src_rate ==810000000 ) frac = frac_table_810m;
@@ -731,8 +738,8 @@ static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate,continue ;regmap_read (rcg->clkr.regmap, rcg->cmd_rcgr +CFG_REG , - &hid_div); - f.pre_div = hid_div; + &pre_div); + f.pre_div = pre_div; f.pre_div >>=CFG_SRC_DIV_SHIFT ; f.pre_div &= mask; f.m = frac->num;
@@ -760,7 +767,7 @@ static int clk_edp_pixel_determine_rate(struct clk_hw *hw,int delta =100000 ;s64 request;u32 mask =BIT (rcg->hid_width) -1 ; -u32 hid_div; +u32 pre_div;int index =qcom_find_src_index (hw, rcg->parent_map, f->src);/* Force the correct parent */
@@ -781,13 +788,13 @@ static int clk_edp_pixel_determine_rate(struct clk_hw *hw,continue ;regmap_read (rcg->clkr.regmap, rcg->cmd_rcgr +CFG_REG , - &hid_div); - hid_div >>=CFG_SRC_DIV_SHIFT ; - hid_div &= mask; + &pre_div); + pre_div >>=CFG_SRC_DIV_SHIFT ; + pre_div &= mask; req->rate =calc_rate (req->best_parent_rate, frac->num, frac->den, - !!frac->den, hid_div); + !!frac->den, pre_div);return 0 ; }
@@ -974,7 +981,7 @@ static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,unsigned long request;int delta =100000 ;u32 mask =BIT (rcg->hid_width) -1 ; -u32 hid_div, cfg; +u32 pre_div, cfg;int i, num_parents =clk_hw_get_num_parents (hw);regmap_read (rcg->clkr.regmap, rcg->cmd_rcgr +CFG_REG , &cfg);
@@ -995,8 +1002,8 @@ static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,continue ;regmap_read (rcg->clkr.regmap, rcg->cmd_rcgr +CFG_REG , - &hid_div); - f.pre_div = hid_div; + &pre_div); + f.pre_div = pre_div; f.pre_div >>=CFG_SRC_DIV_SHIFT ; f.pre_div &= mask; f.m = frac->num;
@@ -1564,7 +1571,7 @@ static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate,struct clk_rcg2 *rcg =to_clk_rcg2 (hw);struct freq_tbl f = {0 };u32 mask =BIT (rcg->hid_width) -1 ; -u32 hid_div, cfg; +u32 pre_div, cfg;int i, num_parents =clk_hw_get_num_parents (hw);unsigned long num, den;
@@ -1576,7 +1583,7 @@ static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate,return -EINVAL ;regmap_read (rcg->clkr.regmap, rcg->cmd_rcgr +CFG_REG , &cfg); - hid_div = cfg; + pre_div = cfg; cfg &=CFG_SRC_SEL_MASK ; cfg >>=CFG_SRC_SEL_SHIFT ;
@@ -1587,7 +1594,7 @@ static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate, } } - f.pre_div = hid_div; + f.pre_div = pre_div; f.pre_div >>=CFG_SRC_DIV_SHIFT ; f.pre_div &= mask;
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 3/27 gcc-sdm845: Add general purpose clock ops
In reply to Dzmitry SankouskiSDM845 has "General Purpose" clocks that can be muxed to SoC pins to clock various external devices.
Those clocks may be used as e.g. PWM sources for external peripherals.
GPCLK can in theory have arbitrary value depending on the use case, so the concept of frequency tables, used in rcg2 clock driver, is not efficient, because it allows only defined frequencies.
Introduce clk_rcg2_gp_ops, which automatically calculate clock mnd values for arbitrary clock rate. The calculation done as follows:
- upon determine rate request, we calculate m/n/pre_div as follows:
- find parent(from our client's assigned-clock-parent) rate
- find scaled rates by dividing rates on its greatest common divisor
- assign requested scaled rate to m
- factorize scaled parent rate, put multipliers to n till max value (determined by mnd_width)
- validate calculated values with *_width:
- if doesn't fit, delete divisor and multiplier by 2 until fit
- return determined rate
Limitations:
- The driver doesn't select a parent clock (it may be selected by client in device tree with assigned-clocks, assigned-clock-parents properties)
--- drivers/clk/qcom/clk-rcg.h | 1 + drivers/clk/qcom/clk-rcg2.c | 192 ++++++++++++++++++++++++++++++++++++++++-- drivers/clk/qcom/gcc-sdm845.c | 21 ++--- 3 files changed, 193 insertions(+), 21 deletions(-)
drivers/clk/qcom/clk-rcg.h +1 -0
@@ -189,6 +189,7 @@ struct clk_rcg2_gfx3d { container_of(to_clk_rcg2(_hw), struct clk_rcg2_gfx3d, rcg)extern const struct clk_ops clk_rcg2_ops; +extern const struct clk_ops clk_rcg2_gp_ops;extern const struct clk_ops clk_rcg2_floor_ops;extern const struct clk_ops clk_rcg2_fm_ops;extern const struct clk_ops clk_rcg2_mux_closest_ops;
drivers/clk/qcom/clk-rcg2.c +186 -6
258 lines not on this page · raw message
drivers/clk/qcom/gcc-sdm845.c +6 -15
@@ -283,26 +283,17 @@ static struct clk_rcg2 gcc_sdm670_cpuss_rbcpr_clk_src = { }, }; -static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = { -F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ), -F (25000000 ,P_GPLL0_OUT_EVEN ,12 ,0 ,0 ), -F (50000000 ,P_GPLL0_OUT_EVEN ,6 ,0 ,0 ), -F (100000000 ,P_GPLL0_OUT_MAIN ,6 ,0 ,0 ), -F (200000000 ,P_GPLL0_OUT_MAIN ,3 ,0 ,0 ), - { } -}; -static struct clk_rcg2 gcc_gp1_clk_src = { .cmd_rcgr =0x64004 , .mnd_width =8 , .hid_width =5 , .parent_map = gcc_parent_map_1, - .freq_tbl = ftbl_gcc_gp1_clk_src, + .freq_tbl = {}, .clkr.hw.init = &(struct clk_init_data ){ .name ="gcc_gp1_clk_src" , .parent_data = gcc_parent_data_1, .num_parents =ARRAY_SIZE (gcc_parent_data_1), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_gp_ops, }, };
@@ -311,12 +302,12 @@ static struct clk_rcg2 gcc_gp2_clk_src = { .mnd_width = 8, .hid_width = 5, .parent_map = gcc_parent_map_1, - .freq_tbl = ftbl_gcc_gp1_clk_src, + .freq_tbl = {}, .clkr.hw.init = &(struct clk_init_data){ .name ="gcc_gp2_clk_src" , .parent_data = gcc_parent_data_1, .num_parents =ARRAY_SIZE (gcc_parent_data_1), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_gp_ops, }, };
@@ -325,12 +316,12 @@ static struct clk_rcg2 gcc_gp3_clk_src = { .mnd_width = 8, .hid_width = 5, .parent_map = gcc_parent_map_1, - .freq_tbl = ftbl_gcc_gp1_clk_src, + .freq_tbl = {}, .clkr.hw.init = &(struct clk_init_data){ .name ="gcc_gp3_clk_src" , .parent_data = gcc_parent_data_1, .num_parents =ARRAY_SIZE (gcc_parent_data_1), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_gp_ops, }, };
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 4/27 dt-bindings: panel: add Samsung s6e3ha8
In reply to Dzmitry SankouskiAdd binding for the Samsung s6e3ha8 panel found in the Samsung S9.
---
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove reset-gpios description
--- .../bindings/display/panel/samsung,s6e3ha8.yaml | 75 ++++++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 80 insertions(+)
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +75 -0
@@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3ha8.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung s6e3ha8 AMOLED DSI panel + +description: The s6e3ha8 is a 1440x2960 DPI display panel from Samsung Mobile + Displays (SMD). + +maintainers: + - Dzmitry Sankouski <[email protected]> + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6e3ha8 + + reg: + maxItems: 1 + + reset-gpios: true + + port: true + + vdd3-supply: + description: VDD regulator + + vci-supply: + description: VCI regulator + + vddr-supply: + description: VDDR regulator + +required: + - compatible + - reset-gpios + - vdd3-supply + - vddr-supply + - vci-supply + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "samsung,s6e3ha8"; + reg = <0>; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; + te-gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&sde_dsi_active &sde_te_active_sleep>; + pinctrl-1 = <&sde_dsi_suspend &sde_te_active_sleep>; + pinctrl-names = "default", "sleep"; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; + }; + +...
MAINTAINERS +5 -0
@@ -7381,6 +7381,11 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml F: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS +M: Dzmitry Sankouski <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml + DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]> S: Maintained
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 5/27 dt-bindings: mfd: add maxim,max77705
In reply to Dzmitry SankouskiAdd maxim,max77705 core binding part.
---
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove interrupt-names property
- remove obvious reg description
- split long(>80) lines
--- .../devicetree/bindings/mfd/maxim,max77705.yaml | 169 +++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 170 insertions(+)
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +169 -0
@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/maxim,max77705.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX77705 Companion Power Management IC and USB Type-C interface IC + +maintainers: + - Dzmitry Sankouski <[email protected]> + +description: | + This is a part of device tree bindings for Maxim MAX77705 multi functional + device. + + The Maxim MAX77705 is a Companion Power Management and Type-C + interface IC which includes charger, fuelgauge, LED, haptic motor driver and + Type-C management IC. + +properties: + compatible: + const: maxim,max77705 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + charger: + $ref: /schemas/power/supply/power-supply.yaml + additionalProperties: true + properties: + compatible: + const: maxim,max77705-charger + + required: + - compatible + - monitored-battery + + fuel_gauge: + $ref: /schemas/power/supply/power-supply.yaml + type: object + additionalProperties: true + description: MAX77705 fuel gauge with ModelGauge m5 EZ algorithm support. + properties: + compatible: + const: maxim,max77705-fuel-gauge + + shunt-resistor-micro-ohms: + description: | + The value of current sense resistor in microohms. + + required: + - compatible + - shunt-resistor-micro-ohms + - monitored-battery + - power-supplies + + haptic: + type: object + additionalProperties: false + properties: + compatible: + const: maxim,max77705-haptic + + haptic-supply: true + + pwms: + maxItems: 1 + + required: + - compatible + - haptic-supply + - pwms + + leds: + type: object + additionalProperties: false + description: + Up to 4 LEDs supported. One LED is represented by one child node. + properties: + compatible: + const: maxim,max77705-led + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + patternProperties: + "^led@[0-3]$": + type: object + $ref: /schemas/leds/common.yaml# + properties: + reg: + description: + LED index. + unevaluatedProperties: false + required: + - reg + + required: + - compatible + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/leds/common.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@66 { + compatible = "maxim,max77705"; + reg = <0x66>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&chg_int_default>; + pinctrl-names = "default"; + + leds { + compatible = "maxim,max77705-led"; + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + label = "red:usr1"; + }; + + led@2 { + reg = <2>; + label = "green:usr2"; + }; + + led@3 { + reg = <3>; + label = "blue:usr3"; + }; + }; + + max77705_charger: charger { + compatible = "maxim,max77705-charger"; + monitored-battery = <&battery>; + }; + + fuel_gauge { + compatible = "maxim,max77705-fuel-gauge"; + monitored-battery = <&battery>; + power-supplies = <&max77705_charger>; + rsense = <5>; + }; + + + haptic { + compatible = "maxim,max77705-haptic"; + haptic-supply = <&vib_regulator>; + pwms = <&vib_pwm 0 50000>; + }; + }; + };
MAINTAINERS +1 -0
@@ -14064,6 +14064,7 @@ B: mailto:[email protected] F: Documentation/devicetree/bindings/*/maxim,max14577.yaml F: Documentation/devicetree/bindings/*/maxim,max77686.yaml F: Documentation/devicetree/bindings/*/maxim,max77693.yaml +F: Documentation/devicetree/bindings/*/maxim,max77705*.yaml F: Documentation/devicetree/bindings/*/maxim,max77843.yaml F: Documentation/devicetree/bindings/clock/maxim,max77686.txt F: drivers/*/*max77843.c
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 6/27 dt-bindings: mfd: add samsung,s2dos05
In reply to Dzmitry SankouskiAdd samsung,s2dos05 MFD module binding.
---
Changes in v4:
- split long(>80) lines
- fix indentation
- merge with regulators binding
- drop pmic suffix
- drop unused labels in example
- correct description
--- .../devicetree/bindings/mfd/samsung,s2dos05.yaml | 99 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 100 insertions(+)
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +99 -0
@@ -0,0 +1,99 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/samsung,s2dos05.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S2DOS05 Power Management IC + +maintainers: + - Dzmitry Sankouski <[email protected]> + +description: + This is a device tree bindings for S2DOS family of Power Management IC (PMIC). + + The S2DOS05 is a companion power management IC for the panel and touchscreen + in smart phones. Provides voltage regulators and + ADC for power/current measurements. + + Regulator section has 4 LDO and 1 BUCK regulators and also + provides ELVDD, ELVSS, AVDD lines. + +properties: + compatible: + const: samsung,s2dos05 + + reg: + maxItems: 1 + + regulators: + patternProperties: + "^buck1|ldo[1-4]$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + + required: + - regulator-name + + additionalProperties: false + +required: + - compatible + - reg + - regulators + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators { + ldo1 { + regulator-name = "s2dos05-ldo1"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-active-discharge = <0x1>; + }; + + ldo2 { + regulator-name = "s2dos05-ldo2"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-active-discharge = <0x1>; + regulator-boot-on; + }; + + ldo3 { + regulator-name = "s2dos05-ldo3"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-active-discharge = <0x1>; + regulator-boot-on; + }; + + ldo4 { + regulator-name = "s2dos05-ldo4"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3775000>; + regulator-active-discharge = <0x1>; + }; + + buck1 { + regulator-name = "s2dos05-buck1"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <2100000>; + regulator-active-discharge = <0x1>; + }; + }; + }; + }; + +...
MAINTAINERS +1 -0
@@ -20465,6 +20465,7 @@ L: [email protected] S: Maintained B: mailto:[email protected] F: Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml +F: Documentation/devicetree/bindings/mfd/samsung,s2dos*.yaml F: Documentation/devicetree/bindings/mfd/samsung,s2m*.yaml F: Documentation/devicetree/bindings/mfd/samsung,s5m*.yaml F: Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 7/27 drm/panel: Add support for S6E3HA8 panel driver
In reply to Dzmitry SankouskiAdd support for MIPI-DSI based S6E3HA8 AMOLED panel driver. This panel has 1440x2960 resolution, 5.8-inch physical size, and can be found in starqltechn device. Brightness regulation is not yet supported.
Changes in v4:
- inline power related functions
- rework driver using new mipi_dsi_dcs_write_seq_multi macro
- use drm_connector_helper_get_modes_fixed for modes
- remove excessive compression setting
--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 350 ++++++++++++++++++++++++++ 4 files changed, 359 insertions(+)
MAINTAINERS +1 -0
@@ -7385,6 +7385,7 @@ DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS M: Dzmitry Sankouski <[email protected]> S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml +F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]>
drivers/gpu/drm/panel/Kconfig +7 -0
@@ -689,6 +689,13 @@ config DRM_PANEL_SAMSUNG_S6E3HA2 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E3HA8 + tristate "Samsung S6E3HA8 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E63J0X03 tristate "Samsung S6E63J0X03 DSI command mode panel" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -70,6 +70,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) += panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +350 -0
350 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 8/27 mfd: max77693: remove unused declarations
In reply to Dzmitry SankouskiRemove enum max77693_irq_source declaration because unused.
--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)
include/linux/mfd/max77693-private.h +0 -11
@@ -419,17 +419,6 @@ enum max77693_haptic_reg {#define MAX77693_CONFIG2_MEN 6#define MAX77693_CONFIG2_HTYP 5 -enum max77693_irq_source { -LED_INT =0 , -TOPSYS_INT , -CHG_INT , -MUIC_INT1 , -MUIC_INT2 , -MUIC_INT3 , - -MAX77693_IRQ_GROUP_NR , -}; -#define SRC_IRQ_CHARGER BIT(0)#define SRC_IRQ_TOP BIT(1)#define SRC_IRQ_FLASH BIT(2)
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 9/27 mfd: Add new driver for MAX77705 PMIC
In reply to Dzmitry SankouskiAdd the core MFD driver for max77705 PMIC. We define five sub-devices for which the drivers will be added in subsequent patches.
---
Changes for V4:
- rework driver from scratch
- migrate to regmap_add_irq_chip, remove max77705-irq.c, rename max77705-core.c to max77705.c
- cleanup headers
- remove debugfs code
- migrate to use max77693_dev structure
- remove max77705.h
--- MAINTAINERS | 2 + drivers/mfd/Kconfig | 12 ++ drivers/mfd/Makefile | 2 + drivers/mfd/max77705.c | 248 +++++++++++++++++++++++++++++++++++ include/linux/mfd/max77693-common.h | 6 +- include/linux/mfd/max77705-private.h | 180 +++++++++++++++++++++++++ 6 files changed, 449 insertions(+), 1 deletion(-)
MAINTAINERS +2 -0
@@ -14072,6 +14072,7 @@ F: drivers/*/*max77843.c F: drivers/*/max14577*.c F: drivers/*/max77686*.c F: drivers/*/max77693*.c +F: drivers/*/max77705*.c F: drivers/clk/clk-max77686.c F: drivers/extcon/extcon-max14577.c F: drivers/extcon/extcon-max77693.c
@@ -14079,6 +14080,7 @@ F: drivers/rtc/rtc-max77686.c F: include/linux/mfd/max14577*.h F: include/linux/mfd/max77686*.h F: include/linux/mfd/max77693*.h +F: include/linux/mfd/max77705*.h MAXIRADIO FM RADIO RECEIVER DRIVER M: Hans Verkuil <[email protected]>
drivers/mfd/Kconfig +12 -0
@@ -904,6 +904,18 @@ config MFD_MAX77693 additional drivers must be enabled in order to use the functionality of the device. +config MFD_MAX77705 + tristate "Maxim Semiconductor MAX77705 PMIC Support" + depends on I2C + select MFD_CORE + help + Say yes here to add support for Maxim Semiconductor MAX77705. + This is a Power Management IC with Charger, safe LDOs, Flash, Haptic + and MUIC controls on chip. + This driver provides common support for accessing the device; + additional drivers must be enabled in order to use the functionality + of the device. + config MFD_MAX77714 tristate "Maxim Semiconductor MAX77714 PMIC Support" depends on I2C
drivers/mfd/Makefile +2 -0
@@ -167,6 +167,7 @@ obj-$(CONFIG_MFD_MAX77620) += max77620.o obj-$(CONFIG_MFD_MAX77650) += max77650.o obj-$(CONFIG_MFD_MAX77686) += max77686.o obj-$(CONFIG_MFD_MAX77693) += max77693.o +obj-$(CONFIG_MFD_MAX77705) += max77705.o obj-$(CONFIG_MFD_MAX77714) += max77714.o obj-$(CONFIG_MFD_MAX77843) += max77843.o obj-$(CONFIG_MFD_MAX8907) += max8907.o
@@ -232,6 +233,7 @@ obj-$(CONFIG_MFD_RK8XX_I2C) += rk8xx-i2c.o obj-$(CONFIG_MFD_RK8XX_SPI) += rk8xx-spi.o obj-$(CONFIG_MFD_RN5T618) += rn5t618.o obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o +obj-$(CONFIG_MFD_S2DOS05) += s2dos05.o obj-$(CONFIG_MFD_SYSCON) += syscon.o obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o obj-$(CONFIG_MFD_VEXPRESS_SYSREG) += vexpress-sysreg.o
drivers/mfd/max77705.c new file +248 -0
248 lines not on this page · raw message
include/linux/mfd/max77693-common.h +5 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* -* Common data shared between Maxim 77693 and 77843 drivers +* Common data shared between Maxim 77693, 77705 and 77843 drivers * * Copyright (C) 2015 Samsung Electronics */
@@ -11,6 +11,7 @@enum max77693_types {TYPE_MAX77693_UNKNOWN ,TYPE_MAX77693 , +TYPE_MAX77705 ,TYPE_MAX77843 ,TYPE_MAX77693_NUM ,
@@ -25,6 +26,7 @@ struct max77693_dev {struct i2c_client *i2c_muic;/* 0x4A , MUIC */ struct i2c_client *i2c_haptic;/* MAX77693: 0x90 , Haptic */ struct i2c_client *i2c_chg;/* MAX77843: 0xD2, Charger */ +struct i2c_client *i2c_fg;/* MAX77843: 0xD2, Charger */ enum max77693_types type;
@@ -32,6 +34,8 @@ struct max77693_dev {struct regmap *regmap_muic;struct regmap *regmap_haptic;/* Only MAX77693 */ struct regmap *regmap_chg;/* Only MAX77843 */ +struct regmap *regmap_fg;/* Only MAX77705 */ +struct regmap *regmap_leds;/* Only MAX77705 */ struct regmap_irq_chip_data *irq_data_led;struct regmap_irq_chip_data *irq_data_topsys;
include/linux/mfd/max77705-private.h new file +180 -0
180 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 10/27 input: max77693: add max77705 haptic support
In reply to Dzmitry SankouskiAdd support for haptic controller on MAX77705 Multifunction device.
This driver supports external pwm and LRA (Linear Resonant Actuator) motor. User can control the haptic device via force feedback framework.
---
Changes in v4:
- add max77705 haptic support to max77693 driver
- delete max77705-haptic
--- drivers/input/misc/Kconfig | 4 ++-- drivers/input/misc/Makefile | 1 + drivers/input/misc/max77693-haptic.c | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-)
drivers/input/misc/Kconfig +2 -2
@@ -241,11 +241,11 @@ config INPUT_MAX77650_ONKEY config INPUT_MAX77693_HAPTIC tristate "MAXIM MAX77693/MAX77843 haptic controller support" - depends on (MFD_MAX77693 || MFD_MAX77843) && PWM + depends on (MFD_MAX77693 || MFD_MAX77705 || MFD_MAX77843) && PWM select INPUT_FF_MEMLESS help This option enables support for the haptic controller on - MAXIM MAX77693 and MAX77843 chips. + MAXIM MAX77693, MAX77705 and MAX77843 chips. To compile this driver as module, choose M here: the module will be called max77693-haptic.
drivers/input/misc/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o obj-$(CONFIG_INPUT_MAX77650_ONKEY) += max77650-onkey.o obj-$(CONFIG_INPUT_MAX77693_HAPTIC) += max77693-haptic.o +obj-$(CONFIG_INPUT_MAX77705_HAPTIC) += max77705-haptic.o obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o obj-$(CONFIG_INPUT_MAX8997_HAPTIC) += max8997_haptic.o obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o
drivers/input/misc/max77693-haptic.c +14 -1
@@ -23,6 +23,7 @@#include <linux/mfd/max77693.h> #include <linux/mfd/max77693-common.h> #include <linux/mfd/max77693-private.h> +#include <linux/mfd/max77705-private.h> #include <linux/mfd/max77843-private.h> #define MAX_MAGNITUDE_SHIFT 16
@@ -115,6 +116,13 @@ static int max77693_haptic_configure(struct max77693_haptic *haptic, MAX77693_HAPTIC_PWM_DIVISOR_128); config_reg =MAX77693_HAPTIC_REG_CONFIG2 ;break ; +case TYPE_MAX77705 : + value = ((haptic->type <<MAX77693_CONFIG2_MODE ) | + (enable <<MAX77693_CONFIG2_MEN ) | + (haptic->mode <<MAX77693_CONFIG2_HTYP ) | +MAX77693_HAPTIC_PWM_DIVISOR_128 ); + config_reg =MAX77705_PMIC_REG_MCONFIG ; +break ;case TYPE_MAX77843 : value = (haptic->type <<MCONFIG_MODE_SHIFT ) | (enable << MCONFIG_MEN_SHIFT) |
@@ -312,6 +320,9 @@ static int max77693_haptic_probe(struct platform_device *pdev)case TYPE_MAX77693 : haptic->regmap_haptic = max77693->regmap_haptic;break ; +case TYPE_MAX77705 : + haptic->regmap_haptic = max77693->regmap; +break ;case TYPE_MAX77843 : haptic->regmap_haptic = max77693->regmap;break ;
@@ -407,6 +418,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops,static const struct platform_device_id max77693_haptic_id[] = { {"max77693-haptic" , }, + {"max77705-haptic" , }, {"max77843-haptic" , }, {}, };
@@ -414,6 +426,7 @@ MODULE_DEVICE_TABLE(platform, max77693_haptic_id);static const struct of_device_id of_max77693_haptic_dt_match[] = { { .compatible ="maxim,max77693-haptic" , }, + { .compatible ="maxim,max77705-haptic" , }, { .compatible ="maxim,max77843-haptic" , }, {/* sentinel */ }, };
@@ -432,5 +445,5 @@ module_platform_driver(max77693_haptic_driver);MODULE_AUTHOR ("Jaewon Kim <[email protected]>" );MODULE_AUTHOR ("Krzysztof Kozlowski <[email protected]>" ); -MODULE_DESCRIPTION ("MAXIM 77693/77843 Haptic driver" ); +MODULE_DESCRIPTION ("MAXIM 77693/77705/77843 Haptic driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 11/27 power: supply: max77705: Add charger driver for Maxim 77705
In reply to Dzmitry SankouskiAdd driver for Maxim 77705 switch-mode charger (part of max77705 MFD driver) providing power supply class information to userspace.
The driver is configured through DTS (battery and system related settings).
---
Changes for V4:
- start from scratch
- change word delimiters in filenames to '_'
- use GENMASK in header
- remove debugfs code
- migrate to regmap_add_irq_chip
- fix property getters to follow the same style
--- drivers/power/supply/Kconfig | 6 + drivers/power/supply/Makefile | 1 + drivers/power/supply/max77705_charger.c | 585 ++++++++++++++++++++++++++++++++ include/linux/mfd/max77705_charger.h | 215 ++++++++++++ 4 files changed, 807 insertions(+)
drivers/power/supply/Kconfig +6 -0
@@ -573,6 +573,12 @@ config CHARGER_MAX77693 help Say Y to enable support for the Maxim MAX77693 battery charger. +config CHARGER_MAX77705 + tristate "Maxim MAX77705 battery charger driver" + depends on MFD_MAX77705 + help + Say Y to enable support for the Maxim MAX77705 battery charger. + config CHARGER_MAX77976 tristate "Maxim MAX77976 battery charger driver" depends on I2C
drivers/power/supply/Makefile +1 -0
@@ -79,6 +79,7 @@ obj-$(CONFIG_CHARGER_MAX14577) += max14577_charger.o obj-$(CONFIG_CHARGER_DETECTOR_MAX14656) += max14656_charger_detector.o obj-$(CONFIG_CHARGER_MAX77650) += max77650-charger.o obj-$(CONFIG_CHARGER_MAX77693) += max77693_charger.o +obj-$(CONFIG_CHARGER_MAX77705) += max77705_charger.o obj-$(CONFIG_CHARGER_MAX77976) += max77976_charger.o obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
drivers/power/supply/max77705_charger.c new file +585 -0
585 lines not on this page · raw message
include/linux/mfd/max77705_charger.h new file +215 -0
215 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 12/27 power: supply: max77705: Add fuel gauge driver for Maxim 77705
In reply to Dzmitry SankouskiAdd driver for Maxim 77705 fuel gauge (part of max77705 MFD driver) providing power supply class information to userspace.
The driver is configured through DTS (battery and system related settings).
---
Changes for V4:
- rework driver from scratch
- change word delimiters in filenames to "_"
- remove debugfs code
- cleanup header
--- drivers/power/supply/Kconfig | 7 + drivers/power/supply/Makefile | 1 + drivers/power/supply/max77705_fuel_gauge.c | 348 +++++++++++++++++++++++++++++ include/linux/power/max77705_fuelgauge.h | 65 ++++++ 4 files changed, 421 insertions(+)
drivers/power/supply/Kconfig +7 -0
@@ -579,6 +579,13 @@ config CHARGER_MAX77705 help Say Y to enable support for the Maxim MAX77705 battery charger. +config FUEL_GAUGE_MAX77705 + tristate "MAX77705 fuel gauge driver" + depends on MFD_MAX77705 + default n + help + Say Y to enable support for MAXIM MAX77705 fuel gauge driver. + config CHARGER_MAX77976 tristate "Maxim MAX77976 battery charger driver" depends on I2C
drivers/power/supply/Makefile +1 -0
@@ -80,6 +80,7 @@ obj-$(CONFIG_CHARGER_DETECTOR_MAX14656) += max14656_charger_detector.o obj-$(CONFIG_CHARGER_MAX77650) += max77650-charger.o obj-$(CONFIG_CHARGER_MAX77693) += max77693_charger.o obj-$(CONFIG_CHARGER_MAX77705) += max77705_charger.o +obj-$(CONFIG_FUEL_GAUGE_MAX77705) += max77705_fuel_gauge.o obj-$(CONFIG_CHARGER_MAX77976) += max77976_charger.o obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
drivers/power/supply/max77705_fuel_gauge.c new file +348 -0
348 lines not on this page · raw message
include/linux/power/max77705_fuelgauge.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 13/27 leds: max77705: Add LEDs support
In reply to Dzmitry SankouskiThis adds basic support for LEDs for the max77705 PMIC.
---
Changes in v4:
- inline BLINK_(ON|OFF) macro
- remove camel case
- drop backwards compatibility(new driver)
- drop module alias
--- MAINTAINERS | 1 + drivers/leds/Kconfig | 6 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-max77705.c | 158 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 166 insertions(+)
MAINTAINERS +1 -0
@@ -14073,6 +14073,7 @@ F: drivers/*/max14577*.c F: drivers/*/max77686*.c F: drivers/*/max77693*.c F: drivers/*/max77705*.c +F: drivers/leds/leds-max77705.c F: drivers/clk/clk-max77686.c F: drivers/extcon/extcon-max14577.c F: drivers/extcon/extcon-max77693.c
drivers/leds/Kconfig +6 -0
@@ -753,6 +753,12 @@ config LEDS_MAX77650 help LEDs driver for MAX77650 family of PMICs from Maxim Integrated. +config LEDS_MAX77705 + tristate "LED support for Maxim MAX77705 RGB" + depends on MFD_MAX77705 && LEDS_CLASS && I2C + help + LED driver for MAX77705 MFD chip from Maxim Integrated. + config LEDS_MAX8997 tristate "LED support for MAX8997 PMIC" depends on LEDS_CLASS && MFD_MAX8997
drivers/leds/Makefile +1 -0
@@ -60,6 +60,7 @@ obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o +obj-$(CONFIG_LEDS_MAX77705) += leds-max77705.o obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o obj-$(CONFIG_LEDS_MC13783) += leds-mc13783.o obj-$(CONFIG_LEDS_MENF21BMC) += leds-menf21bmc.o
drivers/leds/leds-max77705.c new file +158 -0
158 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 14/27 mfd: sec-core: add s2dos05 support
In reply to Dzmitry SankouskiS2dos05 is a panel/touchscreen PMIC, often found in Samsung phones. We define 2 sub-devices for which drivers will be added in subsequent patches.
--- drivers/mfd/sec-core.c | 11 +++++++++++ include/linux/mfd/samsung/core.h | 1 + 2 files changed, 12 insertions(+)
drivers/mfd/sec-core.c +11 -0
@@ -34,6 +34,10 @@ static const struct mfd_cell s5m8767_devs[] = { }, }; +static const struct mfd_cell s2dos05_devs[] = { + { .name ="s2dos05-regulator" , }, +}; +static const struct mfd_cell s2mps11_devs[] = { { .name ="s2mps11-regulator" , }, { .name ="s2mps14-rtc" , },
@@ -83,6 +87,9 @@ static const struct of_device_id sec_dt_match[] = { { .compatible = "samsung,s5m8767-pmic", .data = (void *)S5M8767X, + }, { + .compatible = "samsung,s2dos05", + .data = (void *)S2DOS05, }, { .compatible = "samsung,s2mps11-pmic", .data = (void *)S2MPS11X,
@@ -339,6 +346,10 @@ static int sec_pmic_probe(struct i2c_client *i2c) sec_devs = s5m8767_devs; num_sec_devs =ARRAY_SIZE (s5m8767_devs);break ; +case S2DOS05 : + sec_devs = s2dos05_devs; + num_sec_devs =ARRAY_SIZE (s2dos05_devs); +break ;case S2MPA01 : sec_devs = s2mpa01_devs; num_sec_devs =ARRAY_SIZE (s2mpa01_devs);
include/linux/mfd/samsung/core.h +1 -0
@@ -37,6 +37,7 @@ struct gpio_desc;enum sec_device_type {S5M8767X , +S2DOS05 ,S2MPA01 ,S2MPS11X ,S2MPS13X ,
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 15/27 regulator: add s2dos05 regulator support
In reply to Dzmitry SankouskiS2dos05 has 1 buck and 4 LDO regulators, used for powering panel/touchscreen.
---
Changes in v4:
- remove excessive linux/module.h import
- use generic regulator helpers
- use of_match
- use devm_* for mem allocations
- use // style comment
- drop all junk Samsung code
- adjust to depend on sec-core
--- MAINTAINERS | 1 + drivers/regulator/Kconfig | 8 ++ drivers/regulator/Makefile | 1 + drivers/regulator/s2dos05-regulator.c | 176 ++++++++++++++++++++++++++++++++++ include/linux/regulator/s2dos05.h | 73 ++++++++++++++ 5 files changed, 259 insertions(+)
MAINTAINERS +1 -0
@@ -20476,6 +20476,7 @@ F: Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml F: Documentation/devicetree/bindings/regulator/samsung,s5m*.yaml F: drivers/clk/clk-s2mps11.c F: drivers/mfd/sec*.c +F: drivers/regulator/s2dos*.c F: drivers/regulator/s2m*.c F: drivers/regulator/s5m*.c F: drivers/rtc/rtc-s5m.c
drivers/regulator/Kconfig +8 -0
@@ -1322,6 +1322,14 @@ config REGULATOR_RTQ2208 and two ldos. It features wide output voltage range from 0.4V to 2.05V and the capability to configure the corresponding power stages. +config REGULATOR_S2DOS05 + tristate "SLSI S2DOS05 regulator" + depends on MFD_SEC_CORE || COMPILE_TEST + help + This driver provides support for the voltage regulators of the S2DOS05. + The S2DOS05 is a companion power management IC for the smart phones. + The S2DOS05 has 4 LDOs and 1 BUCK outputs. + config REGULATOR_S2MPA01 tristate "Samsung S2MPA01 voltage regulator" depends on MFD_SEC_CORE || COMPILE_TEST
drivers/regulator/Makefile +1 -0
@@ -154,6 +154,7 @@ obj-$(CONFIG_REGULATOR_RTMV20) += rtmv20-regulator.o obj-$(CONFIG_REGULATOR_RTQ2134) += rtq2134-regulator.o obj-$(CONFIG_REGULATOR_RTQ6752) += rtq6752-regulator.o obj-$(CONFIG_REGULATOR_RTQ2208) += rtq2208-regulator.o +obj-$(CONFIG_REGULATOR_S2DOS05) += s2dos05-regulator.o obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
drivers/regulator/s2dos05-regulator.c new file +176 -0
176 lines not on this page · raw message
include/linux/regulator/s2dos05.h new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 16/27 arm64: dts: qcom: sdm845: enable gmu
In reply to Dzmitry SankouskiLeave gmu enabled, because it's only probed when
GPU is.
--- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 -- 9 files changed, 34 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +0 -4
@@ -741,10 +741,6 @@ touchscreen@10 { }; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay"; };
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +0 -4
@@ -444,10 +444,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +0 -4
@@ -414,10 +414,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +0 -4
@@ -345,10 +345,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +0 -4
@@ -419,10 +419,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi +0 -4
@@ -415,10 +415,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +0 -4
@@ -239,10 +239,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";
arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts +0 -4
@@ -381,10 +381,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };
arch/arm64/boot/dts/qcom/sdm845.dtsi +0 -2
@@ -4948,8 +4948,6 @@ gmu: gmu@506a000 { operating-points-v2 = <&gmu_opp_table>; - status = "disabled"; - gmu_opp_table: opp-table { compatible = "operating-points-v2";
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 17/27 arm64: dts: qcom: starqltechn: remove wifi
In reply to Dzmitry SankouskiStarqltechn has broadcom chip for wifi, so sdm845 wifi part can be disabled.
--- arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 8 -------- 1 file changed, 8 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +0 -8
@@ -418,14 +418,6 @@ &usb_1_qmpphy { status = "okay"; }; -&wifi { - vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>; - vdd-1.8-xo-supply = <&vreg_l7a_1p8>; - vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; - vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; - status = "okay"; -}; - &tlmm { gpio-reserved-ranges = <0 4>, <27 4>, <81 4>, <85 4>;
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 18/27 arm64: dts: qcom: starqltechn: fix usb regulator mistake
In reply to Dzmitry SankouskiUsb regulator was wrongly pointed to vreg_l1a_0p875. However, on starqltechn it's powered from vreg_l5a_0p8.
--- arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +1 -2
@@ -135,8 +135,6 @@ vdda_pll_cc_ebi23: vdda_sp_sensor: vdda_ufs1_core: vdda_ufs2_core: - vdda_usb1_ss_core: - vdda_usb2_ss_core: vreg_l1a_0p875: ldo1 { regulator-min-microvolt = <880000>; regulator-max-microvolt = <880000>;
@@ -157,6 +155,7 @@ vreg_l3a_1p0: ldo3 { regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; }; + vdda_usb1_ss_core: vdd_wcss_cx: vdd_wcss_mx: vdda_wcss_pll:
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 19/27 arm64: dts: qcom: starqltechn: refactor node order
In reply to Dzmitry Sankouski--- arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +1 -1
@@ -382,8 +382,8 @@ &ufs_mem_phy { }; &sdhc_2 { - pinctrl-names = "default"; pinctrl-0 = <&sdc2_clk_state &sdc2_cmd_state &sdc2_data_state &sd_card_det_n_state>; + pinctrl-names = "default"; cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>; vmmc-supply = <&vreg_l21a_2p95>; vqmmc-supply = <&vddpx_2>;
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 20/27 arm64: dts: qcom: starqltechn: remove excess reserved gpios
In reply to Dzmitry SankouskiStarqltechn has 2 reserved gpio ranges <27 4>, <85 4>. <27 4> is spi for eSE(embedded Secure Element). <85 4> is spi for fingerprint.
Remove excess reserved gpio regions.
--- arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +2 -1
@@ -418,7 +418,8 @@ &usb_1_qmpphy { }; &tlmm { - gpio-reserved-ranges = <0 4>, <27 4>, <81 4>, <85 4>; + gpio-reserved-ranges = <27 4>, /* SPI (eSE - embedded Secure Element) */ + <85 4>; /* SPI (fingerprint reader) */ sdc2_clk_state: sdc2-clk-state { pins = "sdc2_clk";
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 21/27 arm64: dts: qcom: starqltechn: add gpio keys
In reply to Dzmitry SankouskiAdd support for phone buttons.
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +36 -0
@@ -7,9 +7,11 @@ /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 "sdm845.dtsi" +#include "pm8998.dtsi" / { chassis-type = "handset";
@@ -69,6 +71,25 @@ memory@a1300000 { pmsg-size = <0x40000>; }; }; + + gpio_keys { + compatible = "gpio-keys"; + autorepeat; + + key-vol-up { + label = "volume_up"; + gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>; + linux,code = <KEY_VOLUMEUP>; + debounce-interval = <15>; + }; + + key-wink { + label = "key_wink"; + gpios = <&pm8998_gpios 19 GPIO_ACTIVE_LOW>; + linux,code = <KEY_ENTER>; + debounce-interval = <15>; + }; + }; };
@@ -417,6 +438,21 @@ &usb_1_qmpphy { status = "okay"; }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; +}; + +&pm8998_gpios { + chg_int_default: chg-int-default-state { + pins = "gpio11"; + function = "normal"; + input-enable; + bias-disable; + power-source = <0>; + }; +}; + &tlmm { gpio-reserved-ranges = <27 4>, /* SPI (eSE - embedded Secure Element) */ <85 4>; /* SPI (fingerprint reader) */
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 22/27 arm64: dts: qcom: starqltechn: add max77705 PMIC
In reply to Dzmitry SankouskiAdd support for max77705 MFD device. Supported sub-devices:
charger, fuelgauge, haptic, led
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +103 -0
@@ -18,6 +18,16 @@ / { model = "Samsung Galaxy S9 SM-G9600"; compatible = "samsung,starqltechn", "qcom,sdm845"; + 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>;
@@ -90,6 +100,27 @@ key-wink { debounce-interval = <15>; }; }; + + vib_regulator: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "haptic"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + enable-active-high; + gpio = <&pm8998_gpios 18 GPIO_ACTIVE_HIGH>; + }; + + vib_pwm: pwm { + #pwm-cells = <2>; + compatible = "clk-pwm"; + clocks = <&gcc GCC_GP1_CLK>; + assigned-clock-parents = <&rpmhcc RPMH_CXO_CLK>; + assigned-clocks = <&gcc GCC_GP1_CLK_SRC>; + pinctrl-0 = <&motor_pwm_default_state>; + pinctrl-1 = <&motor_pwm_suspend_state>; + pinctrl-names = "default", "suspend"; + }; };
@@ -385,10 +416,66 @@ &qupv3_id_1 { status = "okay"; }; +&gpi_dma1 { + status = "okay"; +}; + &uart9 { status = "okay"; }; +&i2c14 { + status = "okay"; + + pmic@66 { + compatible = "maxim,max77705"; + reg = <0x66>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&chg_int_default>; + pinctrl-names = "default"; + + leds { + compatible = "maxim,max77705-led"; + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + label = "red:usr1"; + }; + + led@2 { + reg = <2>; + label = "green:usr2"; + }; + + led@3 { + reg = <3>; + label = "blue:usr3"; + }; + }; + + max77705_charger: charger { + compatible = "maxim,max77705-charger"; + monitored-battery = <&battery>; + }; + + fuel_gauge { + compatible = "maxim,max77705-fuel-gauge"; + monitored-battery = <&battery>; + power-supplies = <&max77705_charger>; + shunt-resistor-micro-ohms = <5000>; + }; + + haptic { + compatible = "maxim,max77705-haptic"; + haptic-supply = <&vib_regulator>; + pwms = <&vib_pwm 0 100000>; + }; + }; +}; + &ufs_mem_hc { reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>; vcc-supply = <&vreg_l20a_2p95>;
@@ -485,4 +572,20 @@ sd_card_det_n_state: sd-card-det-n-state { function = "gpio"; bias-pull-up; }; + + motor_pwm_default_state: motor-pwm-active-state { + pins = "gpio57"; + function = "gcc_gp1"; + drive-strength = <2>; + bias-disable; + output-high; + }; + + motor_pwm_suspend_state: motor-pwm-suspend-state { + pins = "gpio57"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; };
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 23/27 arm64: dts: qcom: starqltechn: add display PMIC
In reply to Dzmitry SankouskiAdd support for s2dos05 display / touchscreen PMIC
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +77 -0
@@ -39,6 +39,9 @@ framebuffer: framebuffer@9d400000 { height = <2960>; stride = <(1440 * 4)>; format = "a8r8g8b8"; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; }; };
@@ -101,6 +104,66 @@ key-wink { }; }; + i2c21 { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 127 GPIO_ACTIVE_HIGH>; + scl-gpios = <&tlmm 128 GPIO_ACTIVE_HIGH>; + i2c-gpio,delay-us = <2>; + pinctrl-0 = <&i2c21_sda_state &i2c21_scl_state>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators { + s2dos05_ldo1: ldo1 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-name = "s2dos05-ldo1"; + }; + + s2dos05_ldo2: ldo2 { + regulator-active-discharge = <1>; + regulator-boot-on; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "s2dos05-ldo2"; + }; + + s2dos05_ldo3: ldo3 { + regulator-active-discharge = <1>; + regulator-boot-on; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "s2dos05-ldo3"; + }; + + s2dos05_ldo4: ldo4 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3775000>; + regulator-name = "s2dos05-ldo4"; + }; + + s2dos05_buck1: buck1 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <2100000>; + regulator-name = "s2dos05-buck1"; + }; + }; + }; + }; + vib_regulator: gpio-regulator { compatible = "regulator-fixed"; regulator-name = "haptic";
@@ -588,4 +651,18 @@ motor_pwm_suspend_state: motor-pwm-suspend-state { bias-disable; output-low; }; + + i2c21_sda_state: i2c21-sda-state { + pins = "gpio127"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + i2c21_scl_state: i2c21-scl-state { + pins = "gpio128"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; };
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 24/27 arm64: dts: qcom: starqltechn: add touchscreen support
In reply to Dzmitry SankouskiAdd support for samsung,s6sy761 touchscreen.
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +28 -0
@@ -561,6 +561,23 @@ &sdhc_2 { status = "okay"; }; +&i2c11 { + clock-frequency = <400000>; + status = "okay"; + + touchscreen@48 { + compatible = "samsung,s6sy761"; + reg = <0x48>; + interrupt-parent = <&tlmm>; + interrupts = <120 IRQ_TYPE_LEVEL_HIGH>; + vdd-supply = <&s2dos05_ldo2>; + avdd-supply = <&s2dos05_ldo3>; + + pinctrl-0 = <&touch_irq_state>; + pinctrl-names = "default"; + }; +}; + &usb_1 { status = "okay"; };
@@ -665,4 +682,15 @@ i2c21_scl_state: i2c21-scl-state { drive-strength = <2>; bias-disable; }; + + touch_irq_state: touch-irq-state { + pins = "gpio120"; + function = "gpio"; + bias-disable; + }; +}; + +&qup_i2c11_default { + drive-strength = <2>; + bias-disable; };
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 25/27 arm64: dts: qcom: starqltechn: add initial sound support
In reply to Dzmitry SankouskiAdd support for sound (headphones and mics only)
Also redefine slpi reserved memory, because adsp_mem overlaps with slpi_mem inherited from sdm845.dtsi.
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +213 -0
@@ -10,8 +10,15 @@ #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/ &adsp_mem; +/delete-node/ &slpi_mem; / { chassis-type = "handset";
@@ -83,6 +90,16 @@ memory@a1300000 { ftrace-size = <0x40000>; pmsg-size = <0x40000>; }; + + slpi_mem: slpi@96700000 { + reg = <0 0x96700000 0 0xf00000>; + no-map; + }; + + adsp_mem: memory@97800000 { + reg = <0 0x97800000 0 0x2000000>; + no-map; + }; }; gpio_keys {
@@ -578,6 +595,202 @@ touchscreen@48 { }; }; +&adsp_pas { + firmware-name = "qcom/sdm845/starqltechn/adsp.mbn"; + status = "okay"; +}; + +&lpasscc { + status = "okay"; +}; + +&wcd9340 { + reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; + vdd-buck-supply = <&vreg_s4a_1p8>; + vdd-buck-sido-supply = <&vreg_s4a_1p8>; + vdd-tx-supply = <&vreg_s4a_1p8>; + vdd-rx-supply = <&vreg_s4a_1p8>; + vdd-io-supply = <&vreg_s4a_1p8>; + qcom,micbias1-microvolt = <1800000>; + qcom,micbias2-microvolt = <2700000>; + qcom,micbias3-microvolt = <1800000>; + qcom,micbias4-microvolt = <1800000>; +}; + +&sound { + compatible = "qcom,sdm845-sndcard"; + model = "Samsung Galaxy S9"; + pinctrl-0 = <&quat_mi2s_active &quat_mi2s_sd0_active &quat_mi2s_sd1_active>; + pinctrl-names = "default"; + status = "okay"; + + audio-routing = "RX_BIAS", "MCLK", + "AMIC2", "MIC BIAS2", /* Headset Mic */ + "AMIC3", "MIC BIAS2", /* FMLeft Tx */ + "AMIC4", "MIC BIAS2", /* FMRight Tx */ + "DMIC0", "MIC BIAS1", /* Digital Mic0 */ + "DMIC5", "MIC BIAS4", /* Digital Mic1 */ + "DMIC4", "MIC BIAS4", /* Digital Mic2 */ + "DMIC3", "MIC BIAS3", /* Digital Mic3 */ + "DMIC2", "MIC BIAS3", /* Digital Mic4 */ + "DMIC1", "MIC BIAS1"; /* Digital Mic5 */ + + mm1-dai-link { + link-name = "MultiMedia1"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + mm2-dai-link { + link-name = "MultiMedia2"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; + }; + }; + + mm3-dai-link { + link-name = "MultiMedia3"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>; + }; + }; + + mm4-dai-link { + link-name = "MultiMedia4"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>; + }; + }; + + mm5-dai-link { + link-name = "MultiMedia5"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA5>; + }; + }; + + mm6-dai-link { + link-name = "MultiMedia6"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA6>; + }; + }; + + slim-dai-link { + link-name = "SLIM Playback 1"; + cpu { + sound-dai = <&q6afedai SLIMBUS_0_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 0>; + }; + }; + + slimcap-dai-link { + link-name = "SLIM Capture 1"; + cpu { + sound-dai = <&q6afedai SLIMBUS_0_TX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 1>; + }; + }; + + slim2-dai-link { + link-name = "SLIM Playback 2"; + cpu { + sound-dai = <&q6afedai SLIMBUS_1_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 2>; /* AIF2_PB */ + }; + }; + + slimcap2-dai-link { + link-name = "SLIM Capture 2"; + cpu { + sound-dai = <&q6afedai SLIMBUS_1_TX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 3>; /* AIF2_CAP */ + }; + }; + + slimcap3-dai-link { + link-name = "SLIM Capture 3"; + cpu { + sound-dai = <&q6afedai SLIMBUS_2_TX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 5>; /* AIF3_CAP */ + }; + }; +}; + +&q6afedai { + dai@22 { + reg = <22>; + qcom,sd-lines = <1>; + }; + + dai@23 { + reg = <23>; + qcom,sd-lines = <0>; + }; +}; + +&q6asmdai { + dai@0 { + reg = <0>; + }; + + dai@1 { + reg = <1>; + }; + + dai@2 { + reg = <2>; + }; + + dai@3 { + reg = <3>; + }; + + dai@4 { + reg = <4>; + }; + + dai@5 { + reg = <5>; + }; +}; + &usb_1 { status = "okay"; };
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 26/27 arm64: dts: qcom: starqltechn: add graphics support
In reply to Dzmitry SankouskiAdd support for gpu and panel.
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +67 -0
@@ -203,6 +203,52 @@ vib_pwm: pwm { }; }; +&gpu { + status = "okay"; + + zap-shader { + memory-region = <&gpu_mem>; + firmware-name = "qcom/sdm845/starqltechn/a630_zap.mbn"; + }; +}; + +&mdss { + status = "okay"; +}; + +&mdss_dsi0 { + vdda-supply = <&vreg_l26a_1p2>; + status = "okay"; + + panel@0 { + compatible = "samsung,s6e3ha8"; + reg = <0>; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; + te-gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&sde_dsi_default &sde_te>; + pinctrl-1 = <&sde_dsi_suspend &sde_te>; + pinctrl-names = "default", "suspend"; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; +}; + +&mdss_dsi0_out { + data-lanes = <0 1 2 3>; + remote-endpoint = <&panel_in>; +}; + +&mdss_dsi0_phy { + vdds-supply = <&vdda_mipi_dsi0_pll>; + status = "okay"; +}; &apps_rsc { regulators-0 {
@@ -837,6 +883,27 @@ &tlmm { gpio-reserved-ranges = <27 4>, /* SPI (eSE - embedded Secure Element) */ <85 4>; /* SPI (fingerprint reader) */ + sde_dsi_default: sde-dsi-default-state { + pins = "gpio6"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + + sde_dsi_suspend: sde-dsi-suspend-state { + pins = "gpio6"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + sde_te: sde-te-state { + pins = "gpio10"; + function = "mdp_vsync"; + drive-strength = <2>; + bias-pull-down; + }; + sdc2_clk_state: sdc2-clk-state { pins = "sdc2_clk"; bias-disable;
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v4 27/27 arm64: dts: qcom: starqltechn: add modem support
In reply to Dzmitry SankouskiAdd support for modem and ipa(IP Accelerator).
Add spss reserved memory node.
--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +39 -0
@@ -17,6 +17,8 @@ #include "pm8998.dtsi" #include "sdm845-wcd9340.dtsi" +/delete-node/ &rmtfs_mem; +/delete-node/ &spss_mem; /delete-node/ &adsp_mem; /delete-node/ &slpi_mem;
@@ -91,15 +93,39 @@ memory@a1300000 { pmsg-size = <0x40000>; }; + /* + * 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 { + reg = <0 0x88f00000 0 0x1c00000>; + no-map; + }; + slpi_mem: slpi@96700000 { reg = <0 0x96700000 0 0xf00000>; no-map; }; + spss_mem: spss@97700000 { + reg = <0 0x97700000 0 0x100000>; + no-map; + }; + adsp_mem: memory@97800000 { reg = <0 0x97800000 0 0x2000000>; no-map; }; + + rmtfs_mem: rmtfs-mem@fde00000 { + compatible = "qcom,rmtfs-mem"; + reg = <0 0xfde00000 0 0x202000>; + qcom,use-guard-pages; + no-map; + + qcom,client-id = <1>; + qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>; + }; }; gpio_keys {
@@ -837,6 +863,19 @@ dai@5 { }; }; +&mss_pil { + firmware-name = "qcom/sdm845/starqltechn/mba.mbn", + "qcom/sdm845/starqltechn/modem.mbn"; + status = "okay"; +}; + +&ipa { + qcom,gsi-loader = "self"; + memory-region = <&ipa_fw_mem>; + firmware-name = "qcom/sdm845/starqltechn/ipa_fws.mbn"; + status = "okay"; +}; + &usb_1 { status = "okay"; };
Signature · 1 line
2.39.2
Rob Herring (Arm)
maintainerRe: [PATCH v4 05/27] dt-bindings: mfd: add maxim,max77705
In reply to Dzmitry SankouskiQuoted 11 lines · Dzmitry Sankouski
Add maxim,max77705 core binding part.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove interrupt-names property
- remove obvious reg description
- split long(>80) lines
Quoted 5 lines
--- .../devicetree/bindings/mfd/maxim,max77705.yaml | 169 +++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 170 insertions(+)
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/maxim,max77705.example.dtb: pmic@66: fuel_gauge: 'shunt-resistor-micro-ohms' is a required property
from schema $id: http://devicetree.org/schemas/mfd/maxim,max77705.yaml#
doc reference errors (make refcheckdocs):
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v4 02/27] clk: qcom: clk-rcg2: name refactoring
In reply to Dzmitry SankouskiQuoting Dzmitry Sankouski (2024-09-13 08:07:45)
Quoted 8 lines
clk-rcg2.cuses 2 variable names for pre divisor register value:pre_divandhid_div.Replace
hid_divwithpre_div. Updatecalc_ratedocs to reflect, thatpre_divis not pure divisor, but a register value, and requires conversion.Signed-off-by Dzmitry Sankouski <[email protected]>---
Nak
hid stands for "half-integer divider" from what I recall. Feel free to document that, but don't rename it.
Re: [PATCH v4 16/27] arm64: dts: qcom: sdm845: enable gmu
In reply to Dzmitry SankouskiHi Dzmitry,
Quoted 152 lines · Dzmitry Sankouski
Leave gmu enabled, because it's only probed when
GPU is.Signed-off-by Dzmitry Sankouski <[email protected]>--- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 4 ---- arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 ---- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 -- 9 files changed, 34 deletions(-)arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +0
-4@@ -741,10 +741,6 @@ touchscreen@10 { }; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay"; };arch/arm64/boot/dts/qcom/sdm845-db845c.dts +0
-4@@ -444,10 +444,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };arch/arm64/boot/dts/qcom/sdm845-mtp.dts +0
-4@@ -414,10 +414,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +0
-4@@ -345,10 +345,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +0
-4@@ -419,10 +419,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi +0
-4@@ -415,10 +415,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +0
-4@@ -239,10 +239,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpu { status = "okay";arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts +0
-4@@ -381,10 +381,6 @@ &gcc { <GCC_LPASS_SWAY_CLK>; }; -&gmu { - status = "okay"; -}; - &gpi_dma0 { status = "okay"; };arch/arm64/boot/dts/qcom/sdm845.dtsi +0
-3@@ -4948,8 +4948,6 @@ gmu: gmu@506a000 { operating-points-v2 = <&gmu_opp_table>; - status = "disabled"; - gmu_opp_table: opp-table { compatible = "operating-points-v2"; --
Quoted 3 lines
2.39.2
This seems like it would also affect the sdm850-lenovo-yoga-c630 which inherits from sdm850.dtsi which inherits from sdm845.dtsi (they are sdm845s with 2 higher clock speeds)
-- steev
Rob Herring
maintainerRe: [PATCH v4 05/27] dt-bindings: mfd: add maxim,max77705
In reply to Dzmitry SankouskiQuoted 44 lines · Dzmitry Sankouski
Add maxim,max77705 core binding part.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove interrupt-names property
- remove obvious reg description
- split long(>80) lines--- .../devicetree/bindings/mfd/maxim,max77705.yaml | 169 +++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 170 insertions(+)Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +22
-0@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/maxim,max77705.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX77705 Companion Power Management IC and USB Type-C interface IC + +maintainers: + - Dzmitry Sankouski <[email protected]> + +description: | + This is a part of device tree bindings for Maxim MAX77705 multi functional + device. + + The Maxim MAX77705 is a Companion Power Management and Type-C + interface IC which includes charger, fuelgauge, LED, haptic motor driver and + Type-C management IC. + +properties: + compatible: + const: maxim,max77705
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +10
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + charger: + $ref: /schemas/power/supply/power-supply.yaml + additionalProperties: true
No, true is only valid for incomplete schemas (i.e. common ones included by another complete schema).
And since you reference another schema, you want 'unevaluatedProperties' instead if you want to use any properties defined in power-supply.yaml.
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 41
Quoted 9 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +9
-0+ properties: + compatible: + const: maxim,max77705-charger + + required: + - compatible + - monitored-battery + + fuel_gauge:
fuel-gauge
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 45
Quoted 4 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +4
-0+ $ref: /schemas/power/supply/power-supply.yaml + type: object + additionalProperties: true + description: MAX77705 fuel gauge with ModelGauge m5 EZ algorithm support.
blank line
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 51
Quoted 6 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +6
-0+ properties: + compatible: + const: maxim,max77705-fuel-gauge + + shunt-resistor-micro-ohms: + description: |
Don't need '|'.
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 62
Quoted 11 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +11
-0+ The value of current sense resistor in microohms. + + required: + - compatible + - shunt-resistor-micro-ohms + - monitored-battery + - power-supplies + + haptic: + type: object + additionalProperties: false
blank line
Quoted 9 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +9
-0+ properties: + compatible: + const: maxim,max77705-haptic + + haptic-supply: true + + pwms: + maxItems: 1 +
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 81
Quoted 10 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +10
-0+ required: + - compatible + - haptic-supply + - pwms + + leds: + type: object + additionalProperties: false + description: + Up to 4 LEDs supported. One LED is represented by one child node.
blank line
Quoted 4 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +4
-0+ properties: + compatible: + const: maxim,max77705-led +
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 95
Quoted 10 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +10
-0+ "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + patternProperties: + "^led@[0-3]$": + type: object + $ref: /schemas/leds/common.yaml#
blank line
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 99
Quoted 4 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +4
-0+ properties: + reg: + description: + LED index.
blank line
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 100
Quoted 1 line
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +1
-0+ unevaluatedProperties: false
blank line
Quoted 49 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +49
-0+ required: + - reg + + required: + - compatible + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/leds/common.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@66 { + compatible = "maxim,max77705"; + reg = <0x66>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&chg_int_default>; + pinctrl-names = "default"; + + leds { + compatible = "maxim,max77705-led"; + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + label = "red:usr1"; + }; + + led@2 { + reg = <2>; + label = "green:usr2"; + }; + + led@3 { + reg = <3>; + label = "blue:usr3"; + }; + }; +
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml line 159
Quoted 10 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +10
-0+ max77705_charger: charger { + compatible = "maxim,max77705-charger"; + monitored-battery = <&battery>; + }; + + fuel_gauge { + compatible = "maxim,max77705-fuel-gauge"; + monitored-battery = <&battery>; + power-supplies = <&max77705_charger>; + rsense = <5>;
Not documented.
Quoted 26 lines
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file +10
-0+ }; + + + haptic { + compatible = "maxim,max77705-haptic"; + haptic-supply = <&vib_regulator>; + pwms = <&vib_pwm 0 50000>; + }; + }; + };MAINTAINERS +1
-0@@ -14064,6 +14064,7 @@ B: mailto:[email protected] F: Documentation/devicetree/bindings/*/maxim,max14577.yaml F: Documentation/devicetree/bindings/*/maxim,max77686.yaml F: Documentation/devicetree/bindings/*/maxim,max77693.yaml +F: Documentation/devicetree/bindings/*/maxim,max77705*.yaml F: Documentation/devicetree/bindings/*/maxim,max77843.yaml F: Documentation/devicetree/bindings/clock/maxim,max77686.txt F: drivers/*/*max77843.cSignature · 2 lines
-- 2.39.2
kernel test robot
build botRe: [PATCH v4 03/27] gcc-sdm845: Add general purpose clock ops
In reply to Dzmitry Sankouskikernel test robot noticed the following build errors:
Hi Dzmitry,
kernel test robot noticed the following build errors:
[auto build test ERROR on 5acd9952f95fb4b7da6d09a3be39195a80845eb6]
url: https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20240913-231027 base: 5acd9952f95fb4b7da6d09a3be39195a80845eb6 patch link: https://lore.kernel.org/r/20240913-starqltechn_integration_upstream-v4-3-2d2efd5c5877%40gmail.com patch subject: [PATCH v4 03/27] gcc-sdm845: Add general purpose clock ops config: i386-buildonly-randconfig-004-20240914 (https://download.01.org/0day-ci/archive/20240914/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
>> drivers/clk/qcom/gcc-sdm845.c:291:9: warning: braces around scalar initializer
291 | .freq_tbl = {},
| ^
drivers/clk/qcom/gcc-sdm845.c:291:9: note: (near initialization for 'gcc_gp1_clk_src.<anonymous>.freq_tbl')
>> drivers/clk/qcom/gcc-sdm845.c:291:21: error: empty scalar initializer
291 | .freq_tbl = {},
| ^
drivers/clk/qcom/gcc-sdm845.c:291:21: note: (near initialization for 'gcc_gp1_clk_src.<anonymous>.freq_tbl')
drivers/clk/qcom/gcc-sdm845.c:305:9: warning: braces around scalar initializer
305 | .freq_tbl = {},
| ^
drivers/clk/qcom/gcc-sdm845.c:305:9: note: (near initialization for 'gcc_gp2_clk_src.<anonymous>.freq_tbl')
drivers/clk/qcom/gcc-sdm845.c:305:21: error: empty scalar initializer
305 | .freq_tbl = {},
| ^
drivers/clk/qcom/gcc-sdm845.c:305:21: note: (near initialization for 'gcc_gp2_clk_src.<anonymous>.freq_tbl')
drivers/clk/qcom/gcc-sdm845.c:319:9: warning: braces around scalar initializer
319 | .freq_tbl = {},
| ^
drivers/clk/qcom/gcc-sdm845.c:319:9: note: (near initialization for 'gcc_gp3_clk_src.<anonymous>.freq_tbl')
drivers/clk/qcom/gcc-sdm845.c:319:21: error: empty scalar initializer
319 | .freq_tbl = {},
| ^ drivers/clk/qcom/gcc-sdm845.c:319:21: note: (near initialization for 'gcc_gp3_clk_src.<anonymous>.freq_tbl')
vim +291 drivers/clk/qcom/gcc-sdm845.c
285
286 static struct clk_rcg2 gcc_gp1_clk_src = {
287 .cmd_rcgr = 0x64004,
288 .mnd_width = 8,
289 .hid_width = 5,
290 .parent_map = gcc_parent_map_1,
> 291 .freq_tbl = {}, 292 .clkr.hw.init = &(struct clk_init_data){
293 .name = "gcc_gp1_clk_src",
294 .parent_data = gcc_parent_data_1,
295 .num_parents = ARRAY_SIZE(gcc_parent_data_1),
296 .ops = &clk_rcg2_gp_ops,
297 },
298 };
299
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v4 11/27] power: supply: max77705: Add charger driver for Maxim 77705
In reply to Dzmitry Sankouskikernel test robot noticed the following build errors:
Hi Dzmitry,
kernel test robot noticed the following build errors:
[auto build test ERROR on 5acd9952f95fb4b7da6d09a3be39195a80845eb6]
url: https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20240913-231027 base: 5acd9952f95fb4b7da6d09a3be39195a80845eb6 patch link: https://lore.kernel.org/r/20240913-starqltechn_integration_upstream-v4-11-2d2efd5c5877%40gmail.com patch subject: [PATCH v4 11/27] power: supply: max77705: Add charger driver for Maxim 77705 config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20240914/[email protected]/config) compiler: sh4-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/power/supply/max77705_charger.c: In function 'max77705_charger_probe':
>> drivers/power/supply/max77705_charger.c:523:48: error: assignment of member 'irq_drv_data' in read-only object
523 | max77705_charger_irq_chip.irq_drv_data = chg;
| ^vim +/irq_drv_data +523 drivers/power/supply/max77705_charger.c
497
498 static int max77705_charger_probe(struct platform_device *pdev)
499 {
500 struct power_supply_config pscfg = {};
501 struct max77693_dev *max77705;
502 struct max77705_charger_data *chg;
503 struct device *dev, *parent;
504 struct regmap_irq_chip_data *irq_data;
505 int ret;
506
507 dev = &pdev->dev;
508 parent = dev->parent;
509 max77705 = dev_get_drvdata(parent);
510
511 chg = devm_kzalloc(dev, sizeof(*chg), GFP_KERNEL);
512 if (!chg)
513 return -ENOMEM;
514
515 platform_set_drvdata(pdev, chg);
516
517 chg->regmap = max77705->regmap_chg;
518 if (!chg->regmap)
519 return -ENODEV;
520
521 chg->dev = dev;
522
> 523 max77705_charger_irq_chip.irq_drv_data = chg;
524 ret = devm_regmap_add_irq_chip(chg->dev, chg->regmap, max77705->irq,
525 IRQF_ONESHOT | IRQF_SHARED, 0,
526 &max77705_charger_irq_chip,
527 &irq_data);
528 if (ret) {
529 dev_err(dev, "failed to add irq chip: %d\n", ret);
530 return ret;
531 }
532
533 ret = regmap_update_bits(chg->regmap,
534 MAX77705_CHG_REG_INT_MASK,
535 MAX77705_CHGIN_IM, 0);
536
537 if (ret)
538 return ret;
539
540 chg->wqueue = create_singlethread_workqueue(dev_name(dev));
541 if (IS_ERR(chg->wqueue)) {
542 dev_err(dev, "failed to create workqueue\n");
543 return PTR_ERR(chg->wqueue);
544 }
545 INIT_WORK(&chg->chgin_work, max77705_chgin_isr_work);
546
547 pscfg.of_node = dev->of_node;
548 pscfg.drv_data = chg;
549
550 chg->psy_chg = devm_power_supply_register(dev, &max77705_charger_psy_desc,
551 &pscfg);
552 if (IS_ERR(chg->psy_chg))
553 return PTR_ERR(chg->psy_chg);
554
555 max77705_charger_initialize(chg);
556
557 return max77705_charger_enable(chg);
558 }
559
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v4 03/27] gcc-sdm845: Add general purpose clock ops
In reply to Dzmitry Sankouskikernel test robot noticed the following build errors:
Hi Dzmitry,
kernel test robot noticed the following build errors:
[auto build test ERROR on 5acd9952f95fb4b7da6d09a3be39195a80845eb6]
url: https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20240913-231027 base: 5acd9952f95fb4b7da6d09a3be39195a80845eb6 patch link: https://lore.kernel.org/r/20240913-starqltechn_integration_upstream-v4-3-2d2efd5c5877%40gmail.com patch subject: [PATCH v4 03/27] gcc-sdm845: Add general purpose clock ops config: arm-randconfig-001-20240914 (https://download.01.org/0day-ci/archive/20240914/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
arm-linux-gnueabi-ld: drivers/clk/qcom/clk-rcg2.o: in function `clk_rcg2_calc_mnd':
>> drivers/clk/qcom/clk-rcg2.c:437:(.text.clk_rcg2_calc_mnd+0x26): undefined reference to `__aeabi_uldivmod' >> arm-linux-gnueabi-ld: drivers/clk/qcom/clk-rcg2.c:438:(.text.clk_rcg2_calc_mnd+0x38): undefined reference to `__aeabi_uldivmod'
vim +437 drivers/clk/qcom/clk-rcg2.c
427
428 static void clk_rcg2_calc_mnd(u64 parent_rate, u64 rate, struct freq_tbl *f,
429 unsigned int mnd_max, unsigned int hid_max)
430 {
431 int i = 2, count = 0;
432 unsigned int pre_div_pure = 1;
433 unsigned long rates_gcd, scaled_parent_rate;
434 u16 m, n = 1, n_candidate = 1, n_max;
435
436 rates_gcd = gcd(parent_rate, rate);
> 437 m = rate / rates_gcd; > 438 scaled_parent_rate = parent_rate / rates_gcd;
439 while (scaled_parent_rate > (mnd_max + m) * hid_max) {
440 // we're exceeding divisor's range, trying lower scale.
441 if (m > 1) {
442 m--;
443 scaled_parent_rate = mult_frac(scaled_parent_rate, m, (m + 1));
444 } else {
445 f->n = mnd_max + m;
446 f->pre_div = hid_max;
447 f->m = m;
448 }
449 }
450
451 n_max = m + mnd_max;
452
453 while (scaled_parent_rate > 1) {
454 while (scaled_parent_rate % i == 0) {
455 n_candidate *= i;
456 if (n_candidate < n_max)
457 n = n_candidate;
458 else if (pre_div_pure * i < hid_max)
459 pre_div_pure *= i;
460 else
461 clk_rcg2_split_div(i, &pre_div_pure, &n, hid_max);
462
463 scaled_parent_rate /= i;
464 }
465 i++;
466 count++;
467 }
468
469 f->m = m;
470 f->n = n;
471 f->pre_div = pre_div_pure > 1 ? pre_div_pure : 0;
472 }
473
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v4 01/27] power: supply: add undervoltage health status property
In reply to Dzmitry SankouskiHi,
Quoted 5 lines · Dzmitry Sankouski
Add
POWER_SUPPLY_HEALTH_UNDERVOLTAGEstatus for power supply to report under voltage lockout failures.Signed-off-by Dzmitry Sankouski <[email protected]>---
This is missing updates toDocumentation/ABI/testing/sysfs-class-power anddrivers/power/supply/power_supply_sysfs.c
(POWER_SUPPLY_HEALTH_TEXT).
Greetings,
-- Sebastian
Quoted 19 lines
include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+)include/linux/power_supply.h +1
-0@@ -58,6 +58,7 @@ enum {POWER_SUPPLY_HEALTH_OVERHEAT ,POWER_SUPPLY_HEALTH_DEAD ,POWER_SUPPLY_HEALTH_OVERVOLTAGE , +POWER_SUPPLY_HEALTH_UNDERVOLTAGE ,POWER_SUPPLY_HEALTH_UNSPEC_FAILURE ,POWER_SUPPLY_HEALTH_COLD , POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,Signature · 2 lines
-- 2.39.2
Re: [PATCH v4 14/27] mfd: sec-core: add s2dos05 support
In reply to Dzmitry SankouskiQuoted 9 lines · Dzmitry Sankouski
S2dos05 is a panel/touchscreen PMIC, often found in Samsung phones. We define 2 sub-devices for which drivers will be added in subsequent patches.
Signed-off-by Dzmitry Sankouski <[email protected]>--- drivers/mfd/sec-core.c | 11 +++++++++++ include/linux/mfd/samsung/core.h | 1 + 2 files changed, 12 insertions(+)
Best regards,
Krzysztof
Re: [PATCH v4 08/27] mfd: max77693: remove unused declarations
In reply to Dzmitry SankouskiQuoted 6 lines · Dzmitry Sankouski
Remove
enum max77693_irq_sourcedeclaration because unused.Signed-off-by Dzmitry Sankouski <[email protected]>--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)
Please split your patchset per subsystems. There is no dependency on MFD bits from your DTS... (if there is, this needs to be fixed anyway)
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v4 06/27] dt-bindings: mfd: add samsung,s2dos05
In reply to Dzmitry SankouskiQuoted 26 lines · Dzmitry Sankouski
Add samsung,s2dos05 MFD module binding.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes in v4:
- split long(>80) lines
- fix indentation
- merge with regulators binding
- drop pmic suffix
- drop unused labels in example
- correct description--- .../devicetree/bindings/mfd/samsung,s2dos05.yaml | 99 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 100 insertions(+)Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +3
-0@@ -0,0 +1,99 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +---
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 13
Quoted 10 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +10
-0+$id: http://devicetree.org/schemas/mfd/samsung,s2dos05.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S2DOS05 Power Management IC + +maintainers: + - Dzmitry Sankouski <[email protected]> + +description: + This is a device tree bindings for S2DOS family of Power Management IC (PMIC).
Drop this sentence, not really useful. I know that I put it into other Samsung PMIC bindings, but let's don't grow this pattern.
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 20
Quoted 7 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +7
-0+ + The S2DOS05 is a companion power management IC for the panel and touchscreen + in smart phones. Provides voltage regulators and + ADC for power/current measurements. + + Regulator section has 4 LDO and 1 BUCK regulators and also + provides ELVDD, ELVSS, AVDD lines.
What are these? Input supplies?
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 31
Quoted 11 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +11
-0+ +properties: + compatible: + const: samsung,s2dos05 + + reg: + maxItems: 1 + + regulators: + patternProperties: + "^buck1|ldo[1-4]$":
s/buck1/buck/
Quoted 17 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +17
-0+ type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + + required: + - regulator-name + + additionalProperties: false + +required: + - compatible + - reg + - regulators + +additionalProperties: false + +examples:
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 58
Quoted 10 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +10
-0+ - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators {
Messed indentation.
Use 4 spaces for example indentation.
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 60
Quoted 2 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +2
-0+ ldo1 { + regulator-name = "s2dos05-ldo1";
Such name is useless, so it's a clear sign you should not require it. If you keep it in example, then say something useful - see your DTS.
Quoted 4 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +4
-0+ regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-active-discharge = <0x1>; + };
...
MAINTAINERS L: [email protected] · line 20469
Quoted 11 lines
+...
MAINTAINERS +1
-0@@ -20465,6 +20465,7 @@ L: [email protected] S: Maintained B: mailto:[email protected] F: Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml +F: Documentation/devicetree/bindings/mfd/samsung,s2dos*.yaml F: Documentation/devicetree/bindings/mfd/samsung,s2m*.yaml
Maybe just change this pattern to s2*.yaml ?
Quoted 6 lines
MAINTAINERS +0
-0F: Documentation/devicetree/bindings/mfd/samsung,s5m*.yaml F: Documentation/devicetree/bindings/regulator/samsung,s2m*.yamlSignature · 2 lines
-- 2.39.2
Krzysztof Kozlowski
maintainerRe: [PATCH v4 23/27] arm64: dts: qcom: starqltechn: add display PMIC
In reply to Dzmitry SankouskiQuoted 36 lines · Dzmitry Sankouski
Add support for s2dos05 display / touchscreen PMIC
Signed-off-by Dzmitry Sankouski <[email protected]>--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+)arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +14
-0@@ -39,6 +39,9 @@ framebuffer: framebuffer@9d400000 { height = <2960>; stride = <(1440 * 4)>; format = "a8r8g8b8"; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; }; };@@ -101,6 +104,66 @@ key-wink { }; }; + i2c21 { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 127 GPIO_ACTIVE_HIGH>; + scl-gpios = <&tlmm 128 GPIO_ACTIVE_HIGH>; + i2c-gpio,delay-us = <2>; + pinctrl-0 = <&i2c21_sda_state &i2c21_scl_state>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 {
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts key-wink { · line 127
Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +10
-0+ compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators { + s2dos05_ldo1: ldo1 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-name = "s2dos05-ldo1";
Useless name. Please use rather names from the schematics, but I guess you might not have them, so maybe downstream has reasonable name?
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v4 22/27] arm64: dts: qcom: starqltechn: add max77705 PMIC
In reply to Dzmitry SankouskiQuoted 30 lines · Dzmitry Sankouski
Add support for max77705 MFD device. Supported sub-devices:
charger, fuelgauge, haptic, ledSigned-off-by Dzmitry Sankouski <[email protected]>--- .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+)arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +10
-0@@ -18,6 +18,16 @@ / { model = "Samsung Galaxy S9 SM-G9600"; compatible = "samsung,starqltechn", "qcom,sdm845"; + 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>;
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts key-wink { · line 104
Quoted 5 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +2
-0@@ -90,6 +100,27 @@ key-wink { debounce-interval = <15>; }; }; + + vib_regulator: gpio-regulator {
Please use name for all fixed regulators which matches current format
recommendation: 'regulator-[0-9]v[0-9]'
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml?h=v6.11-rc1#n46
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts key-wink { · line 116
Quoted 12 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +12
-0+ compatible = "regulator-fixed"; + regulator-name = "haptic"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + enable-active-high; + gpio = <&pm8998_gpios 18 GPIO_ACTIVE_HIGH>; + }; + + vib_pwm: pwm { + #pwm-cells = <2>; + compatible = "clk-pwm";
compatible is always the first property. See DTS coding style.
Quoted 50 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +39
-0+ clocks = <&gcc GCC_GP1_CLK>; + assigned-clock-parents = <&rpmhcc RPMH_CXO_CLK>; + assigned-clocks = <&gcc GCC_GP1_CLK_SRC>; + pinctrl-0 = <&motor_pwm_default_state>; + pinctrl-1 = <&motor_pwm_suspend_state>; + pinctrl-names = "default", "suspend"; + }; };@@ -385,10 +416,66 @@ &qupv3_id_1 { status = "okay"; }; +&gpi_dma1 { + status = "okay"; +}; + &uart9 { status = "okay"; }; +&i2c14 { + status = "okay"; + + pmic@66 { + compatible = "maxim,max77705"; + reg = <0x66>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&chg_int_default>; + pinctrl-names = "default"; + + leds { + compatible = "maxim,max77705-led"; + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + label = "red:usr1"; + }; + + led@2 { + reg = <2>; + label = "green:usr2"; + }; + + led@3 { + reg = <3>;
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts &qupv3_id_1 { · line 464
Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +10
-0+ label = "blue:usr3"; + }; + }; + + max77705_charger: charger { + compatible = "maxim,max77705-charger"; + monitored-battery = <&battery>; + }; + + fuel_gauge {
No underscores in node names. See DTS coding style.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v4 15/27] regulator: add s2dos05 regulator support
In reply to Dzmitry SankouskiQuoted 5 lines · Dzmitry Sankouski
S2dos05 has 1 buck and 4 LDO regulators, used for powering panel/touchscreen.
Signed-off-by Dzmitry Sankouski <[email protected]>
...
Quoted 11 lines
drivers/regulator/s2dos05-regulator.c new file +11
-0+#include <linux/bug.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/slab.h> +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> +#include <linux/regulator/of_regulator.h>
drivers/regulator/s2dos05-regulator.c line 27
Quoted 10 lines
drivers/regulator/s2dos05-regulator.c new file +10
-0+#include <linux/mfd/samsung/core.h> +#include <linux/regulator/s2dos05.h> +#include <linux/i2c.h> + +struct s2dos05_data { +struct regmap *regmap; +struct device *dev; +}; + +static const struct regulator_ops s2dos05_ops = {
Keep definitions together. This goes down, after all declarations and macros.
Quoted 20 lines
drivers/regulator/s2dos05-regulator.c new file +20
-0+ .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, + .is_enabled = regulator_is_enabled_regmap, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .set_active_discharge = regulator_set_active_discharge_regmap, +}; + +#define _BUCK (macro) S2DOS05_BUCK##macro +#define _buck_ops (num) s2dos05_ops##num + +#define _LDO (macro) S2DOS05_LDO##macro +#define _REG (ctrl) S2DOS05_REG##ctrl +#define _ldo_ops (num) s2dos05_ops##num +#define _MASK (macro) S2DOS05_ENABLE_MASK##macro +#define _TIME (macro) S2DOS05_ENABLE_TIME##macro +
...
Review
Quoted 2 lines
(quoted diff) +2
-0+ +static struct regulator_desc regulators[S2DOS05_REGULATOR_MAX] = {
This should be const.
Quoted 20 lines
drivers/regulator/s2dos05-regulator.c new file +20
-0+// name, id, ops, min_uv, uV_step, vsel_reg, enable_reg +LDO_DESC ("ldo1" ,_LDO (1 ), &_ldo_ops (),_LDO (_MIN1), +_LDO (_STEP1),_REG (_LDO1_CFG), +_REG (_EN),_MASK (_L1),_TIME (_LDO),_REG (_LDO1_CFG)), +LDO_DESC ("ldo2" ,_LDO (2 ), &_ldo_ops (),_LDO (_MIN1), +_LDO (_STEP1),_REG (_LDO2_CFG), +_REG (_EN),_MASK (_L2),_TIME (_LDO),_REG (_LDO2_CFG)), +LDO_DESC ("ldo3" ,_LDO (3 ), &_ldo_ops (),_LDO (_MIN2), +_LDO (_STEP1),_REG (_LDO3_CFG), +_REG (_EN),_MASK (_L3),_TIME (_LDO),_REG (_LDO3_CFG)), +LDO_DESC ("ldo4" ,_LDO (4 ), &_ldo_ops (),_LDO (_MIN2), +_LDO (_STEP1),_REG (_LDO4_CFG), +_REG (_EN),_MASK (_L4),_TIME (_LDO),_REG (_LDO4_CFG)), +BUCK_DESC ("buck1" ,_BUCK (1 ), &_buck_ops (),_BUCK (_MIN1), +_BUCK (_STEP1),_REG (_BUCK_VOUT), + _REG(_EN), _MASK(_B1), _TIME(_BUCK), _REG(_BUCK_CFG)), +}; + +static int s2dos05_pmic_probe (struct platform_device *pdev) +{
drivers/regulator/s2dos05-regulator.c line 122
Quoted 10 lines
drivers/regulator/s2dos05-regulator.c new file +10
-0+struct device *dev = &pdev->dev; +struct sec_pmic_dev *iodev =dev_get_drvdata (pdev->dev.parent); +struct of_regulator_match *rdata =NULL ; +struct s2dos05_data *s2dos05; +struct regulator_config config = { }; +unsigned int rdev_num =ARRAY_SIZE (regulators); +int i, ret; + + s2dos05 =devm_kzalloc (dev,sizeof (struct s2dos05_data ), +GFP_KERNEL );
sizeof(*)
Quoted 43 lines
drivers/regulator/s2dos05-regulator.c new file +43
-0+if (!s2dos05) +return -ENOMEM ; + +platform_set_drvdata (pdev, s2dos05); + + rdata =devm_kcalloc (dev, rdev_num,sizeof (*rdata),GFP_KERNEL ); +if (!rdata) +return -ENOMEM ; + +for (i =0 ; i < rdev_num; i++) + rdata[i].name = regulators[i].name; + + s2dos05->regmap = iodev->regmap_pmic; + s2dos05->dev = dev; +if (!dev->of_node) + dev->of_node = dev->parent->of_node; + +for (i =0 ; i < rdev_num; i++) { +struct regulator_dev *regulator; + + config.init_data = rdata[i].init_data; + config.of_node = rdata[i].of_node; + config.dev = dev; + config.driver_data = s2dos05; + regulator =devm_regulator_register (&pdev->dev, + ®ulators[i], &config); +if (IS_ERR (regulator)) { + ret =PTR_ERR (regulator); +dev_err (&pdev->dev,"regulator init failed for %d\n" , + i); + } + } + +return ret; +} + +static const struct platform_device_id s2dos05_pmic_id[] = { + {"s2dos05-regulator" }, + { }, +}; +MODULE_DEVICE_TABLE (platform, s2dos05_pmic_id); + +static struct platform_driver s2dos05_platform_driver = {
drivers/regulator/s2dos05-regulator.c line 175
Quoted 10 lines
drivers/regulator/s2dos05-regulator.c new file +10
-0+ .driver = { + .name = "s2dos05", + }, + .probe = s2dos05_pmic_probe, + .id_table = s2dos05_pmic_id, +}; +module_platform_driver (s2dos05_platform_driver); + +MODULE_AUTHOR ("Dzmitry Sankouski <[email protected]>" ); +MODULE_DESCRIPTION ("SAMSUNG s2dos05 Regulator Driver" );
s/SAMSUNG/Samsung/
Also, your Kconfig used different name, so please use one - probably Samsung.
This applies to MFD patch as well.
include/linux/regulator/s2dos05.h line 1
Quoted 8 lines
drivers/regulator/s2dos05-regulator.c new file +1
-0+MODULE_LICENSE ("GPL" );include/linux/regulator/s2dos05.h new file +1
-0@@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0+ */
Are you sure that here (and other places) you want any newer GPL? This is quite odd. Does original code (from which you took 2016 copyrights) have this as well?
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v4 04/27] dt-bindings: panel: add Samsung s6e3ha8
In reply to Dzmitry SankouskiQuoted 53 lines · Dzmitry Sankouski
Add binding for the Samsung s6e3ha8 panel found in the Samsung S9.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove reset-gpios description--- .../bindings/display/panel/samsung,s6e3ha8.yaml | 75 ++++++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 80 insertions(+)Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +33
-0@@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3ha8.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung s6e3ha8 AMOLED DSI panel + +description: The s6e3ha8 is a 1440x2960 DPI display panel from Samsung Mobile + Displays (SMD). + +maintainers: + - Dzmitry Sankouski <[email protected]> + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6e3ha8 + + reg: + maxItems: 1 + + reset-gpios: true + + port: true + + vdd3-supply: + description: VDD regulator + + vci-supply: + description: VCI regulator
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +10
-0+ + vddr-supply: + description: VDDR regulator + +required: + - compatible + - reset-gpios + - vdd3-supply + - vddr-supply + - vci-supply
If there is going to be resend, then keep the same order as in
properties: block.
Quoted 19 lines
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +19
-0+ +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "samsung,s6e3ha8"; + reg = <0>; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; + te-gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml line 72
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +10
-0+ pinctrl-0 = <&sde_dsi_active &sde_te_active_sleep>; + pinctrl-1 = <&sde_dsi_suspend &sde_te_active_sleep>; + pinctrl-names = "default", "sleep"; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + };
Indentation is still mixed up.
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml line 75
Quoted 3 lines
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +3
-0+ }; + +...
Best regards,
Krzysztof
Dzmitry Sankouski
maintainerRe: [PATCH v4 08/27] mfd: max77693: remove unused declarations
In reply to Krzysztof Kozlowskiпн, 16 сент. 2024 г. в 12:10, Krzysztof Kozlowski <[email protected]>:
Quoted 11 lines · Dzmitry Sankouski
Quoted 6 lines
Remove
enum max77693_irq_sourcedeclaration because unused.Signed-off-by Dzmitry Sankouski <[email protected]>--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)Please split your patchset per subsystems. There is no dependency on MFD bits from your DTS... (if there is, this needs to be fixed anyway)
Indeed, my dts has no dependency on this patch.
However, my dts has dependency on MAX77705, so AFAIU,
I should send this patch separately, while leaving other drivers in same patchset, right?
Krzysztof Kozlowski
maintainerRe: [PATCH v4 08/27] mfd: max77693: remove unused declarations
Quoted 10 lines · Dzmitry Sankouski
пн, 16 сент. 2024 г. в 12:10, Krzysztof Kozlowski <[email protected]>:
Quoted 9 lines · Dzmitry Sankouski
Quoted 6 lines
Remove
enum max77693_irq_sourcedeclaration because unused.Signed-off-by Dzmitry Sankouski <[email protected]>--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)
Quoted 7 lines
Quoted 2 lines
Please split your patchset per subsystems. There is no dependency on MFD bits from your DTS... (if there is, this needs to be fixed anyway)
Indeed, my dts has no dependency on this patch.
However, my dts has dependency on MAX77705, so AFAIU,
I should send this patch separately, while leaving other drivers in same patchset, right?
How DTS could have dependency on MAX77705? It's a clear no go - broken patch. And something very weird, almost never happening for new hardware.
Best regards,
Krzysztof
Dzmitry Sankouski
maintainerRe: [PATCH v4 08/27] mfd: max77693: remove unused declarations
чт, 19 сент. 2024 г. в 10:00, Krzysztof Kozlowski <[email protected]>:
Quoted 15 lines · Dzmitry Sankouski
Quoted 13 lines
пн, 16 сент. 2024 г. в 12:10, Krzysztof Kozlowski <[email protected]>:
Quoted 11 lines · Dzmitry Sankouski
Quoted 6 lines
Remove
enum max77693_irq_sourcedeclaration because unused.Signed-off-by Dzmitry Sankouski <[email protected]>--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)Please split your patchset per subsystems. There is no dependency on MFD bits from your DTS... (if there is, this needs to be fixed anyway)
Quoted 8 lines
Quoted 4 lines
Indeed, my dts has no dependency on this patch.
However, my dts has dependency on MAX77705, so AFAIU,
I should send this patch separately, while leaving other drivers in same patchset, right?How DTS could have dependency on MAX77705? It's a clear no go - broken patch. And something very weird, almost never happening for new hardware.
Oh right, dts only depends on driver bindings, not driver code, so I can send dts
patches with bindings in separate series, and per subsystem series for new driver code.
Krzysztof Kozlowski
maintainerRe: [PATCH v4 08/27] mfd: max77693: remove unused declarations
Quoted 21 lines · Dzmitry Sankouski
чт, 19 сент. 2024 г. в 10:00, Krzysztof Kozlowski <[email protected]>:
Quoted 20 lines · Dzmitry Sankouski
Quoted 17 lines
пн, 16 сент. 2024 г. в 12:10, Krzysztof Kozlowski <[email protected]>:
Quoted 11 lines · Dzmitry Sankouski
Quoted 6 lines
Remove
enum max77693_irq_sourcedeclaration because unused.Signed-off-by Dzmitry Sankouski <[email protected]>--- include/linux/mfd/max77693-private.h | 11 ----------- 1 file changed, 11 deletions(-)Please split your patchset per subsystems. There is no dependency on MFD bits from your DTS... (if there is, this needs to be fixed anyway)
Indeed, my dts has no dependency on this patch.
However, my dts has dependency on MAX77705, so AFAIU,
I should send this patch separately, while leaving other drivers in same patchset, right?
Quoted 7 lines
Quoted 3 lines
How DTS could have dependency on MAX77705? It's a clear no go - broken patch. And something very weird, almost never happening for new hardware.
Oh right, dts only depends on driver bindings, not driver code, so I can send dts
patches with bindings in separate series, and per subsystem series for new driver code.
This is how you can organize patchsets:
https://lore.kernel.org/all/[email protected]/
Here is a brief description how to organize the patchset:
https://lore.kernel.org/linux-samsung-soc/CADrjBPq_0nUYRABKpskRF_dhHu+4K=duPVZX==0pr+cjSL_caQ@mail.gmail.com/T/#m2d9130a1342ab201ab49670fa6c858ee3724c83c
Best regards,
Krzysztof
Dzmitry Sankouski
maintainerRe: [PATCH v4 06/27] dt-bindings: mfd: add samsung,s2dos05
In reply to Krzysztof Kozlowskiпн, 16 сент. 2024 г. в 12:14, Krzysztof Kozlowski <[email protected]>:
Quoted 42 lines · Dzmitry Sankouski
Quoted 26 lines
Add samsung,s2dos05 MFD module binding.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes in v4:
- split long(>80) lines
- fix indentation
- merge with regulators binding
- drop pmic suffix
- drop unused labels in example
- correct description--- .../devicetree/bindings/mfd/samsung,s2dos05.yaml | 99 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 100 insertions(+)Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +3
-0@@ -0,0 +1,99 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +---Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 13
Quoted 10 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +10
-0+$id: http://devicetree.org/schemas/mfd/samsung,s2dos05.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S2DOS05 Power Management IC + +maintainers: + - Dzmitry Sankouski <[email protected]> + +description: + This is a device tree bindings for S2DOS family of Power Management IC (PMIC).Drop this sentence, not really useful. I know that I put it into other Samsung PMIC bindings, but let's don't grow this pattern.
Quoted 10 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml line 20
Quoted 7 lines
Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml new file +7
-0+ + The S2DOS05 is a companion power management IC for the panel and touchscreen + in smart phones. Provides voltage regulators and + ADC for power/current measurements. + + Regulator section has 4 LDO and 1 BUCK regulators and also + provides ELVDD, ELVSS, AVDD lines.What are these? Input supplies?
ELVSS and ELVDD are common abbreviations for AMOLED panel backlight supplies, AVDD for panel electronics. I conclude that s2dos05 ic provides ELVSS, ELVDD, AVDD from the facts, it can measure its current and power. Those power lines are controlled by display hardware [1],
i.e. vendor kernel driver has no clue how to control those regulators.
I guess they just combined regular regulator ic with ELVSS, ELVDD, AVDD ic like [2].
[1]: https://github.com/klabit87/twrp_android_samsung_kernel_sdm845/blob/android-8.0/drivers/gpu/drm/msm/samsung/S6E3HA8_AMB577PX01/dsi_panel_S6E3HA8_AMB577PX01_wqhd_octa_cmd.dtsi#L3508
[2]: https://www.st.com/resource/en/data_brief/stmp30.pdf
Dzmitry Sankouski
maintainerRe: [PATCH v4 23/27] arm64: dts: qcom: starqltechn: add display PMIC
In reply to Krzysztof KozlowskiQuoted 12 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts key-wink { · line 127
Quoted 11 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +11
-0+ pmic@60 { + compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators { + s2dos05_ldo1: ldo1 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-name = "s2dos05-ldo1";
Quoted 2 lines
Useless name. Please use rather names from the schematics, but I guess you might not have them, so maybe downstream has reasonable name?
Unfortunately, downstream uses that same name.
Signature · 2 lines
Best regards, Dzmitry
Krzysztof Kozlowski
maintainerRe: [PATCH v4 23/27] arm64: dts: qcom: starqltechn: add display PMIC
Quoted 12 lines · Dzmitry Sankouski
Quoted 12 lines
Quoted 11 lines
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +11
-0+ pmic@60 { + compatible = "samsung,s2dos05"; + reg = <0x60>; + + regulators { + s2dos05_ldo1: ldo1 { + regulator-active-discharge = <1>; + regulator-enable-ramp-delay = <12000>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-name = "s2dos05-ldo1";
Quoted 4 lines
Quoted 2 lines
Useless name. Please use rather names from the schematics, but I guess you might not have them, so maybe downstream has reasonable name?
Unfortunately, downstream uses that same name.
Then "ldo1" is enough.
Best regards,
Krzysztof
Dzmitry Sankouski
maintainerRe: [PATCH v4 15/27] regulator: add s2dos05 regulator support
In reply to Krzysztof KozlowskiQuoted 12 lines
include/linux/regulator/s2dos05.h line 1
Quoted 7 lines
include/linux/regulator/s2dos05.h new file +1
-0@@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ Are you sure that here (and other places) you want any newer GPL? This is quite odd. Does original code (from which you took 2016 copyrights) have this as well?
Original code permits redistribution under 2+ license [1]. Is 2+ preferable over 2 only?
Re: [PATCH v4 07/27] drm/panel: Add support for S6E3HA8 panel driver
In reply to Dzmitry SankouskiQuoted 201 lines · Dzmitry Sankouski
Add support for MIPI-DSI based S6E3HA8 AMOLED panel driver. This panel has 1440x2960 resolution, 5.8-inch physical size, and can be found in starqltechn device. Brightness regulation is not yet supported.
Signed-off-by Dzmitry Sankouski <[email protected]>Changes in v4:
- inline power related functions
- rework driver using newmipi_dsi_dcs_write_seq_multimacro
- usedrm_connector_helper_get_modes_fixedfor modes
- remove excessive compression setting--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 350 ++++++++++++++++++++++++++ 4 files changed, 359 insertions(+)MAINTAINERS +1
-0@@ -7385,6 +7385,7 @@ DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS M: Dzmitry Sankouski <[email protected]> S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml +F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]>drivers/gpu/drm/panel/Kconfig +7
-0@@ -689,6 +689,13 @@ config DRM_PANEL_SAMSUNG_S6E3HA2 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E3HA8 + tristate "Samsung S6E3HA8 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E63J0X03 tristate "Samsung S6E63J0X03 DSI command mode panel" depends on OFdrivers/gpu/drm/panel/Makefile +1
-0@@ -70,6 +70,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) += panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.odrivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +134
-0@@ -0,0 +1,350 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree: +// Copyright (c) 2013, The Linux Foundation. All rights reserved. +// Copyright (c) 2024 Dzmitry Sankouski <[email protected]> + +#include <linux/delay.h> +#include <linux/gpio/consumer.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/regulator/consumer.h> + +#include <drm/display/drm_dsc.h> +#include <drm/display/drm_dsc_helper.h> +#include <drm/drm_mipi_dsi.h> +#include <drm/drm_probe_helper.h> +#include <drm/drm_panel.h> + +struct s6e3ha8 { +struct drm_panel panel; +struct mipi_dsi_device *dsi; +struct drm_dsc_config dsc; +struct gpio_desc *reset_gpio; +struct regulator_bulk_data supplies[3 ]; +}; + +static inline +struct s6e3ha8 *to_s6e3ha8_amb577px01_wqhd (struct drm_panel *panel) +{ + return container_of(panel, struct s6e3ha8, panel); +} + +#define s6e3ha8_test_key_on_lvl2 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl2 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl3 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl3 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl1 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0xa5, 0xa5) +#define s6e3ha8_test_key_off_lvl1 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0x5a, 0x5a) +#define s6e3ha8_afc_off (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xe2, 0x00, 0x00) + +static void s6e3ha8_amb577px01_wqhd_reset (struct s6e3ha8 *priv) +{ +gpiod_set_value_cansleep (priv->reset_gpio,1 ); +usleep_range (5000 ,6000 ); +gpiod_set_value_cansleep (priv->reset_gpio,0 ); +usleep_range (5000 ,6000 ); +gpiod_set_value_cansleep (priv->reset_gpio,1 ); +usleep_range (5000 ,6000 ); +} + +static int s6e3ha8_amb577px01_wqhd_on (struct s6e3ha8 *priv) +{ +struct mipi_dsi_device *dsi = priv->dsi; +struct device *dev = &dsi->dev; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; +int ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +s6e3ha8_test_key_on_lvl1 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); + + ret =mipi_dsi_compression_mode (dsi, true); +if (ret <0 ) { +dev_err (dev,"Failed to set compression mode: %d\n" , ret); +return ret; + } + +s6e3ha8_test_key_off_lvl2 (&ctx); + + ret =mipi_dsi_dcs_exit_sleep_mode (dsi); +if (ret <0 ) { +dev_err (dev,"Failed to exit sleep mode: %d\n" , ret); +return ret; + } +usleep_range (5000 ,6000 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x13 ); +s6e3ha8_test_key_off_lvl2 (&ctx); + +usleep_range (10000 ,11000 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x13 ); +s6e3ha8_test_key_off_lvl2 (&ctx); + +/* OMOK setting 1 (Initial setting) - Scaler Latch Setting Guide */ +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x07 ); +/* latch setting 1 : Scaler on/off & address setting & PPS setting -> Image update latch */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x3c ,0x10 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x0b ); +/* latch setting 2 : Ratio change mode -> Image update latch */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x30 ); +/* OMOK setting 2 - Seamless setting guide : WQHD */ +mipi_dsi_dcs_write_seq_multi (&ctx,0x2a ,0x00 ,0x00 ,0x05 ,0x9f );/* CASET */ +mipi_dsi_dcs_write_seq_multi (&ctx,0x2b ,0x00 ,0x00 ,0x0b ,0x8f );/* PASET */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xba ,0x01 );/* scaler setup : scaler off */ +s6e3ha8_test_key_off_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0x35 ,0x00 );/* TE Vsync ON */ +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xed ,0x4c );/* ERR_FG */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl3 (&ctx); +/* FFC Setting 897.6Mbps */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xc5 ,0x0d ,0x10 ,0xb4 ,0x3e ,0x01 ); +s6e3ha8_test_key_off_lvl3 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb9 , +0x00 ,0xb0 ,0x81 ,0x09 ,0x00 ,0x00 ,0x00 , +0x11 ,0x03 );/* TSP HSYNC Setting */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x03 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf6 ,0x43 ); +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +/* Brightness condition set */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xca , +0x07 ,0x00 ,0x00 ,0x00 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x00 ,0x00 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb1 ,0x00 ,0x0c );/* AID Set : 0% */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5,
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 144
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+0x19 ,0xdc ,0x16 ,0x01 ,0x34 ,0x67 ,0x9a , +0xcd ,0x01 ,0x22 ,0x33 ,0x44 ,0x00 ,0x00 , +0x05 ,0x55 ,0xcc ,0x0c ,0x01 ,0x11 ,0x11 , + 0x10); /* MPS/ELVSS Setting */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf4 ,0xeb ,0x28 );/* VINT */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf7 ,0x03 );/* Gamma, LTPS(AID) update */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_off_lvl1 (&ctx); + +return 0 ;
return ctx.accum_err;
Quoted 39 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +39
-0+} + +static int s6e3ha8_enable (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; + +s6e3ha8_test_key_on_lvl1 (&ctx); + ctx.accum_err =mipi_dsi_dcs_set_display_on (dsi); +s6e3ha8_test_key_off_lvl1 (&ctx); + +return ctx.accum_err; +} + +static int s6e3ha8_disable (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; + +s6e3ha8_test_key_on_lvl1 (&ctx); + ctx.accum_err =mipi_dsi_dcs_set_display_off (dsi); +s6e3ha8_test_key_off_lvl1 (&ctx); +msleep (20 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +s6e3ha8_afc_off (&ctx); +s6e3ha8_test_key_off_lvl2 (&ctx); + +msleep (160 ); + +return 0 ; +} + +static int s6e3ha8_amb577px01_wqhd_prepare (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi;
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 193
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+struct device *dev = &dsi->dev; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; +struct drm_dsc_picture_parameter_set pps; +int ret; + + ret =regulator_bulk_enable (ARRAY_SIZE (priv->supplies), priv->supplies); +if (ret <0 ) +return ret; +msleep (120 ); +s6e3ha8_amb577px01_wqhd_reset (priv);
empty line
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 195
Quoted 2 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +2
-0+ ret =s6e3ha8_amb577px01_wqhd_on (priv); +
no empty line
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 197
Quoted 2 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +2
-0+if (ret <0 ) { +dev_err (dev,"Failed to initialize panel: %d\n" , ret);
_multi functions will say that for you already.
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 205
Quoted 8 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +8
-0+gpiod_set_value_cansleep (priv->reset_gpio,1 ); + goto err; + } + +drm_dsc_pps_payload_pack (&pps, &priv->dsc); + +s6e3ha8_test_key_on_lvl1 (&ctx); + ret =mipi_dsi_picture_parameter_set (priv->dsi, &pps);
Probably we should add _multi version here, could you please add it? Otherwise you might have missed the fact that previous function has failed.
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 212
Quoted 7 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +7
-0+if (ret <0 ) { +dev_err (panel->dev,"failed to transmit PPS: %d\n" , ret); +return ret; + } +s6e3ha8_test_key_off_lvl1 (&ctx); + +msleep (28 );
mipi_dsi_msleep
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 214
Quoted 2 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +2
-0+ +return 0 ;
handle ctx.accum_err please.
Quoted 140 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +136
-0+err: +regulator_bulk_disable (ARRAY_SIZE (priv->supplies), priv->supplies); +return ret; +} + +static int s6e3ha8_amb577px01_wqhd_unprepare (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); + +return regulator_bulk_disable (ARRAY_SIZE (priv->supplies), priv->supplies); +} + +static const struct drm_display_mode s6e3ha8_amb577px01_wqhd_mode = { + .clock = (1440 +116 +44 +120 ) * (2960 +120 +80 +124 ) *60 /1000 , + .hdisplay =1440 , + .hsync_start =1440 +116 , + .hsync_end =1440 +116 +44 , + .htotal =1440 +116 +44 +120 , + .vdisplay =2960 , + .vsync_start =2960 +120 , + .vsync_end =2960 +120 +80 , + .vtotal =2960 +120 +80 +124 , + .width_mm =64 , + .height_mm =132 , +}; + +static int s6e3ha8_amb577px01_wqhd_get_modes (struct drm_panel *panel, +struct drm_connector *connector) +{ +return drm_connector_helper_get_modes_fixed (connector, &s6e3ha8_amb577px01_wqhd_mode); +} + +static const struct drm_panel_funcs s6e3ha8_amb577px01_wqhd_panel_funcs = { + .prepare = s6e3ha8_amb577px01_wqhd_prepare, + .unprepare = s6e3ha8_amb577px01_wqhd_unprepare, + .get_modes = s6e3ha8_amb577px01_wqhd_get_modes, + .enable = s6e3ha8_enable, + .disable = s6e3ha8_disable, +}; + +static int s6e3ha8_amb577px01_wqhd_probe (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +struct s6e3ha8 *priv; +int ret; + + priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + + priv->supplies[0 ].supply ="vdd3" ; + priv->supplies[1 ].supply ="vci" ; + priv->supplies[2 ].supply ="vddr" ; + + ret =devm_regulator_bulk_get (dev,ARRAY_SIZE (priv->supplies), + priv->supplies); +if (ret <0 ) { +dev_err (dev,"failed to get regulators: %d\n" , ret); +return ret; + } + + priv->reset_gpio =devm_gpiod_get (dev,"reset" ,GPIOD_OUT_HIGH ); +if (IS_ERR (priv->reset_gpio)) +return dev_err_probe (dev,PTR_ERR (priv->reset_gpio), +"Failed to get reset-gpios\n" ); + + priv->dsi = dsi; +mipi_dsi_set_drvdata (dsi, priv); + + dsi->lanes =4 ; + dsi->format =MIPI_DSI_FMT_RGB888 ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VIDEO_NO_HFP |MIPI_DSI_MODE_VIDEO_NO_HBP | +MIPI_DSI_MODE_VIDEO_NO_HSA |MIPI_DSI_MODE_NO_EOT_PACKET ; + +drm_panel_init (&priv->panel, dev, &s6e3ha8_amb577px01_wqhd_panel_funcs, +DRM_MODE_CONNECTOR_DSI ); + priv->panel.prepare_prev_first = true; + +drm_panel_add (&priv->panel); + +/* This panel only supports DSC; unconditionally enable it */ + dsi->dsc = &priv->dsc; + + priv->dsc.dsc_version_major =1 ; + priv->dsc.dsc_version_minor =1 ; + + priv->dsc.slice_height =40 ; + priv->dsc.slice_width =720 ; +WARN_ON (1440 % priv->dsc.slice_width); + priv->dsc.slice_count =1440 / priv->dsc.slice_width; + priv->dsc.bits_per_component =8 ; + priv->dsc.bits_per_pixel =8 <<4 ;/* 4 fractional bits */ + priv->dsc.block_pred_enable = true; + + ret =mipi_dsi_attach (dsi); +if (ret <0 ) { +dev_err (dev,"Failed to attach to DSI host: %d\n" , ret); +drm_panel_remove (&priv->panel); +return ret; + } + +return 0 ; +} + +static void s6e3ha8_amb577px01_wqhd_remove (struct mipi_dsi_device *dsi) +{ +struct s6e3ha8 *priv =mipi_dsi_get_drvdata (dsi); +int ret; + + ret =mipi_dsi_detach (dsi); +if (ret <0 ) +dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); + +drm_panel_remove (&priv->panel); +} + +static const struct of_device_id s6e3ha8_amb577px01_wqhd_of_match[] = { + { .compatible ="samsung,s6e3ha8" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, s6e3ha8_amb577px01_wqhd_of_match); + +static struct mipi_dsi_driver s6e3ha8_amb577px01_wqhd_driver = { + .probe = s6e3ha8_amb577px01_wqhd_probe, + .remove = s6e3ha8_amb577px01_wqhd_remove, + .driver = { + .name ="panel-s6e3ha8" , + .of_match_table = s6e3ha8_amb577px01_wqhd_of_match, + }, +}; +module_mipi_dsi_driver (s6e3ha8_amb577px01_wqhd_driver); + +MODULE_AUTHOR ("Dzmitry Sankouski <[email protected]>" ); +MODULE_DESCRIPTION ("DRM driver for S6E3HA8 panel" ); +MODULE_LICENSE ("GPL" );Signature · 2 lines
-- 2.39.2
Signature · 2 lines
With best wishes Dmitry
Krzysztof Kozlowski
maintainerRe: [PATCH v4 15/27] regulator: add s2dos05 regulator support
In reply to Dzmitry SankouskiQuoted 12 lines · Dzmitry Sankouski
Quoted 12 lines
include/linux/regulator/s2dos05.h line 1
Quoted 7 lines
include/linux/regulator/s2dos05.h new file +1
-0@@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ Are you sure that here (and other places) you want any newer GPL? This is quite odd. Does original code (from which you took 2016 copyrights) have this as well?
Quoted 4 lines
Original code permits redistribution under 2+ license [1]. Is 2+ preferable over 2 only?
For new code we usually suggest 2-only, but your work looks like derivative, so keeping 2+ is fine.
Best regards,
Krzysztof