From 08f87f769b595151be1afeff53e144f543faa614 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 06 Dec 2023 09:51:13 +0000 Subject: [PATCH] add dts config --- kernel/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 49 +++++++++++++++++++++++++++++-------------------- 1 files changed, 29 insertions(+), 20 deletions(-) diff --git a/kernel/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/kernel/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index 98f740a..a843a73 100644 --- a/kernel/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +++ b/kernel/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -1,19 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Header file for Analogix DP (Display Port) core interface driver. * * Copyright (C) 2012 Samsung Electronics Co., Ltd. * Author: Jingoo Han <jg1.han@samsung.com> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. */ #ifndef _ANALOGIX_DP_CORE_H #define _ANALOGIX_DP_CORE_H #include <drm/drm_crtc.h> +#include <drm/drm_bridge.h> #include <drm/drm_dp_helper.h> #define DP_TIMEOUT_LOOP_COUNT 100 @@ -74,6 +71,8 @@ TRAINING_PTN1, TRAINING_PTN2, TRAINING_PTN3, + TEST_PATTERN_80BIT, + TEST_PATTERN_HBR2, DP_NONE }; @@ -125,13 +124,6 @@ POWER_ALL }; -enum dp_irq_type { - DP_IRQ_TYPE_HP_CABLE_IN = BIT(0), - DP_IRQ_TYPE_HP_CABLE_OUT = BIT(1), - DP_IRQ_TYPE_HP_CHANGE = BIT(2), - DP_IRQ_TYPE_UNKNOWN = BIT(3), -}; - struct video_info { char *name; struct drm_display_mode mode; @@ -147,8 +139,10 @@ int max_link_rate; enum link_lane_count_type max_lane_count; + u32 lane_map[4]; bool video_bist_enable; + bool force_stream_valid; }; struct link_train { @@ -164,37 +158,48 @@ enum link_training_state lt_state; }; +struct analogix_dp_compliance { + struct drm_dp_phy_test_params phytest; + int test_link_rate; + u8 test_lane_count; + unsigned long test_type; + bool test_active; +}; + struct analogix_dp_device { struct drm_encoder *encoder; struct device *dev; struct drm_device *drm_dev; struct drm_connector connector; - struct drm_bridge *bridge; + struct drm_bridge bridge; struct drm_dp_aux aux; + struct clk_bulk_data *clks; + int nr_clks; unsigned int irq; void __iomem *reg_base; struct video_info video_info; struct link_train link_train; struct phy *phy; - bool phy_enabled; int dpms_mode; struct gpio_desc *hpd_gpiod; - int hpd_irq; bool force_hpd; - bool psr_enable; bool fast_train_enable; + bool psr_supported; + struct work_struct modeset_retry_work; struct mutex panel_lock; bool panel_is_prepared; + u8 dpcd[DP_RECEIVER_CAP_SIZE]; struct analogix_dp_plat_data *plat_data; + struct extcon_dev *extcon; + struct analogix_dp_compliance compliance; }; /* analogix_dp_reg.c */ void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable); void analogix_dp_stop_video(struct analogix_dp_device *dp); -void analogix_dp_lane_swap(struct analogix_dp_device *dp, bool enable); void analogix_dp_init_analog_param(struct analogix_dp_device *dp); void analogix_dp_init_interrupt(struct analogix_dp_device *dp); void analogix_dp_reset(struct analogix_dp_device *dp); @@ -210,7 +215,6 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp); void analogix_dp_init_hpd(struct analogix_dp_device *dp); void analogix_dp_force_hpd(struct analogix_dp_device *dp); -enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp); void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp); void analogix_dp_reset_aux(struct analogix_dp_device *dp); void analogix_dp_init_aux(struct analogix_dp_device *dp); @@ -222,6 +226,7 @@ void analogix_dp_get_lane_count(struct analogix_dp_device *dp, u32 *count); void analogix_dp_enable_enhanced_mode(struct analogix_dp_device *dp, bool enable); +bool analogix_dp_get_enhanced_mode(struct analogix_dp_device *dp); void analogix_dp_set_training_pattern(struct analogix_dp_device *dp, enum pattern_set pattern); void analogix_dp_set_lane_link_training(struct analogix_dp_device *dp); @@ -245,17 +250,21 @@ void analogix_dp_disable_scrambling(struct analogix_dp_device *dp); void analogix_dp_enable_psr_crc(struct analogix_dp_device *dp); int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, - struct edp_vsc_psr *vsc, bool blocking); + struct dp_sdp *vsc, bool blocking); ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, struct drm_dp_aux_msg *msg); void analogix_dp_set_video_format(struct analogix_dp_device *dp); void analogix_dp_video_bist_enable(struct analogix_dp_device *dp); bool analogix_dp_ssc_supported(struct analogix_dp_device *dp); -void analogix_dp_phy_power_on(struct analogix_dp_device *dp); +int analogix_dp_phy_power_on(struct analogix_dp_device *dp); void analogix_dp_phy_power_off(struct analogix_dp_device *dp); void analogix_dp_audio_config_spdif(struct analogix_dp_device *dp); void analogix_dp_audio_config_i2s(struct analogix_dp_device *dp); void analogix_dp_audio_enable(struct analogix_dp_device *dp); void analogix_dp_audio_disable(struct analogix_dp_device *dp); +void analogix_dp_init(struct analogix_dp_device *dp); +void analogix_dp_irq_handler(struct analogix_dp_device *dp); +void analogix_dp_phy_test(struct analogix_dp_device *dp); +void analogix_dp_check_device_service_irq(struct analogix_dp_device *dp); #endif /* _ANALOGIX_DP_CORE_H */ -- Gitblit v1.6.2