提交 3424e3a4 编写于 作者: Y Yakir Yang

drm: bridge: analogix/dp: split exynos dp driver to bridge directory

Split the dp core driver from exynos directory to bridge directory,
and rename the core driver to analogix_dp_*, rename the platform
code to exynos_dp.

Beside the new analogix_dp driver would export six hooks.
"analogix_dp_bind()" and "analogix_dp_unbind()"
"analogix_dp_suspned()" and "analogix_dp_resume()"
"analogix_dp_detect()" and "analogix_dp_get_modes()"

The bind/unbind symbols is used for analogix platform driver to connect
with analogix_dp core driver. And the detect/get_modes is used for analogix
platform driver to init the connector.

They reason why connector need register in helper driver is rockchip drm
haven't implement the atomic API, but Exynos drm have implement it, so
there would need two different connector helper functions, that's why we
leave the connector register in helper driver.
Acked-by: NInki Dae <inki.dae@samsung.com>
Tested-by: NCaesar Wang <wxt@rock-chips.com>
Tested-by: NDouglas Anderson <dianders@chromium.org>
Tested-by: NHeiko Stuebner <heiko@sntech.de>
Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: NYakir Yang <ykk@rock-chips.com>
Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
上级 4604202c
...@@ -40,4 +40,6 @@ config DRM_PARADE_PS8622 ...@@ -40,4 +40,6 @@ config DRM_PARADE_PS8622
---help--- ---help---
Parade eDP-LVDS bridge chip driver. Parade eDP-LVDS bridge chip driver.
source "drivers/gpu/drm/bridge/analogix/Kconfig"
endmenu endmenu
...@@ -4,3 +4,4 @@ obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o ...@@ -4,3 +4,4 @@ obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o
obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o
obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
config DRM_ANALOGIX_DP
tristate
depends on DRM
analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o
obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o
此差异已折叠。
/* /*
* Header file for Samsung DP (Display Port) interface driver. * Header file for Analogix DP (Display Port) core interface driver.
* *
* Copyright (C) 2012 Samsung Electronics Co., Ltd. * Copyright (C) 2012 Samsung Electronics Co., Ltd.
* Author: Jingoo Han <jg1.han@samsung.com> * Author: Jingoo Han <jg1.han@samsung.com>
...@@ -10,15 +10,11 @@ ...@@ -10,15 +10,11 @@
* option) any later version. * option) any later version.
*/ */
#ifndef _EXYNOS_DP_CORE_H #ifndef _ANALOGIX_DP_CORE_H
#define _EXYNOS_DP_CORE_H #define _ANALOGIX_DP_CORE_H
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_dp_helper.h> #include <drm/drm_dp_helper.h>
#include <drm/exynos_drm.h>
#include <video/videomode.h>
#include "exynos_drm_drv.h"
#define DP_TIMEOUT_LOOP_COUNT 100 #define DP_TIMEOUT_LOOP_COUNT 100
#define MAX_CR_LOOP 5 #define MAX_CR_LOOP 5
...@@ -147,14 +143,12 @@ struct link_train { ...@@ -147,14 +143,12 @@ struct link_train {
enum link_training_state lt_state; enum link_training_state lt_state;
}; };
struct exynos_dp_device { struct analogix_dp_device {
struct drm_encoder encoder; struct drm_encoder *encoder;
struct device *dev; struct device *dev;
struct drm_device *drm_dev; struct drm_device *drm_dev;
struct drm_connector connector; struct drm_connector connector;
struct drm_panel *panel;
struct drm_bridge *bridge; struct drm_bridge *bridge;
struct drm_bridge *ptn_bridge;
struct clk *clock; struct clk *clock;
unsigned int irq; unsigned int irq;
void __iomem *reg_base; void __iomem *reg_base;
...@@ -165,97 +159,98 @@ struct exynos_dp_device { ...@@ -165,97 +159,98 @@ struct exynos_dp_device {
struct phy *phy; struct phy *phy;
int dpms_mode; int dpms_mode;
int hpd_gpio; int hpd_gpio;
struct videomode vm;
struct analogix_dp_plat_data *plat_data;
}; };
/* exynos_dp_reg.c */ /* analogix_dp_reg.c */
void exynos_dp_enable_video_mute(struct exynos_dp_device *dp, bool enable); void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable);
void exynos_dp_stop_video(struct exynos_dp_device *dp); void analogix_dp_stop_video(struct analogix_dp_device *dp);
void exynos_dp_lane_swap(struct exynos_dp_device *dp, bool enable); void analogix_dp_lane_swap(struct analogix_dp_device *dp, bool enable);
void exynos_dp_init_analog_param(struct exynos_dp_device *dp); void analogix_dp_init_analog_param(struct analogix_dp_device *dp);
void exynos_dp_init_interrupt(struct exynos_dp_device *dp); void analogix_dp_init_interrupt(struct analogix_dp_device *dp);
void exynos_dp_reset(struct exynos_dp_device *dp); void analogix_dp_reset(struct analogix_dp_device *dp);
void exynos_dp_swreset(struct exynos_dp_device *dp); void analogix_dp_swreset(struct analogix_dp_device *dp);
void exynos_dp_config_interrupt(struct exynos_dp_device *dp); void analogix_dp_config_interrupt(struct analogix_dp_device *dp);
enum pll_status exynos_dp_get_pll_lock_status(struct exynos_dp_device *dp); enum pll_status analogix_dp_get_pll_lock_status(struct analogix_dp_device *dp);
void exynos_dp_set_pll_power_down(struct exynos_dp_device *dp, bool enable); void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable);
void exynos_dp_set_analog_power_down(struct exynos_dp_device *dp, void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
enum analog_power_block block, enum analog_power_block block,
bool enable); bool enable);
void exynos_dp_init_analog_func(struct exynos_dp_device *dp); void analogix_dp_init_analog_func(struct analogix_dp_device *dp);
void exynos_dp_init_hpd(struct exynos_dp_device *dp); void analogix_dp_init_hpd(struct analogix_dp_device *dp);
enum dp_irq_type exynos_dp_get_irq_type(struct exynos_dp_device *dp); enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp);
void exynos_dp_clear_hotplug_interrupts(struct exynos_dp_device *dp); void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp);
void exynos_dp_reset_aux(struct exynos_dp_device *dp); void analogix_dp_reset_aux(struct analogix_dp_device *dp);
void exynos_dp_init_aux(struct exynos_dp_device *dp); void analogix_dp_init_aux(struct analogix_dp_device *dp);
int exynos_dp_get_plug_in_status(struct exynos_dp_device *dp); int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp);
void exynos_dp_enable_sw_function(struct exynos_dp_device *dp); void analogix_dp_enable_sw_function(struct analogix_dp_device *dp);
int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp); int analogix_dp_start_aux_transaction(struct analogix_dp_device *dp);
int exynos_dp_write_byte_to_dpcd(struct exynos_dp_device *dp, int analogix_dp_write_byte_to_dpcd(struct analogix_dp_device *dp,
unsigned int reg_addr, unsigned int reg_addr,
unsigned char data); unsigned char data);
int exynos_dp_read_byte_from_dpcd(struct exynos_dp_device *dp, int analogix_dp_read_byte_from_dpcd(struct analogix_dp_device *dp,
unsigned int reg_addr, unsigned int reg_addr,
unsigned char *data); unsigned char *data);
int exynos_dp_write_bytes_to_dpcd(struct exynos_dp_device *dp, int analogix_dp_write_bytes_to_dpcd(struct analogix_dp_device *dp,
unsigned int reg_addr, unsigned int reg_addr,
unsigned int count, unsigned int count,
unsigned char data[]); unsigned char data[]);
int exynos_dp_read_bytes_from_dpcd(struct exynos_dp_device *dp, int analogix_dp_read_bytes_from_dpcd(struct analogix_dp_device *dp,
unsigned int reg_addr, unsigned int reg_addr,
unsigned int count, unsigned int count,
unsigned char data[]); unsigned char data[]);
int exynos_dp_select_i2c_device(struct exynos_dp_device *dp, int analogix_dp_select_i2c_device(struct analogix_dp_device *dp,
unsigned int device_addr, unsigned int device_addr,
unsigned int reg_addr); unsigned int reg_addr);
int exynos_dp_read_byte_from_i2c(struct exynos_dp_device *dp, int analogix_dp_read_byte_from_i2c(struct analogix_dp_device *dp,
unsigned int device_addr, unsigned int device_addr,
unsigned int reg_addr, unsigned int reg_addr,
unsigned int *data); unsigned int *data);
int exynos_dp_read_bytes_from_i2c(struct exynos_dp_device *dp, int analogix_dp_read_bytes_from_i2c(struct analogix_dp_device *dp,
unsigned int device_addr, unsigned int device_addr,
unsigned int reg_addr, unsigned int reg_addr,
unsigned int count, unsigned int count,
unsigned char edid[]); unsigned char edid[]);
void exynos_dp_set_link_bandwidth(struct exynos_dp_device *dp, u32 bwtype); void analogix_dp_set_link_bandwidth(struct analogix_dp_device *dp, u32 bwtype);
void exynos_dp_get_link_bandwidth(struct exynos_dp_device *dp, u32 *bwtype); void analogix_dp_get_link_bandwidth(struct analogix_dp_device *dp, u32 *bwtype);
void exynos_dp_set_lane_count(struct exynos_dp_device *dp, u32 count); void analogix_dp_set_lane_count(struct analogix_dp_device *dp, u32 count);
void exynos_dp_get_lane_count(struct exynos_dp_device *dp, u32 *count); void analogix_dp_get_lane_count(struct analogix_dp_device *dp, u32 *count);
void exynos_dp_enable_enhanced_mode(struct exynos_dp_device *dp, bool enable); void analogix_dp_enable_enhanced_mode(struct analogix_dp_device *dp, bool enable);
void exynos_dp_set_training_pattern(struct exynos_dp_device *dp, void analogix_dp_set_training_pattern(struct analogix_dp_device *dp,
enum pattern_set pattern); enum pattern_set pattern);
void exynos_dp_set_lane0_pre_emphasis(struct exynos_dp_device *dp, u32 level); void analogix_dp_set_lane0_pre_emphasis(struct analogix_dp_device *dp, u32 level);
void exynos_dp_set_lane1_pre_emphasis(struct exynos_dp_device *dp, u32 level); void analogix_dp_set_lane1_pre_emphasis(struct analogix_dp_device *dp, u32 level);
void exynos_dp_set_lane2_pre_emphasis(struct exynos_dp_device *dp, u32 level); void analogix_dp_set_lane2_pre_emphasis(struct analogix_dp_device *dp, u32 level);
void exynos_dp_set_lane3_pre_emphasis(struct exynos_dp_device *dp, u32 level); void analogix_dp_set_lane3_pre_emphasis(struct analogix_dp_device *dp, u32 level);
void exynos_dp_set_lane0_link_training(struct exynos_dp_device *dp, void analogix_dp_set_lane0_link_training(struct analogix_dp_device *dp,
u32 training_lane); u32 training_lane);
void exynos_dp_set_lane1_link_training(struct exynos_dp_device *dp, void analogix_dp_set_lane1_link_training(struct analogix_dp_device *dp,
u32 training_lane); u32 training_lane);
void exynos_dp_set_lane2_link_training(struct exynos_dp_device *dp, void analogix_dp_set_lane2_link_training(struct analogix_dp_device *dp,
u32 training_lane); u32 training_lane);
void exynos_dp_set_lane3_link_training(struct exynos_dp_device *dp, void analogix_dp_set_lane3_link_training(struct analogix_dp_device *dp,
u32 training_lane); u32 training_lane);
u32 exynos_dp_get_lane0_link_training(struct exynos_dp_device *dp); u32 analogix_dp_get_lane0_link_training(struct analogix_dp_device *dp);
u32 exynos_dp_get_lane1_link_training(struct exynos_dp_device *dp); u32 analogix_dp_get_lane1_link_training(struct analogix_dp_device *dp);
u32 exynos_dp_get_lane2_link_training(struct exynos_dp_device *dp); u32 analogix_dp_get_lane2_link_training(struct analogix_dp_device *dp);
u32 exynos_dp_get_lane3_link_training(struct exynos_dp_device *dp); u32 analogix_dp_get_lane3_link_training(struct analogix_dp_device *dp);
void exynos_dp_reset_macro(struct exynos_dp_device *dp); void analogix_dp_reset_macro(struct analogix_dp_device *dp);
void exynos_dp_init_video(struct exynos_dp_device *dp); void analogix_dp_init_video(struct analogix_dp_device *dp);
void exynos_dp_set_video_color_format(struct exynos_dp_device *dp); void analogix_dp_set_video_color_format(struct analogix_dp_device *dp);
int exynos_dp_is_slave_video_stream_clock_on(struct exynos_dp_device *dp); int analogix_dp_is_slave_video_stream_clock_on(struct analogix_dp_device *dp);
void exynos_dp_set_video_cr_mn(struct exynos_dp_device *dp, void analogix_dp_set_video_cr_mn(struct analogix_dp_device *dp,
enum clock_recovery_m_value_type type, enum clock_recovery_m_value_type type,
u32 m_value, u32 m_value,
u32 n_value); u32 n_value);
void exynos_dp_set_video_timing_mode(struct exynos_dp_device *dp, u32 type); void analogix_dp_set_video_timing_mode(struct analogix_dp_device *dp, u32 type);
void exynos_dp_enable_video_master(struct exynos_dp_device *dp, bool enable); void analogix_dp_enable_video_master(struct analogix_dp_device *dp, bool enable);
void exynos_dp_start_video(struct exynos_dp_device *dp); void analogix_dp_start_video(struct analogix_dp_device *dp);
int exynos_dp_is_video_stream_on(struct exynos_dp_device *dp); int analogix_dp_is_video_stream_on(struct analogix_dp_device *dp);
void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp); void analogix_dp_config_video_slave_mode(struct analogix_dp_device *dp);
void exynos_dp_enable_scrambling(struct exynos_dp_device *dp); void analogix_dp_enable_scrambling(struct analogix_dp_device *dp);
void exynos_dp_disable_scrambling(struct exynos_dp_device *dp); void analogix_dp_disable_scrambling(struct analogix_dp_device *dp);
/* I2C EDID Chip ID, Slave Address */ /* I2C EDID Chip ID, Slave Address */
#define I2C_EDID_DEVICE_ADDR 0x50 #define I2C_EDID_DEVICE_ADDR 0x50
...@@ -279,4 +274,4 @@ void exynos_dp_disable_scrambling(struct exynos_dp_device *dp); ...@@ -279,4 +274,4 @@ void exynos_dp_disable_scrambling(struct exynos_dp_device *dp);
#define DPCD_VOLTAGE_SWING_SET(x) (((x) & 0x3) << 0) #define DPCD_VOLTAGE_SWING_SET(x) (((x) & 0x3) << 0)
#define DPCD_VOLTAGE_SWING_GET(x) (((x) >> 0) & 0x3) #define DPCD_VOLTAGE_SWING_GET(x) (((x) >> 0) & 0x3)
#endif /* _EXYNOS_DP_CORE_H */ #endif /* _ANALOGIX_DP_CORE_H */
/* /*
* Register definition file for Samsung DP driver * Register definition file for Analogix DP core driver
* *
* Copyright (C) 2012 Samsung Electronics Co., Ltd. * Copyright (C) 2012 Samsung Electronics Co., Ltd.
* Author: Jingoo Han <jg1.han@samsung.com> * Author: Jingoo Han <jg1.han@samsung.com>
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef _EXYNOS_DP_REG_H #ifndef _ANALOGIX_DP_REG_H
#define _EXYNOS_DP_REG_H #define _ANALOGIX_DP_REG_H
#define EXYNOS_DP_TX_SW_RESET 0x14 #define EXYNOS_DP_TX_SW_RESET 0x14
#define EXYNOS_DP_FUNC_EN_1 0x18 #define EXYNOS_DP_FUNC_EN_1 0x18
...@@ -363,4 +363,4 @@ ...@@ -363,4 +363,4 @@
#define VIDEO_MODE_SLAVE_MODE (0x1 << 0) #define VIDEO_MODE_SLAVE_MODE (0x1 << 0)
#define VIDEO_MODE_MASTER_MODE (0x0 << 0) #define VIDEO_MODE_MASTER_MODE (0x0 << 0)
#endif /* _EXYNOS_DP_REG_H */ #endif /* _ANALOGIX_DP_REG_H */
...@@ -71,8 +71,9 @@ config DRM_EXYNOS_DSI ...@@ -71,8 +71,9 @@ config DRM_EXYNOS_DSI
This enables support for Exynos MIPI-DSI device. This enables support for Exynos MIPI-DSI device.
config DRM_EXYNOS_DP config DRM_EXYNOS_DP
bool "Display Port" bool "EXYNOS specific extensions for Analogix DP driver"
depends on DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON depends on DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON
select DRM_ANALOGIX_DP
default DRM_EXYNOS default DRM_EXYNOS
select DRM_PANEL select DRM_PANEL
help help
......
...@@ -12,7 +12,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o ...@@ -12,7 +12,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o
exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON) += exynos7_drm_decon.o exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON) += exynos7_drm_decon.o
exynosdrm-$(CONFIG_DRM_EXYNOS_DPI) += exynos_drm_dpi.o exynosdrm-$(CONFIG_DRM_EXYNOS_DPI) += exynos_drm_dpi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_DSI) += exynos_drm_dsi.o exynosdrm-$(CONFIG_DRM_EXYNOS_DSI) += exynos_drm_dsi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_DP) += exynos_dp_core.o exynos_dp_reg.o exynosdrm-$(CONFIG_DRM_EXYNOS_DP) += exynos_dp_core.o
exynosdrm-$(CONFIG_DRM_EXYNOS_MIXER) += exynos_mixer.o exynosdrm-$(CONFIG_DRM_EXYNOS_MIXER) += exynos_mixer.o
exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o
exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o
......
/*
* Analogix DP (Display Port) Core interface driver.
*
* Copyright (C) 2015 Rockchip Electronics Co., Ltd.
*
* 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_H_
#define _ANALOGIX_DP_H_
#include <drm/drm_crtc.h>
enum analogix_dp_devtype {
EXYNOS_DP,
};
struct analogix_dp_plat_data {
enum analogix_dp_devtype dev_type;
struct drm_panel *panel;
struct drm_encoder *encoder;
struct drm_connector *connector;
int (*power_on)(struct analogix_dp_plat_data *);
int (*power_off)(struct analogix_dp_plat_data *);
int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *,
struct drm_connector *);
int (*get_modes)(struct analogix_dp_plat_data *);
};
int analogix_dp_resume(struct device *dev);
int analogix_dp_suspend(struct device *dev);
int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
struct analogix_dp_plat_data *plat_data);
void analogix_dp_unbind(struct device *dev, struct device *master, void *data);
#endif /* _ANALOGIX_DP_H_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册