From 6fdf97b68b78e26d405d9669a6cbea1924c3e4a6 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 17 Aug 2024 13:54:06 +0000 Subject: [PATCH] Sat Aug 17 13:53:21 UTC 2024 Kernel update --- bsp/drivers/clk/sunxi-ng/ccu-sun55iw3.c | 128 +- bsp/drivers/clk/sunxi-ng/ccu_mult.h | 3 + bsp/drivers/clk/sunxi-ng/ccu_nm.c | 6 +- bsp/drivers/crashdump/sunxi-dump2pc.c | 4 +- bsp/drivers/drm/Kconfig | 107 +- bsp/drivers/drm/Makefile | 65 +- bsp/drivers/drm/panel/Kconfig | 35 +- bsp/drivers/drm/panel/Makefile | 11 +- .../drm/panel/SQ101D_Q5DI404_84H501H.c | 351 - bsp/drivers/drm/panel/edp_general_panel.c | 36 +- bsp/drivers/drm/panel/panel-bp101wx1.c | 269 - bsp/drivers/drm/panel/panels.c | 381 - bsp/drivers/drm/panel/panels.h | 75 +- .../drm/sunxi_device/hardware/disp_features.h | 106 - .../drm/sunxi_device/hardware/include.h | 1174 +- .../hardware/lowlevel_edp/edp_lowlevel.h | 191 - .../lowlevel_edp/inno_edp13/inno_edp13.c | 1418 +- .../lowlevel_edp/inno_edp13/inno_edp13.h | 9 + .../hardware/lowlevel_hdmi20/Makefile | 11 +- .../hardware/lowlevel_hdmi20/dw_avp.c | 1604 +- .../hardware/lowlevel_hdmi20/dw_avp.h | 219 +- .../hardware/lowlevel_hdmi20/dw_cec.c | 2 +- .../hardware/lowlevel_hdmi20/dw_dev.c | 152 +- .../hardware/lowlevel_hdmi20/dw_dev.h | 429 +- .../hardware/lowlevel_hdmi20/dw_edid.c | 735 +- .../hardware/lowlevel_hdmi20/dw_edid.h | 55 +- .../hardware/lowlevel_hdmi20/dw_fc.c | 834 +- .../hardware/lowlevel_hdmi20/dw_fc.h | 63 +- .../hardware/lowlevel_hdmi20/dw_hdcp.c | 598 +- .../hardware/lowlevel_hdmi20/dw_hdcp.h | 210 +- .../hardware/lowlevel_hdmi20/dw_hdcp22.c | 549 +- .../hardware/lowlevel_hdmi20/dw_hdcp22.h | 174 +- .../hardware/lowlevel_hdmi20/dw_i2cm.c | 172 +- .../hardware/lowlevel_hdmi20/dw_i2cm.h | 23 +- .../hardware/lowlevel_hdmi20/dw_mc.c | 68 +- .../hardware/lowlevel_hdmi20/dw_mc.h | 53 +- .../hardware/lowlevel_hdmi20/dw_phy.c | 83 +- .../hardware/lowlevel_hdmi20/dw_phy.h | 10 - .../esm_lib/esm_host_lib_auth.c | 5 +- .../esm_lib/esm_host_lib_exceptions.c | 1 - .../esm_lib/esm_host_lib_init.c | 8 - .../esm_lib/esm_host_lib_log.c | 1 - .../esm_lib/esm_host_lib_status.c | 1 - .../hardware/lowlevel_hdmi20/phy_aw.c | 17 +- .../hardware/lowlevel_hdmi20/phy_aw.h | 5 - .../hardware/lowlevel_hdmi20/phy_inno.c | 121 +- .../hardware/lowlevel_hdmi20/phy_inno.h | 3 - .../hardware/lowlevel_hdmi20/phy_snps.c | 1613 +- .../hardware/lowlevel_hdmi20/phy_snps.h | 49 +- .../hardware/lowlevel_v35x/Makefile | 43 - .../hardware/lowlevel_v35x/de35x/de350_feat.c | 836 - .../hardware/lowlevel_v35x/de35x/de351_feat.c | 560 - .../hardware/lowlevel_v35x/de35x/de_bld.c | 336 - .../hardware/lowlevel_v35x/de35x/de_bld.h | 72 - .../lowlevel_v35x/de35x/de_bld_type.h | 232 - .../hardware/lowlevel_v35x/de35x/de_ccsc.c | 231 - .../hardware/lowlevel_v35x/de35x/de_ccsc.h | 29 - .../lowlevel_v35x/de35x/de_ccsc_type.h | 65 - .../hardware/lowlevel_v35x/de35x/de_cdc.c | 752 - .../hardware/lowlevel_v35x/de35x/de_cdc.h | 30 - .../lowlevel_v35x/de35x/de_cdc_table.c | 54444 ---------------- .../lowlevel_v35x/de35x/de_cdc_table.h | 46 - .../lowlevel_v35x/de35x/de_cdc_type.h | 192 - .../hardware/lowlevel_v35x/de35x/de_crc.c | 371 - .../hardware/lowlevel_v35x/de35x/de_crc.h | 41 - .../lowlevel_v35x/de35x/de_crc_type.h | 209 - .../lowlevel_v35x/de35x/de_csc_table.c | 1271 - .../lowlevel_v35x/de35x/de_csc_table.h | 42 - .../hardware/lowlevel_v35x/de35x/de_dci.c | 696 - .../lowlevel_v35x/de35x/de_dci_type.h | 518 - .../hardware/lowlevel_v35x/de35x/de_dcsc.c | 1228 - .../hardware/lowlevel_v35x/de35x/de_dcsc.h | 31 - .../lowlevel_v35x/de35x/de_dcsc_type.h | 68 - .../hardware/lowlevel_v35x/de35x/de_deband.c | 398 - .../lowlevel_v35x/de35x/de_deband_type.h | 280 - .../hardware/lowlevel_v35x/de35x/de_dither.c | 167 - .../lowlevel_v35x/de35x/de_dither_type.h | 106 - .../hardware/lowlevel_v35x/de35x/de_enhance.c | 765 - .../hardware/lowlevel_v35x/de35x/de_enhance.h | 328 - .../hardware/lowlevel_v35x/de35x/de_fbd_atw.c | 558 - .../hardware/lowlevel_v35x/de35x/de_fbd_atw.h | 28 - .../lowlevel_v35x/de35x/de_fbd_atw_type.h | 465 - .../hardware/lowlevel_v35x/de35x/de_fcm.c | 560 - .../lowlevel_v35x/de35x/de_fcm_type.h | 594 - .../hardware/lowlevel_v35x/de35x/de_feat.c | 533 - .../hardware/lowlevel_v35x/de35x/de_feat.h | 185 - .../hardware/lowlevel_v35x/de35x/de_fmt.c | 191 - .../hardware/lowlevel_v35x/de35x/de_fmt.h | 76 - .../lowlevel_v35x/de35x/de_fmt_type.h | 129 - .../hardware/lowlevel_v35x/de35x/de_gamma.c | 1990 - .../lowlevel_v35x/de35x/de_gamma_type.h | 226 - .../hardware/lowlevel_v35x/de35x/de_ksc.c | 171 - .../hardware/lowlevel_v35x/de35x/de_ksc.h | 29 - .../lowlevel_v35x/de35x/de_ksc_type.h | 87 - .../hardware/lowlevel_v35x/de35x/de_ovl.c | 783 - .../hardware/lowlevel_v35x/de35x/de_ovl.h | 36 - .../lowlevel_v35x/de35x/de_ovl_type.h | 266 - .../hardware/lowlevel_v35x/de35x/de_rtmx.c | 1821 - .../hardware/lowlevel_v35x/de35x/de_rtmx.h | 428 - .../lowlevel_v35x/de35x/de_scaler_table.c | 986 - .../lowlevel_v35x/de35x/de_scaler_table.h | 52 - .../hardware/lowlevel_v35x/de35x/de_sharp.c | 374 - .../lowlevel_v35x/de35x/de_sharp_type.h | 234 - .../hardware/lowlevel_v35x/de35x/de_smbl.c | 594 - .../hardware/lowlevel_v35x/de35x/de_smbl.h | 46 - .../lowlevel_v35x/de35x/de_smbl_tab.h | 32471 --------- .../lowlevel_v35x/de35x/de_smbl_type.h | 266 - .../hardware/lowlevel_v35x/de35x/de_snr.c | 347 - .../hardware/lowlevel_v35x/de35x/de_snr.h | 31 - .../lowlevel_v35x/de35x/de_snr_type.h | 92 - .../hardware/lowlevel_v35x/de35x/de_tfbd.c | 419 - .../hardware/lowlevel_v35x/de35x/de_tfbd.h | 28 - .../lowlevel_v35x/de35x/de_tfbd_type.h | 153 - .../hardware/lowlevel_v35x/de35x/de_top.c | 552 - .../hardware/lowlevel_v35x/de35x/de_top.h | 170 - .../hardware/lowlevel_v35x/de35x/de_vep.h | 26 - .../lowlevel_v35x/de35x/de_vep_table.c | 157 - .../lowlevel_v35x/de35x/de_vep_table.h | 24 - .../hardware/lowlevel_v35x/de35x/de_vsu.c | 1717 - .../hardware/lowlevel_v35x/de35x/de_vsu.h | 106 - .../lowlevel_v35x/de35x/de_vsu_type.h | 907 - .../hardware/lowlevel_v35x/de35x/de_wb.c | 920 - .../hardware/lowlevel_v35x/de35x/de_wb.h | 53 - .../hardware/lowlevel_v35x/de35x/de_wb_type.h | 304 - .../hardware/lowlevel_v35x/disp_al_de.h | 57 - .../hardware/lowlevel_v35x/disp_al_tcon.h | 20 - .../hardware/lowlevel_v35x/tcon/de_dsi.c | 1378 - .../hardware/lowlevel_v35x/tcon/de_dsi.h | 214 - .../hardware/lowlevel_v35x/tcon/de_dsi_28.c | 1127 - .../hardware/lowlevel_v35x/tcon/de_dsi_type.h | 1237 - .../lowlevel_v35x/tcon/de_dsi_type_28.h | 634 - .../hardware/lowlevel_v35x/tcon/de_lcd.c | 1994 - .../hardware/lowlevel_v35x/tcon/de_lcd.h | 176 - .../hardware/lowlevel_v35x/tcon/de_lcd_type.h | 1043 - .../hardware/lowlevel_v35x/tcon_feat.c | 123 - .../hardware/lowlevel_v35x/tcon_feat.h | 106 - bsp/drivers/drm/sunxi_device/sunxi_de.h | 35 - bsp/drivers/drm/sunxi_device/sunxi_de_v35x.c | 717 - bsp/drivers/drm/sunxi_device/sunxi_dsi.c | 616 - bsp/drivers/drm/sunxi_device/sunxi_dsi.h | 51 - .../drm/sunxi_device/sunxi_dsi_combo_phy.c | 232 - bsp/drivers/drm/sunxi_device/sunxi_edp.c | 1130 +- bsp/drivers/drm/sunxi_device/sunxi_edp.h | 594 +- bsp/drivers/drm/sunxi_device/sunxi_hdmi.c | 1038 +- bsp/drivers/drm/sunxi_device/sunxi_hdmi.h | 550 +- bsp/drivers/drm/sunxi_device/sunxi_tcon.h | 72 +- bsp/drivers/drm/sunxi_device/sunxi_tcon_top.c | 74 +- bsp/drivers/drm/sunxi_device/sunxi_tcon_top.h | 1 + .../drm/sunxi_device/sunxi_tcon_v35x.c | 1174 - bsp/drivers/drm/sunxi_drm_crtc.c | 1918 +- bsp/drivers/drm/sunxi_drm_crtc.h | 70 +- bsp/drivers/drm/sunxi_drm_drv.c | 875 +- bsp/drivers/drm/sunxi_drm_drv.h | 52 +- bsp/drivers/drm/sunxi_drm_edp.c | 1900 +- bsp/drivers/drm/sunxi_drm_edp.h | 194 - bsp/drivers/drm/sunxi_drm_fbdev.c | 262 - bsp/drivers/drm/sunxi_drm_hdmi.c | 4008 +- bsp/drivers/drm/sunxi_drm_hdmi.h | 31 - bsp/drivers/drm/sunxi_drm_intf.h | 2 +- bsp/drivers/drm/sunxi_drm_lcd.c | 374 - bsp/drivers/drm/sunxi_drm_lcd.h | 21 - bsp/drivers/input/ctp/Kconfig | 3 +- bsp/drivers/input/ctp/Makefile | 2 +- bsp/drivers/input/ctp/focaltech_touch/Kconfig | 8 +- .../input/ctp/focaltech_touch/Makefile | 24 +- .../ctp/focaltech_touch/focaltech_common.h | 5 +- .../ctp/focaltech_touch/focaltech_config.h | 60 +- .../ctp/focaltech_touch/focaltech_core.c | 1163 +- .../ctp/focaltech_touch/focaltech_core.h | 106 +- .../ctp/focaltech_touch/focaltech_esdcheck.c | 11 +- .../ctp/focaltech_touch/focaltech_ex_fun.c | 321 +- .../ctp/focaltech_touch/focaltech_flash.c | 103 +- .../ctp/focaltech_touch/focaltech_flash.h | 10 +- .../focaltech_touch/focaltech_flash/Makefile | 1 - .../focaltech_upgrade_ft3427.c | 154 - .../ctp/focaltech_touch/focaltech_gesture.c | 16 +- .../input/ctp/focaltech_touch/focaltech_i2c.c | 273 +- .../ctp/focaltech_touch/focaltech_proximity.c | 3 +- .../focaltech_touch/focaltech_touch_dts.txt | 52 +- .../include/firmware/fw_sample.h | 0 .../include/firmware/fw_sample_hk_7inch.h | 2801 - bsp/drivers/input/ctp/gslx680new/gslX680.c | 104 +- bsp/drivers/input/ctp/gt82x/gt82x.c | 26 +- bsp/drivers/input/ctp/gt9xx/gt9xx_ts.c | 42 +- bsp/drivers/input/ctp/gt9xx/gt9xx_update.c | 13 +- bsp/drivers/input/ctp/gt9xxnew/Kconfig | 5 +- .../input/ctp/hynitron/hynitron_core.c | 25 +- .../input/ctp/ilitek_tddi/ilitek_v3_i2c.c | 17 +- .../input/ctp/ilitek_tddi/ilitek_v3_ic.c | 2 +- .../input/ctp/ilitek_tddi/ilitek_v3_init.c | 5 +- .../input/ctp/ilitek_tddi/ilitek_v3_node.c | 4 +- bsp/drivers/input/ctp/nvt36xxx/nt36xxx.c | 13 +- bsp/drivers/input/ctp/tlsc6x/tlsc6x_main.c | 43 +- bsp/drivers/input/ctp/wacom_pen/wacom_i2c.c | 25 +- bsp/drivers/input/init-input.c | 16 +- .../input/misc/hall_sensor/hall_sensor.c | 3 +- .../input/misc/vibrator/sunxi-vibrator.c | 25 +- bsp/drivers/input/sensor/bmi323/bmi3.c | 2 +- bsp/drivers/input/sensor/bmi323/bmi323_spi.c | 12 + bsp/drivers/input/sensor/bmi323/bmi3_defs.h | 2 +- bsp/drivers/input/sensor/mir3da/mir3da_cust.c | 13 + bsp/drivers/input/sensor/mmc5603/mmc5603.c | 15 + bsp/drivers/input/sensor/msa/msa_cust.c | 13 + bsp/drivers/input/sensor/qmi8658/qmi8658.c | 17 + bsp/drivers/input/sensor/sc7a20/sc7a20.c | 13 + bsp/drivers/input/sensor/stk3x1x/stk3x1x.c | 13 + bsp/drivers/iommu/sunxi-iommu-v1.c | 11 +- bsp/drivers/iommu/sunxi-iommu-v2.c | 11 +- bsp/drivers/iommu/sunxi-iommu-v3.c | 11 +- bsp/drivers/mmc/sunxi-mmc-panic.c | 1 - bsp/drivers/mmc/sunxi-mmc-pstore-panic.c | 1 - bsp/drivers/mmc/sunxi-mmc-sun50iw1p1-0.c | 3 - bsp/drivers/mmc/sunxi-mmc-sun50iw1p1-1.c | 3 - bsp/drivers/mmc/sunxi-mmc-v4p00x.c | 3 - bsp/drivers/mmc/sunxi-mmc-v4p10x.c | 6 - bsp/drivers/mmc/sunxi-mmc-v4p1x.c | 3 - bsp/drivers/mmc/sunxi-mmc-v4p5x.c | 109 +- .../sunxi-mmc-v5p3x-HS400-phase-delaychain.c | 2 - bsp/drivers/mmc/sunxi-mmc-v5p3x.c | 10 +- bsp/drivers/mmc/sunxi-mmc-v5p3x.h | 3 + bsp/drivers/mmc/sunxi-mmc.c | 403 +- bsp/drivers/mmc/sunxi-mmc.h | 14 +- .../aw_nna_vip/linux/gc_vip_kernel_os_debug.c | 19 +- .../aw_nna_vip/linux/gc_vip_kernel_os_debug.h | 1 + bsp/drivers/phy/sunxi-inno-combophy.c | 270 +- bsp/drivers/power/mfd/axp2101-i2c.c | 1 + bsp/drivers/power/mfd/axp2101.c | 471 +- bsp/drivers/power/power_key/axp2101-pek.c | 86 +- .../power/regulator/axp2101-regulator.c | 183 + bsp/drivers/power/supply/axp2601_battery.h | 4 +- bsp/drivers/redeposit/redeposit.h | 2 + bsp/drivers/rtc/rtc-sunxi.c | 5 +- bsp/drivers/stmmac/Kconfig | 66 +- bsp/drivers/stmmac/Makefile | 19 +- bsp/drivers/stmmac/chain_mode.c | 168 - bsp/drivers/stmmac/common.h | 568 - bsp/drivers/stmmac/descs.h | 186 - bsp/drivers/stmmac/descs_com.h | 83 - bsp/drivers/stmmac/dwmac-dwc-qos-eth.c | 518 - bsp/drivers/stmmac/dwmac-generic.c | 104 - bsp/drivers/stmmac/dwmac-sunxi.c | 1021 +- bsp/drivers/stmmac/dwmac100.h | 111 - bsp/drivers/stmmac/dwmac1000.h | 334 - bsp/drivers/stmmac/dwmac1000_core.c | 565 - bsp/drivers/stmmac/dwmac1000_dma.c | 290 - bsp/drivers/stmmac/dwmac100_core.c | 201 - bsp/drivers/stmmac/dwmac100_dma.c | 127 - bsp/drivers/stmmac/dwmac4.h | 518 - bsp/drivers/stmmac/dwmac4_core.c | 1377 - bsp/drivers/stmmac/dwmac4_descs.c | 590 - bsp/drivers/stmmac/dwmac4_descs.h | 147 - bsp/drivers/stmmac/dwmac4_dma.c | 577 - bsp/drivers/stmmac/dwmac4_dma.h | 238 - bsp/drivers/stmmac/dwmac4_lib.c | 235 - bsp/drivers/stmmac/dwmac5.c | 769 - bsp/drivers/stmmac/dwmac5.h | 160 - bsp/drivers/stmmac/dwmac_dma.h | 166 - bsp/drivers/stmmac/dwmac_lib.c | 286 - bsp/drivers/stmmac/dwxgmac2.h | 474 - bsp/drivers/stmmac/dwxgmac2_core.c | 1637 - bsp/drivers/stmmac/dwxgmac2_descs.c | 382 - bsp/drivers/stmmac/dwxgmac2_dma.c | 582 - bsp/drivers/stmmac/dwxlgmac2.h | 22 - bsp/drivers/stmmac/enh_desc.c | 494 - bsp/drivers/stmmac/hwif.c | 342 - bsp/drivers/stmmac/hwif.h | 644 - bsp/drivers/stmmac/mmc.h | 129 - bsp/drivers/stmmac/mmc_core.c | 475 - bsp/drivers/stmmac/norm_desc.c | 361 - bsp/drivers/stmmac/pcs-xpcs-nxp.c | 185 - bsp/drivers/stmmac/pcs-xpcs.c | 1169 - bsp/drivers/stmmac/pcs-xpcs.h | 115 - bsp/drivers/stmmac/ring_mode.c | 148 - bsp/drivers/stmmac/stmmac.h | 397 - bsp/drivers/stmmac/stmmac_ethtool.c | 1201 - bsp/drivers/stmmac/stmmac_hwtstamp.c | 218 - bsp/drivers/stmmac/stmmac_main.c | 7507 --- bsp/drivers/stmmac/stmmac_mdio.c | 585 - bsp/drivers/stmmac/stmmac_pci.c | 316 - bsp/drivers/stmmac/stmmac_pcs.h | 155 - bsp/drivers/stmmac/stmmac_platform.c | 824 - bsp/drivers/stmmac/stmmac_platform.h | 33 - bsp/drivers/stmmac/stmmac_ptp.c | 346 - bsp/drivers/stmmac/stmmac_ptp.h | 91 - bsp/drivers/stmmac/stmmac_selftests.c | 2047 - bsp/drivers/stmmac/stmmac_tc.c | 996 - bsp/drivers/stmmac/stmmac_xdp.c | 135 - bsp/drivers/stmmac/stmmac_xdp.h | 15 - bsp/drivers/stmmac/tsn_configfs.c | 674 - bsp/drivers/stmmac/tsn_core.c | 1236 - bsp/drivers/stmmac/tsn_header.c | 167 - bsp/drivers/stmmac/tsn_internal.h | 401 - bsp/drivers/stmmac/tsn_net.c | 438 - bsp/drivers/thermal/sunxi_thermal.c | 6 +- bsp/drivers/usb/Kconfig | 10 +- bsp/drivers/usb/host/ehci-sunxi.c | 90 +- bsp/drivers/usb/host/ohci-sunxi.c | 74 +- bsp/drivers/usb/host/sunxi-hci.c | 138 +- bsp/drivers/usb/host/sunxi-hci.h | 2 +- bsp/drivers/usb/host/xhci_sunxi.c | 56 +- .../usb/sunxi_usb/include/sunxi_usb_debug.h | 6 - .../usb/sunxi_usb/manager/usb_hcd_servers.c | 4 +- .../usb/sunxi_usb/manager/usb_hw_scan.c | 52 +- .../usb/sunxi_usb/manager/usb_manager.c | 50 +- .../usb/sunxi_usb/manager/usb_msg_center.c | 4 +- bsp/drivers/usb/sunxi_usb/udc/sunxi_udc.c | 211 +- .../usb/sunxi_usb/udc/sunxi_udc_board.c | 12 +- bsp/drivers/usb/sunxi_usb/udc/sunxi_udc_dma.c | 40 +- bsp/drivers/usb/sunxi_usb/usbc/usbc_dev.c | 2 +- bsp/drivers/ve/cedar-ve/cedar_ve.c | 2 +- .../video/sunxi/disp2/disp/de/disp_lcd.c | 36 +- .../disp2/hdmi2/aw_hdmi_core/aw_hdmi_core.c | 3 + .../disp2/hdmi2/aw_hdmi_core/dw_hdmi/dw_fc.c | 6 + .../disp2/hdmi2/aw_hdmi_core/dw_hdmi/dw_fc.h | 2 + bsp/include/dt-bindings/clock/sun55iw3-ccu.h | 336 +- bsp/include/dt-bindings/display/sunxi-lcd.h | 25 + bsp/include/power/axp2101.h | 253 + bsp/include/uapi/linux/cedar_ve_uapi.h | 165 + bsp/include/uapi/media/sunxi_camera_v2.h | 758 + bsp/include/uapi/rt-media/uapi_rt_media.h | 478 +- bsp/include/uapi/video/sunxi_display2.h | 1193 + bsp/include/video/sunxi_drm.h | 376 + bsp/include/video/sunxi_metadata.h | 279 +- 323 files changed, 20391 insertions(+), 176772 deletions(-) delete mode 100644 bsp/drivers/drm/panel/SQ101D_Q5DI404_84H501H.c delete mode 100644 bsp/drivers/drm/panel/panel-bp101wx1.c delete mode 100644 bsp/drivers/drm/panel/panels.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/disp_features.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_edp/edp_lowlevel.h mode change 100644 => 100755 bsp/drivers/drm/sunxi_device/hardware/lowlevel_hdmi20/Makefile delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/Makefile delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de350_feat.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de351_feat.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_bld.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_bld.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_bld_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ccsc.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ccsc.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ccsc_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_cdc.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_cdc.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_cdc_table.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_cdc_table.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_cdc_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_crc.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_crc.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_crc_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_csc_table.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_csc_table.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dci.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dci_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dcsc.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dcsc.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dcsc_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_deband.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_deband_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dither.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_dither_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_enhance.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_enhance.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fbd_atw.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fbd_atw.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fbd_atw_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fcm.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fcm_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_feat.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_feat.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fmt.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fmt.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_fmt_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_gamma.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_gamma_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ksc.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ksc.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ksc_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ovl.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ovl.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_ovl_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_rtmx.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_rtmx.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_scaler_table.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_scaler_table.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_sharp.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_sharp_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_smbl.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_smbl.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_smbl_tab.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_smbl_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_snr.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_snr.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_snr_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_tfbd.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_tfbd.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_tfbd_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_top.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_top.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vep.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vep_table.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vep_table.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vsu.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vsu.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_vsu_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_wb.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_wb.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/de35x/de_wb_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/disp_al_de.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/disp_al_tcon.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_dsi.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_dsi.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_dsi_28.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_dsi_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_dsi_type_28.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_lcd.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_lcd.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon/de_lcd_type.h delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon_feat.c delete mode 100644 bsp/drivers/drm/sunxi_device/hardware/lowlevel_v35x/tcon_feat.h delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_de.h delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_de_v35x.c delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_dsi.c delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_dsi.h delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_dsi_combo_phy.c delete mode 100644 bsp/drivers/drm/sunxi_device/sunxi_tcon_v35x.c delete mode 100644 bsp/drivers/drm/sunxi_drm_edp.h delete mode 100644 bsp/drivers/drm/sunxi_drm_fbdev.c delete mode 100644 bsp/drivers/drm/sunxi_drm_hdmi.h delete mode 100644 bsp/drivers/drm/sunxi_drm_lcd.c delete mode 100644 bsp/drivers/drm/sunxi_drm_lcd.h delete mode 100644 bsp/drivers/input/ctp/focaltech_touch/focaltech_flash/Makefile delete mode 100644 bsp/drivers/input/ctp/focaltech_touch/focaltech_flash/focaltech_upgrade_ft3427.c delete mode 100644 bsp/drivers/input/ctp/focaltech_touch/include/firmware/fw_sample.h delete mode 100644 bsp/drivers/input/ctp/focaltech_touch/include/firmware/fw_sample_hk_7inch.h delete mode 100644 bsp/drivers/stmmac/chain_mode.c delete mode 100644 bsp/drivers/stmmac/common.h delete mode 100644 bsp/drivers/stmmac/descs.h delete mode 100644 bsp/drivers/stmmac/descs_com.h delete mode 100644 bsp/drivers/stmmac/dwmac-dwc-qos-eth.c delete mode 100644 bsp/drivers/stmmac/dwmac-generic.c delete mode 100644 bsp/drivers/stmmac/dwmac100.h delete mode 100644 bsp/drivers/stmmac/dwmac1000.h delete mode 100644 bsp/drivers/stmmac/dwmac1000_core.c delete mode 100644 bsp/drivers/stmmac/dwmac1000_dma.c delete mode 100644 bsp/drivers/stmmac/dwmac100_core.c delete mode 100644 bsp/drivers/stmmac/dwmac100_dma.c delete mode 100644 bsp/drivers/stmmac/dwmac4.h delete mode 100644 bsp/drivers/stmmac/dwmac4_core.c delete mode 100644 bsp/drivers/stmmac/dwmac4_descs.c delete mode 100644 bsp/drivers/stmmac/dwmac4_descs.h delete mode 100644 bsp/drivers/stmmac/dwmac4_dma.c delete mode 100644 bsp/drivers/stmmac/dwmac4_dma.h delete mode 100644 bsp/drivers/stmmac/dwmac4_lib.c delete mode 100644 bsp/drivers/stmmac/dwmac5.c delete mode 100644 bsp/drivers/stmmac/dwmac5.h delete mode 100644 bsp/drivers/stmmac/dwmac_dma.h delete mode 100644 bsp/drivers/stmmac/dwmac_lib.c delete mode 100644 bsp/drivers/stmmac/dwxgmac2.h delete mode 100644 bsp/drivers/stmmac/dwxgmac2_core.c delete mode 100644 bsp/drivers/stmmac/dwxgmac2_descs.c delete mode 100644 bsp/drivers/stmmac/dwxgmac2_dma.c delete mode 100644 bsp/drivers/stmmac/dwxlgmac2.h delete mode 100644 bsp/drivers/stmmac/enh_desc.c delete mode 100644 bsp/drivers/stmmac/hwif.c delete mode 100644 bsp/drivers/stmmac/hwif.h delete mode 100644 bsp/drivers/stmmac/mmc.h delete mode 100644 bsp/drivers/stmmac/mmc_core.c delete mode 100644 bsp/drivers/stmmac/norm_desc.c delete mode 100644 bsp/drivers/stmmac/pcs-xpcs-nxp.c delete mode 100644 bsp/drivers/stmmac/pcs-xpcs.c delete mode 100644 bsp/drivers/stmmac/pcs-xpcs.h delete mode 100644 bsp/drivers/stmmac/ring_mode.c delete mode 100644 bsp/drivers/stmmac/stmmac.h delete mode 100644 bsp/drivers/stmmac/stmmac_ethtool.c delete mode 100644 bsp/drivers/stmmac/stmmac_hwtstamp.c delete mode 100644 bsp/drivers/stmmac/stmmac_main.c delete mode 100644 bsp/drivers/stmmac/stmmac_mdio.c delete mode 100644 bsp/drivers/stmmac/stmmac_pci.c delete mode 100644 bsp/drivers/stmmac/stmmac_pcs.h delete mode 100644 bsp/drivers/stmmac/stmmac_platform.c delete mode 100644 bsp/drivers/stmmac/stmmac_platform.h delete mode 100644 bsp/drivers/stmmac/stmmac_ptp.c delete mode 100644 bsp/drivers/stmmac/stmmac_ptp.h delete mode 100644 bsp/drivers/stmmac/stmmac_selftests.c delete mode 100644 bsp/drivers/stmmac/stmmac_tc.c delete mode 100644 bsp/drivers/stmmac/stmmac_xdp.c delete mode 100644 bsp/drivers/stmmac/stmmac_xdp.h delete mode 100644 bsp/drivers/stmmac/tsn_configfs.c delete mode 100644 bsp/drivers/stmmac/tsn_core.c delete mode 100644 bsp/drivers/stmmac/tsn_header.c delete mode 100644 bsp/drivers/stmmac/tsn_internal.h delete mode 100644 bsp/drivers/stmmac/tsn_net.c create mode 100644 bsp/include/dt-bindings/display/sunxi-lcd.h create mode 100644 bsp/include/uapi/linux/cedar_ve_uapi.h create mode 100644 bsp/include/uapi/media/sunxi_camera_v2.h create mode 100644 bsp/include/uapi/video/sunxi_display2.h create mode 100644 bsp/include/video/sunxi_drm.h diff --git a/bsp/drivers/clk/sunxi-ng/ccu-sun55iw3.c b/bsp/drivers/clk/sunxi-ng/ccu-sun55iw3.c index ab743a9ec1..a3257c3f4d 100644 --- a/bsp/drivers/clk/sunxi-ng/ccu-sun55iw3.c +++ b/bsp/drivers/clk/sunxi-ng/ccu-sun55iw3.c @@ -40,16 +40,17 @@ #define UPD_KEY_VALUE 0x8000000 #define SUN55IW3_PLL_DDR_CTRL_REG 0x0010 -static struct ccu_nkmp pll_ddr_clk = { +static struct ccu_nm pll_ddr_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(0, 1), /* input divider */ - .p = _SUNXI_CCU_DIV(1, 1), /* output divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .m = _SUNXI_CCU_DIV(0, 1), /* output divider */ + .min_rate = 600000000, + .max_rate = 2520000000, .common = { .reg = 0x0010, .hw.init = CLK_HW_INIT("pll-ddr", "dcxo24M", - &ccu_nkmp_ops, + &ccu_nm_ops, CLK_SET_RATE_UNGATE | CLK_IS_CRITICAL), }, @@ -59,8 +60,9 @@ static struct ccu_nkmp pll_ddr_clk = { static struct ccu_nm pll_peri0_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0020, .hw.init = CLK_HW_INIT("pll-peri0-parent", "dcxo24M", @@ -119,8 +121,9 @@ static CLK_FIXED_FACTOR(pll_peri0_25m_clk, "pll-peri0-25m", static struct ccu_nm pll_peri1_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0028, .hw.init = CLK_HW_INIT("pll-peri1-parent", "dcxo24M", @@ -164,87 +167,100 @@ static CLK_FIXED_FACTOR(pll_peri1_150m_clk, "pll-peri1-150m", 2, 1, 0); #define SUN55IW3_PLL_GPU_CTRL_REG 0x0030 -static struct ccu_nkmp pll_gpu_clk = { +static struct ccu_nm pll_gpu_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ - .p = _SUNXI_CCU_DIV(0, 1), /* output divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .m = _SUNXI_CCU_DIV(0, 1), /* output divider */ + .min_rate = 600000000, + .max_rate = 2520000000, .common = { .reg = 0x0030, .hw.init = CLK_HW_INIT("pll-gpu", "dcxo24M", - &ccu_nkmp_ops, + &ccu_nm_ops, CLK_SET_RATE_UNGATE), }, }; #define SUN55IW3_PLL_VIDEO0_CTRL_REG 0x0040 -static struct ccu_nkmp pll_video0_4x_clk = { +static struct ccu_nm pll_video0_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ - .p = _SUNXI_CCU_DIV(0, 1), /* output divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0040, - .hw.init = CLK_HW_INIT("pll-video0-4x", "dcxo24M", - &ccu_nkmp_ops, + .hw.init = CLK_HW_INIT("pll-video0-parent", "dcxo24M", + &ccu_nm_ops, CLK_SET_RATE_UNGATE | CLK_IGNORE_UNUSED), }, }; +static SUNXI_CCU_M(pll_video0_4x_clk, "pll-video0-4x", + "pll-video0-parent", 0x0040, 0, 1, CLK_SET_RATE_PARENT); + static CLK_FIXED_FACTOR_HW(pll_video0_3x_clk, "pll-video0-3x", - &pll_video0_4x_clk.common.hw, - 1, 3, 0); + &pll_video0_parent_clk.common.hw, + 3, 1, 0); #define SUN55IW3_PLL_VIDEO1_CTRL_REG 0x0048 -static struct ccu_nm pll_video1_4x_clk = { +static struct ccu_nm pll_video1_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0048, - .hw.init = CLK_HW_INIT("pll-video1-4x", "dcxo24M", + .hw.init = CLK_HW_INIT("pll-video1-parent", "dcxo24M", &ccu_nm_ops, CLK_SET_RATE_UNGATE | CLK_IGNORE_UNUSED), }, }; +static SUNXI_CCU_M(pll_video1_4x_clk, "pll-video1-4x", + "pll-video1-parent", 0x0048, 0, 1, CLK_SET_RATE_PARENT); + static CLK_FIXED_FACTOR_HW(pll_video1_3x_clk, "pll-video1-3x", - &pll_video1_4x_clk.common.hw, - 1, 3, 0); + &pll_video1_parent_clk.common.hw, + 3, 1, 0); #define SUN55IW3_PLL_VIDEO2_CTRL_REG 0x0050 -static struct ccu_nm pll_video2_4x_clk = { +static struct ccu_nm pll_video2_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0050, - .hw.init = CLK_HW_INIT("pll-video2-4x", "dcxo24M", + .hw.init = CLK_HW_INIT("pll-video2-parent", "dcxo24M", &ccu_nm_ops, CLK_SET_RATE_UNGATE), }, }; +static SUNXI_CCU_M(pll_video2_4x_clk, "pll-video2-4x", + "pll-video2-parent", 0x0050, 0, 1, CLK_SET_RATE_PARENT); + static CLK_FIXED_FACTOR_HW(pll_video2_3x_clk, "pll-video2-3x", - &pll_video2_4x_clk.common.hw, - 1, 3, 0); + &pll_video2_parent_clk.common.hw, + 3, 1, 0); #define SUN55IW3_PLL_VE_CTRL_REG 0x0058 -static struct ccu_nkmp pll_ve_clk = { +static struct ccu_nm pll_ve_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(0, 1), /* input divider */ - .p = _SUNXI_CCU_DIV(1, 1), /* output divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .m = _SUNXI_CCU_DIV(0, 1), /* output divider */ .sdm = _SUNXI_CCU_SDM_INFO(BIT(24), 0x158), + .min_rate = 600000000, + .max_rate = 2520000000, .common = { .reg = 0x0058, .hw.init = CLK_HW_INIT("pll-ve", "dcxo24M", - &ccu_nkmp_ops, + &ccu_nm_ops, CLK_SET_RATE_UNGATE), }, }; @@ -253,9 +269,10 @@ static struct ccu_nkmp pll_ve_clk = { static struct ccu_nm pll_video3_parent_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), .sdm = _SUNXI_CCU_SDM_INFO(BIT(24), 0x168), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0068, .hw.init = CLK_HW_INIT("pll-video3-parent", "dcxo24M", @@ -273,14 +290,14 @@ static CLK_FIXED_FACTOR_HW(pll_video3_3x_clk, "pll-video3-3x", #define SUN55IW3_PLL_AUDIO0_REG 0x078 static struct ccu_sdm_setting pll_audio0_sdm_table[] = { - { .rate = 196608000, .pattern = 0xC001EB85, .m = 5, .n = 40 }, /* 24.576 */ + { .rate = 196608000, .pattern = 0xC001D70A, .m = 10, .n = 81 }, /* 24.576 */ { .rate = 1083801600, .pattern = 0xA000A234, .m = 2, .n = 90 }, /* 22.5792 */ }; static struct ccu_nm pll_audio0_4x_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), .m = _SUNXI_CCU_DIV(16, 6), .sdm = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24), 0x178, BIT(31)), @@ -309,8 +326,9 @@ static CLK_FIXED_FACTOR(pll_audio0_div_48m_clk, "pll-audio0-div-48m", static struct ccu_nm pll_npu_4x_clk = { .enable = BIT(27) | BIT(30) | BIT(31), .lock = BIT(28), - .n = _SUNXI_CCU_MULT_MIN(8, 8, 12), - .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .n = _SUNXI_CCU_MULT_MIN_MAX(8, 8, 50, 105), + .min_rate = 1200000000, + .max_rate = 2520000000, .common = { .reg = 0x0080, .hw.init = CLK_HW_INIT("pll-npu-4x", "dcxo24M", @@ -1350,10 +1368,13 @@ static struct clk_hw_onecell_data sun55iw3_hw_clks = { [CLK_PLL_PERI1_160M] = &pll_peri1_160m_clk.hw, [CLK_PLL_PERI1_150M] = &pll_peri1_150m_clk.hw, [CLK_PLL_GPU] = &pll_gpu_clk.common.hw, + [CLK_PLL_VIDEO0_PARENT] = &pll_video0_parent_clk.common.hw, [CLK_PLL_VIDEO0_4X] = &pll_video0_4x_clk.common.hw, [CLK_PLL_VIDEO0_3X] = &pll_video0_3x_clk.hw, + [CLK_PLL_VIDEO1_PARENT] = &pll_video1_parent_clk.common.hw, [CLK_PLL_VIDEO1_4X] = &pll_video1_4x_clk.common.hw, [CLK_PLL_VIDEO1_3X] = &pll_video1_3x_clk.hw, + [CLK_PLL_VIDEO2_PARENT] = &pll_video2_parent_clk.common.hw, [CLK_PLL_VIDEO2_4X] = &pll_video2_4x_clk.common.hw, [CLK_PLL_VIDEO2_3X] = &pll_video2_3x_clk.hw, [CLK_PLL_VIDEO3_PARENT] = &pll_video3_parent_clk.common.hw, @@ -1532,8 +1553,11 @@ static struct ccu_common *sun55iw3_ccu_clks[] = { &pll_peri1_800m_clk.common, &pll_peri1_480m_clk.common, &pll_gpu_clk.common, + &pll_video0_parent_clk.common, &pll_video0_4x_clk.common, + &pll_video1_parent_clk.common, &pll_video1_4x_clk.common, + &pll_video2_parent_clk.common, &pll_video2_4x_clk.common, &pll_video3_parent_clk.common, &pll_video3_4x_clk.common, @@ -1725,11 +1749,6 @@ static const u32 sun55iw3_pll_regs[] = { SUN55IW3_PLL_NPU_CTRL_REG, }; -static const u32 sun55iw3_pll_video_regs[] = { - SUN55IW3_PLL_VIDEO1_CTRL_REG, - SUN55IW3_PLL_VIDEO2_CTRL_REG, -}; - static const u32 sun55iw3_usb_clk_regs[] = { SUN55IW3_USB0_CTRL_REG, SUN55IW3_USB1_CTRL_REG, @@ -1767,14 +1786,7 @@ static int sun55iw3_ccu_probe(struct platform_device *pdev) set_reg(reg + SUN55IW3_PLL_PERIPH1_PATTERN0_REG, 0xd1303333, 32, 0); set_reg(reg +SUN55IW3_PLL_PERI1_CTRL_REG, 1, 1, 24); - /* - * Force the output divider of video PLLs to 0. - * - * See the comment before pll-video0 definition for the reason. - */ - for (i = 0; i < ARRAY_SIZE(sun55iw3_pll_video_regs); i++) { - set_reg(reg + sun55iw3_pll_video_regs[i], 0x0, 1, 0); - } + set_reg(reg + SUN55IW3_PLL_NPU_CTRL_REG, 0x0, 1, 1); /* Enforce m1 = 0, m0 = 1 for Audio PLL */ set_reg(reg + SUN55IW3_PLL_AUDIO0_REG, 0x1, 0, 0); diff --git a/bsp/drivers/clk/sunxi-ng/ccu_mult.h b/bsp/drivers/clk/sunxi-ng/ccu_mult.h index ed2e9ff118..bbd8163d51 100644 --- a/bsp/drivers/clk/sunxi-ng/ccu_mult.h +++ b/bsp/drivers/clk/sunxi-ng/ccu_mult.h @@ -24,6 +24,9 @@ struct ccu_mult_internal { .width = _width, \ } +#define _SUNXI_CCU_MULT_MIN_MAX(_shift, _width, _min, _max) \ + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, _max) + #define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \ _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, 0) diff --git a/bsp/drivers/clk/sunxi-ng/ccu_nm.c b/bsp/drivers/clk/sunxi-ng/ccu_nm.c index a8e35c7671..fae204bd06 100644 --- a/bsp/drivers/clk/sunxi-ng/ccu_nm.c +++ b/bsp/drivers/clk/sunxi-ng/ccu_nm.c @@ -256,8 +256,10 @@ static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long _rate, spin_lock_irqsave(nm->common.lock, flags); reg = readl(nm->common.base + nm->common.reg); - reg &= ~GENMASK(nm->n.width + nm->n.shift - 1, nm->n.shift); - reg &= ~GENMASK(nm->m.width + nm->m.shift - 1, nm->m.shift); + if (nm->n.width) + reg &= ~GENMASK(nm->n.width + nm->n.shift - 1, nm->n.shift); + if (nm->m.width) + reg &= ~GENMASK(nm->m.width + nm->m.shift - 1, nm->m.shift); reg |= (_nm.n - nm->n.offset) << nm->n.shift; reg |= (_nm.m - nm->m.offset) << nm->m.shift; diff --git a/bsp/drivers/crashdump/sunxi-dump2pc.c b/bsp/drivers/crashdump/sunxi-dump2pc.c index 4e33f73e92..aa049afd2c 100644 --- a/bsp/drivers/crashdump/sunxi-dump2pc.c +++ b/bsp/drivers/crashdump/sunxi-dump2pc.c @@ -263,8 +263,8 @@ static int sunxi_dump_panic_event(struct notifier_block *self, unsigned long val return NOTIFY_DONE; } -#if IS_REACHABLE(CONFIG_AW_DISP2) - sunxi_kernel_panic_printf("CRASHDUMP NOW, PLEASE CONNECT TO TIGERDUMP TOOL\n AND KEEP POWER ON"); +#if IS_REACHABLE(CONFIG_AW_DISP2) || IS_REACHABLE(CONFIG_AW_DRM) + sunxi_kernel_panic_printf("CRASHDUMP NOW,\n PLEASE CONNECT TO TIGERDUMP TOOL\n AND KEEP POWER ON"); #endif flush_cache_all(); diff --git a/bsp/drivers/drm/Kconfig b/bsp/drivers/drm/Kconfig index 3ea1d9414d..2a8dfc93df 100644 --- a/bsp/drivers/drm/Kconfig +++ b/bsp/drivers/drm/Kconfig @@ -20,6 +20,7 @@ config AW_DRM_DE help If you want use DE of Version 35X, select it. +# remove it after both tcon_lcd/tcon_tv ready? config AW_DRM_TCON bool "Support Timing Controller(TCON)" depends on AW_DRM @@ -27,6 +28,13 @@ config AW_DRM_TCON help If you want use TCON, select it. +config AW_DRM_TCON_TV + bool "Support Timing Controller(TCON_TV)" + depends on AW_DRM + default y + help + If you want use TCON_TV, select it. + config AW_DRM_TCON_TOP bool "Support TCON TOP" depends on AW_DRM @@ -34,36 +42,33 @@ config AW_DRM_TCON_TOP help If you want use TCON TOP, select it. -config AW_DRM_FBDEV_BOOTLOGO - bool "Support Bootlogo Output from uboot" - depends on AW_DRM_LCD +config AW_DRM_LVDS + bool "Support LVDS Output" + depends on AW_DRM + select GENERIC_PHY default n help - If you want bootlogo output for drm driver, select it. + If you want use lvds, select it. -menuconfig AW_DRM_LCD - bool "Support LCD Output" +config AW_DRM_RGB + bool "Support RGB Output" depends on AW_DRM - default y + select GENERIC_PHY + default n help - If you want lcd output for drm driver, select it. + If you want use rgb, select it. -config AW_DRM_LCD_DSI - bool "Support LCD-DSI Output" +config AW_DRM_DSI + bool "Support DSI Output" + depends on AW_DRM select DRM_MIPI_DSI - depends on AW_DRM_LCD + select GENERIC_PHY + select GENERIC_PHY_MIPI_DPHY default n help If you want lcd-dsi output for drm driver, select it. -config AW_DRM_LCD_DSI_COMBO_PHY - bool "Support LCD-DSI COMBO PHY" - depends on AW_DRM_LCD_DSI - default y - help - If you want lcd-dsi combp phy, select it. - -menuconfig AW_DRM_HDMI_TX +config AW_DRM_HDMI_TX tristate "Support Hdmi Output" depends on AW_DRM select DRM_DISPLAY_HDCP_HELPER @@ -72,49 +77,21 @@ menuconfig AW_DRM_HDMI_TX help If you want hdmi output for drm driver, select it. -menuconfig AW_DRM_HDMI14 +config AW_DRM_HDMI14 bool "Support HDMI1.4 Output" depends on AW_DRM_HDMI_TX default n help If you want hdmi1.4 output for drm driver, select it. -menuconfig AW_DRM_HDMI20 +config AW_DRM_HDMI20 bool "Support HDMI2.0 Output" depends on AW_DRM_HDMI_TX default y - help - If you want hdmi2.0 output for drm driver, select it. - -config AW_HDMI20_HDCP14 - bool "HDMI2.0 HDCP1.4" - depends on (AW_DRM_HDMI20) - default n - help - Say Y here if you want to enable hdcp1.4 function. - Say N here if you want to disable hdcp1.4 function. - If unsure, say N. - -config AW_HDMI20_HDCP22 - bool "HDMI2.0 HDCP2.2" - depends on (AW_DRM_HDMI20) - default n - help - Say Y here if you want to enable hdcp2.2 function. - Say N here if you want to disable hdcp2.2 function. - If unsure, say N. - -config AW_HDMI20_CEC - bool "HDMI2.0 CEC" - depends on (AW_DRM_HDMI20) - default n select CEC_CORE select CEC_NOTIFIER help - Say Y here if you want to enable cec function. - Also enable CEC_CORE and CEC_NOTIFIER. - Say N here if you want to disable cec function. - If unsure, say N. + If you want hdmi2.0 output for drm driver, select it. menuconfig AW_DRM_EDP bool "Support eDP Output" @@ -124,21 +101,43 @@ menuconfig AW_DRM_EDP help If you want edp/dp output for drm driver, select it. -config AW_DRM_EDP_PHY_USED +config AW_DRM_EDP_CONTROLLER_USED def_bool n depends on (AW_DRM_EDP) default n help Selected when aw edp phy used. +config AW_DRM_DP_HDCP + def_bool n + bool "Support HDCP For DisplayPort" + depends on (AW_DRM_EDP) + default n + help + Selected when hdcp need authenticate by software. + config AW_DRM_INNO_EDP13 - bool "Support inno edp 1.3 PHY" + bool "Support inno edp 1.3 controller" + depends on AW_DRM_EDP + select AW_DRM_EDP_CONTROLLER_USED + default n + help + If you want inno edp 1.3 as edp controller, select it. + +config AW_DRM_TRILINEAR_EDP14 + bool "Support trilinear edp 1.4 controller" depends on AW_DRM_EDP - select AW_DRM_EDP_PHY_USED + select AW_DRM_EDP_CONTROLLER_USED + select AW_DRM_DP_HDCP + select AW_CADENCE_COMBOPHY default n help - If you want inno edp 1.3 as edp phy, select it. + If you want trilinear edp 1.4 as edp controller, select it. +menu "sunxi drm panels select" + depends on AW_DRM source "bsp/drivers/drm/panel/Kconfig" +endmenu +source "bsp/drivers/drm/phy/Kconfig" endmenu diff --git a/bsp/drivers/drm/Makefile b/bsp/drivers/drm/Makefile index 87b6589823..ca5555d206 100644 --- a/bsp/drivers/drm/Makefile +++ b/bsp/drivers/drm/Makefile @@ -1,39 +1,64 @@ # SPDX-License-Identifier: GPL-2.0-only -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(dir $(mkfile_path)) +ccflags-y += -I$(srctree)/$(obj)/sunxi_device/hardware/ +ccflags-y += -I$(srctree)/$(obj)/sunxi_device/hardware/lowlevel_lcd/ +ccflags-y += -I$(srctree)/$(obj)/sunxi_device/hardware/lowlevel_tcon/ +ccflags-y += -I$(srctree)/$(obj)/phy/ +ccflags-y += -I$(srctree)/$(obj)/lib/inc/ -ccflags-y += -I$(mkfile_dir)/sunxi_device/hardware -ccflags-y += -I$(mkfile_dir)/ +# base +sunxidrm-y += sunxi_drm_drv.o sunxi_drm_crtc.o sunxi_drm_intf.o +sunxidrm-y += sunxi_drm_debug.o kernel_panic_printf.o -# Although now only support v35x, new platform support should not add new dir -ccflags-y += -I$(mkfile_dir)/sunxi_device/hardware/lowlevel_v35x/tcon -ccflags-y += -I$(mkfile_dir)/sunxi_device/hardware/lowlevel_v35x/ -ccflags-y += -DDE_VERSION_V35X -include $(srctree)/$(obj)/sunxi_device/hardware/lowlevel_v35x/Makefile +#fbdev +sunxidrm-$(CONFIG_DRM_FBDEV_EMULATION) += sunxi_fbdev_core.o sunxi_fbdev_platform.o -obj-$(CONFIG_AW_DRM) += sunxidrm.o +# de +include $(srctree)/$(obj)/sunxi_device/hardware/lowlevel_de/Makefile +sunxidrm-$(CONFIG_AW_DRM_DE) += $(de_obj) -sunxidrm-y += sunxi_drm_drv.o sunxi_drm_crtc.o sunxi_drm_intf.o sunxi_drm_fbdev.o -sunxidrm-y += $(obj_low) +# tcon +include $(srctree)/$(obj)/sunxi_device/hardware/lowlevel_tcon/Makefile +sunxidrm-$(CONFIG_AW_DRM_TCON) += $(tcon_obj) \ + sunxi_device/sunxi_tcon.o \ + sunxi_device/hardware/lowlevel_lcd/tcon_lcd.o -sunxidrm-$(CONFIG_AW_DRM_DE) += sunxi_device/sunxi_de_v35x.o -sunxidrm-$(CONFIG_AW_DRM_TCON) += sunxi_device/sunxi_tcon_v35x.o +# tcon_top sunxidrm-$(CONFIG_AW_DRM_TCON_TOP) += sunxi_device/sunxi_tcon_top.o -sunxidrm-$(CONFIG_AW_DRM_LCD) += sunxi_drm_lcd.o panel/panels.o -sunxidrm-$(CONFIG_AW_DRM_LCD_DSI) += sunxi_device/sunxi_dsi.o -sunxidrm-$(CONFIG_AW_DRM_LCD_DSI_COMBO_PHY) += sunxi_device/sunxi_dsi_combo_phy.o -# add HDMI +# dsi +sunxidrm-$(CONFIG_AW_DRM_DSI) += sunxi_drm_dsi.o \ + sunxi_device/hardware/lowlevel_lcd/dsi_v1.o + +# lvds +sunxidrm-$(CONFIG_AW_DRM_LVDS) += sunxi_drm_lvds.o + +# rgb +sunxidrm-$(CONFIG_AW_DRM_RGB) += sunxi_drm_rgb.o + +# HDMI sunxidrm-$(CONFIG_AW_DRM_HDMI_TX) += sunxi_drm_hdmi.o sunxidrm-$(CONFIG_AW_DRM_HDMI_TX) += sunxi_device/sunxi_hdmi.o -ccflags-$(CONFIG_AW_DRM_HDMI20) += -I$(mkfile_dir)/sunxi_device/hardware/lowlevel_hdmi20/ +ccflags-$(CONFIG_AW_DRM_HDMI20) += -I$(src)/sunxi_device/hardware/lowlevel_hdmi20/ include $(srctree)/$(obj)/sunxi_device/hardware/lowlevel_hdmi20/Makefile sunxidrm-$(CONFIG_AW_DRM_HDMI20) += $(obj_low_hdmi) # edp sunxidrm-$(CONFIG_AW_DRM_EDP) += sunxi_drm_edp.o sunxidrm-$(CONFIG_AW_DRM_EDP) += sunxi_device/sunxi_edp.o +sunxidrm-$(CONFIG_AW_DRM_DP_HDCP) += sunxi_device/sunxi_edp_hdcp.o +sunxidrm-$(CONFIG_AW_DRM_DP_HDCP) += lib/src/sha1.o sunxidrm-$(CONFIG_AW_DRM_INNO_EDP13) += sunxi_device/hardware/lowlevel_edp/inno_edp13/inno_edp13.o +sunxidrm-$(CONFIG_AW_DRM_TRILINEAR_EDP14) += sunxi_device/hardware/lowlevel_edp/trilinear_dp14/trilinear_dp14.o + +# phy +obj-$(CONFIG_AW_DRM_PHY) += phy/ # panel -obj-$(CONFIG_AW_DRM_PANEL) += panel/ +obj-y += panel/ + +# tracepoints +# define_trace.h needs to know how to find our header +CFLAGS_sunxi_drm_trace.o := -I$(src) +sunxidrm-y += sunxi_drm_trace.o + +obj-$(CONFIG_AW_DRM) += sunxidrm.o diff --git a/bsp/drivers/drm/panel/Kconfig b/bsp/drivers/drm/panel/Kconfig index 3b5d47c70b..5d89bd64ce 100644 --- a/bsp/drivers/drm/panel/Kconfig +++ b/bsp/drivers/drm/panel/Kconfig @@ -1,32 +1,41 @@ # SPDX-License-Identifier: GPL-2.0-or-later -menuconfig AW_DRM_PANEL - tristate "Support panel based on DRM framework" - depends on AW_DRM +config PANEL_DSI_GENERAL + tristate "dsi general panel" + depends on (AW_DRM) + select VIDEOMODE_HELPERS + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_PWM default n help - If you want use DRM panel, select it. + If you want to support general dsi panel, select it. -config PANEL_SQ101D_Q5DI404_84H501H - bool "SQ101D_Q5DI404_84H501H panel" - depends on (AW_DRM_PANEL) +config PANEL_LVDS_GENERAL + tristate "lvds general panel" + depends on (AW_DRM) select VIDEOMODE_HELPERS + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_PWM default n help - If you want to support PANEL_SQ101D_Q5DI404_84H501H panel, select it. + If you want to support general lvds panel, select it. -config PANEL_BP101WX1 - bool "BP101WX1 LVDS panel" - depends on (AW_DRM_PANEL) +config PANEL_RGB_GENERAL + tristate "rgb general panel" + depends on (AW_DRM) select VIDEOMODE_HELPERS + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_PWM default n help - If you want to support PANEL_BP101WX1 panel, select it. + If you want to support general rgb panel, select it. config PANEL_EDP_GENERAL tristate "eDP general drm panel" - depends on (AW_DRM_PANEL) + depends on (AW_DRM) select VIDEOMODE_HELPERS + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_PWM default n help If you want to support general edp panel, select it. diff --git a/bsp/drivers/drm/panel/Makefile b/bsp/drivers/drm/panel/Makefile index df6e680abf..74bf9183f2 100644 --- a/bsp/drivers/drm/panel/Makefile +++ b/bsp/drivers/drm/panel/Makefile @@ -8,10 +8,7 @@ ccflags-y += -I$(mkfile_dir)/../sunxi_device/hardware ccflags-y += -I$(mkfile_dir)/../sunxi_device/hardware/lowlevel_v35x/tcon ccflags-y += -I$(mkfile_dir)/../sunxi_device/hardware/lowlevel_v35x/ - - -obj-$(CONFIG_AW_DRM_PANEL) += sunxi_drm_panel.o -#sunxi_drm_panel-y += panels.o -sunxi_drm_panel-$(CONFIG_PANEL_SQ101D_Q5DI404_84H501H) += SQ101D_Q5DI404_84H501H.o -sunxi_drm_panel-$(CONFIG_PANEL_BP101WX1) += panel-bp101wx1.o -sunxi_drm_panel-$(CONFIG_PANEL_EDP_GENERAL) += edp_general_panel.o +obj-$(CONFIG_PANEL_EDP_GENERAL) += edp_general_panel.o +obj-$(CONFIG_PANEL_DSI_GENERAL) += panel-dsi.o +obj-$(CONFIG_PANEL_LVDS_GENERAL) += panel-lvds.o +obj-$(CONFIG_PANEL_RGB_GENERAL) += panel-rgb.o diff --git a/bsp/drivers/drm/panel/SQ101D_Q5DI404_84H501H.c b/bsp/drivers/drm/panel/SQ101D_Q5DI404_84H501H.c deleted file mode 100644 index 7fc34591ed..0000000000 --- a/bsp/drivers/drm/panel/SQ101D_Q5DI404_84H501H.c +++ /dev/null @@ -1,351 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* Copyright(c) 2020 - 2023 Allwinner Technology Co.,Ltd. All rights reserved. */ -/* - * SQ101D_Q5DI404_84H501H panel driver - * - * Copyright (c) 2007-2022 Allwinnertech Co., Ltd. - * Author: huangyongxing - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include "panels.h" -//TODO remove private dsi api -#include "../sunxi_device/sunxi_dsi.h" - -#define REGFLAG_DELAY 0XFE -#define REGFLAG_END_OF_TABLE 0xFD // END OF REGISTERS MARKER - -struct LCM_setting_table { - u8 cmd; - u32 count; - u8 para_list[64]; -}; - -/*add panel initialization below*/ - -static struct LCM_setting_table lcm_initialization_setting[] = { - - { 0x11, 1, { 0x00 } }, - { REGFLAG_DELAY, REGFLAG_DELAY, { 120 } }, - - { 0x29, 1, { 0x00 } }, - { REGFLAG_DELAY, REGFLAG_DELAY, { 20 } }, - { REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} } -}; - -static void LCD_panel_init(struct sunxi_panel *panel) -{ - __u32 i; - struct device *dsi = panel->dsi; - - sunxi_dsi_clk_enable(dsi); - msleep(20); - sunxi_dsi_dcs_write_0para(dsi, DSI_DCS_SOFT_RESET); - msleep(10); - - for (i = 0;; i++) { - if (lcm_initialization_setting[i].count == REGFLAG_END_OF_TABLE) - break; - else if (lcm_initialization_setting[i].count == REGFLAG_DELAY) - msleep(lcm_initialization_setting[i].para_list[0]); - else - sunxi_dsi_dcs_wr( - dsi, lcm_initialization_setting[i].cmd, - lcm_initialization_setting[i].para_list, - lcm_initialization_setting[i].count); - //break; - } - - return; -} - -static void LCD_panel_exit(struct sunxi_panel *panel) -{ - struct device *dsi = panel->dsi; - sunxi_dsi_dcs_write_0para(dsi, DSI_DCS_SET_DISPLAY_OFF); - msleep(20); - sunxi_dsi_dcs_write_0para(dsi, DSI_DCS_ENTER_SLEEP_MODE); - msleep(80); -} - -static void sunxi_panel_extend_para_populate(struct sunxi_panel *sunxi_panel) -{ - struct panel_extend_para *info = &sunxi_panel->extend_para; - u32 i = 0, j = 0; - u32 items; - u8 lcd_gamma_tbl[][2] = { - //{input value, corrected value} - { 0, 0 }, { 15, 15 }, { 30, 30 }, { 45, 45 }, - { 60, 60 }, { 75, 75 }, { 90, 90 }, { 105, 105 }, - { 120, 120 }, { 135, 135 }, { 150, 150 }, { 165, 165 }, - { 180, 180 }, { 195, 195 }, { 210, 210 }, { 225, 225 }, - { 240, 240 }, { 255, 255 }, - }; - - u32 lcd_cmap_tbl[2][3][4] = { - { - { LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3 }, - { LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3 }, - { LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3 }, - }, - { - { LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0 }, - { LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0 }, - { LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0 }, - }, - }; - - items = sizeof(lcd_gamma_tbl) / 2; - for (i = 0; i < items - 1; i++) { - u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0]; - - for (j = 0; j < num; j++) { - u32 value = 0; - - value = lcd_gamma_tbl[i][1] + - ((lcd_gamma_tbl[i + 1][1] - - lcd_gamma_tbl[i][1]) * - j) / num; - info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] = - (value << 16) + (value << 8) + value; - } - } - info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) + - (lcd_gamma_tbl[items - 1][1] << 8) + - lcd_gamma_tbl[items - 1][1]; - - memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl)); -} - -static int sq101d_panel_unprepare(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - - sunxi_panel_reset_assert(sunxi_panel); - msleep(5); - regulator_disable(sunxi_panel->supply[0]); - msleep(20); - return 0; -} - -static int sq101d_panel_prepare(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - int ret; - - sunxi_panel_reset_assert(sunxi_panel); - ret = regulator_enable(sunxi_panel->supply[0]); - if (ret < 0) { - dev_err(sunxi_panel->dev, "failed to enable supply: %d\n", ret); - return ret; - } - msleep(20); - - sunxi_panel_reset_deassert(sunxi_panel); - msleep(5); - - return 0; -} - -static int sq101d_panel_enable(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - - LCD_panel_init(sunxi_panel); - - msleep(10); - sunxi_panel_enable_gpio(sunxi_panel); - return 0; -} - -static int sq101d_panel_disable(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - - LCD_panel_exit(sunxi_panel); - msleep(20); - - return 0; -} - -static int sq101d_panel_get_modes(struct drm_panel *panel, - struct drm_connector *connector) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - struct drm_display_mode *mode; - - mode = drm_mode_create(connector->dev); - if (!mode) - return 0; - - drm_display_mode_from_videomode(&sunxi_panel->video_mode, mode); - mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(connector, mode); - - // connector->display_info.width_mm = lvds->width; - // connector->display_info.height_mm = lvds->height; - /* drm_display_info_set_bus_formats(&connector->display_info, - &lvds->bus_format, 1);*/ - /* connector->display_info.bus_flags = lvds->data_mirror - ? DRM_BUS_FLAG_DATA_LSB_TO_MSB - : DRM_BUS_FLAG_DATA_MSB_TO_LSB;*/ - // drm_connector_set_panel_orientation(connector, lvds->orientation); - - return 1; -} -/* -static int sq101d_panel_get_timings(struct drm_panel *panel, - unsigned int num_timings, - struct display_timing *timings) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - - if (timings) - *timings = kmemdup(&sunxi_panel->timings, - sizeof(struct display_timing), GFP_KERNEL); - ; - - return sunxi_panel->num_timings; -}*/ - -static const struct drm_panel_funcs sq101d_panel_funcs = { - .prepare = sq101d_panel_prepare, - .unprepare = sq101d_panel_unprepare, - .get_modes = sq101d_panel_get_modes, - .enable = sq101d_panel_enable, - .disable = sq101d_panel_disable, -/* .get_timings = sq101d_panel_get_timings,*/ -}; - -static int sq101d_panel_parse_dt(struct sunxi_panel *sunxi_panel) -{ - int ret; - - ret = sunxi_panel_parse_timings(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse timings failed\n"); - return ret; - } - - ret = sunxi_panel_parse_misc(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse misc failed\n"); - return ret; - } - - ret = sunxi_panel_parse_dsi(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse dsi failed\n"); - return ret; - } - - return 0; -} - -static int sq101d_panel_probe(struct mipi_dsi_device *dsi) -{ - struct sunxi_panel *sunxi_panel; - int ret; - - sunxi_panel = - devm_kzalloc(&dsi->dev, sizeof(struct sunxi_panel), GFP_KERNEL); - if (!sunxi_panel) - return -ENOMEM; - - sunxi_panel->dev = &dsi->dev; - sunxi_panel->num_timings = 1; - - dev_err(sunxi_panel->dev, "panel initi\n"); - ret = sq101d_panel_parse_dt(sunxi_panel); - if (ret) - return ret; - - sunxi_panel_extend_para_populate(sunxi_panel); - - ret = sunxi_panel_get_power(sunxi_panel); - if (ret) - return ret; - - /* Get GPIOs*/ - ret = sunxi_panel_get_enable_gpio(sunxi_panel); - if (ret) - return ret; - - ret = sunxi_panel_get_reset_gpio(sunxi_panel); - if (ret) - return ret; - - /* Register the panel. */ - drm_panel_init(&sunxi_panel->panel, sunxi_panel->dev, - &sq101d_panel_funcs, DRM_MODE_CONNECTOR_DSI); - - /* Get backlight controller. */ - ret = drm_panel_of_backlight(&sunxi_panel->panel); - if (ret) - return ret; - - drm_panel_add(&sunxi_panel->panel); - - dev_set_drvdata(sunxi_panel->dev, sunxi_panel); - return 0; -} - -static int sq101d_panel_remove(struct mipi_dsi_device *dsi) -{ - struct sunxi_panel *sunxi_panel = dev_get_drvdata(&dsi->dev); - - drm_panel_remove(&sunxi_panel->panel); - - drm_panel_disable(&sunxi_panel->panel); - - return 0; -} - -static const struct of_device_id sq101d_of_table[] = { - { - .compatible = "SQ101D_Q5DI404_84H501", - }, - { /* Sentinel */ }, -}; - -static struct mipi_dsi_driver sq101d_dsi_panel_driver = { - .driver = { - .name = "panel-SQ101D_Q5DI404_84H501", - .of_match_table = sq101d_of_table, - }, - .probe = sq101d_panel_probe, - .remove = sq101d_panel_remove, -}; - -static int __init panel_init(void) -{ - int err = -EINVAL; - - if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) { - err = mipi_dsi_driver_register(&sq101d_dsi_panel_driver); - } - - return err; -} - -module_init(panel_init); -/* -MODULE_DEVICE_TABLE(of, sq101d_of_table); - -static struct platform_driver sq101d_panel_driver = { - .probe = sq101d_panel_probe, - .remove = sq101d_panel_remove, - .driver = { - .name = "SQ101D", - .of_match_table = sq101d_of_table, - }, -}; - -module_platform_driver(sq101d_panel_driver); -*/ -MODULE_AUTHOR("Huangyongxing "); -MODULE_DESCRIPTION("SQ101D_Q5DI404_84H501 Panel Driver"); -MODULE_LICENSE("GPL"); diff --git a/bsp/drivers/drm/panel/edp_general_panel.c b/bsp/drivers/drm/panel/edp_general_panel.c index 7923783943..24897f51b2 100644 --- a/bsp/drivers/drm/panel/edp_general_panel.c +++ b/bsp/drivers/drm/panel/edp_general_panel.c @@ -39,7 +39,6 @@ struct general_panel { struct gpio_desc *enable_gpio[GPIO_MAX]; struct gpio_desc *reset_gpio; enum drm_panel_orientation orientation; - bool non_edid_modes; }; static inline struct general_panel *to_general_panel(struct drm_panel *panel) @@ -113,7 +112,9 @@ static int general_panel_get_modes(struct drm_panel *panel, struct edid *edid = NULL; int mode_num = 0; - if (edp_panel->non_edid_modes) { + if ((edp_panel->video_mode.hactive != 0) && + (edp_panel->video_mode.vactive != 0) && + (edp_panel->video_mode.pixelclock != 0)) { mode = drm_mode_create(connector->dev); if (!mode) return 0; @@ -122,27 +123,15 @@ static int general_panel_get_modes(struct drm_panel *panel, mode->type |= DRM_MODE_TYPE_USERDEF; drm_mode_probed_add(connector, mode); mode_num++; - } else { - if (connector->edid_blob_ptr) - edid = drm_edid_duplicate(connector->edid_blob_ptr->data); - else - DRM_ERROR("edid for connector not update yet!\n"); - - mode_num += drm_add_edid_modes(connector, edid); - - if (!mode_num) { - mode = drm_mode_create(connector->dev); - if (!mode) - return 0; - - DRM_ERROR("parse mode from edid fail, try to parse mode from dts!\n"); - drm_display_mode_from_videomode(&edp_panel->video_mode, mode); - mode->type |= DRM_MODE_TYPE_USERDEF; - drm_mode_probed_add(connector, mode); - mode_num++; - } } + if (connector->edid_blob_ptr) + edid = drm_edid_duplicate(connector->edid_blob_ptr->data); + else + DRM_ERROR("edid for connector not update yet!\n"); + + mode_num += drm_add_edid_modes(connector, edid); + drm_connector_set_panel_orientation(connector, edp_panel->orientation); return mode_num; @@ -167,11 +156,6 @@ static int general_panel_parse_dt(struct general_panel *edp_panel) edp_panel->orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; } - if (of_find_property(np, "non-edid-modes", NULL)) - edp_panel->non_edid_modes = true; - else - edp_panel->non_edid_modes = false; - ret = of_get_display_timing(np, "panel-timing", &timing); if (ret < 0) { dev_err(edp_panel->dev, "%pOF: problems parsing panel-timing (%d)\n", diff --git a/bsp/drivers/drm/panel/panel-bp101wx1.c b/bsp/drivers/drm/panel/panel-bp101wx1.c deleted file mode 100644 index e952b5d6fb..0000000000 --- a/bsp/drivers/drm/panel/panel-bp101wx1.c +++ /dev/null @@ -1,269 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* Copyright(c) 2020 - 2023 Allwinner Technology Co.,Ltd. All rights reserved. */ -/* - * BP101WX1 LVDS panel driver - * - * Copyright (c) 2007-2022 Allwinnertech Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include "panels.h" - -static void sunxi_panel_extend_para_populate(struct sunxi_panel *sunxi_panel) -{ - struct panel_extend_para *info = &sunxi_panel->extend_para; - u32 i = 0, j = 0; - u32 items; - u8 lcd_gamma_tbl[][2] = { - //{input value, corrected value} - { 0, 0 }, { 15, 15 }, { 30, 30 }, { 45, 45 }, - { 60, 60 }, { 75, 75 }, { 90, 90 }, { 105, 105 }, - { 120, 120 }, { 135, 135 }, { 150, 150 }, { 165, 165 }, - { 180, 180 }, { 195, 195 }, { 210, 210 }, { 225, 225 }, - { 240, 240 }, { 255, 255 }, - }; - - u32 lcd_cmap_tbl[2][3][4] = { - { - { LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3 }, - { LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3 }, - { LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3 }, - }, - { - { LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0 }, - { LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0 }, - { LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0 }, - }, - }; - - items = sizeof(lcd_gamma_tbl) / 2; - for (i = 0; i < items - 1; i++) { - u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0]; - - for (j = 0; j < num; j++) { - u32 value = 0; - - value = lcd_gamma_tbl[i][1] + - ((lcd_gamma_tbl[i + 1][1] - - lcd_gamma_tbl[i][1]) * - j) / num; - info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] = - (value << 16) + (value << 8) + value; - } - } - info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) + - (lcd_gamma_tbl[items - 1][1] << 8) + - lcd_gamma_tbl[items - 1][1]; - - memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl)); -} - -static int bp101wx1_panel_unprepare(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - int ret; - int i; - - for (i = 2; i >= 0; i--) { - if (sunxi_panel->supply[i]) - ret = regulator_disable(sunxi_panel->supply[i]); - if (ret < 0) { - dev_err(sunxi_panel->dev, - "failed to disable supply: %d ret= %d\n", i, - ret); - return ret; - } - } - - msleep(5); - return 0; -} - -static int bp101wx1_panel_prepare(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - int ret; - int i; - - for (i = 0; i < 3; i++) { - if (sunxi_panel->supply[i]) - ret = regulator_enable(sunxi_panel->supply[i]); - if (ret < 0) { - dev_err(sunxi_panel->dev, - "failed to enable supply: %d ret= %d\n", i, - ret); - return ret; - } - } - - msleep(5); - return 0; -} - -static int bp101wx1_panel_enable(struct drm_panel *panel) -{ - return 0; -} - -static int bp101wx1_panel_disable(struct drm_panel *panel) -{ - return 0; -} - -static int bp101wx1_panel_get_modes(struct drm_panel *panel, - struct drm_connector *connector) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - struct drm_display_mode *mode; - - mode = drm_mode_create(connector->dev); - if (!mode) - return 0; - - drm_display_mode_from_videomode(&sunxi_panel->video_mode, mode); - mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(connector, mode); - - // connector->display_info.width_mm = lvds->width; - // connector->display_info.height_mm = lvds->height; - /* drm_display_info_set_bus_formats(&connector->display_info, - &lvds->bus_format, 1);*/ - /* connector->display_info.bus_flags = lvds->data_mirror - ? DRM_BUS_FLAG_DATA_LSB_TO_MSB - : DRM_BUS_FLAG_DATA_MSB_TO_LSB;*/ - // drm_connector_set_panel_orientation(connector, lvds->orientation); - - return 1; -} -/* -static int bp101wx1_panel_get_timings(struct drm_panel *panel, - unsigned int num_timings, - struct display_timing *timings) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - - if (timings) - *timings = kmemdup(&sunxi_panel->timings, - sizeof(struct display_timing), GFP_KERNEL); - ; - - return sunxi_panel->num_timings; -}*/ - -static const struct drm_panel_funcs bp101wx1_panel_funcs = { - .prepare = bp101wx1_panel_prepare, - .unprepare = bp101wx1_panel_unprepare, - .get_modes = bp101wx1_panel_get_modes, - .enable = bp101wx1_panel_enable, - .disable = bp101wx1_panel_disable, -/* .get_timings = bp101wx1_panel_get_timings,*/ -}; - -static int bp101wx1_panel_parse_dt(struct sunxi_panel *sunxi_panel) -{ - int ret; - - ret = sunxi_panel_parse_timings(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse timings failed\n"); - return ret; - } - - ret = sunxi_panel_parse_misc(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse misc failed\n"); - return ret; - } - - ret = sunxi_panel_parse_lvds(sunxi_panel); - if (ret) { - dev_err(sunxi_panel->dev, "sunxi panel parse lvds failed\n"); - return ret; - } - - return 0; -} - -static int bp101wx1_panel_probe(struct platform_device *pdev) -{ - struct sunxi_panel *sunxi_panel; - int ret; - - sunxi_panel = devm_kzalloc(&pdev->dev, sizeof(struct sunxi_panel), - GFP_KERNEL); - if (!sunxi_panel) - return -ENOMEM; - - sunxi_panel->dev = &pdev->dev; - sunxi_panel->num_timings = 1; - - dev_err(sunxi_panel->dev, "panel init\n"); - ret = bp101wx1_panel_parse_dt(sunxi_panel); - if (ret) - return ret; - - sunxi_panel_extend_para_populate(sunxi_panel); - - ret = sunxi_panel_get_power(sunxi_panel); - if (ret) - return ret; - - /* Get GPIOs*/ - ret = sunxi_panel_get_enable_gpio(sunxi_panel); - if (ret) - return ret; - - ret = sunxi_panel_get_reset_gpio(sunxi_panel); - if (ret) - return ret; - - /* Register the panel. */ - drm_panel_init(&sunxi_panel->panel, sunxi_panel->dev, - &bp101wx1_panel_funcs, DRM_MODE_CONNECTOR_LVDS); - - /* Get backlight controller. */ - ret = drm_panel_of_backlight(&sunxi_panel->panel); - // if (ret) - // return ret; - //FIXME - - drm_panel_add(&sunxi_panel->panel); - - dev_set_drvdata(sunxi_panel->dev, sunxi_panel); - return 0; -} - -static int bp101wx1_panel_remove(struct platform_device *pdev) -{ - struct sunxi_panel *sunxi_panel = dev_get_drvdata(&pdev->dev); - - drm_panel_remove(&sunxi_panel->panel); - - drm_panel_disable(&sunxi_panel->panel); - - return 0; -} - -static const struct of_device_id bp101wx1_of_table[] = { - { - .compatible = "BP101WX1", - }, - { /* Sentinel */ }, -}; - -static struct platform_driver bp101wx1_panel_driver = { - .driver = { - .name = "BP101WX1", - .of_match_table = bp101wx1_of_table, - }, - .probe = bp101wx1_panel_probe, - .remove = bp101wx1_panel_remove, -}; - -module_platform_driver(bp101wx1_panel_driver); -MODULE_AUTHOR("chenqingjia "); -MODULE_DESCRIPTION("LVDS Panel bp101wx1 Driver"); -MODULE_LICENSE("GPL"); diff --git a/bsp/drivers/drm/panel/panels.c b/bsp/drivers/drm/panel/panels.c deleted file mode 100644 index 5226539b08..0000000000 --- a/bsp/drivers/drm/panel/panels.c +++ /dev/null @@ -1,381 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* Copyright(c) 2020 - 2023 Allwinner Technology Co.,Ltd. All rights reserved. */ -/* - * - * Copyright (c) 2007-2022 Allwinnertech Co., Ltd. - * Author: huangyongxing - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include - -#include "panels.h" - -static s32 sunxi_panel_get_dsi(struct sunxi_panel *sunxi_panel) -{ - int ret = -EINVAL; - struct platform_device *pdev; - struct device_node *dsi_node; - - if (sunxi_panel->panel_para.lcd_if != LCD_IF_DSI) { - dev_err(sunxi_panel->dev, - "try to get dsi for not dsi panel if = %d\n", - sunxi_panel->panel_para.lcd_if); - return ret; - } - dsi_node = of_get_parent(sunxi_panel->dev->of_node); - if (!dsi_node) { - dev_err(sunxi_panel->dev, - "panel is not port of dsi device! get dsi failed\n"); - return ret; - } - - pdev = of_find_device_by_node(dsi_node); - if (IS_ERR_OR_NULL(pdev)) { - dev_err(sunxi_panel->dev, "find dsi device failed \n"); - return ret; - } - - sunxi_panel->dsi = &pdev->dev; - return 0; -} - -void sunxi_panel_para_from_timing(struct display_timing *timings, - struct disp_panel_para *panel_para) -{ - panel_para->lcd_x = timings->hactive.typ; - panel_para->lcd_hbp = timings->hback_porch.typ; - panel_para->lcd_hspw = timings->hsync_len.typ; - panel_para->lcd_ht = - timings->hactive.typ + timings->hback_porch.typ + - /*timings->hsync_len.typ*/ +timings->hfront_porch.typ; - - panel_para->lcd_y = timings->vactive.typ; - panel_para->lcd_vbp = timings->vback_porch.typ; - panel_para->lcd_vspw = timings->vsync_len.typ; - panel_para->lcd_vt = - timings->vactive.typ + timings->vback_porch.typ + - /*timings->vsync_len.typ*/ +timings->vfront_porch.typ; //fixme - panel_para->lcd_dclk_freq = timings->pixelclock.typ / 1000000; -} -EXPORT_SYMBOL(sunxi_panel_para_from_timing); - -s32 sunxi_panel_parse_timings(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - int ret; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - ret = of_get_display_timing(np, "panel-timing", &sunxi_panel->timings); - if (ret < 0) { - dev_err(sunxi_panel->dev, - "%pOF: problems parsing panel-timing (%d)\n", np, ret); - return ret; - } - - videomode_from_timing(&sunxi_panel->timings, &sunxi_panel->video_mode); - sunxi_panel_para_from_timing(&sunxi_panel->timings, - &sunxi_panel->panel_para); - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_parse_timings); - -s32 sunxi_panel_parse_delay_time(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct sunxi_panel_delay *delay = &sunxi_panel->delay; - u32 val; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - if (!of_property_read_u32(np, "prepare_time", &val)) - delay->prepare_time = val; - - if (!of_property_read_u32(np, "enable_time", &val)) - delay->enable_time = val; - - if (!of_property_read_u32(np, "disable_time", &val)) - delay->disable_time = val; - - if (!of_property_read_u32(np, "unprepare_time", &val)) - delay->unprepare_time = val; - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_parse_delay_time); - -s32 sunxi_panel_parse_dsi(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct disp_panel_para *panel_para = &sunxi_panel->panel_para; - u32 val; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - if (!of_property_read_u32(np, "lcd_dsi_if", &val)) - panel_para->lcd_dsi_if = val; - - if (!of_property_read_u32(np, "lcd_dsi_lane", &val)) - panel_para->lcd_dsi_lane = val; - - // if (!of_property_read_u32(np, "lcd_dclk_freq", &val)) - // panel_para->lcd_dclk_freq = val; - - if (!of_property_read_u32(np, "lcd_dsi_format", &val)) - panel_para->lcd_dsi_format = val; - - if (!of_property_read_u32(np, "lcd_dsi_te", &val)) - panel_para->lcd_dsi_te = val; - - if (!of_property_read_u32(np, "lcd_dsi_eotp", &val)) - panel_para->lcd_dsi_eotp = val; - - if (!of_property_read_u32(np, "lcd_dsi_port_num", &val)) - panel_para->lcd_dsi_port_num = val; - - return sunxi_panel_get_dsi(sunxi_panel); -} -EXPORT_SYMBOL(sunxi_panel_parse_dsi); - -s32 sunxi_panel_parse_lvds(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct disp_panel_para *panel_para = &sunxi_panel->panel_para; - u32 val; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - if (!of_property_read_u32(np, "lcd_lvds_if", &val)) - panel_para->lcd_lvds_if = val; - - if (!of_property_read_u32(np, "lcd_lvds_mode", &val)) - panel_para->lcd_lvds_mode = val; - - if (!of_property_read_u32(np, "lcd_lvds_colordepth", &val)) - panel_para->lcd_lvds_colordepth = val; - - if (!of_property_read_u32(np, "lcd_lvds_io_polarity", &val)) - panel_para->lcd_lvds_io_polarity = val; - - if (!of_property_read_u32(np, "lcd_lvds_clk_polarity", &val)) - panel_para->lcd_lvds_clk_polarity = val; - - return 0; -} - -s32 sunxi_panel_parse_hv(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct disp_panel_para *panel_para = &sunxi_panel->panel_para; - u32 val; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - if (!of_property_read_u32(np, "lcd_hv_if", &val)) - panel_para->lcd_hv_if = val; - - if (!of_property_read_u32(np, "lcd_hv_clk_phase", &val)) - panel_para->lcd_hv_clk_phase = val; - - if (!of_property_read_u32(np, "lcd_hv_sync_polarity", &val)) - panel_para->lcd_hv_sync_polarity = val; - - if (!of_property_read_u32(np, "lcd_hv_data_polarity", &val)) - panel_para->lcd_hv_data_polarity = val; - - if (!of_property_read_u32(np, "lcd_hv_srgb_seq", &val)) - panel_para->lcd_hv_srgb_seq = val; - - if (!of_property_read_u32(np, "lcd_hv_syuv_seq", &val)) - panel_para->lcd_hv_syuv_seq = val; - - if (!of_property_read_u32(np, "lcd_hv_syuv_fdly", &val)) - panel_para->lcd_hv_syuv_fdly = val; - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_parse_hv); - -s32 sunxi_panel_parse_misc(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct disp_panel_para *panel_para = &sunxi_panel->panel_para; - u32 val; - - if (!np) { - dev_err(sunxi_panel->dev, - "sunxi panel's device node missing!\n"); - return -ENXIO; - } - - if (!of_property_read_u32(np, "lcd_if", &val)) - panel_para->lcd_if = val; - - if (!of_property_read_u32(np, "lcd_frm", &val)) - panel_para->lcd_frm = val; - - if (!of_property_read_u32(np, "lcd_gamma_en", &val)) - panel_para->lcd_gamma_en = val; - - if (!of_property_read_u32(np, "lcd_xtal_freq", &val)) - panel_para->lcd_xtal_freq = val; - - if (!of_property_read_u32(np, "lcd_width", &val)) - panel_para->lcd_width = val; - - if (!of_property_read_u32(np, "lcd_height", &val)) - panel_para->lcd_height = val; - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_parse_misc); - -s32 sunxi_panel_get_power(struct sunxi_panel *sunxi_panel) -{ - struct device_node *np = sunxi_panel->dev->of_node; - struct regulator *regulator; - char power_name[25]; - char power_supply_name[25]; - u32 i; - int ret; - - for (i = 0; i < PANEL_POWER_MAX; i++) { - sprintf(power_name, "power%d", i); - sprintf(power_supply_name, "%s-supply", power_name); - if (of_property_read_bool(np, power_supply_name)) { - regulator = devm_regulator_get_optional( - sunxi_panel->dev, power_name); - if (IS_ERR(regulator)) { - ret = PTR_ERR(regulator); - - if (ret != -ENODEV) { - if (ret != -EPROBE_DEFER) - dev_err(sunxi_panel->dev, - "failed to request %s's regulator: %d\n", - power_supply_name, ret); - return ret; - } - - sunxi_panel->supply[i] = NULL; - } else - sunxi_panel->supply[i] = regulator; - } - } - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_get_power); - -s32 sunxi_panel_get_enable_gpio(struct sunxi_panel *sunxi_panel) -{ - int ret; - - sunxi_panel->enable_gpio = devm_gpiod_get_optional( - sunxi_panel->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR(sunxi_panel->enable_gpio)) { - ret = PTR_ERR(sunxi_panel->enable_gpio); - dev_err(sunxi_panel->dev, "failed to request %s GPIO: %d\n", - "enable", ret); - return ret; - } - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_get_enable_gpio); - -s32 sunxi_panel_get_reset_gpio(struct sunxi_panel *sunxi_panel) -{ - int ret; - - sunxi_panel->reset_gpio = devm_gpiod_get_optional( - sunxi_panel->dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(sunxi_panel->reset_gpio)) { - ret = PTR_ERR(sunxi_panel->reset_gpio); - dev_err(sunxi_panel->dev, "failed to request %s GPIO: %d\n", - "reset", ret); - return ret; - } - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_get_reset_gpio); - -void sunxi_panel_set_gpio_output_value(struct gpio_desc *gpio, - unsigned int value) -{ - gpiod_set_value_cansleep(gpio, value); -} -EXPORT_SYMBOL(sunxi_panel_set_gpio_output_value); - -void sunxi_panel_enable_gpio(struct sunxi_panel *sunxi_panel) -{ - if (sunxi_panel->enable_gpio) - gpiod_set_value_cansleep(sunxi_panel->enable_gpio, 1); -} -EXPORT_SYMBOL(sunxi_panel_enable_gpio); - -void sunxi_panel_disable_gpio(struct sunxi_panel *sunxi_panel) -{ - if (sunxi_panel->enable_gpio) - gpiod_set_value_cansleep(sunxi_panel->enable_gpio, 0); -} -EXPORT_SYMBOL(sunxi_panel_disable_gpio); - -void sunxi_panel_reset_assert(struct sunxi_panel *sunxi_panel) -{ - if (sunxi_panel->reset_gpio) - gpiod_set_value_cansleep(sunxi_panel->reset_gpio, 0); -} -EXPORT_SYMBOL(sunxi_panel_reset_assert); - -void sunxi_panel_reset_deassert(struct sunxi_panel *sunxi_panel) -{ - if (sunxi_panel->reset_gpio) - sunxi_panel_set_gpio_output_value(sunxi_panel->reset_gpio, 1); -} -EXPORT_SYMBOL(sunxi_panel_reset_deassert); - -int sunxi_panel_sw_enable(struct drm_panel *panel) -{ - struct sunxi_panel *sunxi_panel = to_sunxi_panel(panel); - int ret; - int i; - - for (i = 0; i < PANEL_POWER_MAX; i++) { - if (sunxi_panel->supply[i]) { - ret = regulator_enable(sunxi_panel->supply[i]); - if (ret) { - dev_err(panel->dev, "failed to enable supply: %d ret =%d \n", i, ret); - return ret; - } - } - } - - return 0; -} -EXPORT_SYMBOL(sunxi_panel_sw_enable); diff --git a/bsp/drivers/drm/panel/panels.h b/bsp/drivers/drm/panel/panels.h index 9c7b334495..548c42563a 100644 --- a/bsp/drivers/drm/panel/panels.h +++ b/bsp/drivers/drm/panel/panels.h @@ -13,73 +13,16 @@ #ifndef __PANELS_H__ #define __PANELS_H__ -#include -#include -#include -#include -#include -#include -#include