Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Yuti Amonkar <yamonkar@cadence.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Yuti Amonkar and committed by
Kishon Vijay Abraham I
42d06847 e7b4aaf0

+100
+95
include/linux/phy/phy-dp.h
··· 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 + */ 17 + struct 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_ */
+5
include/linux/phy/phy.h
··· 16 16 #include <linux/pm_runtime.h> 17 17 #include <linux/regulator/consumer.h> 18 18 19 + #include <linux/phy/phy-dp.h> 19 20 #include <linux/phy/phy-mipi-dphy.h> 20 21 21 22 struct phy; ··· 41 40 PHY_MODE_MIPI_DPHY, 42 41 PHY_MODE_SATA, 43 42 PHY_MODE_LVDS, 43 + PHY_MODE_DP 44 44 }; 45 45 46 46 /** ··· 49 47 * 50 48 * @mipi_dphy: Configuration set applicable for phys supporting 51 49 * the MIPI_DPHY phy mode. 50 + * @dp: Configuration set applicable for phys supporting 51 + * the DisplayPort protocol. 52 52 */ 53 53 union phy_configure_opts { 54 54 struct phy_configure_opts_mipi_dphy mipi_dphy; 55 + struct phy_configure_opts_dp dp; 55 56 }; 56 57 57 58 /**