Skip to content

Commit

Permalink
lg: x3: Optimus 4X HD and Optimus Vu support
Browse files Browse the repository at this point in the history
Signed-off-by: Svyatoslav Ryhel <[email protected]>
  • Loading branch information
clamor-s committed Oct 18, 2022
1 parent db9826a commit efeab69
Show file tree
Hide file tree
Showing 16 changed files with 1,511 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += \
tegra30-beaver.dtb \
tegra30-cardhu.dtb \
tegra30-colibri.dtb \
tegra30-lge-p880.dtb \
tegra30-lge-p895.dtb \
tegra30-tec-ng.dtb \
tegra114-dalmore.dtb \
tegra124-apalis.dtb \
Expand Down
68 changes: 68 additions & 0 deletions arch/arm/dts/tegra30-lge-p880.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/dts-v1/;

#include "tegra30-lge-x3.dtsi"

/ {
model = "LG Optimus 4X HD";
compatible = "lge,p880", "nvidia,tegra30";

aliases {
mmc1 = &sdmmc3; /* uSD slot */
};

host1x@50000000 {
status = "okay";
dc@54200000 {
status = "okay";
rgb {
status = "okay";

nvidia,panel = <&bridge>;

display-timings {
timing@0 {
/* 1280x720@60Hz */
clock-frequency = <68000000>;
hactive = <720>;
vactive = <1280>;
hfront-porch = <92>;
hback-porch = <62>;
hsync-len = <4>;
vsync-len = <1>;
vfront-porch = <6>;
vback-porch = <3>;
};
};
};
};
};

sdmmc3: sdhci@78000400 {
status = "okay";
bus-width = <4>;

cd-gpios = <&gpio TEGRA_GPIO(W, 5) GPIO_ACTIVE_LOW>;

vmmc-supply = <&vdd_usd>;
vqmmc-supply = <&vdd_1v8_vio>;
};

gpio-keyboard {
key-volume-up {
label = "Volume Up";
gpios = <&gpio TEGRA_GPIO(O, 7) GPIO_ACTIVE_LOW>;
linux,code = <KEY_UP>;
};
};

panel: panel {
compatible = "jdi,dx12d100vm0eaa";

enable-gpios = <&gpio TEGRA_GPIO(Y, 0) GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio TEGRA_GPIO(W, 0) GPIO_ACTIVE_HIGH>;

backlight = <&backlight>;
bridge-spi = <&spi_bus>;
};
};
82 changes: 82 additions & 0 deletions arch/arm/dts/tegra30-lge-p895.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/dts-v1/;

#include "tegra30-lge-x3.dtsi"

/ {
model = "LG Optimus Vu";
compatible = "lge,p895", "nvidia,tegra30";

host1x@50000000 {
status = "okay";
dc@54200000 {
status = "okay";
rgb {
status = "okay";

nvidia,panel = <&bridge>;

display-timings {
timing@0 {
/* 1024x768@60Hz */
clock-frequency = <62000000>;
hactive = <768>;
vactive = <1024>;
hfront-porch = <116>;
hback-porch = <81>;
hsync-len = <5>;
vsync-len = <2>;
vfront-porch = <24>;
vback-porch = <8>;
};
};
};
};
};

gpio-keyboard {
key-volume-up {
label = "Volume Up";
gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_LOW>;
linux,code = <KEY_UP>;
};
};

panel: panel {
compatible = "hitachi,tx13d100vm0eaa";

reset-gpios = <&gpio TEGRA_GPIO(W, 0) GPIO_ACTIVE_HIGH>;

vcc-supply = <&vcc_3v0_lcd>;
iovcc-supply = <&iovcc_1v8_lcd>;

backlight = <&backlight>;
bridge-spi = <&spi_bus>;
};

regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;

vcc_3v0_lcd: regulator@0 {
compatible = "regulator-fixed";
reg = <0>;
regulator-name = "vcc_3v0_lcd";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
gpio = <&gpio TEGRA_GPIO(BB, 0) GPIO_ACTIVE_HIGH>;
enable-active-high;
};

iovcc_1v8_lcd: regulator@1 {
compatible = "regulator-fixed";
reg = <1>;
regulator-name = "iovcc_1v8_lcd";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio TEGRA_GPIO(Y, 0) GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
};
169 changes: 169 additions & 0 deletions arch/arm/dts/tegra30-lge-x3.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include <dt-bindings/input/gpio-keys.h>
#include <dt-bindings/input/linux-event-codes.h>

#include "tegra30.dtsi"

/ {
chosen {
stdout-path = &uartd;
};

aliases {
i2c0 = &pwr_i2c;
i2c1 = &gen2_i2c;

mmc0 = &sdmmc4; /* eMMC */

rtc0 = &pmic;
rtc1 = "/rtc@7000e000";

spi0 = &dsi_spi;

usb0 = &micro_usb;
};

memory {
device_type = "memory";
reg = <0x80000000 0x40000000>;
};

uartd: serial@70006300 {
status = "okay";
};

gen2_i2c: i2c@7000c400 {
status = "okay";
clock-frequency = <400000>;

backlight: lm3533@36 {
compatible = "ti,lm3533";
reg = <0x36>;

enable-gpios = <&gpio TEGRA_GPIO(N, 6) GPIO_ACTIVE_HIGH>;
};

muic@44 {
compatible = "maxim,max14526-muic";
reg = <0x44>;

maxim,ap-usb;

usif-gpios = <&gpio TEGRA_GPIO(Y, 3) GPIO_ACTIVE_HIGH>;
dp2t-gpios = <&gpio TEGRA_GPIO(CC, 2) GPIO_ACTIVE_HIGH>;
};
};

pwr_i2c: i2c@7000d000 {
status = "okay";
clock-frequency = <400000>;

pmic: max77663@1c {
compatible = "maxim,max77663";
reg = <0x1c>;

interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <2>;
interrupt-controller;

#gpio-cells = <2>;
gpio-controller;

system-power-controller;

regulators {
vdd_1v8_vio: sd2 {
regulator-name = "vdd_1v8_gen";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-boot-on;
};

vdd_usd: ldo3 {
regulator-name = "vdd_sdmmc3";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
regulator-boot-on;
};

vcore_emmc: ldo5 {
regulator-name = "vdd_ddr_rx";
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
regulator-always-on;
regulator-boot-on;
};
};
};
};

dsi_spi: spi@7000dc00 {
status = "okay";
spi-max-frequency = <25000000>;

spi_bus: bridge-spi@2 {
compatible = "lge,bridge-spi";
reg = <2>;

spi-cpol;
spi-cpha;

spi-max-frequency = <1000000>;
};
};

sdmmc4: sdhci@78000600 {
status = "okay";
bus-width = <8>;
non-removable;

vmmc-supply = <&vcore_emmc>;
vqmmc-supply = <&vdd_1v8_vio>;
};

micro_usb: usb@7d000000 {
status = "okay";
dr_mode = "otg";
};

clocks {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;

clk32k_in: clock@0 {
compatible = "fixed-clock";
reg = <0>;
#clock-cells = <0>;
clock-frequency = <32768>;
};
};

gpio-keyboard {
compatible = "gpio-kbd";

key-power {
label = "Power";
gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>;
linux,code = <KEY_ENTER>;
};

key-volume-down {
label = "Volume Down";
gpios = <&gpio TEGRA_GPIO(O, 4) GPIO_ACTIVE_LOW>;
linux,code = <KEY_DOWN>;
};
};

bridge: bridge {
compatible = "solomon,ssd2825";

enable-gpios = <&gpio TEGRA_GPIO(B, 1) GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio TEGRA_GPIO(O, 2) GPIO_ACTIVE_HIGH>;

panel = <&panel>;
};
};
5 changes: 5 additions & 0 deletions arch/arm/mach-tegra/tegra30/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ config TARGET_TRANSFORMER_T30
bool "Asus Tegra30 Transformer board"
select BOARD_LATE_INIT

config TARGET_X3_T30
bool "LG X3 Tegra30 board"
select BOARD_LATE_INIT

endchoice

config SYS_SOC
Expand All @@ -39,5 +43,6 @@ source "board/nvidia/beaver/Kconfig"
source "board/nvidia/cardhu/Kconfig"
source "board/toradex/colibri_t30/Kconfig"
source "board/avionic-design/tec-ng/Kconfig"
source "board/lg/x3-t30/Kconfig"

endif
26 changes: 26 additions & 0 deletions board/lg/x3-t30/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
if TARGET_X3_T30

config SYS_BOARD
default "x3-t30"

config SYS_VENDOR
default "lg"

config SYS_CONFIG_NAME
default "x3-t30"

config DEVICE_P880
bool "Enable support for LG Optimus 4X HD"
default n
help
LG Optimus 4X HD derives from x3 board but has slight
differences.

config DEVICE_P895
bool "Enable support for LG Optimus Vu"
default n
help
LG Optimus Vu derives from x3 board but has slight
differences.

endif
6 changes: 6 additions & 0 deletions board/lg/x3-t30/MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
X3 BOARD
M: Svyatoslav Ryhel <[email protected]>
S: Maintained
F: board/lg/x3-t30/
F: include/configs/x3-t30.h
F: configs/x3_t30_defconfig
11 changes: 11 additions & 0 deletions board/lg/x3-t30/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# (C) Copyright 2010-2012
# NVIDIA Corporation <www.nvidia.com>
#
# (C) Copyright 2021
# Svyatoslav Ryhel <[email protected]>

obj-$(CONFIG_SPL_BUILD) += x3-t30-spl.o

obj-y += x3-t30.o x3-late.o
Loading

0 comments on commit efeab69

Please sign in to comment.