History

phy: Add DisplayPort configuration options

Allow DisplayPort PHYs to be configured through the generic functions through a custom structure added to the generic union. The configuration structure is used for reconfiguration of DisplayPort PHYs during link training operation. The parameters added here are the ones defined in the DisplayPort spec v1.4 which include link rate, number of lanes, voltage swing and pre-emphasis. Add the DisplayPort phy mode to the generic phy_mode enum.

Yuti Amonkar committed 6 years ago

Commit 42d06841 parent e7b4aaf2 files · +100 −0Browse files

Showing the changes to include/linux (2 of 2 files). Show all

Unified · Split

2 files
  1. include/linux/phy/phy-dp.h +95 −0
  2. include/linux/phy/phy.h +5 −0
include/linux/phy/phy-dp.h+95−0
@@ -0,0 +1,95 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2019 Cadence Design Systems Inc.
4 */
5
6#ifndef __PHY_DP_H_
7#define __PHY_DP_H_
8
9#include <linux/types.h>
10
11/**
12 * struct phy_configure_opts_dp - DisplayPort PHY configuration set
13 *
14 * This structure is used to represent the configuration state of a
15 * DisplayPort phy.
16 */
17struct phy_configure_opts_dp {
18 /**
19 * @link_rate:
20 *
21 * Link Rate, in Mb/s, of the main link.
22 *
23 * Allowed values: 1620, 2160, 2430, 2700, 3240, 4320, 5400, 8100 Mb/s
24 */
25 unsigned int link_rate;
26
27 /**
28 * @lanes:
29 *
30 * Number of active, consecutive, data lanes, starting from
31 * lane 0, used for the transmissions on main link.
32 *
33 * Allowed values: 1, 2, 4
34 */
35 unsigned int lanes;
36
37 /**
38 * @voltage:
39 *
40 * Voltage swing levels, as specified by DisplayPort specification,
41 * to be used by particular lanes. One value per lane.
42 * voltage[0] is for lane 0, voltage[1] is for lane 1, etc.
43 *
44 * Maximum value: 3
45 */
46 unsigned int voltage[4];
47
48 /**
49 * @pre:
50 *
51 * Pre-emphasis levels, as specified by DisplayPort specification, to be
52 * used by particular lanes. One value per lane.
53 *
54 * Maximum value: 3
55 */
56 unsigned int pre[4];
57
58 /**
59 * @ssc:
60 *
61 * Flag indicating, whether or not to enable spread-spectrum clocking.
62 *
63 */
64 u8 ssc : 1;
65
66 /**
67 * @set_rate:
68 *
69 * Flag indicating, whether or not reconfigure link rate and SSC to
70 * requested values.
71 *
72 */
73 u8 set_rate : 1;
74
75 /**
76 * @set_lanes:
77 *
78 * Flag indicating, whether or not reconfigure lane count to
79 * requested value.
80 *
81 */
82 u8 set_lanes : 1;
83
84 /**
85 * @set_voltages:
86 *
87 * Flag indicating, whether or not reconfigure voltage swing
88 * and pre-emphasis to requested values. Only lanes specified
89 * by "lanes" parameter will be affected.
90 *
91 */
92 u8 set_voltages : 1;
93};
94
95#endif /* __PHY_DP_H_ */
include/linux/phy/phy.h+5−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/pm_runtime.h>16#include <linux/pm_runtime.h>
17#include <linux/regulator/consumer.h>17#include <linux/regulator/consumer.h>
18 18
19#include <linux/phy/phy-dp.h>
19#include <linux/phy/phy-mipi-dphy.h>20#include <linux/phy/phy-mipi-dphy.h>
20 21
21struct phy;22struct phy;
@@ -40,6 +41,7 @@ enum phy_mode { · 18 unmodified lines
40 PHY_MODE_MIPI_DPHY,41 PHY_MODE_MIPI_DPHY,
41 PHY_MODE_SATA,42 PHY_MODE_SATA,
42 PHY_MODE_LVDS,43 PHY_MODE_LVDS,
44 PHY_MODE_DP
43};45};
44 46
45/**47/**
@@ -47,9 +49,12 @@ enum phy_mode { · 1 unmodified line
47 *49 *
48 * @mipi_dphy: Configuration set applicable for phys supporting50 * @mipi_dphy: Configuration set applicable for phys supporting
49 * the MIPI_DPHY phy mode.51 * the MIPI_DPHY phy mode.
52 * @dp: Configuration set applicable for phys supporting
53 * the DisplayPort protocol.
50 */54 */
51union phy_configure_opts {55union phy_configure_opts {
52 struct phy_configure_opts_mipi_dphy mipi_dphy;56 struct phy_configure_opts_mipi_dphy mipi_dphy;
57 struct phy_configure_opts_dp dp;
53};58};
54 59
55/**60/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t