diff --git a/arch/arm64/boot/dts/amlogic/meson-s6.dtsi b/arch/arm64/boot/dts/amlogic/meson-s6.dtsi index e89fccb00..56dafc7bb 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s6.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s6.dtsi @@ -1914,6 +1914,15 @@ }; &periphs_pinctrl { + bl_pwm_off_pins:bl_pwm_off_pin { + mux { + groups = "GPIOF_4"; + function = "gpio_periphs"; + drive-strength = <3>; + bias-pull-up; + }; + }; + i2c0_pins1:i2c0_pins1 { mux { groups = "i2c0_sda_e", diff --git a/arch/arm64/boot/dts/amlogic/mesons6_BQ20X_panel.dtsi b/arch/arm64/boot/dts/amlogic/mesons6_BQ20X_panel.dtsi index 30c06be5a..b1ee1ca17 100644 --- a/arch/arm64/boot/dts/amlogic/mesons6_BQ20X_panel.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesons6_BQ20X_panel.dtsi @@ -76,7 +76,7 @@ 0 1 0 10 0 0 0 100 0xff 0 0 0>; /*ending*/ - backlight_index = <0x1>; + backlight_index = <0xff>; }; dsi_0{ model_name = "AML08012001920-02"; @@ -192,57 +192,97 @@ 0 1 0 10 0 0 0 100 0xff 0 0 0>; /*ending*/ - backlight_index = <0x1>; - }; - - dsi_lt8911{ - model_name = "DSI_to_eDP_LT8911EXB"; - interface = "mipi"; - - // - basic_setting = <1920 1080 2200 1125 8 400 300>; - // - lcd_timing = <44 88 0 5 36 0>; - // - clk_attr = <0xff 0 1 148500000>; - // - mipi_attr = <4 1000 0 1 0 2 1 0>; - - /* power step: type, index, value, delay(ms) */ - power_on_step = < - 0 0 1 10 /*vcc en*/ - 0 1 1 1 /*rst high*/ - 0 3 1 30 /*3v3 high*/ - 0 1 0 10 /*rst low*/ - 0 1 1 20 /*rst high*/ - 2 0 0 100 - 3 0 0 0 - 0xff 0 0 0>; /*ending*/ - power_off_step = <0xff 0 0 0>; /*ending*/ - extern_init = <0>; backlight_index = <0xff>; }; + dsi_1 { + model_name = "LX70WSK40164-V0"; + interface = "mipi"; + basic_setting = <600 1024 940 1058 8 90 153>; + lcd_timing = <60 140 0 4 14 0>; + clk_attr = <2 0 1 60>; + mipi_attr = <4 360 0 1 0 2 1 0>; + /* dsi_init: data_type, num, data... */ + dsi_init_on = < + 0x39 4 0xB9 0xF1 0x12 0x87 + 0x39 28 0xBA 0x33 0x81 0x05 0xF9 0x0E 0x0E 0x20 0x00 0x00 0x00 0x00 + 0x00 0x00 0x00 0x44 0x25 0x00 0x91 0x0A 0x00 0x00 0x01 0x4F + 0x01 0x00 0x00 0x37 + 0x39 4 0xB2 0x00 0x15 0x78 + 0x39 11 0xB3 0x28 0x28 0x28 0x28 0x03 0xFF 0x00 0x00 0x00 0x00 + 0x15 2 0xB4 0xA0 + 0x39 3 0xB5 0x09 0x09 + 0x39 3 0xB6 0x78 0x78 + 0x39 3 0xB8 0x26 0x22 + 0x15 2 0xBC 0x46 + 0x39 6 0xBF 0x02 0x11 0x00 0x80 0x04 + 0x39 10 0xC0 0x73 0x73 0x50 0x50 0x00 0x00 0x08 0x73 0x00 + 0x39 18 0xC1 0x54 0x00 0x32 0x32 0x77 0xF1 0x3C 0x3C 0x7E 0x7E 0xCF + 0xCF 0x11 0x11 0x00 0x00 0x32 + 0x39 13 0xC7 0xB8 0x00 0x0A 0x00 0x00 0x00 0x00 0x80 0xED 0xC7 0x00 + 0xA5 + 0x39 5 0xC8 0x10 0x40 0x1E 0x03 + 0x39 2 0xCC 0x0B + 0x39 35 0xE0 0x00 0x02 0x03 0x23 0x38 0x3F 0x2D 0x27 0x04 0x08 0x0A + 0x0F 0x11 0x0E 0x11 0x12 0x18 0x00 0x02 0x03 0x23 0x38 0x3F + 0x2D 0x27 0x04 0x08 0x0A 0x0F 0x11 0x0E 0x11 0x12 0x18 + 0x39 8 0xE1 0x11 0x11 0x91 0x00 0x00 0x00 0x00 + 0x39 15 0xE3 0x07 0x07 0x0B 0x0B 0x03 0x0B 0x00 0x00 0x00 0x00 0xFF + 0x04 0xC0 0x10 + 0x39 64 0xE9 0xC8 0x10 0x03 0x04 0x0A 0x80 0x81 0x12 0x31 0x23 0x4F + 0x81 0x80 0x81 0x37 0x08 0x00 0x04 0x08 0x00 0x00 0x00 0x00 + 0x04 0x08 0x00 0x00 0x00 0x88 0x94 0xF8 0x13 0x57 0x18 0x88 + 0x88 0x88 0x88 0x88 0x88 0x94 0xF8 0x02 0x46 0x08 0x88 0x88 + 0x88 0x88 0x88 0x00 0x00 0x00 0x00 0x00 0x80 0x81 0x30 0x00 + 0x00 0x00 0x00 0x00 + 0x39 64 0xEA 0x01 0x10 0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x00 + 0x00 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 + 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x23 + 0x00 0x00 0x00 0xB8 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + 0x00 0x00 0x00 0x04 0x0D 0x12 0x30 0x30 0x80 0x81 0x50 0x80 + 0x81 0x00 0x00 0x00 + 0x39 4 0xEF 0xFF 0xFF 0x01 + 0x05 1 0x11 + 0xfd 1 250 + 0x05 1 0x29 + 0xfd 1 50 + 0xff 0>; /*ending*/ + dsi_init_off = < + 0x05 1 0x28 + 0xfd 1 10 /*delay(ms)*/ + 0x05 1 0x10 + 0xfd 1 10 /*delay(ms)*/ + 0xff 0>; /*ending*/ + extern_init = <0xff>; /*0xff for invalid*/ + + /* power step: type, index, value, delay(ms) */ + power_on_step = < + 0 0 1 10 /* LCD_VCC */ + 0 2 1 0 /* BL_EN, IO_VDD */ + 0 1 0 10 + 0 1 1 15 /* LCD_RST */ + 2 0 0 0 + 0 3 1 0 /* BL_PWM */ + 0xff 0 0 0>; /*ending*/ + power_off_step = < + 0 3 0 40 + 2 0 0 50 + 0 2 0 5 + 0 1 0 5 + 0 0 0 0 + 0xff 0 0 0>; /*ending*/ + backlight_index = <0xff>; + }; dsi_test { model_name = "DSI_test"; interface = "mipi"; basic_setting = <1920 1080 2200 1125 8 160 90>; lcd_timing = <44 148 0 5 36 0>; clk_attr = <0 0 1 165>; - mipi_attr = <4 2800 0 1 0 0 1 0>; + mipi_attr = <4 2500 0 1 0 0 1 0>; /* dsi_init: data_type, num, data... */ - dsi_init_on = < - 0x05 1 0x11 - 0xff 200 - 0x05 1 0x29 - 0xff 20 - 0xff 0xff>; /* ending flag */ - dsi_init_off = < - 0x05 1 0x28 - 0xff 10 - 0x05 1 0x10 - 0xff 10 - 0xff 0xff>; /* ending flag */ + dsi_init_on = <0xff 0xff>; /* ending flag */ + dsi_init_off = <0xff 0xff>; /* ending flag */ /* extern_init: 0xff for invalid */ extern_init = <0xff>; /* power step: type,index,value,delay(ms) */ @@ -312,18 +352,10 @@ }; lcd_extern{ compatible = "amlogic, lcd_extern"; - status = "okay"; + status = "disabled"; index = <0>; key_valid = <0>; i2c_bus = "i2c_bus_a"; - - extern_0{ - index = <0>; - extern_name = "LT8911EXB"; - status = "okay"; - type = <0>; /* 0=i2c, 1=spi, 2=mipi */ - i2c_address = <0x29>; - }; }; backlight{ @@ -332,19 +364,21 @@ index = <0>; key_valid = <0>; pinctrl-names = "pwm_on","pwm_off"; - // pinctrl-0 = <&pwm_e_pins>; /* GPIOY_1*/ - // pinctrl-1 = <&bl_pwm_off_pins>; /* GPIOY_1*/ + //pinctrl-0 = <&pwm_e_pins1>; /* GPIOF_4*/ + //pinctrl-1 = <&bl_pwm_off_pins>; /* GPIOY_1*/ pinctrl_version = <2>; /* for uboot */ + interrupts = <0 197 1>, <0 194 1>; interrupt-names = "vsync","vsync2"; - /*bl_pwm_config = <&bl_pwm_conf>; */ + bl_pwm_config = <&bl_pwm_conf>; /* pwm port: PWM_A, PWM_B, PWM_C, PWM_D, PWM_E, PWM_F, PWM_VS*/ /* power index:(point gpios_index, 0xff=invalid) */ /* power value:(0=output low, 1=output high, 2=input) */ /* power delay:(unit in ms) */ bl-gpios = <&gpio GPIOA_5 GPIO_ACTIVE_HIGH>, //LCD_BL_EN_I2S_DOUT_7 - <&gpio GPIOA_11 GPIO_ACTIVE_HIGH>; //LCD_BL_PWM_LINE_IN_DETECT - bl_gpio_names = "GPIOA_5", "GPIOA_11"; + <&gpio GPIOA_11 GPIO_ACTIVE_HIGH>, //LCD_BL_PWM_LINE_IN_DETECT + <&gpio GPIOF_4 GPIO_ACTIVE_HIGH>; //LCD_BL_PWM_TEST_ON_sta_LED + bl_gpio_names = "GPIOA_5", "GPIOA_11", "GPIOF_4"; backlight_0{ index = <0>; @@ -356,15 +390,25 @@ bl_power_attr = <0 /*en_gpio_index*/ 1 0 /*on_value, off_value*/ 200 200>; /*on_delay(ms), off_delay(ms)*/ - bl_pwm_port = "PWM_E"; + bl_pwm_port = "PWM_C"; bl_pwm_attr = <1 /*pwm_method(0=negative, 1=positive)*/ - 180 /*pwm_freq(pwm:Hz, pwm_vs:multiple of vs)*/ - 100 25>; /*duty_max(%), duty_min(%)*/ - bl_pwm_power = <1 0 /*pwm_gpio_index, pwm_gpio_off*/ + 2000 /*pwm_freq(pwm:Hz, pwm_vs:multiple of vs)*/ + 100 5>; /*duty_max(%), duty_min(%)*/ + bl_pwm_power = <2 0 /*pwm_gpio_index, pwm_gpio_off*/ 10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/ en_sequence_reverse = <0>; /* 1 for reverse */ }; + }; + bl_pwm_conf:bl_pwm_conf{ + pwm_channel_0 { + pwm_port = "PWM_C"; + pwms = <&pwm_c MESON_PWM_0 30040 0>; + }; }; }; /* end of / */ + +//&pwm_c { +// status = "okay"; +//}; diff --git a/drivers/media/vout/lcd/backlight/lcd_bl.c b/drivers/media/vout/lcd/backlight/lcd_bl.c index 0974b6a45..44060609b 100644 --- a/drivers/media/vout/lcd/backlight/lcd_bl.c +++ b/drivers/media/vout/lcd/backlight/lcd_bl.c @@ -4209,6 +4209,12 @@ static struct bl_data_s bl_data_txhd2 = { .pwm_vs_flag = 1, }; +static struct bl_data_s bl_data_s6 = { + .chip_type = LCD_CHIP_S6, + .chip_name = "s6", + .pwm_vs_flag = 1, +}; + static const struct of_device_id bl_dt_match_table[] = { { .compatible = "amlogic, backlight-axg", @@ -4276,6 +4282,10 @@ static const struct of_device_id bl_dt_match_table[] = { .compatible = "amlogic, backlight-txhd2", .data = &bl_data_txhd2, }, + { + .compatible = "amlogic, backlight-s6", + .data = &bl_data_s6, + }, {} }; #endif diff --git a/drivers/media/vout/lcd/lcd_extern/Kconfig b/drivers/media/vout/lcd/lcd_extern/Kconfig index 2729d8a38..2740c8c91 100644 --- a/drivers/media/vout/lcd/lcd_extern/Kconfig +++ b/drivers/media/vout/lcd/lcd_extern/Kconfig @@ -10,16 +10,6 @@ menuconfig AMLOGIC_LCD_EXTERN through the panel interface to write data to the LCD, make its initialization -config AMLOGIC_LCD_EXTERN_I2C_T5800Q - bool "lcd external i2c T5800Q init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external i2c_T5800Q init driver support - Once the power on, according to the timing requirements, - through the i2c interface to write data to the LCD, - make its initialization - config AMLOGIC_LCD_EXTERN_I2C_ANX6862_7911 bool "lcd external i2c ANX6862_7911 init driver" default n @@ -30,26 +20,6 @@ config AMLOGIC_LCD_EXTERN_I2C_ANX6862_7911 through the i2c interface to write data to the LCD, make its initialization -config AMLOGIC_LCD_EXTERN_I2C_DLPC3439 - bool "lcd external i2c DLPC3439 init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external i2c_DLPC3439 init driver support - Once the power on, according to the timing requirements, - through the i2c interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_I2C_ANX6345 - bool "lcd external i2c ANX6345 init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external i2c_ANX6345 init driver support - Once the power on, according to the timing requirements, - through the i2c interface to write data to the LCD, - make its initialization - config AMLOGIC_LCD_EXTERN_I2C_CS602 bool "lcd external i2c CS602 init driver" default n @@ -69,73 +39,3 @@ config AMLOGIC_LCD_EXTERN_I2C_OLED Once the power on, according to the timing requirements, through the i2c interface to write data to the LCD, make its initialization - -config AMLOGIC_LCD_EXTERN_SPI_LD070WS2 - bool "lcd external spi LD070WS2 init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external spi_LD070WS2 init driver support - Once the power on, according to the timing requirements, - through the spi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_KD080D13 - bool "lcd external mipi KD080D13 init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_KD080D13 init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_N070ICN - bool "lcd external mipi N070ICN init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_N070ICN init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_TV070WSM - bool "lcd external mipi TV070WSM init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_TV070WSM init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_ST7701 - bool "lcd external mipi ST7701 init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_ST7701 init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_P070ACB - bool "lcd external mipi P070ACB init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_P070ACB init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization - -config AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT - bool "lcd external mipi TL050FHV02CT init driver" - default n - depends on AMLOGIC_LCD_EXTERN - help - Amlogic LCD external mipi_TL050FHV02CT init driver support - Once the power on, according to the timing requirements, - through the mipi interface to write data to the LCD, - make its initialization diff --git a/drivers/media/vout/lcd/lcd_extern/Makefile b/drivers/media/vout/lcd/lcd_extern/Makefile index b9673e100..9b4644b3d 100644 --- a/drivers/media/vout/lcd/lcd_extern/Makefile +++ b/drivers/media/vout/lcd/lcd_extern/Makefile @@ -6,6 +6,6 @@ $(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN) += vout/lcd/lcd_extern/ext_spi $(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN) += vout/lcd/lcd_extern/ext_func.o $(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN) += vout/lcd/lcd_extern/ext_default.o $(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN) += vout/lcd/lcd_extern/mipi_default.o -$(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_ANX6862_7911) += vout/lcd/lcd_extern/i2c_ANX6862_7911.o -$(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_CS602) += vout/lcd/lcd_extern/i2c_CS602.o $(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_OLED) += vout/lcd/lcd_extern/i2c_oled.o + +include $(COMMON_DRIVERS_DIR)/drivers/media/vout/lcd/lcd_extern/external_chip/Makefile diff --git a/drivers/media/vout/lcd/lcd_extern/external_chip/Makefile b/drivers/media/vout/lcd/lcd_extern/external_chip/Makefile new file mode 100644 index 000000000..b2250d3b4 --- /dev/null +++ b/drivers/media/vout/lcd/lcd_extern/external_chip/Makefile @@ -0,0 +1,2 @@ +$(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_ANX6862_7911) += vout/lcd/lcd_extern/i2c_ANX6862_7911.o +$(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_CS602) += vout/lcd/lcd_extern/i2c_CS602.o diff --git a/drivers/media/vout/lcd/lcd_extern/i2c_ANX6862_7911.c b/drivers/media/vout/lcd/lcd_extern/external_chip/i2c_ANX6862_7911.c similarity index 99% rename from drivers/media/vout/lcd/lcd_extern/i2c_ANX6862_7911.c rename to drivers/media/vout/lcd/lcd_extern/external_chip/i2c_ANX6862_7911.c index 6d4108106..306ae3fee 100644 --- a/drivers/media/vout/lcd/lcd_extern/i2c_ANX6862_7911.c +++ b/drivers/media/vout/lcd/lcd_extern/external_chip/i2c_ANX6862_7911.c @@ -15,7 +15,7 @@ #include #include #include -#include "lcd_extern.h" +#include "../lcd_extern.h" #define LCD_EXTERN_NAME "i2c_ANX6862_7911" diff --git a/drivers/media/vout/lcd/lcd_extern/i2c_CS602.c b/drivers/media/vout/lcd/lcd_extern/external_chip/i2c_CS602.c similarity index 99% rename from drivers/media/vout/lcd/lcd_extern/i2c_CS602.c rename to drivers/media/vout/lcd/lcd_extern/external_chip/i2c_CS602.c index e13be38ef..da7ec3858 100644 --- a/drivers/media/vout/lcd/lcd_extern/i2c_CS602.c +++ b/drivers/media/vout/lcd/lcd_extern/external_chip/i2c_CS602.c @@ -14,7 +14,7 @@ #include #include #include -#include "lcd_extern.h" +#include "../lcd_extern.h" #define LCD_EXTERN_NAME "i2c_CS602"