Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64: dts: qcom: msm8916-longcheer-l8910 + msm8939-longcheer-l9100: Add rear flash #343

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions Documentation/devicetree/bindings/leds/silergy,sy7802.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/silergy,sy7802.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Silergy SY7802 1800mA Boost Charge Pump LED Driver

maintainers:
- André Apitzsch <git@apitzsch.eu>

description: |
The SY7802 is a current-regulated charge pump which can regulate two current
levels for Flash and Torch modes.

The SY7802 is a high-current synchronous boost converter with 2-channel
high side current sources. Each channel is able to deliver 900mA current.

properties:
compatible:
enum:
- silergy,sy7802

reg:
maxItems: 1

enable-gpios:
maxItems: 1
description: A connection to the 'EN' pin.

flash-gpios:
maxItems: 1
description: A connection to the 'FLEN' pin.

vin-supply:
description: Regulator providing power to the 'VIN' pin.

"#address-cells":
const: 1

"#size-cells":
const: 0

patternProperties:
"^led@[0-1]$":
type: object
$ref: common.yaml#
unevaluatedProperties: false

properties:
reg:
description: Index of the LED.
minimum: 0
maximum: 1

led-sources:
minItems: 1
maxItems: 2
items:
minimum: 0
maximum: 1

required:
- reg
- led-sources

required:
- compatible
- reg
- "#address-cells"
- "#size-cells"
- enable-gpios

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>

i2c {
#address-cells = <1>;
#size-cells = <0>;

flash-led-controller@53 {
compatible = "silergy,sy7802";
reg = <0x53>;
#address-cells = <1>;
#size-cells = <0>;

enable-gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;

led@0 {
reg = <0>;
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_WHITE>;
led-sources = <0>, <1>;
};
};
};
26 changes: 26 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@
};
};
};

flash-led-controller@53 {
compatible = "silergy,sy7802";
reg = <0x53>;
#address-cells = <1>;
#size-cells = <0>;

enable-gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;

pinctrl-0 = <&camera_rear_flash_default>;
pinctrl-names = "default";

led@0 {
reg = <0>;
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_WHITE>;
led-sources = <0>, <1>;
};
};
};

&blsp_i2c3 {
Expand Down Expand Up @@ -420,6 +439,13 @@
bias-disable;
};

camera_rear_flash_default: camera-rear-flash-default-state {
pins = "gpio9", "gpio16", "gpio117";
function = "gpio";
drive-strength = <2>;
bias-disable;
};

gpio_keys_default: gpio-keys-default-state {
pins = "gpio107";
function = "gpio";
Expand Down
26 changes: 26 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,25 @@
};
};
};

flash-led-controller@53 {
compatible = "silergy,sy7802";
reg = <0x53>;
#address-cells = <1>;
#size-cells = <0>;

enable-gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;

pinctrl-0 = <&camera_rear_flash_default>;
pinctrl-names = "default";

led@0 {
reg = <0>;
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_WHITE>;
led-sources = <0>, <1>;
};
};
};

&blsp_i2c3 {
Expand Down Expand Up @@ -420,6 +439,13 @@
bias-disable;
};

camera_rear_flash_default: camera-rear-flash-default-state {
pins = "gpio9", "gpio16", "gpio51";
function = "gpio";
drive-strength = <2>;
bias-disable;
};

gpio_hall_sensor_default: gpio-hall-sensor-default-state {
pins = "gpio20";
function = "gpio";
Expand Down
11 changes: 11 additions & 0 deletions drivers/leds/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ config LEDS_SGM3140
This option enables support for the SGM3140 500mA Buck/Boost Charge
Pump LED Driver.

config LEDS_SY7802
tristate "LED support for the Silergy SY7802"
depends on I2C && OF
depends on GPIOLIB
select REGMAP_I2C
help
This option enables support for the SY7802 flash LED controller.
SY7802 includes torch and flash functions with programmable current.

This driver can be built as a module, it will be called "leds-sy7802".

endif # LEDS_CLASS_FLASH
1 change: 1 addition & 0 deletions drivers/leds/flash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ obj-$(CONFIG_LEDS_QCOM_FLASH) += leds-qcom-flash.o
obj-$(CONFIG_LEDS_RT4505) += leds-rt4505.o
obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
obj-$(CONFIG_LEDS_SGM3140) += leds-sgm3140.o
obj-$(CONFIG_LEDS_SY7802) += leds-sy7802.o
Loading