2023-01-06 11:55:29

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 0/3] General Purpose clocks and matisse-wifi backlight

This series adds support for general purpose clocks found on MSM8226
and enables ti,lp8556 backlight on matisse-wifi which uses general
purpose clocks with clk-pwm.

Luca Weiss (1):
pinctrl: qcom: msm8226: Add General Purpose clocks

Matti Lehtimäki (2):
dt-bindings: pinctrl: msm8226: Add General Purpose clocks
ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add display backlight

.../pinctrl/qcom,msm8226-pinctrl.yaml | 4 +-
.../dts/qcom-apq8026-samsung-matisse-wifi.dts | 59 +++++++++++++++++++
drivers/pinctrl/qcom/pinctrl-msm8226.c | 11 +++-
3 files changed, 70 insertions(+), 4 deletions(-)

--
2.34.1


2023-01-06 11:55:35

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 2/3] pinctrl: qcom: msm8226: Add General Purpose clocks

From: Luca Weiss <[email protected]>

Add support for the general purpose clocks that are found on MSM8226.

Signed-off-by: Luca Weiss <[email protected]>
Co-developed-by: Matti Lehtimäki <[email protected]>
Signed-off-by: Matti Lehtimäki <[email protected]>
---
drivers/pinctrl/qcom/pinctrl-msm8226.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm8226.c b/drivers/pinctrl/qcom/pinctrl-msm8226.c
index fca0645e8008..0f05725e0a21 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm8226.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm8226.c
@@ -362,6 +362,8 @@ enum msm8226_functions {
MSM_MUX_cam_mclk0,
MSM_MUX_cam_mclk1,
MSM_MUX_cci_i2c0,
+ MSM_MUX_gp0_clk,
+ MSM_MUX_gp1_clk,
MSM_MUX_gpio,
MSM_MUX_sdc3,
MSM_MUX_wlan,
@@ -447,6 +449,9 @@ static const char * const cci_i2c0_groups[] = { "gpio29", "gpio30" };
static const char * const cam_mclk0_groups[] = { "gpio26" };
static const char * const cam_mclk1_groups[] = { "gpio27" };

+static const char * const gp0_clk_groups[] = { "gpio33" };
+static const char * const gp1_clk_groups[] = { "gpio34" };
+
static const char * const sdc3_groups[] = {
"gpio39", "gpio40", "gpio41", "gpio42", "gpio43", "gpio44"
};
@@ -480,6 +485,8 @@ static const struct msm_function msm8226_functions[] = {
FUNCTION(cam_mclk0),
FUNCTION(cam_mclk1),
FUNCTION(cci_i2c0),
+ FUNCTION(gp0_clk),
+ FUNCTION(gp1_clk),
FUNCTION(gpio),
FUNCTION(sdc3),
FUNCTION(wlan),
@@ -519,8 +526,8 @@ static const struct msm_pingroup msm8226_groups[] = {
PINGROUP(30, cci_i2c0, NA, NA, NA, NA, NA, NA),
PINGROUP(31, NA, NA, NA, NA, NA, NA, NA),
PINGROUP(32, NA, NA, NA, NA, NA, NA, NA),
- PINGROUP(33, NA, NA, NA, NA, NA, NA, NA),
- PINGROUP(34, NA, NA, NA, NA, NA, NA, NA),
+ PINGROUP(33, NA, NA, gp0_clk, NA, NA, NA, NA),
+ PINGROUP(34, NA, NA, gp1_clk, NA, NA, NA, NA),
PINGROUP(35, NA, NA, NA, NA, NA, NA, NA),
PINGROUP(36, NA, NA, NA, NA, NA, NA, NA),
PINGROUP(37, NA, NA, NA, NA, NA, NA, NA),
--
2.34.1

2023-01-06 11:56:22

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add display backlight

Uses ti,lp8556 backlight with clk-pwm.

Signed-off-by: Matti Lehtimäki <[email protected]>
---
.../dts/qcom-apq8026-samsung-matisse-wifi.dts | 59 +++++++++++++++++++
1 file changed, 59 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
index 15b9590ba07b..848cfda64e5a 100644
--- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
+++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
@@ -23,6 +23,14 @@ aliases {
display0 = &framebuffer0;
};

+ backlight_pwm: pwm {
+ compatible = "clk-pwm";
+ #pwm-cells = <2>;
+ clocks = <&mmcc CAMSS_GP0_CLK>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&backlight_pwm_default_state>;
+ };
+
chosen {
#address-cells = <1>;
#size-cells = <1>;
@@ -80,6 +88,45 @@ key-volume-up {
};
};

+ i2c-backlight {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 20 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&backlight_i2c_default_state>;
+
+ i2c-gpio,delay-us = <4>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ backlight@2c {
+ compatible = "ti,lp8556";
+ reg = <0x2c>;
+
+ dev-ctrl = /bits/ 8 <0x80>;
+ init-brt = /bits/ 8 <0x3f>;
+ pwm-period = <100000>;
+
+ pwms = <&backlight_pwm 0 100000>;
+ pwm-names = "lp8556";
+
+ rom-a0h {
+ rom-addr = /bits/ 8 <0xa0>;
+ rom-val = /bits/ 8 <0x44>;
+ };
+ rom-a1h {
+ rom-addr = /bits/ 8 <0xa1>;
+ rom-val = /bits/ 8 <0x6c>;
+ };
+ rom-a5h {
+ rom-addr = /bits/ 8 <0xa5>;
+ rom-val = /bits/ 8 <0x24>;
+ };
+ };
+ };
+
reg_tsp_1p8v: regulator-tsp-1p8v {
compatible = "regulator-fixed";
regulator-name = "tsp_1p8v";
@@ -418,6 +465,18 @@ accel_int_default_state: accel-int-default-state {
bias-disable;
};

+ backlight_i2c_default_state: backlight-i2c-default-state {
+ pins = "gpio20", "gpio21";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ backlight_pwm_default_state: backlight-pwm-default-state {
+ pins = "gpio33";
+ function = "gp0_clk";
+ };
+
muic_int_default_state: muic-int-default-state {
pins = "gpio67";
function = "gpio";
--
2.34.1

2023-01-07 10:54:22

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 3/3] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add display backlight



On 6.01.2023 12:44, Matti Lehtimäki wrote:
> Uses ti,lp8556 backlight with clk-pwm.
>
> Signed-off-by: Matti Lehtimäki <[email protected]>
> ---
> .../dts/qcom-apq8026-samsung-matisse-wifi.dts | 59 +++++++++++++++++++
> 1 file changed, 59 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> index 15b9590ba07b..848cfda64e5a 100644
> --- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> +++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> @@ -23,6 +23,14 @@ aliases {
> display0 = &framebuffer0;
> };
>
> + backlight_pwm: pwm {
This should be sorted alphabetically.


> + compatible = "clk-pwm";
> + #pwm-cells = <2>;
> + clocks = <&mmcc CAMSS_GP0_CLK>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&backlight_pwm_default_state>;
> + };
> +
> chosen {
> #address-cells = <1>;
> #size-cells = <1>;
> @@ -80,6 +88,45 @@ key-volume-up {
> };
> };
>
> + i2c-backlight {
> + compatible = "i2c-gpio";
> + sda-gpios = <&tlmm 20 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> + scl-gpios = <&tlmm 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&backlight_i2c_default_state>;
Please reorder these two properties.

> +
> + i2c-gpio,delay-us = <4>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + backlight@2c {
> + compatible = "ti,lp8556";
> + reg = <0x2c>;
> +
> + dev-ctrl = /bits/ 8 <0x80>;
> + init-brt = /bits/ 8 <0x3f>;
> + pwm-period = <100000>;
> +
> + pwms = <&backlight_pwm 0 100000>;
> + pwm-names = "lp8556";
> +
> + rom-a0h {
> + rom-addr = /bits/ 8 <0xa0>;
> + rom-val = /bits/ 8 <0x44>;
> + };
Please add a newline between each subnode.

Otherwise I think this looks good..

Konrad

> + rom-a1h {
> + rom-addr = /bits/ 8 <0xa1>;
> + rom-val = /bits/ 8 <0x6c>;
> + };
> + rom-a5h {
> + rom-addr = /bits/ 8 <0xa5>;
> + rom-val = /bits/ 8 <0x24>;
> + };
> + };
> + };
> +
> reg_tsp_1p8v: regulator-tsp-1p8v {
> compatible = "regulator-fixed";
> regulator-name = "tsp_1p8v";
> @@ -418,6 +465,18 @@ accel_int_default_state: accel-int-default-state {
> bias-disable;
> };
>
> + backlight_i2c_default_state: backlight-i2c-default-state {
> + pins = "gpio20", "gpio21";
> + function = "gpio";
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> + backlight_pwm_default_state: backlight-pwm-default-state {
> + pins = "gpio33";
> + function = "gp0_clk";
> + };
> +
> muic_int_default_state: muic-int-default-state {
> pins = "gpio67";
> function = "gpio";

2023-01-10 08:36:57

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 2/3] pinctrl: qcom: msm8226: Add General Purpose clocks

On Fri, Jan 6, 2023 at 12:44 PM Matti Lehtimäki
<[email protected]> wrote:

> From: Luca Weiss <[email protected]>
>
> Add support for the general purpose clocks that are found on MSM8226.
>
> Signed-off-by: Luca Weiss <[email protected]>
> Co-developed-by: Matti Lehtimäki <[email protected]>
> Signed-off-by: Matti Lehtimäki <[email protected]>

Patch applied!

Please funnel patch 3/3 thru the SoC tree.

Yours,
Linus Walleij