diff --git a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-s66-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-s66-v10.dtsi index 0346f3c9f9ba..5080e20b8c44 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-s66-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-s66-v10.dtsi @@ -97,7 +97,26 @@ &i2c3 { status = "okay"; - //todo, add gyro IAM20680 + + iam20680_acc: acc@69 { + compatible = "iam20680_acc"; + reg = <0x69>; + irq-gpio = <&gpio1 RK_PC2 IRQ_TYPE_LEVEL_LOW>; + irq_enable = <1>; + poll_delay_ms = <30>; + type = ; + layout = <1>; + }; + + iam20680_gyro: gyro@69 { + compatible = "iam20680_gyro"; + reg = <0x69>; + irq_enable = <0>; + poll_delay_ms = <30>; + type = ; + layout = <1>; + }; + //todo, add mfi }; diff --git a/arch/arm64/configs/rockchip_defconfig b/arch/arm64/configs/rockchip_defconfig index bfd0b41c567d..f42667ad83d4 100644 --- a/arch/arm64/configs/rockchip_defconfig +++ b/arch/arm64/configs/rockchip_defconfig @@ -633,6 +633,7 @@ CONFIG_DRM_ROCKCHIP_RK618=y CONFIG_DRM_ROCKCHIP_RK628=y CONFIG_DRM_PANEL_SIMPLE=y CONFIG_DRM_PANEL_MAXIM_MAX96752F=y +CONFIG_DRM_PANEL_MAXIM_MAX96772=y CONFIG_DRM_DISPLAY_CONNECTOR=y CONFIG_DRM_MAXIM_MAX96745=y CONFIG_DRM_MAXIM_MAX96755F=y diff --git a/drivers/gpu/drm/bridge/maxim-max96755f.c b/drivers/gpu/drm/bridge/maxim-max96755f.c index a61395b876f0..d43f550c6892 100644 --- a/drivers/gpu/drm/bridge/maxim-max96755f.c +++ b/drivers/gpu/drm/bridge/maxim-max96755f.c @@ -41,6 +41,7 @@ struct max96755f_bridge { bool dv_swp_ab; bool dpi_deskew_en; bool split_mode; + bool bridge_dual_link; u32 dsi_lane_map[4]; struct { @@ -283,7 +284,7 @@ static void max96755f_bridge_pre_enable(struct drm_bridge *bridge) static void max96755f_bridge_reset_oneshot(struct max96755f_bridge *ser) { - regmap_update_bits(ser->regmap, 0x10, RESET_ONESHOT, + regmap_update_bits(ser->regmap, 0x0010, RESET_ONESHOT, FIELD_PREP(RESET_ONESHOT, 1)); mdelay(100); @@ -324,6 +325,12 @@ static void max96755f_bridge_enable(struct drm_bridge *bridge) FIELD_PREP(START_PORTAY, 1)); regmap_update_bits(ser->regmap, 0x02, VID_TX_EN_X, FIELD_PREP(VID_TX_EN_X, 1)); + if (ser->bridge_dual_link) { + regmap_update_bits(ser->regmap, 0x0010, + AUTO_LINK | LINK_CFG, + FIELD_PREP(AUTO_LINK, 0) | + FIELD_PREP(LINK_CFG, DUAL_LINK)); + } } max96755f_bridge_reset_oneshot(ser); @@ -358,7 +365,7 @@ static void max96755f_bridge_disable(struct drm_bridge *bridge) FIELD_PREP(VID_TX_EN_X, 0) | FIELD_PREP(VID_TX_EN_Y, 0)); - if (ser->split_mode) + if (ser->split_mode || ser->bridge_dual_link) regmap_update_bits(ser->regmap, 0x0010, AUTO_LINK | LINK_CFG, FIELD_PREP(AUTO_LINK, 1) | @@ -489,6 +496,7 @@ static irqreturn_t max96755f_bridge_lock_irq_handler(int irq, void *arg) static int max96755f_bridge_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; struct max96755f_bridge *ser; int ret; @@ -531,6 +539,8 @@ static int max96755f_bridge_probe(struct platform_device *pdev) if (ret) return dev_err_probe(dev, ret, "failed to request lock IRQ\n"); + ser->bridge_dual_link = of_property_read_bool(np, "bridge_dual_link"); + ser->bridge.funcs = &max96755f_bridge_funcs; ser->bridge.of_node = dev->of_node; ser->bridge.ops = DRM_BRIDGE_OP_DETECT; diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index c1ef337b3647..4d5c48ac987d 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -376,6 +376,14 @@ config DRM_PANEL_MAXIM_MAX96752F Say Y if you want to enable support for panels based on the Maxim MAX96752F. +config DRM_PANEL_MAXIM_MAX96772 + tristate "Maxim MAX96772-based panels" + depends on OF + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y if you want to enable support for panels based on the + Maxim MAX96772. + config DRM_PANEL_OLIMEX_LCD_OLINUXINO tristate "Olimex LCD-OLinuXino panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 06ec391681dc..98e0a86a2004 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o obj-$(CONFIG_DRM_PANEL_MAXIM_MAX96752F) += panel-maxim-max96752f.o +obj-$(CONFIG_DRM_PANEL_MAXIM_MAX96772) += panel-maxim-max96772.o obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += panel-osd-osd101t2587-53ts.o diff --git a/drivers/gpu/drm/panel/panel-maxim-max96772.c b/drivers/gpu/drm/panel/panel-maxim-max96772.c new file mode 100644 index 000000000000..2e16d0337887 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-maxim-max96772.c @@ -0,0 +1,543 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2022 Rockchip Electronics Co. Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include