Changed boot logo, added AXP209 support and removed 90 degrees screen rotation because of tearing effect

This commit is contained in:
Michel-FK 2019-10-18 23:17:32 +02:00
parent 4f5bd016eb
commit 63a307645c
7 changed files with 9705 additions and 9680 deletions

View File

@ -5,6 +5,7 @@ CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=12
CONFIG_CGROUPS=y
CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y
CONFIG_MODULES=y
@ -17,6 +18,7 @@ CONFIG_ARCH_SUNXI=y
# CONFIG_MACH_SUN6I is not set
# CONFIG_MACH_SUN7I is not set
# CONFIG_MACH_SUN9I is not set
CONFIG_SMP=y
CONFIG_HAVE_ARM_ARCH_TIMER=y
CONFIG_ARM_PSCI=y
CONFIG_HIGHMEM=y
@ -53,6 +55,7 @@ CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_AXP20X_PEK=y
CONFIG_INPUT_UINPUT=y
CONFIG_LEGACY_PTY_COUNT=4
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
@ -67,7 +70,11 @@ CONFIG_I2C_MV64XXX=y
CONFIG_SPI=y
CONFIG_SPI_SUN6I=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_AXP209=y
CONFIG_POWER_SUPPLY=y
CONFIG_CHARGER_AXP20X=y
CONFIG_BATTERY_AXP20X=y
CONFIG_AXP20X_POWER=y
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
CONFIG_CPU_THERMAL=y
@ -81,8 +88,7 @@ CONFIG_REGULATOR_AXP20X=y
# CONFIG_RC_CORE is not set
CONFIG_FB=y
CONFIG_FB_SIMPLE=y
# CONFIG_LCD_CLASS_DEVICE is not set
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_FB_SSD1307=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
@ -131,7 +137,8 @@ CONFIG_FB_FLEX=y
# CONFIG_SUN8I_H3_CCU is not set
CONFIG_SUN8I_DE2_CCU=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_PWM=y
CONFIG_IIO=y
CONFIG_AXP20X_ADC=y
CONFIG_PWM_SUN4I=y
CONFIG_PHY_SUN4I_USB=y
CONFIG_NVMEM_SUNXI_SID=y
@ -147,6 +154,7 @@ CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_FTRACE is not set
# CONFIG_ARM_UNWIND is not set
CONFIG_KEYS=y

View File

@ -1,67 +0,0 @@
From 538e97d56bae968580ac046389243383b7559ab9 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:26:56 +0100
Subject: [PATCH 9/9] rotated screen 90 degrees CW
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 2 +-
drivers/staging/fbtft/fb_st7789v.c | 13 ++++++++++---
drivers/staging/fbtft/fbtft-core.c | 8 +++++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
index 69f52af..e966993 100644
--- a/drivers/staging/fbtft/fb_st7789v.c
+++ b/drivers/staging/fbtft/fb_st7789v.c
@@ -150,9 +150,6 @@ static int init_display(struct fbtft_par *par)
*/
write_reg(par, PWCTRL1, 0xA4, 0xA1);
- /* Ystart at 80 , Yend at 240 */
- write_reg(par, 0x2B, 0x00, 0x50, 0x00, 0xF0);
-
/* Display Inversion of colors */
write_reg(par, 0x21);
@@ -190,6 +187,16 @@ static int set_var(struct fbtft_par *par)
return -EINVAL;
}
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, madctl_par);
+
+ // All offset operations are done after in fbtft_set_addr_win, not here
+ /* Ystart at 0 , Yend at 239 */
+ //write_reg(par, 0x2B, 0x00, 0x50, 0x00, 0xEF);
+ write_reg(par, 0x2B, 0x00, 0x00, 0x00, 0xEF);
+ //write_reg(par, 0x2B, 0x00, 0x50, 0x01, 0x3F);
+ /* Xstart at 80 , Xend at 319 */
+ write_reg(par, 0x2A, 0x00, 0x50, 0x01, 0x3F);
+ //write_reg(par, 0x2A, 0x00, 0x50, 0x00, 0xEF);
+
return 0;
}
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 6d0363d..fbb0934 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -391,9 +391,15 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line,
fbtft_par_dbg(DEBUG_UPDATE_DISPLAY, par, "%s(start_line=%u, end_line=%u)\n",
__func__, start_line, end_line);
- if (par->fbtftops.set_addr_win)
+ // Carefull removing this. this will work only if the full screen is updated at once
+ /*if (par->fbtftops.set_addr_win){
par->fbtftops.set_addr_win(par, 0, start_line,
par->info->var.xres - 1, end_line);
+ }*/
+ if (par->fbtftops.set_addr_win){
+ par->fbtftops.set_addr_win(par, 80, start_line,
+ 320 - 1, end_line);
+ }
offset = start_line * par->info->fix.line_length;
len = (end_line - start_line + 1) * par->info->fix.line_length;
--
2.7.4

View File

@ -161,8 +161,8 @@
+ reg = <0>;
+ spi-max-frequency = <40000000>;
+ txbuflen = <115200>;
+ rotate = <90>;
+ fps = <42>;
+ rotate = <0>;
+ fps = <39>;
+ buswidth = <8>;
+ reset-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; //PE1
+ dc-gpios = <&pio 2 0 GPIO_ACTIVE_LOW>; //PC0 (MISO)

View File

@ -0,0 +1,69 @@
diff --git a/arch/arm/boot/dts/sun8i-v3s-funkey.dts b/arch/arm/boot/dts/sun8i-v3s-funkey.dts
index 0a8ce5c0..31fddd2e 100644
--- a/arch/arm/boot/dts/sun8i-v3s-funkey.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-funkey.dts
@@ -81,13 +81,14 @@
&i2c0 {
status = "okay";
- /* axp209: pmic@34 {
+ axp209: pmic@34 {
compatible = "x-powers,axp209";
reg = <0x34>;
- interrupts = <0>;
+ interrupt-parent = <&pio>;
+ interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <1>;
- }; */
+ };
};
&mmc0 {
@@ -104,9 +105,24 @@
status = "okay";
};
-/*
#include "axp209.dtsi"
+&ac_power_supply {
+ status = "okay";
+};
+
+&axp_gpio {
+ status = "okay";
+};
+
+&battery_power_supply {
+ status = "okay";
+};
+
+&usb_power_supply {
+ status = "okay";
+};
+
&reg_dcdc2 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
@@ -133,7 +149,6 @@
regulator-max-microvolt = <3300000>;
regulator-name = "avcc-pll";
};
-*/
&reg_vcc3v0 {
regulator-always-on;
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 376a99b7..0718d191 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -169,7 +169,7 @@ static const struct regulator_desc axp20x_regulators[] = {
AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
AXP_DESC(AXP20X, DCDC3, "dcdc3", "vin3", 700, 3500, 25,
AXP20X_DCDC3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
- AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 1300),
+ AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 3300),
AXP_DESC(AXP20X, LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25,

View File

@ -81,13 +81,14 @@
&i2c0 {
status = "okay";
/* axp209: pmic@34 {
axp209: pmic@34 {
compatible = "x-powers,axp209";
reg = <0x34>;
interrupts = <0>;
interrupt-parent = <&pio>;
interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <1>;
}; */
};
};
&mmc0 {
@ -104,9 +105,24 @@
status = "okay";
};
/*
#include "axp209.dtsi"
&ac_power_supply {
status = "okay";
};
&axp_gpio {
status = "okay";
};
&battery_power_supply {
status = "okay";
};
&usb_power_supply {
status = "okay";
};
&reg_dcdc2 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
@ -133,7 +149,6 @@
regulator-max-microvolt = <3300000>;
regulator-name = "avcc-pll";
};
*/
&reg_vcc3v0 {
regulator-always-on;
@ -158,8 +173,8 @@
reg = <0>;
spi-max-frequency = <40000000>;
txbuflen = <115200>;
rotate = <90>;
fps = <42>;
rotate = <0>;
fps = <39>;
buswidth = <8>;
reset-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; //PE1
dc-gpios = <&pio 2 0 GPIO_ACTIVE_LOW>; //PC0 (MISO)

View File

@ -5,6 +5,6 @@
|___| |_____|__|__||__|\\__||_____|___ |
FUN ON A KEYCHAIN |_____|
-----------------------------------------------------
Version 0.1
Version 0.2
-----------------------------------------------------