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

Motorola Surnia Backlight Driver #284

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
47 changes: 47 additions & 0 deletions Documentation/devicetree/bindings/leds/rohm,bd65b60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ROHM BD65B60 device tree bindings
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved

BD65B60 is a white LED driver IC that integrates PWM
step-up DC/DC converter with boost-capability of up to
maximum 28.5V and current driver with drive capability of up
to 25mA(Typ.) maximum setting. Precise brightness can be
controlled at wide ranges through the external PWM pulse
input.

Ranges below noted as [a, b] are closed ranges between a and b, i.e. a
and b are included in the range.

Please also see common.txt in the same directory.


Required properties
===================

compatible : Must be "rohm,bd65b60".
reg : The I2C address of the device. Typically 0x64.
linux,name : Sysfs name.

Optional properties
===========================================

linux,default-trigger : Trigger
rohm,no-reset : Don't trigger software reset during initalisation.
rohm,default-on : Set LED to on state by default.
rohm,led1-used : LED1 is being used.
rohm,led2-used : LED2 is being used.
rohm,init-level : Default brightness [0, 255].
rohm,ovp-val : Over Voltage Protection Detect Voltage (can be: 0x0, 0x8 or 0x10)

Example
=======

wled: bd65b60@64 {
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
compatible = "rohm,bd65b60";
reg = <0x64>;
linux,name = "wled:backlight";
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
linux,default-trigger = "bkl-trigger";
rohm,no-reset;
rohm,led1-used;
pinctrl-names = "default";
pinctrl-0 = <&backlight_reset_default>;
};

39 changes: 38 additions & 1 deletion arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@
pinctrl-1 = <&usb_id_sleep>;
pinctrl-names = "default", "sleep";
};

backlight: panel-backlight {
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
compatible = "led-backlight";
leds = <&wled>;
default-brightness-level = <192>;
};
};

&blsp_i2c1 {
status = "okay";

wled: bd65b60@64 {
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
compatible = "rohm,bd65b60";
reg = <0x64>;
linux,name = "wled:backlight";
linux,default-trigger = "bkl-trigger";
rohm,no-reset;
rohm,led1-used;
pinctrl-names = "default";
pinctrl-0 = <&backlight_reset_default>;
};

};

&blsp_i2c2 {
Expand Down Expand Up @@ -124,7 +146,7 @@
panel@0 {
compatible = "motorola,surnia-panel";
reg = <0>;

backlight = <&backlight>;
power-supply = <&pm8916_l17>;
reset-gpios = <&msmgpio 78 GPIO_ACTIVE_LOW>;

Expand Down Expand Up @@ -320,6 +342,14 @@
bias-pull-up;
};

backlight_reset_default: backlight-reset-default-state {
pins = "gpio36";
function = "gpio";
drive-strength = <2>;
bias-pull-down;
output-high;
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
};

gpio_keys_default: gpio-keys-default-state {
pins = "gpio107";
function = "gpio";
Expand All @@ -341,6 +371,13 @@
bias-pull-down;
};

ts_reset_default: ts-reset-default-state {
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved
pins = "gpio20";
function = "gpio";
drive-strength = <2>;
bias-disable;
};

ts_int_default: ts-int-default-state {
pins = "gpio21";
function = "gpio";
Expand Down
11 changes: 11 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,17 @@ config LEDS_BLINKM
This option enables support for the BlinkM RGB LED connected
through I2C. Say Y to enable support for the BlinkM LED.

config LEDS_BD65B60
tristate "LED Driver for BD65B60"
depends on LEDS_CLASS
depends on I2C
help
If you have a LCD backlight connected to the ROHM BD65B60,
say Y here to enable this driver.

To compile this driver as a module, choose M here: the module will
be called leds-bd65b60.

config LEDS_POWERNV
tristate "LED support for PowerNV Platform"
depends on LEDS_CLASS
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds-turris-omnia.o
obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
obj-$(CONFIG_LEDS_BD65B60) += leds-bd65b60.o
BogdanTheGeek marked this conversation as resolved.
Show resolved Hide resolved

# LED SPI Drivers
obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o
Expand Down
Loading