1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Analogix DP (Display port) core register interface driver.
5 * Copyright (C) 2012 Samsung Electronics Co., Ltd.
6 * Author: Jingoo Han <jg1.han@samsung.com>
9 #include <linux/delay.h>
10 #include <linux/device.h>
11 #include <linux/gpio/consumer.h>
13 #include <linux/iopoll.h>
15 #include <drm/bridge/analogix_dp.h>
17 #include "analogix_dp_core.h"
18 #include "analogix_dp_reg.h"
20 #define COMMON_INT_MASK_1 0
21 #define COMMON_INT_MASK_2 0
22 #define COMMON_INT_MASK_3 0
23 #define COMMON_INT_MASK_4 (HOTPLUG_CHG | HPD_LOST | PLUG)
24 #define INT_STA_MASK INT_HPD
26 void analogix_dp_enable_video_mute(struct analogix_dp_device
*dp
, bool enable
)
31 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
32 reg
|= HDCP_VIDEO_MUTE
;
33 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
35 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
36 reg
&= ~HDCP_VIDEO_MUTE
;
37 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
41 void analogix_dp_stop_video(struct analogix_dp_device
*dp
)
45 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
47 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
50 void analogix_dp_lane_swap(struct analogix_dp_device
*dp
, bool enable
)
55 reg
= LANE3_MAP_LOGIC_LANE_0
| LANE2_MAP_LOGIC_LANE_1
|
56 LANE1_MAP_LOGIC_LANE_2
| LANE0_MAP_LOGIC_LANE_3
;
58 reg
= LANE3_MAP_LOGIC_LANE_3
| LANE2_MAP_LOGIC_LANE_2
|
59 LANE1_MAP_LOGIC_LANE_1
| LANE0_MAP_LOGIC_LANE_0
;
61 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LANE_MAP
);
64 void analogix_dp_init_analog_param(struct analogix_dp_device
*dp
)
68 reg
= TX_TERMINAL_CTRL_50_OHM
;
69 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_ANALOG_CTL_1
);
71 reg
= SEL_24M
| TX_DVDD_BIT_1_0625V
;
72 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_ANALOG_CTL_2
);
74 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
)) {
76 if (dp
->plat_data
->dev_type
== RK3288_DP
)
79 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_PLL_REG_1
);
80 writel(0x95, dp
->reg_base
+ ANALOGIX_DP_PLL_REG_2
);
81 writel(0x40, dp
->reg_base
+ ANALOGIX_DP_PLL_REG_3
);
82 writel(0x58, dp
->reg_base
+ ANALOGIX_DP_PLL_REG_4
);
83 writel(0x22, dp
->reg_base
+ ANALOGIX_DP_PLL_REG_5
);
86 reg
= DRIVE_DVDD_BIT_1_0625V
| VCO_BIT_600_MICRO
;
87 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_ANALOG_CTL_3
);
89 reg
= PD_RING_OSC
| AUX_TERMINAL_CTRL_50_OHM
|
90 TX_CUR1_2X
| TX_CUR_16_MA
;
91 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_PLL_FILTER_CTL_1
);
93 reg
= CH3_AMP_400_MV
| CH2_AMP_400_MV
|
94 CH1_AMP_400_MV
| CH0_AMP_400_MV
;
95 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TX_AMP_TUNING_CTL
);
98 void analogix_dp_init_interrupt(struct analogix_dp_device
*dp
)
100 /* Set interrupt pin assertion polarity as high */
101 writel(INT_POL1
| INT_POL0
, dp
->reg_base
+ ANALOGIX_DP_INT_CTL
);
103 /* Clear pending regisers */
104 writel(0xff, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_1
);
105 writel(0x4f, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_2
);
106 writel(0xe0, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_3
);
107 writel(0xe7, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_4
);
108 writel(0x63, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
110 /* 0:mask,1: unmask */
111 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_1
);
112 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_2
);
113 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_3
);
114 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_4
);
115 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_INT_STA_MASK
);
118 void analogix_dp_reset(struct analogix_dp_device
*dp
)
122 analogix_dp_stop_video(dp
);
123 analogix_dp_enable_video_mute(dp
, 0);
125 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
126 reg
= RK_VID_CAP_FUNC_EN_N
| RK_VID_FIFO_FUNC_EN_N
|
129 reg
= MASTER_VID_FUNC_EN_N
| SLAVE_VID_FUNC_EN_N
|
130 AUD_FIFO_FUNC_EN_N
| AUD_FUNC_EN_N
|
131 HDCP_FUNC_EN_N
| SW_FUNC_EN_N
;
133 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_1
);
135 reg
= SSC_FUNC_EN_N
| AUX_FUNC_EN_N
|
136 SERDES_FIFO_FUNC_EN_N
|
137 LS_CLK_DOMAIN_FUNC_EN_N
;
138 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
140 usleep_range(20, 30);
142 analogix_dp_lane_swap(dp
, 0);
144 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_1
);
145 writel(0x40, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_2
);
146 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
147 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
149 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
150 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_HDCP_CTL
);
152 writel(0x5e, dp
->reg_base
+ ANALOGIX_DP_HPD_DEGLITCH_L
);
153 writel(0x1a, dp
->reg_base
+ ANALOGIX_DP_HPD_DEGLITCH_H
);
155 writel(0x10, dp
->reg_base
+ ANALOGIX_DP_LINK_DEBUG_CTL
);
157 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_PHY_TEST
);
159 writel(0x0, dp
->reg_base
+ ANALOGIX_DP_VIDEO_FIFO_THRD
);
160 writel(0x20, dp
->reg_base
+ ANALOGIX_DP_AUDIO_MARGIN
);
162 writel(0x4, dp
->reg_base
+ ANALOGIX_DP_M_VID_GEN_FILTER_TH
);
163 writel(0x2, dp
->reg_base
+ ANALOGIX_DP_M_AUD_GEN_FILTER_TH
);
165 writel(0x00000101, dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
168 void analogix_dp_swreset(struct analogix_dp_device
*dp
)
170 writel(RESET_DP_TX
, dp
->reg_base
+ ANALOGIX_DP_TX_SW_RESET
);
173 void analogix_dp_config_interrupt(struct analogix_dp_device
*dp
)
177 /* 0: mask, 1: unmask */
178 reg
= COMMON_INT_MASK_1
;
179 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_1
);
181 reg
= COMMON_INT_MASK_2
;
182 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_2
);
184 reg
= COMMON_INT_MASK_3
;
185 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_3
);
187 reg
= COMMON_INT_MASK_4
;
188 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_4
);
191 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_INT_STA_MASK
);
194 void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device
*dp
)
198 /* 0: mask, 1: unmask */
199 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_4
);
200 reg
&= ~COMMON_INT_MASK_4
;
201 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_4
);
203 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_INT_STA_MASK
);
204 reg
&= ~INT_STA_MASK
;
205 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_INT_STA_MASK
);
208 void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device
*dp
)
212 /* 0: mask, 1: unmask */
213 reg
= COMMON_INT_MASK_4
;
214 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_MASK_4
);
217 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_INT_STA_MASK
);
220 enum pll_status
analogix_dp_get_pll_lock_status(struct analogix_dp_device
*dp
)
224 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_DEBUG_CTL
);
231 void analogix_dp_set_pll_power_down(struct analogix_dp_device
*dp
, bool enable
)
234 u32 mask
= DP_PLL_PD
;
235 u32 pd_addr
= ANALOGIX_DP_PLL_CTL
;
237 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
)) {
238 pd_addr
= ANALOGIX_DP_PD
;
242 reg
= readl(dp
->reg_base
+ pd_addr
);
247 writel(reg
, dp
->reg_base
+ pd_addr
);
250 void analogix_dp_set_analog_power_down(struct analogix_dp_device
*dp
,
251 enum analog_power_block block
,
255 u32 phy_pd_addr
= ANALOGIX_DP_PHY_PD
;
258 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
259 phy_pd_addr
= ANALOGIX_DP_PD
;
263 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
268 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
273 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
277 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
283 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
287 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
293 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
297 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
303 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
307 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
313 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
317 * There is no bit named DP_PHY_PD, so We used DP_INC_BG
318 * to power off everything instead of DP_PHY_PD in
321 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
326 reg
= readl(dp
->reg_base
+ phy_pd_addr
);
332 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
333 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
334 usleep_range(10, 15);
339 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
342 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
343 usleep_range(10, 15);
345 writel(reg
, dp
->reg_base
+ phy_pd_addr
);
346 usleep_range(10, 15);
348 writel(0x00, dp
->reg_base
+ phy_pd_addr
);
356 int analogix_dp_init_analog_func(struct analogix_dp_device
*dp
)
359 int timeout_loop
= 0;
361 analogix_dp_set_analog_power_down(dp
, POWER_ALL
, 0);
364 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_1
);
366 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_DEBUG_CTL
);
367 reg
&= ~(F_PLL_LOCK
| PLL_LOCK_CTRL
);
368 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_DEBUG_CTL
);
371 if (analogix_dp_get_pll_lock_status(dp
) == PLL_UNLOCKED
) {
372 analogix_dp_set_pll_power_down(dp
, 0);
374 while (analogix_dp_get_pll_lock_status(dp
) == PLL_UNLOCKED
) {
376 if (DP_TIMEOUT_LOOP_COUNT
< timeout_loop
) {
377 dev_err(dp
->dev
, "failed to get pll lock status\n");
380 usleep_range(10, 20);
384 /* Enable Serdes FIFO function and Link symbol clock domain module */
385 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
386 reg
&= ~(SERDES_FIFO_FUNC_EN_N
| LS_CLK_DOMAIN_FUNC_EN_N
388 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
392 void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device
*dp
)
399 reg
= HOTPLUG_CHG
| HPD_LOST
| PLUG
;
400 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_4
);
403 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
406 void analogix_dp_init_hpd(struct analogix_dp_device
*dp
)
413 analogix_dp_clear_hotplug_interrupts(dp
);
415 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
416 reg
&= ~(F_HPD
| HPD_CTRL
);
417 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
420 void analogix_dp_force_hpd(struct analogix_dp_device
*dp
)
424 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
425 reg
= (F_HPD
| HPD_CTRL
);
426 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
429 enum dp_irq_type
analogix_dp_get_irq_type(struct analogix_dp_device
*dp
)
434 reg
= gpiod_get_value(dp
->hpd_gpiod
);
436 return DP_IRQ_TYPE_HP_CABLE_IN
;
438 return DP_IRQ_TYPE_HP_CABLE_OUT
;
440 /* Parse hotplug interrupt status register */
441 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_4
);
444 return DP_IRQ_TYPE_HP_CABLE_IN
;
447 return DP_IRQ_TYPE_HP_CABLE_OUT
;
449 if (reg
& HOTPLUG_CHG
)
450 return DP_IRQ_TYPE_HP_CHANGE
;
452 return DP_IRQ_TYPE_UNKNOWN
;
456 void analogix_dp_reset_aux(struct analogix_dp_device
*dp
)
460 /* Disable AUX channel module */
461 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
462 reg
|= AUX_FUNC_EN_N
;
463 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
466 void analogix_dp_init_aux(struct analogix_dp_device
*dp
)
470 /* Clear inerrupts related to AUX channel */
471 reg
= RPLY_RECEIV
| AUX_ERR
;
472 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
474 analogix_dp_set_analog_power_down(dp
, AUX_BLOCK
, true);
475 usleep_range(10, 11);
476 analogix_dp_set_analog_power_down(dp
, AUX_BLOCK
, false);
478 analogix_dp_reset_aux(dp
);
480 /* AUX_BIT_PERIOD_EXPECTED_DELAY doesn't apply to Rockchip IP */
481 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
))
484 reg
= AUX_BIT_PERIOD_EXPECTED_DELAY(3);
486 /* Disable AUX transaction H/W retry */
487 reg
|= AUX_HW_RETRY_COUNT_SEL(0) |
488 AUX_HW_RETRY_INTERVAL_600_MICROSECONDS
;
490 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_HW_RETRY_CTL
);
492 /* Receive AUX Channel DEFER commands equal to DEFFER_COUNT*64 */
493 reg
= DEFER_CTRL_EN
| DEFER_COUNT(1);
494 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_DEFER_CTL
);
496 /* Enable AUX channel module */
497 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
498 reg
&= ~AUX_FUNC_EN_N
;
499 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_2
);
502 int analogix_dp_get_plug_in_status(struct analogix_dp_device
*dp
)
507 if (gpiod_get_value(dp
->hpd_gpiod
))
510 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
511 if (reg
& HPD_STATUS
)
518 void analogix_dp_enable_sw_function(struct analogix_dp_device
*dp
)
522 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_1
);
523 reg
&= ~SW_FUNC_EN_N
;
524 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_1
);
527 int analogix_dp_start_aux_transaction(struct analogix_dp_device
*dp
)
531 int timeout_loop
= 0;
533 /* Enable AUX CH operation */
534 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_2
);
536 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_2
);
538 /* Is AUX CH command reply received? */
539 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
540 while (!(reg
& RPLY_RECEIV
)) {
542 if (DP_TIMEOUT_LOOP_COUNT
< timeout_loop
) {
543 dev_err(dp
->dev
, "AUX CH command reply failed!\n");
546 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
547 usleep_range(10, 11);
550 /* Clear interrupt source for AUX CH command reply */
551 writel(RPLY_RECEIV
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
553 /* Clear interrupt source for AUX CH access error */
554 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
556 writel(AUX_ERR
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
560 /* Check AUX CH error access status */
561 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_AUX_CH_STA
);
562 if ((reg
& AUX_STATUS_MASK
) != 0) {
563 dev_err(dp
->dev
, "AUX CH error happens: %d\n\n",
564 reg
& AUX_STATUS_MASK
);
571 int analogix_dp_write_byte_to_dpcd(struct analogix_dp_device
*dp
,
572 unsigned int reg_addr
,
579 for (i
= 0; i
< 3; i
++) {
580 /* Clear AUX CH data buffer */
582 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_BUFFER_DATA_CTL
);
584 /* Select DPCD device address */
585 reg
= AUX_ADDR_7_0(reg_addr
);
586 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_7_0
);
587 reg
= AUX_ADDR_15_8(reg_addr
);
588 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_15_8
);
589 reg
= AUX_ADDR_19_16(reg_addr
);
590 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_19_16
);
592 /* Write data buffer */
593 reg
= (unsigned int)data
;
594 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_BUF_DATA_0
);
597 * Set DisplayPort transaction and write 1 byte
598 * If bit 3 is 1, DisplayPort transaction.
599 * If Bit 3 is 0, I2C transaction.
601 reg
= AUX_TX_COMM_DP_TRANSACTION
| AUX_TX_COMM_WRITE
;
602 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_1
);
604 /* Start AUX transaction */
605 retval
= analogix_dp_start_aux_transaction(dp
);
609 dev_dbg(dp
->dev
, "%s: Aux Transaction fail!\n", __func__
);
615 void analogix_dp_set_link_bandwidth(struct analogix_dp_device
*dp
, u32 bwtype
)
620 if ((bwtype
== DP_LINK_BW_2_7
) || (bwtype
== DP_LINK_BW_1_62
))
621 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LINK_BW_SET
);
624 void analogix_dp_get_link_bandwidth(struct analogix_dp_device
*dp
, u32
*bwtype
)
628 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LINK_BW_SET
);
632 void analogix_dp_set_lane_count(struct analogix_dp_device
*dp
, u32 count
)
637 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LANE_COUNT_SET
);
640 void analogix_dp_get_lane_count(struct analogix_dp_device
*dp
, u32
*count
)
644 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LANE_COUNT_SET
);
648 void analogix_dp_enable_enhanced_mode(struct analogix_dp_device
*dp
,
654 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
656 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
658 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
660 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
664 void analogix_dp_set_training_pattern(struct analogix_dp_device
*dp
,
665 enum pattern_set pattern
)
671 reg
= SCRAMBLING_ENABLE
| LINK_QUAL_PATTERN_SET_PRBS7
;
672 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
675 reg
= SCRAMBLING_ENABLE
| LINK_QUAL_PATTERN_SET_D10_2
;
676 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
679 reg
= SCRAMBLING_DISABLE
| SW_TRAINING_PATTERN_SET_PTN1
;
680 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
683 reg
= SCRAMBLING_DISABLE
| SW_TRAINING_PATTERN_SET_PTN2
;
684 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
687 reg
= SCRAMBLING_ENABLE
|
688 LINK_QUAL_PATTERN_SET_DISABLE
|
689 SW_TRAINING_PATTERN_SET_NORMAL
;
690 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
697 void analogix_dp_set_lane0_pre_emphasis(struct analogix_dp_device
*dp
,
702 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LN0_LINK_TRAINING_CTL
);
703 reg
&= ~PRE_EMPHASIS_SET_MASK
;
704 reg
|= level
<< PRE_EMPHASIS_SET_SHIFT
;
705 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN0_LINK_TRAINING_CTL
);
708 void analogix_dp_set_lane1_pre_emphasis(struct analogix_dp_device
*dp
,
713 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LN1_LINK_TRAINING_CTL
);
714 reg
&= ~PRE_EMPHASIS_SET_MASK
;
715 reg
|= level
<< PRE_EMPHASIS_SET_SHIFT
;
716 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN1_LINK_TRAINING_CTL
);
719 void analogix_dp_set_lane2_pre_emphasis(struct analogix_dp_device
*dp
,
724 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LN2_LINK_TRAINING_CTL
);
725 reg
&= ~PRE_EMPHASIS_SET_MASK
;
726 reg
|= level
<< PRE_EMPHASIS_SET_SHIFT
;
727 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN2_LINK_TRAINING_CTL
);
730 void analogix_dp_set_lane3_pre_emphasis(struct analogix_dp_device
*dp
,
735 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_LN3_LINK_TRAINING_CTL
);
736 reg
&= ~PRE_EMPHASIS_SET_MASK
;
737 reg
|= level
<< PRE_EMPHASIS_SET_SHIFT
;
738 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN3_LINK_TRAINING_CTL
);
741 void analogix_dp_set_lane0_link_training(struct analogix_dp_device
*dp
,
747 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN0_LINK_TRAINING_CTL
);
750 void analogix_dp_set_lane1_link_training(struct analogix_dp_device
*dp
,
756 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN1_LINK_TRAINING_CTL
);
759 void analogix_dp_set_lane2_link_training(struct analogix_dp_device
*dp
,
765 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN2_LINK_TRAINING_CTL
);
768 void analogix_dp_set_lane3_link_training(struct analogix_dp_device
*dp
,
774 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_LN3_LINK_TRAINING_CTL
);
777 u32
analogix_dp_get_lane0_link_training(struct analogix_dp_device
*dp
)
779 return readl(dp
->reg_base
+ ANALOGIX_DP_LN0_LINK_TRAINING_CTL
);
782 u32
analogix_dp_get_lane1_link_training(struct analogix_dp_device
*dp
)
784 return readl(dp
->reg_base
+ ANALOGIX_DP_LN1_LINK_TRAINING_CTL
);
787 u32
analogix_dp_get_lane2_link_training(struct analogix_dp_device
*dp
)
789 return readl(dp
->reg_base
+ ANALOGIX_DP_LN2_LINK_TRAINING_CTL
);
792 u32
analogix_dp_get_lane3_link_training(struct analogix_dp_device
*dp
)
794 return readl(dp
->reg_base
+ ANALOGIX_DP_LN3_LINK_TRAINING_CTL
);
797 void analogix_dp_reset_macro(struct analogix_dp_device
*dp
)
801 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_PHY_TEST
);
803 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_PHY_TEST
);
805 /* 10 us is the minimum reset time. */
806 usleep_range(10, 20);
809 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_PHY_TEST
);
812 void analogix_dp_init_video(struct analogix_dp_device
*dp
)
816 reg
= VSYNC_DET
| VID_FORMAT_CHG
| VID_CLK_CHG
;
817 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_COMMON_INT_STA_1
);
820 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_1
);
822 reg
= CHA_CRI(4) | CHA_CTRL
;
823 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_2
);
826 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
828 reg
= VID_HRES_TH(2) | VID_VRES_TH(0);
829 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_8
);
832 void analogix_dp_set_video_color_format(struct analogix_dp_device
*dp
)
836 /* Configure the input color depth, color space, dynamic range */
837 reg
= (dp
->video_info
.dynamic_range
<< IN_D_RANGE_SHIFT
) |
838 (dp
->video_info
.color_depth
<< IN_BPC_SHIFT
) |
839 (dp
->video_info
.color_space
<< IN_COLOR_F_SHIFT
);
840 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_2
);
842 /* Set Input Color YCbCr Coefficients to ITU601 or ITU709 */
843 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_3
);
844 reg
&= ~IN_YC_COEFFI_MASK
;
845 if (dp
->video_info
.ycbcr_coeff
)
846 reg
|= IN_YC_COEFFI_ITU709
;
848 reg
|= IN_YC_COEFFI_ITU601
;
849 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_3
);
852 int analogix_dp_is_slave_video_stream_clock_on(struct analogix_dp_device
*dp
)
856 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_1
);
857 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_1
);
859 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_1
);
861 if (!(reg
& DET_STA
)) {
862 dev_dbg(dp
->dev
, "Input stream clock not detected.\n");
866 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_2
);
867 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_2
);
869 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_2
);
870 dev_dbg(dp
->dev
, "wait SYS_CTL_2.\n");
873 dev_dbg(dp
->dev
, "Input stream clk is changing\n");
880 void analogix_dp_set_video_cr_mn(struct analogix_dp_device
*dp
,
881 enum clock_recovery_m_value_type type
,
882 u32 m_value
, u32 n_value
)
886 if (type
== REGISTER_M
) {
887 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
889 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
890 reg
= m_value
& 0xff;
891 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_M_VID_0
);
892 reg
= (m_value
>> 8) & 0xff;
893 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_M_VID_1
);
894 reg
= (m_value
>> 16) & 0xff;
895 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_M_VID_2
);
897 reg
= n_value
& 0xff;
898 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_N_VID_0
);
899 reg
= (n_value
>> 8) & 0xff;
900 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_N_VID_1
);
901 reg
= (n_value
>> 16) & 0xff;
902 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_N_VID_2
);
904 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
906 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_4
);
908 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_N_VID_0
);
909 writel(0x80, dp
->reg_base
+ ANALOGIX_DP_N_VID_1
);
910 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_N_VID_2
);
914 void analogix_dp_set_video_timing_mode(struct analogix_dp_device
*dp
, u32 type
)
918 if (type
== VIDEO_TIMING_FROM_CAPTURE
) {
919 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
921 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
923 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
925 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
929 void analogix_dp_enable_video_master(struct analogix_dp_device
*dp
, bool enable
)
934 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
935 reg
&= ~VIDEO_MODE_MASK
;
936 reg
|= VIDEO_MASTER_MODE_EN
| VIDEO_MODE_MASTER_MODE
;
937 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
939 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
940 reg
&= ~VIDEO_MODE_MASK
;
941 reg
|= VIDEO_MODE_SLAVE_MODE
;
942 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
946 void analogix_dp_start_video(struct analogix_dp_device
*dp
)
950 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
952 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_1
);
955 int analogix_dp_is_video_stream_on(struct analogix_dp_device
*dp
)
959 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
960 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
962 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_SYS_CTL_3
);
963 if (!(reg
& STRM_VALID
)) {
964 dev_dbg(dp
->dev
, "Input video stream is not detected.\n");
971 void analogix_dp_config_video_slave_mode(struct analogix_dp_device
*dp
)
975 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_1
);
976 if (dp
->plat_data
&& is_rockchip(dp
->plat_data
->dev_type
)) {
977 reg
&= ~(RK_VID_CAP_FUNC_EN_N
| RK_VID_FIFO_FUNC_EN_N
);
979 reg
&= ~(MASTER_VID_FUNC_EN_N
| SLAVE_VID_FUNC_EN_N
);
980 reg
|= MASTER_VID_FUNC_EN_N
;
982 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_FUNC_EN_1
);
984 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
985 reg
&= ~INTERACE_SCAN_CFG
;
986 reg
|= (dp
->video_info
.interlaced
<< 2);
987 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
989 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
990 reg
&= ~VSYNC_POLARITY_CFG
;
991 reg
|= (dp
->video_info
.v_sync_polarity
<< 1);
992 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
994 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
995 reg
&= ~HSYNC_POLARITY_CFG
;
996 reg
|= (dp
->video_info
.h_sync_polarity
<< 0);
997 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_10
);
999 reg
= AUDIO_MODE_SPDIF_MODE
| VIDEO_MODE_SLAVE_MODE
;
1000 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_SOC_GENERAL_CTL
);
1003 void analogix_dp_enable_scrambling(struct analogix_dp_device
*dp
)
1007 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
1008 reg
&= ~SCRAMBLING_DISABLE
;
1009 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
1012 void analogix_dp_disable_scrambling(struct analogix_dp_device
*dp
)
1016 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
1017 reg
|= SCRAMBLING_DISABLE
;
1018 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_TRAINING_PTN_SET
);
1021 void analogix_dp_enable_psr_crc(struct analogix_dp_device
*dp
)
1023 writel(PSR_VID_CRC_ENABLE
, dp
->reg_base
+ ANALOGIX_DP_CRC_CON
);
1026 static ssize_t
analogix_dp_get_psr_status(struct analogix_dp_device
*dp
)
1031 val
= drm_dp_dpcd_readb(&dp
->aux
, DP_PSR_STATUS
, &status
);
1033 dev_err(dp
->dev
, "PSR_STATUS read failed ret=%zd", val
);
1039 int analogix_dp_send_psr_spd(struct analogix_dp_device
*dp
,
1040 struct dp_sdp
*vsc
, bool blocking
)
1046 /* don't send info frame */
1047 val
= readl(dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1049 writel(val
, dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1051 /* configure single frame update mode */
1052 writel(PSR_FRAME_UP_TYPE_BURST
| PSR_CRC_SEL_HARDWARE
,
1053 dp
->reg_base
+ ANALOGIX_DP_PSR_FRAME_UPDATE_CTRL
);
1055 /* configure VSC HB0~HB3 */
1056 writel(vsc
->sdp_header
.HB0
, dp
->reg_base
+ ANALOGIX_DP_SPD_HB0
);
1057 writel(vsc
->sdp_header
.HB1
, dp
->reg_base
+ ANALOGIX_DP_SPD_HB1
);
1058 writel(vsc
->sdp_header
.HB2
, dp
->reg_base
+ ANALOGIX_DP_SPD_HB2
);
1059 writel(vsc
->sdp_header
.HB3
, dp
->reg_base
+ ANALOGIX_DP_SPD_HB3
);
1061 /* configure reused VSC PB0~PB3, magic number from vendor */
1062 writel(0x00, dp
->reg_base
+ ANALOGIX_DP_SPD_PB0
);
1063 writel(0x16, dp
->reg_base
+ ANALOGIX_DP_SPD_PB1
);
1064 writel(0xCE, dp
->reg_base
+ ANALOGIX_DP_SPD_PB2
);
1065 writel(0x5D, dp
->reg_base
+ ANALOGIX_DP_SPD_PB3
);
1067 /* configure DB0 / DB1 values */
1068 writel(vsc
->db
[0], dp
->reg_base
+ ANALOGIX_DP_VSC_SHADOW_DB0
);
1069 writel(vsc
->db
[1], dp
->reg_base
+ ANALOGIX_DP_VSC_SHADOW_DB1
);
1071 /* set reuse spd inforframe */
1072 val
= readl(dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_3
);
1073 val
|= REUSE_SPD_EN
;
1074 writel(val
, dp
->reg_base
+ ANALOGIX_DP_VIDEO_CTL_3
);
1076 /* mark info frame update */
1077 val
= readl(dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1078 val
= (val
| IF_UP
) & ~IF_EN
;
1079 writel(val
, dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1081 /* send info frame */
1082 val
= readl(dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1084 writel(val
, dp
->reg_base
+ ANALOGIX_DP_PKT_SEND_CTL
);
1089 ret
= readx_poll_timeout(analogix_dp_get_psr_status
, dp
, psr_status
,
1091 ((vsc
->db
[1] && psr_status
== DP_PSR_SINK_ACTIVE_RFB
) ||
1092 (!vsc
->db
[1] && psr_status
== DP_PSR_SINK_INACTIVE
)), 1500,
1093 DP_TIMEOUT_PSR_LOOP_MS
* 1000);
1095 dev_warn(dp
->dev
, "Failed to apply PSR %d\n", ret
);
1101 ssize_t
analogix_dp_transfer(struct analogix_dp_device
*dp
,
1102 struct drm_dp_aux_msg
*msg
)
1106 u8
*buffer
= msg
->buffer
;
1108 int num_transferred
= 0;
1111 /* Buffer size of AUX CH is 16 bytes */
1112 if (WARN_ON(msg
->size
> 16))
1115 /* Clear AUX CH data buffer */
1117 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_BUFFER_DATA_CTL
);
1119 switch (msg
->request
& ~DP_AUX_I2C_MOT
) {
1120 case DP_AUX_I2C_WRITE
:
1121 reg
= AUX_TX_COMM_WRITE
| AUX_TX_COMM_I2C_TRANSACTION
;
1122 if (msg
->request
& DP_AUX_I2C_MOT
)
1123 reg
|= AUX_TX_COMM_MOT
;
1126 case DP_AUX_I2C_READ
:
1127 reg
= AUX_TX_COMM_READ
| AUX_TX_COMM_I2C_TRANSACTION
;
1128 if (msg
->request
& DP_AUX_I2C_MOT
)
1129 reg
|= AUX_TX_COMM_MOT
;
1132 case DP_AUX_NATIVE_WRITE
:
1133 reg
= AUX_TX_COMM_WRITE
| AUX_TX_COMM_DP_TRANSACTION
;
1136 case DP_AUX_NATIVE_READ
:
1137 reg
= AUX_TX_COMM_READ
| AUX_TX_COMM_DP_TRANSACTION
;
1144 reg
|= AUX_LENGTH(msg
->size
);
1145 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_1
);
1147 /* Select DPCD device address */
1148 reg
= AUX_ADDR_7_0(msg
->address
);
1149 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_7_0
);
1150 reg
= AUX_ADDR_15_8(msg
->address
);
1151 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_15_8
);
1152 reg
= AUX_ADDR_19_16(msg
->address
);
1153 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_ADDR_19_16
);
1155 if (!(msg
->request
& DP_AUX_I2C_READ
)) {
1156 for (i
= 0; i
< msg
->size
; i
++) {
1158 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_BUF_DATA_0
+
1164 /* Enable AUX CH operation */
1167 /* Zero-sized messages specify address-only transactions. */
1171 writel(reg
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_2
);
1173 ret
= readx_poll_timeout(readl
, dp
->reg_base
+ ANALOGIX_DP_AUX_CH_CTL_2
,
1174 reg
, !(reg
& AUX_EN
), 25, 500 * 1000);
1176 dev_err(dp
->dev
, "AUX CH enable timeout!\n");
1180 /* TODO: Wait for an interrupt instead of looping? */
1181 /* Is AUX CH command reply received? */
1182 ret
= readx_poll_timeout(readl
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
,
1183 reg
, reg
& RPLY_RECEIV
, 10, 20 * 1000);
1185 dev_err(dp
->dev
, "AUX CH cmd reply timeout!\n");
1189 /* Clear interrupt source for AUX CH command reply */
1190 writel(RPLY_RECEIV
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
1192 /* Clear interrupt source for AUX CH access error */
1193 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
1194 status_reg
= readl(dp
->reg_base
+ ANALOGIX_DP_AUX_CH_STA
);
1195 if ((reg
& AUX_ERR
) || (status_reg
& AUX_STATUS_MASK
)) {
1196 writel(AUX_ERR
, dp
->reg_base
+ ANALOGIX_DP_INT_STA
);
1198 dev_warn(dp
->dev
, "AUX CH error happened: %#x (%d)\n",
1199 status_reg
& AUX_STATUS_MASK
, !!(reg
& AUX_ERR
));
1203 if (msg
->request
& DP_AUX_I2C_READ
) {
1204 for (i
= 0; i
< msg
->size
; i
++) {
1205 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_BUF_DATA_0
+
1207 buffer
[i
] = (unsigned char)reg
;
1212 /* Check if Rx sends defer */
1213 reg
= readl(dp
->reg_base
+ ANALOGIX_DP_AUX_RX_COMM
);
1214 if (reg
== AUX_RX_COMM_AUX_DEFER
)
1215 msg
->reply
= DP_AUX_NATIVE_REPLY_DEFER
;
1216 else if (reg
== AUX_RX_COMM_I2C_DEFER
)
1217 msg
->reply
= DP_AUX_I2C_REPLY_DEFER
;
1218 else if ((msg
->request
& ~DP_AUX_I2C_MOT
) == DP_AUX_I2C_WRITE
||
1219 (msg
->request
& ~DP_AUX_I2C_MOT
) == DP_AUX_I2C_READ
)
1220 msg
->reply
= DP_AUX_I2C_REPLY_ACK
;
1221 else if ((msg
->request
& ~DP_AUX_I2C_MOT
) == DP_AUX_NATIVE_WRITE
||
1222 (msg
->request
& ~DP_AUX_I2C_MOT
) == DP_AUX_NATIVE_READ
)
1223 msg
->reply
= DP_AUX_NATIVE_REPLY_ACK
;
1225 return num_transferred
> 0 ? num_transferred
: -EBUSY
;
1228 /* if aux err happen, reset aux */
1229 analogix_dp_init_aux(dp
);