Re: [PATCH v1] phy: Add DisplayPort configuration options
From: Kishon Vijay Abraham I
Date: Mon Dec 23 2019 - 07:34:35 EST
+ Maxime (Fixed Maxime's email address)
On 23/12/19 5:57 PM, Kishon Vijay Abraham I wrote:
> + Maxime
>
> Hi,
>
> On 23/12/19 12:24 PM, Yuti Amonkar wrote:
>> 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 which include link rate, number of lanes, voltage swing
>> and pre-emphasis.
>
> Which version of display port specification?
>
> Rest of commit log should move below the "---"
>
>
>>
>> This patch was a part of [1] series earlier but we think that it needs
>> to have a separate attention of the reviewers. Also as both [1] & [2] are
>> dependent on this patch, our sincere request to reviewers to have a
>> faster review of this patch.
>>
>> [1]
>>
>> https://lkml.org/lkml/2019/12/11/455
>>
>> [2]
>>
>> https://patchwork.kernel.org/cover/11271191/
>
> Thanks
> Kishon
>
>>
>> Signed-off-by: Yuti Amonkar <yamonkar@xxxxxxxxxxx>
>> ---
>> Â include/linux/phy/phy-dp.h | 95
>> ++++++++++++++++++++++++++++++++++++++++++++++
>> Â include/linux/phy/phy.hÂÂÂ |Â 4 ++
>> Â 2 files changed, 99 insertions(+)
>> Â create mode 100644 include/linux/phy/phy-dp.h
>>
>> diff --git a/include/linux/phy/phy-dp.h b/include/linux/phy/phy-dp.h
>> new file mode 100644
>> index 0000000..18cad23
>> --- /dev/null
>> +++ b/include/linux/phy/phy-dp.h
>> @@ -0,0 +1,95 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/*
>> + * Copyright (C) 2019 Cadence Design Systems Inc.
>> + */
>> +
>> +#ifndef __PHY_DP_H_
>> +#define __PHY_DP_H_
>> +
>> +#include <linux/types.h>
>> +
>> +/**
>> + * struct phy_configure_opts_dp - DisplayPort PHY configuration set
>> + *
>> + * This structure is used to represent the configuration state of a
>> + * DisplayPort phy.
>> + */
>> +struct phy_configure_opts_dp {
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @link_rate:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Link Rate, in Mb/s, of the main link.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Allowed values: 1620, 2160, 2430, 2700, 3240, 4320, 5400, 8100
>> Mb/s
>> +ÂÂÂÂ */
>> +ÂÂÂ unsigned int link_rate;
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @lanes:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Number of active, consecutive, data lanes, starting from
>> +ÂÂÂÂ * lane 0, used for the transmissions on main link.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Allowed values: 1, 2, 4
>> +ÂÂÂÂ */
>> +ÂÂÂ unsigned int lanes;
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @voltage:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Voltage swing levels, as specified by DisplayPort specification,
>> +ÂÂÂÂ * to be used by particular lanes. One value per lane.
>> +ÂÂÂÂ * voltage[0] is for lane 0, voltage[1] is for lane 1, etc.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Maximum value: 3
>> +ÂÂÂÂ */
>> +ÂÂÂ unsigned int voltage[4];
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @pre:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Pre-emphasis levels, as specified by DisplayPort
>> specification, to be
>> +ÂÂÂÂ * used by particular lanes. One value per lane.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Maximum value: 3
>> +ÂÂÂÂ */
>> +ÂÂÂ unsigned int pre[4];
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @ssc:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Flag indicating, whether or not to enable spread-spectrum
>> clocking.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ */
>> +ÂÂÂ u8 ssc : 1;
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @set_rate:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Flag indicating, whether or not reconfigure link rate and SSC to
>> +ÂÂÂÂ * requested values.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ */
>> +ÂÂÂ u8 set_rate : 1;
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @set_lanes:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Flag indicating, whether or not reconfigure lane count to
>> +ÂÂÂÂ * requested value.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ */
>> +ÂÂÂ u8 set_lanes : 1;
>> +
>> +ÂÂÂ /**
>> +ÂÂÂÂ * @set_voltages:
>> +ÂÂÂÂ *
>> +ÂÂÂÂ * Flag indicating, whether or not reconfigure voltage swing
>> +ÂÂÂÂ * and pre-emphasis to requested values. Only lanes specified
>> +ÂÂÂÂ * by "lanes" parameter will be affected.
>> +ÂÂÂÂ *
>> +ÂÂÂÂ */
>> +ÂÂÂ u8 set_voltages : 1;
>> +};
>> +
>> +#endif /* __PHY_DP_H_ */
>> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
>> index 15032f14..ba0aab5 100644
>> --- a/include/linux/phy/phy.h
>> +++ b/include/linux/phy/phy.h
>> @@ -16,6 +16,7 @@
>> Â #include <linux/pm_runtime.h>
>> Â #include <linux/regulator/consumer.h>
>> Â +#include <linux/phy/phy-dp.h>
>> Â #include <linux/phy/phy-mipi-dphy.h>
>> Â Â struct phy;
>> @@ -46,9 +47,12 @@ enum phy_mode {
>> ÂÂ *
>> ÂÂ * @mipi_dphy:ÂÂÂ Configuration set applicable for phys supporting
>> ÂÂ *ÂÂÂÂÂÂÂ the MIPI_DPHY phy mode.
>> + * @dp:ÂÂÂÂÂÂÂ Configuration set applicable for phys supporting
>> + *ÂÂÂÂÂÂÂ the DisplayPort protocol.
>> ÂÂ */
>> Â union phy_configure_opts {
>> ÂÂÂÂÂ struct phy_configure_opts_mipi_dphyÂÂÂ mipi_dphy;
>> +ÂÂÂ struct phy_configure_opts_dpÂÂÂÂÂÂÂ dp;
>> Â };
>> Â Â /**
>>