From e9f505ca122359b6402f8dae1408311f25e58afa Mon Sep 17 00:00:00 2001 From: Bogdan Ionescu Date: Mon, 6 Mar 2023 20:39:41 +0000 Subject: [PATCH] dts: dt-bindings: motorola-surnia enable backlight Signed-off-by: Bogdan Ionescu --- .../boot/dts/qcom/msm8916-motorola-surnia.dts | 37 ++++++++++++++++++- include/dt-bindings/leds/leds-bd65b60.h | 22 +++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/leds/leds-bd65b60.h diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts index ac51a491b56630..181fbdc9ba67de 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts @@ -8,6 +8,8 @@ #include #include #include +#include +#include / { model = "Motorola Moto E 2015 LTE (surnia)"; @@ -57,6 +59,31 @@ pinctrl-1 = <&usb_id_sleep>; pinctrl-names = "default", "sleep"; }; + + backlight_dsi: backlight-dsi { + compatible = "led-backlight"; + leds = <&backlight_led>; + default-brightness-level = <192>; + }; +}; + +&blsp_i2c1 { + status = "okay"; + + led_controler@64 { + compatible = "rohm,bd65b60"; + reg = <0x64>; + pinctrl-names = "default"; + pinctrl-0 = <&backlight_reset_default>; + + backlight_led: led { + function = LED_FUNCTION_BACKLIGHT; + color = ; + rohm,enable = ; + default-state = "keep"; + linux,default-trigger = "backlight"; + }; + }; }; &blsp_i2c2 { @@ -124,7 +151,7 @@ panel@0 { compatible = "motorola,surnia-panel"; reg = <0>; - + backlight = <&backlight_dsi>; power-supply = <&pm8916_l17>; reset-gpios = <&msmgpio 78 GPIO_ACTIVE_LOW>; @@ -320,6 +347,14 @@ bias-pull-up; }; + backlight_reset_default: backlight-reset-default-state { + pins = "gpio36"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + output-high; + }; + gpio_keys_default: gpio-keys-default-state { pins = "gpio107"; function = "gpio"; diff --git a/include/dt-bindings/leds/leds-bd65b60.h b/include/dt-bindings/leds/leds-bd65b60.h new file mode 100644 index 00000000000000..3f2cf67baec469 --- /dev/null +++ b/include/dt-bindings/leds/leds-bd65b60.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This header provides macros for the ROHM BD65B60 device tre§e bindings. + * + * Copyright (C) 2023 Bogdan Ionescu + */ + +#ifndef _DT_BINDINGS_LEDS_BD65B60_H +#define _DT_BINDINGS_LEDS_BD65B60_H + +#define BIT(X) (1 << (X)) + +#define BD65B60_ENABLE_NONE 0 +#define BD65B60_ENABLE_LED1 BIT(0) +#define BD65B60_ENABLE_LED2 BIT(2) +#define BD65B60_ENABLE_BOTH (BD65B60_ENABLE_LED1 | BD65B60_ENABLE_LED2) + +#define BD65B60_OVP_25V 0 +#define BD65B60_OVP_30V BIT(4) +#define BD65B60_OVP_35V BIT(5) + +#endif /* _DT_BINDINGS_LEDS_BD65B60_H */