This commit is contained in:
Miguel Fuertes committed 2025-10-13 11:07:43 +02:00
1 parent 18ca4dcd7d
commit 8af1a015e0
2 files changed
+157 -105

No files matched your search

@@ -2,14 +2,15 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
===================================================================
--- a/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
@@ -0,0 +1,135 @@
@@ -0,0 +1,208 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+#include "msm8916-ufi.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "MF68E 4G LTE Mobile WiFi Router";
@@ -24,16 +25,16 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+
+ ocv-capacity-celsius = <25>;
+ ocv-capacity-table-0 = <4330000 100>, <4265000 95>,
+ <4208000 90>, <4154000 85>, <4102000 80>,
+ <4063000 75>, <4006000 70>, <3972000 65>,
+ <3931000 60>, <3880000 55>, <3841000 50>,
+ <3817000 45>, <3798000 40>, <3783000 35>,
+ <3767000 30>, <3747000 25>, <3729000 20>,
+ <3700000 16>, <3687000 13>, <3683000 11>,
+ <3681000 10>, <3680000 9>, <3678000 8>,
+ <3674000 7>, <3666000 6>, <3641000 5>,
+ <3597000 4>, <3537000 3>, <3457000 2>,
+ <3336000 1>, <3000000 0>;
+ <4208000 90>, <4154000 85>, <4102000 80>,
+ <4063000 75>, <4006000 70>, <3972000 65>,
+ <3931000 60>, <3880000 55>, <3841000 50>,
+ <3817000 45>, <3798000 40>, <3783000 35>,
+ <3767000 30>, <3747000 25>, <3729000 20>,
+ <3700000 16>, <3687000 13>, <3683000 11>,
+ <3681000 10>, <3680000 9>, <3678000 8>,
+ <3674000 7>, <3666000 6>, <3641000 5>,
+ <3597000 4>, <3537000 3>, <3457000 2>,
+ <3336000 1>, <3000000 0>;
+ };
+
+ usb_id: usb-id {
@@ -46,32 +47,85 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pwms = <&pm8916_pwm 0 100000>;
+ brightness-levels = <255 128 64 32 16 8 4 0>;
+ num-interpolated-steps = <255>;
+ default-brightness-level = <1>;
+ brightness-levels = <0 32 64 128 255>;
+ num-interpolated-steps = <32>;
+ default-brightness-level = <128>;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-0 = <&button_default>;
+ pinctrl-names = "default";
+
+ label = "GPIO Buttons";
+
+ button-power {
+ label = "Power";
+ linux,code = <KEY_POWER>;
+ gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+ };
+
+ button-reset {
+ label = "Reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ pinctrl-0 = <&gpio_leds_default>;
+ pinctrl-names = "default";
+
+ led-0 {
+ gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
+ function = LED_FUNCTION_WLAN;
+ color = <LED_COLOR_ID_BLUE>;
+ };
+
+ led-1 {
+ gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+ function = LED_FUNCTION_STATUS;
+ color = <LED_COLOR_ID_GREEN>;
+ };
+ };
+};
+
+&blsp_spi5 {
+ status = "okay";
+
+ panel@0 {
+ compatible = "sitronix,st7735s-128x128";
+ pinctrl-0 = <&spi5_default &spi5_cs_default>;
+ pinctrl-names = "default";
+
+ display@0 {
+ compatible = "sitronix,st7735s";
+ reg = <0>;
+ spi-max-frequency = <32000000>;
+ spi-max-frequency = <16000000>;
+ spi-cpol;
+ spi-cpha;
+
+ reset-gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>;
+ dc-gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
+ backlight = <&backlight>;
+ reset-gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>;
+
+ backlight = <&backlight>;
+
+ vdd-supply = <&pm8916_l17>;
+ vddio-supply = <&pm8916_l6>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&panel_default>;
+ rotation = <0>;
+ width-mm = <23>;
+ height-mm = <23>;
+ };
+};
+
+&pm8916_pwm {
+ pinctrl-0 = <&pwm_out>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&pm8916_l6 {
+ regulator-always-on;
+};
@@ -84,22 +138,6 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+ };
+};
+
+&pm8916_pwm {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm_out>;
+};
+
+&pm8916_mpps {
+ pwm_out: mpp4-state {
+ pins = "mpp4";
+ function = "digital";
+ output-low;
+ qcom,dtest = <1>;
+ power-source = <PM8916_MPP_VPH>;
+ };
+};
+
+&pm8916_bms {
+ status = "okay";
+ monitored-battery = <&bat>;
@@ -122,9 +160,34 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+ extcon = <&usb_id>;
+};
+
+&sdhc_1 {
+ status = "okay";
+};
+
+&tlmm {
+ panel_default: panel-default-state {
+ pins = "gpio25", "gpio30", "gpio97";
+ button_default: button-default-state {
+ pins = "gpio35", "gpio37";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ gpio_leds_default: gpio-leds-default-state {
+ pins = "gpio20", "gpio21";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ spi5_default: spi5-default-state {
+ pins = "gpio16", "gpio17", "gpio19";
+ function = "blsp_spi5";
+ drive-strength = <8>;
+ bias-disable;
+ };
+
+ spi5_cs_default: spi5-cs-default-state {
+ pins = "gpio18";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
@@ -138,3 +201,13 @@ Index: arch/arm64/boot/dts/qcom/msm8916-generic-mf68e.dts
+ bias-pull-up;
+ };
+};
+
+&pm8916_mpps {
+ pwm_out: pwm-out-state {
+ pins = "mpp4";
+ function = "digital";
+ power-source = <PM8916_MPP_VPH>;
+ output-low;
+ qcom,dtest = <1>;
+ };
+};
@@ -29,11 +29,11 @@ Index: drivers/gpu/drm/tiny/Makefile
obj-$(CONFIG_TINYDRM_ST7586) += st7586.o
obj-$(CONFIG_TINYDRM_ST7735R) += st7735r.o
+obj-$(CONFIG_TINYDRM_ST7735S) += st7735s.o
Index: b/drivers/gpu/drm/tiny/st7735s.c
Index: drivers/gpu/drm/tiny/st7735s.c
===================================================================
--- a/drivers/gpu/drm/tiny/st7735s.c
+++ b/drivers/gpu/drm/tiny/st7735s.c
@@ -0,0 +1,247 @@
@@ -0,0 +1,226 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * DRM driver for Sitronix ST7735S / GalaxyCore GC9106 display controller
@@ -76,76 +76,55 @@ Index: b/drivers/gpu/drm/tiny/st7735s.c
+};
+
+static void st7735s_pipe_enable(struct drm_simple_display_pipe *pipe,
+ struct drm_crtc_state *crtc_state,
+ struct drm_plane_state *plane_state)
+ struct drm_crtc_state *crtc_state,
+ struct drm_plane_state *plane_state)
+{
+ struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
+ struct mipi_dbi *dbi = &dbidev->dbi;
+ int ret, idx;
+ struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
+ struct mipi_dbi *dbi = &dbidev->dbi;
+ int ret, idx;
+
+ if (!drm_dev_enter(pipe->crtc.dev, &idx))
+ return;
+ if (!drm_dev_enter(pipe->crtc.dev, &idx))
+ return;
+
+ DRM_DEBUG_KMS("\n");
+ DRM_DEBUG_KMS("\n");
+
+ ret = mipi_dbi_poweron_reset(dbidev);
+ if (ret)
+ goto out_exit;
+ ret = mipi_dbi_poweron_reset(dbidev);
+ if (ret)
+ goto out_exit;
+
+ /* GC9106 Inter Register Enable sequence */
+ mipi_dbi_command(dbi, 0xfe);
+ mipi_dbi_command(dbi, 0xfe);
+ mipi_dbi_command(dbi, 0xfe);
+ mipi_dbi_command(dbi, 0xef);
+ msleep(120);
+
+ /* GC9106 Configuration */
+ mipi_dbi_command(dbi, 0xb3, 0x03); /* Frame rate control */
+ mipi_dbi_command(dbi, 0x36, 0x00); /* Memory access control: normal */
+ mipi_dbi_command(dbi, 0x3a, 0x05); /* Pixel format: 16-bit */
+ mipi_dbi_command(dbi, 0xb6, 0x11); /* Display function control */
+ mipi_dbi_command(dbi, 0xac, 0x0b); /* Internal setting */
+ mipi_dbi_command(dbi, 0xb4, 0x21); /* Display inversion control */
+ mipi_dbi_command(dbi, 0xb1, 0xc0); /* Frame rate normal mode */
+ mipi_dbi_command(dbi, 0xe6, 0x50, 0x43); /* Internal register */
+ mipi_dbi_command(dbi, 0xe7, 0x56, 0x43); /* Internal register */
+ mipi_dbi_command(dbi, 0xB1, 0x05, 0x3C, 0x3C);
+ mipi_dbi_command(dbi, 0xB2, 0x05, 0x3C, 0x3C);
+ mipi_dbi_command(dbi, 0xB3, 0x05, 0x3C, 0x3C, 0x05, 0x3C, 0x3C);
+ mipi_dbi_command(dbi, 0xB4, 0x03);
+ mipi_dbi_command(dbi, 0xC0, 0x0E, 0x0E, 0x04);
+ mipi_dbi_command(dbi, 0xC1, 0xC0);
+ mipi_dbi_command(dbi, 0xC2, 0x0D, 0x00);
+ mipi_dbi_command(dbi, 0xC3, 0x8D, 0x2A);
+ mipi_dbi_command(dbi, 0xC4, 0x8D, 0xEE);
+ mipi_dbi_command(dbi, 0xC5, 0x0C);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_ADDRESS_MODE, 0xD8);
+ mipi_dbi_command(dbi, 0xE0, 0x0C, 0x1C, 0x0F, 0x18, 0x36, 0x2F, 0x27, 0x2A,
+ 0x27, 0x25, 0x2D, 0x3C, 0x00, 0x05, 0x03, 0x10);
+ mipi_dbi_command(dbi, 0xE1, 0x0C, 0x1A, 0x09, 0x09, 0x26, 0x22, 0x1E, 0x25,
+ 0x25, 0x25, 0x2E, 0x3B, 0x00, 0x05, 0x03, 0x10);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_PIXEL_FORMAT, MIPI_DCS_PIXEL_FMT_16BIT);
+ mipi_dbi_command(dbi, MIPI_DCS_EXIT_SLEEP_MODE);
+ msleep(120);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON);
+ msleep(20);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, 0x00, 0x00, 0x00, 0x7F);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, 0x00, 0x20, 0x00, 0x9F);
+ mipi_dbi_command(dbi, MIPI_DCS_WRITE_MEMORY_START);
+
+ /* Positive Gamma */
+ mipi_dbi_command(dbi, 0xF0, 0x1f, 0x41, 0x1B, 0x55, 0x36, 0x3d, 0x3e,
+ 0x0, 0x16, 0x08, 0x09, 0x15, 0x14, 0xf);
+
+ /* Negative Gamma */
+ mipi_dbi_command(dbi, 0xF1, 0x1f, 0x41, 0x1B, 0x55, 0x36, 0x3d, 0x3e,
+ 0x0, 0x16, 0x08, 0x09, 0x15, 0x14, 0xf);
+
+ /* Exit inter-register mode */
+ mipi_dbi_command(dbi, 0xfe);
+ mipi_dbi_command(dbi, 0xff);
+
+ /* Tearing effect line on */
+ mipi_dbi_command(dbi, 0x35, 0x00);
+
+ /* Exit sleep mode */
+ mipi_dbi_command(dbi, MIPI_DCS_EXIT_SLEEP_MODE);
+ msleep(120);
+
+ /* Display on */
+ mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON);
+ msleep(20);
+
+ /* Set window address for 128x128 display
+ * Column: 0-127 (128 pixels)
+ * Page: 0-127 (128 pixels) - try offset 16 if display is shifted
+ */
+ mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, 0x00, 0x00, 0x00, 0x7F);
+ mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, 0x00, 0x00, 0x00, 0x7F);
+ mipi_dbi_command(dbi, MIPI_DCS_WRITE_MEMORY_START);
+
+ mipi_dbi_enable_flush(dbidev, crtc_state, plane_state);
+ mipi_dbi_enable_flush(dbidev, crtc_state, plane_state);
+
+out_exit:
+ drm_dev_exit(idx);
+ drm_dev_exit(idx);
+}
+
+
+static const struct drm_simple_display_pipe_funcs st7735s_pipe_funcs = {
+ DRM_MIPI_DBI_SIMPLE_DISPLAY_PIPE_FUNCS(st7735s_pipe_enable),
+};
@@ -153,7 +132,7 @@ Index: b/drivers/gpu/drm/tiny/st7735s.c
+static const struct st7735s_cfg mf68e_128x128_cfg = {
+ .mode = { DRM_SIMPLE_MODE(128, 128, 25, 26) },
+ .left_offset = 0,
+ .top_offset = 0,
+ .top_offset = 32,
+ .write_only = true,
+ .rgb = true,
+};
@@ -173,13 +152,13 @@ Index: b/drivers/gpu/drm/tiny/st7735s.c
+};
+
+static const struct of_device_id st7735s_of_match[] = {
+ { .compatible = "sitronix,st7735s-128x128", .data = &mf68e_128x128_cfg },
+ { .compatible = "sitronix,st7735s", .data = &mf68e_128x128_cfg },
+ { },
+};
+MODULE_DEVICE_TABLE(of, st7735s_of_match);
+
+static const struct spi_device_id st7735s_id[] = {
+ { "st7735s-128x128", (uintptr_t)&mf68e_128x128_cfg },
+ { "st7735s", (uintptr_t)&mf68e_128x128_cfg },
+ { },
+};
+MODULE_DEVICE_TABLE(spi, st7735s_id);
@@ -278,6 +257,6 @@ Index: b/drivers/gpu/drm/tiny/st7735s.c
+};
+module_spi_driver(st7735s_spi_driver);
+
+MODULE_DESCRIPTION("Sitronix ST7735S / GalaxyCore GC9106 DRM driver");
+MODULE_DESCRIPTION("Sitronix ST7735S DRM driver for MSM8916");
+MODULE_AUTHOR("Stefan x Nilsson <stefan.x.nilsson@axis.com>");
+MODULE_LICENSE("GPL");