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

L8150: display panel support #19

Merged
merged 9 commits into from
Aug 11, 2019
66 changes: 66 additions & 0 deletions Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Binding for Qualcomm Light Pulse Generator

The Qualcomm Light Pulse Generator consists of three different hardware blocks;
a ramp generator with lookup table, the light pulse generator and a three
channel current sink. These blocks are found in a wide range of Qualcomm PMICs.

Required properties:
- compatible: one of:
"qcom,pm8916-pwm",
"qcom,pm8941-lpg",
"qcom,pm8994-lpg",
"qcom,pmi8994-lpg",
"qcom,pmi8998-lpg",

Optional properties:
- qcom,power-source: power-source used to drive the output, as defined in the
datasheet. Should be specified if the TRILED block is
present
- qcom,dtest: configures the output into an internal test line of the
pmic. Specified by a list of u32 pairs, one pair per channel,
where each pair denotes the test line to drive and the second
configures how the value should be outputed, as defined in the
datasheet
- #pwm-cells: should be 2, see ../pwm/pwm.txt

LED subnodes:
A set of subnodes can be used to specify LEDs connected to the LPG. Channels
not associated with a LED are available as pwm channels, see ../pwm/pwm.txt.

Required properties:
- led-sources: list of channels associated with this LED, starting at 1 for the
first LPG channel

Optional properties:
- label: see Documentation/devicetree/bindings/leds/common.txt
- default-state: see Documentation/devicetree/bindings/leds/common.txt
- linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt

Example:
The following example defines a RGB LED attached to the PM8941.

&spmi_bus {
pm8941@1 {
lpg {
compatible = "qcom,pm8941-lpg";
qcom,power-source = <1>;

rgb {
led-sources = <7 6 5>;
};
};
};
};

The following example defines the single PWM channel of the PM8916, which can
be muxed by the MPP4 as a current sink.

&spmi_bus {
pm8916@1 {
pm8916_pwm: pwm {
compatible = "qcom,pm8916-pwm";

#pwm-cells = <2>;
};
};
};
125 changes: 102 additions & 23 deletions arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/sound/apq8016-lpass.h>
#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>

/ {
model = "Longcheer L8150";
Expand All @@ -24,17 +25,6 @@
#address-cells = <2>;
#size-cells = <2>;
ranges;

framebuffer@83200000 {
compatible = "simple-framebuffer";
reg = <0x0 0x83200000 0x0 (720 * 1280 * 3)>;
width = <720>;
height = <1280>;
stride = <(720 * 3)>;
format = "r8g8b8";

power-domains = <&gcc MDSS_GDSC>;
};
};

reserved-memory {
Expand All @@ -46,11 +36,6 @@
reg = <0x0 0x8b600000 0x0 0x600000>;
no-map;
};

framebuffer@83200000 {
reg = <0x0 0x83200000 0x0 0x300000>;
no-map;
};
};

soc {
Expand Down Expand Up @@ -143,16 +128,23 @@
};
};

wcnss@a21b000 {
status = "okay";
};

mdss@1a00000 {
status = "disabled";
dsi@1a98000 {
#address-cells = <1>;
#size-cells = <0>;

dsi@1a98000 { status = "disabled"; };
dsi-phy@1a98300 { status = "disabled"; };
mdp@1a01000 { status = "disabled"; };
};
vdda-supply = <&pm8916_l2>;
vddio-supply = <&pm8916_l6>;
};

wcnss@a21b000 {
status = "okay";
dsi-phy@1a98300 {
vddio-supply = <&pm8916_l6>;
qcom,dsi-phy-regulator-ldo-mode;
};
};

/*
Expand All @@ -179,6 +171,15 @@
etm@85f000 { status = "disabled"; };
};

backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 100000>;

brightness-levels = <0 255>;
num-interpolated-steps = <255>;
default-brightness-level = <255>;
};

// FIXME: Use extcon device provided by charger driver when available
usb_vbus: usb-vbus {
compatible = "linux,extcon-usb-gpio";
Expand Down Expand Up @@ -271,6 +272,42 @@
};
};

&dsi0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pmx_mdss_default>;
pinctrl-1 = <&pmx_mdss_sleep>;

panel@0 {
compatible = "booyi,otm1287";
reg = <0>;

power-supply = <&pm8916_l17>;
backlight = <&backlight>;
reset-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;

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

port@0 {
reg = <0>;
panel_in: endpoint {
remote-endpoint = <&dsi0_out>;
};
};
};
};

ports {
port@1 {
endpoint {
remote-endpoint = <&panel_in>;
data-lanes = <0 1 2 3>;
};
};
};
};

&msmgpio {
ctp_pwr_en_default: ctp_pwr_en_default {
pinmux {
Expand All @@ -296,6 +333,28 @@
};
};

pmx_mdss_default: pmx_mdss_default {
pinmux {
function = "gpio";
pins = "gpio25";
};
pinconf {
drive-strength = <8>;
bias-disable;
};
};

pmx_mdss_sleep: pmx_mdss_sleep {
pinmux {
function = "gpio";
pins = "gpio25";
};
pinconf {
drive-strength = <2>;
bias-pull-down;
};
};

tp_int_default: tp_int_default {
pinmux {
function = "gpio";
Expand All @@ -320,6 +379,18 @@
};
};

&pm8916_mpps {
pwm_out: pm8916_mpp4 {
pinconf {
pins = "mpp4";
function = "digital";
output-low;
power-source = <PM8916_MPP_VPH>;
qcom,dtest = <1>;
};
};
};

&spmi_bus {
pm8916@0 {
pon@800 {
Expand All @@ -338,6 +409,14 @@
qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
};

pwm: pwm {
compatible = "qcom,pm8916-pwm";
#pwm-cells = <2>;

pinctrl-names = "default";
pinctrl-0 = <&pwm_out>;
};
};
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/msm8916_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ CONFIG_DRM=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_SAMSUNG_EA8061V_AMS497EE01=m
CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01=m
CONfIG_DRM_PANEL_BOOYI_OTM1287=m
CONFIG_DRM_LEGACY=y
CONFIG_FB=y
CONFIG_FB_MODE_HELPERS=y
Expand Down
19 changes: 16 additions & 3 deletions drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ static void dsi_28nm_phy_regulator_ctrl(struct msm_dsi_phy *phy, bool enable)
return;
}

if (phy->regulator_ldo_mode) {
DRM_DEV_ERROR(&phy->pdev->dev, "Using regulator_ldo_mode\n");
// From msm8916-qrd.dtsi with msm_mdss_io_8974.c
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_0, 0x0);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CAL_PWR_CFG, 0);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_5, 0x7);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_3, 0);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_2, 0x1);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_1, 0x1);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_4, 0x20);
dsi_phy_write(phy->base + REG_DSI_28nm_PHY_LDO_CNTRL, 0x05);
return;
}

// TODO: These values do not match those in downstream
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_0, 0x0);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CAL_PWR_CFG, 1);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_5, 0);
Expand All @@ -56,6 +71,7 @@ static void dsi_28nm_phy_regulator_ctrl(struct msm_dsi_phy *phy, bool enable)
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_1, 0x9);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_0, 0x7);
dsi_phy_write(base + REG_DSI_28nm_PHY_REGULATOR_CTRL_4, 0x20);
dsi_phy_write(phy->base + REG_DSI_28nm_PHY_LDO_CNTRL, 0x00);
}

static int dsi_28nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id,
Expand All @@ -77,8 +93,6 @@ static int dsi_28nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id,

dsi_28nm_phy_regulator_ctrl(phy, true);

dsi_phy_write(base + REG_DSI_28nm_PHY_LDO_CNTRL, 0x00);

dsi_28nm_dphy_set_timing(phy, timing);

dsi_phy_write(base + REG_DSI_28nm_PHY_CTRL_1, 0x00);
Expand Down Expand Up @@ -159,4 +173,3 @@ const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs = {
.io_start = { 0x1a98500 },
.num_dsi_phy = 1,
};

6 changes: 6 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ config DRM_PANEL_SIMPLE
that it can be automatically turned off when the panel goes into a
low power state.

config DRM_PANEL_BOOYI_OTM1287
tristate "Booyi OTM1287 panel"
depends on OF
select DRM_MIPI_DSI
select VIDEOMODE_HELPERS

config DRM_PANEL_FEIYANG_FY07024DI26A30D
tristate "Feiyang FY07024DI26A30-D MIPI-DSI LCD panel"
depends on OF
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/panel/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
obj-$(CONFIG_DRM_PANEL_BOOYI_OTM1287) += panel-booyi-otm1287.o
obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o
Expand Down
Loading