diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index d96ac08a606e..2f52093b14ce 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -27,6 +27,11 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ audremap.dtbo \ balena-fin.dtbo \ bmp085_i2c-sensor.dtbo \ + devterm-bt.dtbo \ + devterm-misc.dtbo \ + devterm-panel.dtbo \ + devterm-pmu.dtbo \ + devterm-wifi.dtbo \ chipdip-i2s-master-dac.dtbo \ dht11.dtbo \ dionaudio-loco.dtbo \ diff --git a/arch/arm/boot/dts/overlays/devterm-bt-overlay.dts b/arch/arm/boot/dts/overlays/devterm-bt-overlay.dts new file mode 100755 index 000000000000..4b634fdd3bda --- /dev/null +++ b/arch/arm/boot/dts/overlays/devterm-bt-overlay.dts @@ -0,0 +1,40 @@ +/dts-v1/; +/plugin/; + +/{ + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&uart0>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins &bt_pins>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&gpio>; + __overlay__ { + uart0_pins: uart0_pins { + brcm,pins = <14 15 16 17>; + brcm,function = <4 4 7 7>; + brcm,pull = <0 2 0 2>; + }; + + bt_pins: bt_pins { + brcm,pins = <5 6 7>; + brcm,function = <1 0 1>; + brcm,pull = <0 2 0>; + }; + }; + }; + + fragment@2 { + target-path = "/aliases"; + __overlay__ { + serial1 = "/soc/serial@7e201000"; + serial0 = "/soc/serial@7e215040"; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/devterm-misc-overlay.dts b/arch/arm/boot/dts/overlays/devterm-misc-overlay.dts new file mode 100644 index 000000000000..84413870bf4c --- /dev/null +++ b/arch/arm/boot/dts/overlays/devterm-misc-overlay.dts @@ -0,0 +1,94 @@ +/dts-v1/; +/plugin/; + +/{ + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&pwm>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + assigned-clock-rates = <100000000>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; + + adc101c: adc@54 { + reg = <0x54>; + compatible = "ti,adc101c"; + status = "okay"; + }; + + }; + }; + + fragment@2 { + target = <&spi0>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; + cs-gpios = <&gpio 35 1>; + status = "okay"; + }; + }; + + fragment@3 { + target = <&uart1>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; + }; + }; + + fragment@4 { + target = <&gpio>; + __overlay__ { + + pwm_pins: pwm_pins { + brcm,pins = <12 13>; + brcm,function = <4>; + }; + + i2c1_pins: i2c1 { + brcm,pins = <44 45>; + brcm,function = <6>; + }; + + spi0_pins: spi0_pins { + brcm,pins = <38 39>; + brcm,function = <4>; + }; + + spi0_cs_pins: spi0_cs_pins { + brcm,pins = <35>; + brcm,function = <1>; + }; + + uart1_pins: uart1_pins { + brcm,pins = <32 33>; + brcm,function = <2>; + brcm,pull = <0 2>; + }; + + }; + }; + + fragment@5 { + target-path = "/chosen"; + __overlay__ { + bootargs = "8250.nr_uarts=1"; + }; + }; + +}; diff --git a/arch/arm/boot/dts/overlays/devterm-panel-overlay.dts b/arch/arm/boot/dts/overlays/devterm-panel-overlay.dts new file mode 100644 index 000000000000..7d9ff963f309 --- /dev/null +++ b/arch/arm/boot/dts/overlays/devterm-panel-overlay.dts @@ -0,0 +1,46 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target=<&dsi1>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port { + dsi_out_port: endpoint { + remote-endpoint = <&panel_dsi_port>; + }; + }; + + panel_cwd686: panel@0 { + compatible = "cw,cwd686"; + reg = <0>; + reset-gpio = <&gpio 8 1>; + backlight = <&ocp8178_backlight>; + + port { + panel_dsi_port: endpoint { + remote-endpoint = <&dsi_out_port>; + }; + }; + }; + }; + }; + + fragment@1 { + target-path = "/"; + __overlay__ { + ocp8178_backlight: backlight@0 { + compatible = "ocp8178-backlight"; + backlight-control-gpios = <&gpio 9 0>; + default-brightness = <5>; + }; + }; + }; + +}; diff --git a/arch/arm/boot/dts/overlays/devterm-pmu-overlay.dts b/arch/arm/boot/dts/overlays/devterm-pmu-overlay.dts new file mode 100644 index 000000000000..45f730e0e757 --- /dev/null +++ b/arch/arm/boot/dts/overlays/devterm-pmu-overlay.dts @@ -0,0 +1,124 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&i2c0>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&i2c0_pins>; + pinctrl-names = "default"; + status = "okay"; + + axp22x: pmic@34 { + interrupt-controller; + #interrupt-cells = <1>; + compatible = "x-powers,axp221"; + reg = <0x34>; /* i2c address */ + interrupt-parent = <&gpio>; + interrupts = <2 8>; /* IRQ_TYPE_EDGE_FALLING */ + irq-gpios = <&gpio 2 0>; + + regulators { + + x-powers,dcdc-freq = <3000>; + + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "audio-vdd"; + }; + + reg_aldo2: aldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "display-vcc"; + }; + + reg_aldo3: aldo3 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "wifi-vdd"; + }; + + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "wifi-vcc1"; + }; + + reg_dldo2: dldo2 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "dldo2"; + }; + + reg_dldo3: dldo3 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "dldo3"; + }; + + reg_dldo4: dldo4 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "dldo4"; + }; + + reg_eldo1: eldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "wifi-vcc2"; + }; + + reg_eldo2: eldo2 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "wifi-vcc3"; + }; + + reg_eldo3: eldo3 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "wifi-vcc4"; + }; + + }; + + battery_power_supply: battery-power-supply { + compatible = "x-powers,axp221-battery-power-supply"; + monitored-battery = <&battery>; + }; + + usb_power_supply: usb_power_supply { + compatible = "x-powers,axp221-usb-power-supply"; + }; + + }; + }; + }; + + fragment@1 { + target-path = "/"; + __overlay__ { + battery: battery@0 { + compatible = "simple-battery"; + constant_charge_current_max_microamp = <2100000>; + voltage-min-design-microvolt = <3300000>; + }; + }; + }; + +}; diff --git a/arch/arm/boot/dts/overlays/devterm-wifi-overlay.dts b/arch/arm/boot/dts/overlays/devterm-wifi-overlay.dts new file mode 100644 index 000000000000..d5da786dc445 --- /dev/null +++ b/arch/arm/boot/dts/overlays/devterm-wifi-overlay.dts @@ -0,0 +1,41 @@ +/dts-v1/; +/plugin/; + +/* Enable SDIO from MMC interface via various GPIO groups */ + +/{ + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&mmc>; + sdio_ovl: __overlay__ { + pinctrl-0 = <&sdio_ovl_pins>; + pinctrl-names = "default"; + non-removable; + bus-width = <4>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_ovl_pins: sdio_ovl_pins { + brcm,pins = <22 23 24 25 26 27>; + brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2 2 2>; + }; + }; + }; + + fragment@2 { + target-path = "/"; + __overlay__ { + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpio 3 0>; + }; + }; + }; + +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts index c5f687e8bcb9..d01d5e5d7810 100644 --- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts +++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts @@ -141,12 +141,20 @@ }; }; + fragment@18 { + target-path = "/chosen"; + __dormant__ { + bootargs = "cma=384M"; + }; + }; + __overrides__ { - cma-256 = <0>,"+0-1-2-3-4"; - cma-192 = <0>,"-0+1-2-3-4"; - cma-128 = <0>,"-0-1+2-3-4"; - cma-96 = <0>,"-0-1-2+3-4"; - cma-64 = <0>,"-0-1-2-3+4"; + cma-256 = <0>,"+0-1-2-3-4-18"; + cma-192 = <0>,"-0+1-2-3-4-18"; + cma-128 = <0>,"-0-1+2-3-4-18"; + cma-96 = <0>,"-0-1-2+3-4-18"; + cma-64 = <0>,"-0-1-2-3+4-18"; + cma-384 = <0>,"-0-1-2-3-4+18"; audio = <0>,"!17"; }; }; diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index 4fd6bcc8b2bb..b9fbb84c8811 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -676,7 +676,7 @@ CONFIG_I2C_MUX=m CONFIG_I2C_MUX_GPMUX=m CONFIG_I2C_MUX_PCA954x=m CONFIG_I2C_BCM2708=m -CONFIG_I2C_BCM2835=m +CONFIG_I2C_BCM2835=y CONFIG_I2C_GPIO=m CONFIG_I2C_ROBOTFUZZ_OSIF=m CONFIG_I2C_TINY_USB=m @@ -1468,3 +1468,15 @@ CONFIG_FUNCTION_PROFILER=y CONFIG_KGDB=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y + +CONFIG_AXP20X_ADC=m +CONFIG_AXP20X_POWER=m +CONFIG_BATTERY_AXP20X=m +CONFIG_CHARGER_AXP20X=m +CONFIG_INPUT_AXP20X_PEK=y +CONFIG_MFD_AXP20X=y +CONFIG_MFD_AXP20X_I2C=y +CONFIG_REGULATOR_AXP20X=y +CONFIG_BACKLIGHT_OCP8178=y +CONFIG_DRM_PANEL_CWD686=m +CONFIG_TI_ADC081C=m diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6020c30a33b3..1a0f8d87c7db 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -186,4 +186,17 @@ config DRM_PANEL_SITRONIX_ST7789V Say Y here if you want to enable support for the Sitronix ST7789V controller for 240x320 LCD panels + +config DRM_PANEL_CWD686 + tristate "CWD686 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for CWD686 panel. + The panel has a 480x1280 resolution and uses 24 bit RGB per pixel. + + To compile this driver as a module, choose M here: the module + will be called panel-cwd686. + endmenu diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 5ccaaa9d13af..52859d54b0f9 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o +obj-$(CONFIG_DRM_PANEL_CWD686) += panel-cwd686.o diff --git a/drivers/gpu/drm/panel/panel-cwd686.c b/drivers/gpu/drm/panel/panel-cwd686.c new file mode 100644 index 000000000000..6b6969f29f62 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-cwd686.c @@ -0,0 +1,295 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include + +#include