Skip to content

Instantly share code, notes, and snippets.

@devbis
Created August 31, 2021 07:12
Show Gist options
  • Save devbis/366c3b97da1f7c8bb1937f81cca7160d to your computer and use it in GitHub Desktop.
Save devbis/366c3b97da1f7c8bb1937f81cca7160d to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: GPL-2.0
#include "qcom-apq8064-v2.0.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mfd/qcom-rpm.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
/ {
model = "LGE Nexus 4 (mako)";
compatible = "lge,nexus4-mako", "qcom,apq8064";
aliases {
serial0 = &gsbi7_serial;
serial1 = &gsbi6_serial;
serial2 = &gsbi4_serial;
};
chosen {
stdout-path = "serial2:115200n8";
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
ramoops@88d00000{
compatible = "ramoops";
reg = <0x88d00000 0x100000>;
record-size = <0x00020000>;
console-size = <0x00020000>;
ftrace-size = <0x00020000>;
};
};
ext_dsv_load: regulator-gpio@1 {
compatible = "regulator-fixed";
// regulator-min-microvolt = <3300000>;
// regulator-max-microvolt = <3300000>;
regulator-name = "ext_dsv_load";
regulator-type = "voltage";
startup-delay-us = <0>;
gpio = <&tlmm_pinmux 86 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-boot-on;
};
gpio-keys {
compatible = "gpio-keys";
volume_up {
label = "Volume Up";
gpios = <&pm8921_gpio 35 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_VOLUMEUP>;
};
volume_down {
label = "Volume Down";
gpios = <&pm8921_gpio 38 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_VOLUMEDOWN>;
};
};
battery_cell: battery-cell {
compatible = "simple-battery";
constant-charge-current-max-microamp = <900000>;
operating-range-celsius = <0 45>;
};
soc {
pinctrl@800000 {
gsbi4_uart_pin_a: gsbi4-uart-pin-active {
rx {
pins = "gpio11";
function = "gsbi4";
drive-strength = <2>;
bias-disable;
// bias-pull-up;
};
tx {
pins = "gpio10";
function = "gsbi4";
drive-strength = <4>;
bias-disable;
};
};
// panel_pin: panel {
// te {
// pins = "gpio0";
// function = "mdp_vsync";
//
// drive-strength = <2>;
// bias-disable;
// };
// };
// usb_hs1_xcvr_pins: usb_hs1_xcvr_pin-active {
// clk {
// pins = "usb_hs1_xcvr_clk";
// drive-strengh = <16>;
// bias-disable;
// };
//
// cmd {
// pins = "sdc1_cmd";
// drive-strengh = <10>;
// bias-pull-up;
// };
//
// data {
// pins = "sdc1_data";
// drive-strengh = <10>;
// bias-pull-up;
// };
// };
};
rpm@108000 {
regulators {
vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
vin_lvs1_3_6-supply = <&pm8921_s4>;
vin_lvs4_5_7-supply = <&pm8921_s4>;
vdd_l24-supply = <&pm8921_s1>;
vdd_l25-supply = <&pm8921_s1>;
vin_lvs2-supply = <&pm8921_s1>;
vdd_l26-supply = <&pm8921_s7>;
vdd_l27-supply = <&pm8921_s7>;
vdd_l28-supply = <&pm8921_s7>;
vdd_ncp-supply = <&pm8921_l6>;
/* Buck SMPS */
s1 {
regulator-always-on;
regulator-min-microvolt = <1225000>;
regulator-max-microvolt = <1225000>;
qcom,switch-mode-frequency = <3200000>;
bias-pull-down;
};
s2 {
regulator-min-microvolt = <1300000>;
regulator-max-microvolt = <1300000>;
qcom,switch-mode-frequency = <1600000>;
bias-pull-down;
};
/* msm otg HSUSB_VDDCX */
s3 {
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1150000>;
qcom,switch-mode-frequency = <4800000>;
bias-pull-down;
};
/*
* msm_sdcc.1-sdc-vdd_io
* tabla2x-slim-CDC_VDDA_RX
* tabla2x-slim-CDC_VDDA_TX
* tabla2x-slim-CDC_VDD_CP
* tabla2x-slim-VDDIO_CDC
*/
s4 {
regulator-always-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
qcom,switch-mode-frequency = <1600000>;
bias-pull-down;
qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
};
s7 {
regulator-min-microvolt = <1300000>;
regulator-max-microvolt = <1300000>;
qcom,switch-mode-frequency = <3200000>;
};
s8 {
regulator-min-microvolt = <2200000>;
regulator-max-microvolt = <2200000>;
qcom,switch-mode-frequency = <1600000>;
};
/* unknown */
l1 {
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-always-on;
bias-pull-down;
};
/* mipi_dsi.1-dsi1_pll_vdda */
l2 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
bias-pull-down;
};
/* msm_otg-HSUSB_3p3 */
l3 {
regulator-min-microvolt = <3075000>;
regulator-max-microvolt = <3500000>;
bias-pull-down;
};
/* msm_otg-HSUSB_1p8 */
l4 {
regulator-always-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
bias-pull-down;
};
/* msm_sdcc.1-sdc_vdd */
l5 {
regulator-min-microvolt = <2950000>;
regulator-max-microvolt = <2950000>;
regulator-always-on;
};
/* earjack_debug */
l6 {
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
bias-pull-down;
};
/* sdc_vdd_io msm_sdcc.3 */
// l7 {
// regulator-min-microvolt = <1850000>;
// regulator-max-microvolt = <2950000>;
// bias-pull-down;
// };
// REGULATOR_SUPPLY("dsi_vci", "mipi_dsi.1"),
l8 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <3000000>;
bias-pull-down;
};
/* wcnss_wlan.0-iris_vddpa */
l10 {
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <2900000>;
};
/* mipi_dsi.1-dsi1_avdd */
l11 {
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
bias-pull-down;
};
// ????
// l12 {
// regulator-min-microvolt = <1200000>;
// regulator-max-microvolt = <1200000>;
// bias-pull-down;
// };
/* touch_vdd */
l15 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2950000>;
bias-pull-down;
};
/* slimport_dvdd */
/* l18 {
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
bias-pull-down;
};
*/
/* touch_io */
l22 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
bias-pull-down;
};
/*
REGULATOR_SUPPLY("dsi_vddio", "mipi_dsi.1"),
REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"),
REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"),
REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"),
REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"),
*/
l23 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
bias-pull-down;
};
/*
* tabla2x-slim-CDC_VDDA_A_1P2V
* tabla2x-slim-VDDD_CDC_D
*/
l24 {
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1150000>;
bias-pull-down;
};
l25 {
regulator-min-microvolt = <1250000>;
regulator-max-microvolt = <1250000>;
regulator-always-on;
bias-pull-down;
};
l27 {
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
};
l28 {
regulator-min-microvolt = <1050000>;
regulator-max-microvolt = <1050000>;
bias-pull-down;
};
/* REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0") */
lvs1 {
bias-pull-down;
};
lvs2 {
bias-pull-down;
};
lvs3 {
bias-pull-down;
};
lvs4 {
bias-pull-down;
};
lvs5 {
bias-pull-down;
};
/* REGULATOR_SUPPLY("dsi_iovcc", "mipi_dsi.1"), */
lvs6 {
bias-pull-down;
};
/*
REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
REGULATOR_SUPPLY("lvds_vdda", "lvds.0"),
REGULATOR_SUPPLY("dsi1_vddio", "mipi_dsi.1"),
REGULATOR_SUPPLY("hdmi_vdda", "hdmi_msm.0"),
*/
lvs7 {
bias-pull-down;
};
ncp {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
qcom,switch-mode-frequency = <1600000>;
};
};
};
mdp@5100000 {
status = "okay";
ports {
port@1 {
mdp_dsi1_out: endpoint {
remote-endpoint = <&dsi0_in>;
};
};
};
};
dsi0: mdss_dsi@4700000 {
status = "okay";
vdda-supply = <&pm8921_l2>; // dsi_vdda
//vdd-supply = <&pm8921_l8>; // dsi_vci ??
vdd-supply = <&ext_dsv_load>;
// dsi_iovcc is used in board filed
vddio-supply = <&pm8921_lvs6>; // lvs7 is HDMI poser
avdd-supply = <&pm8921_l11>; // mipi_dsi.1-dsi1_avdd
panel@0 {
reg = <0>;
compatible = "lg,lh467wx1-sd01";
vdd-supply = <&pm8921_l2>;
vci-supply = <&pm8921_l8>; //
iovcc-supply = <&pm8921_lvs7>;
backlight = <&backlight>;
// enable-gpios = <&pm8921_gpio 42 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pm8921_gpio 42 GPIO_ACTIVE_LOW>;
dcdc-en-gpios = <&tlmm_pinmux 57 GPIO_ACTIVE_HIGH>;
port {
panel_in: endpoint {
remote-endpoint = <&dsi0_out>;
};
};
};
ports {
port@0 {
dsi0_in: endpoint {
remote-endpoint = <&mdp_dsi1_out>;
};
};
port@1 {
dsi0_out: endpoint {
remote-endpoint = <&panel_in>;
data-lanes = <0 1 2 3>;
};
};
};
};
dsi-phy@4700200 {
status = "okay";
vddio-supply = <&pm8921_lvs6>; /*VDD_PLL2_1 to 7*/
};
// gsbi@16200000 {
// status = "okay";
// qcom,mode = <GSBI_PROT_I2C>;
// i2c@16280000 {
// status = "okay";
// clock-frequency = <200000>;
// pinctrl-0 = <&i2c3_pins>;
// pinctrl-names = "default";
//
// trackpad@10 {
// compatible = "elan,ekth3500";
// reg = <0x10>;
// interrupt-parent = <&tlmm_pinmux>;
// interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
// };
// };
// };
gsbi@12440000 {
status = "okay";
qcom,mode = <GSBI_PROT_I2C>;
gsbi1_i2c: i2c@12460000 {
status = "okay";
clock-frequency = <200000>;
pinctrl-0 = <&i2c1_pins>;
pinctrl-names = "default";
// eeprom@52 {
// compatible = "atmel,24c128";
// reg = <0x52>;
// pagesize = <32>;
// };
//
// bq27541@55 {
// compatible = "ti,bq27541";
// reg = <0x55>;
// };
backlight: lm3530@38 {
compatible = "backlight,lm3530";
status = "okay";
reg = <0x38>;
lm3530,en_gpio = <&pm8921_gpio 24 GPIO_ACTIVE_HIGH>;
lm3530,max_current = /bits/ 8 <0x17>;
lm3530,default_brt = /bits/ 8 <0x10>;
lm3530,max_brt = /bits/ 8 <0x72>;
lm3530,mode = /bits/ 8 <0>; /* Manual Mode */
lm3530,linear_map = /bits/ 8 <1>; /* Linear map */
lm3530,brt_ramp_fall = /bits/ 8 <0>;
lm3530,brt_ramp_rise = /bits/ 8 <0>;
lm3530,no_regulator;
};
tpa2028d@58 {
compatible = "speaker_amp,tpa2028d";
status = "ok";
reg = <0x58>;
tpa2028d,agc_compression_rate = <0>;
tpa2028d,agc_output_limiter_disable = <1>;
tpa2028d,agc_fixed_gain = <11>;
tpa2028d,enable_gpio = <&pm8921_gpio 19 GPIO_ACTIVE_HIGH>;
};
};
};
// gsbi@16300000 {
// status = "ok";
// qcom,mode = <GSBI_PROT_I2C_UART>;
// gsbi4_serial: serial@16340000 {
// status = "ok";
// pinctrl-names = "default";
// pinctrl-0 = <&gsbi4_uart_pin_a>;
// };
// };
// gsbi@16500000 {
// status = "okay";
// qcom,mode = <GSBI_PROT_I2C_UART>;
//
// serial@16540000 {
// status = "okay";
//
// pinctrl-names = "default";
// pinctrl-0 = <&gsbi6_uart_4pins>;
// };
// };
//
// gsbi@16600000 {
// status = "okay";
// qcom,mode = <GSBI_PROT_I2C_UART>;
// serial@16640000 {
// status = "okay";
// };
// };
/* OTG */
usb@12500000 {
status = "okay";
dr_mode = "otg";
ulpi {
phy {
v3p3-supply = <&pm8921_l3>;
v1p8-supply = <&pm8921_l4>;
};
};
};
amba {
/* eMMC */
sdcc@12400000 {
status = "okay";
vmmc-supply = <&pm8921_l5>;
vqmmc-supply = <&pm8921_s4>;
};
};
riva-pil@3204000 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&riva_wlan_pin_a>;
// pinctrl-0 = <&riva_wlan_pin_a>, <&riva_bt_pin_a>, <&riva_fm_pin_a>;
};
// imem@2a03f000 {
// compatible = "syscon", "simple-mfd";
// reg = <0x2a03f000 0x1000>;
//
// reboot-mode {
// compatible = "syscon-reboot-mode";
// offset = <0x65c>;
//
// mode-normal = <0x77665501>;
// mode-bootloader = <0x77665500>;
// mode-recovery = <0x77665502>;
// };
// };
};
};
&gsbi3 {
status = "okay";
};
&gsbi3_i2c {
status = "okay";
};
&gsbi4 {
status = "okay";
qcom,mode = <GSBI_PROT_I2C_UART>;
gsbi4_serial: serial@16340000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x16340000 0x1000>,
<0x16300000 0x1000>;
interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gcc GSBI4_UART_CLK>, <&gcc GSBI4_H_CLK>;
clock-names = "core", "iface";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&gsbi4_uart_pin_a>;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment