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

phy: Add LVDS configuration options

This patch allows LVDS PHYs to be configured through
the generic functions and through a custom structure
added to the generic union.

The parameters added here are based on common LVDS PHY
implementation practices. The set of parameters
should cover all potential users.

Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: NXP Linux Team <linux-imx@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20220419010852.452169-3-victor.liu@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Liu Ying and committed by
Vinod Koul
3abfaefb e72659b6

+36
+32
include/linux/phy/phy-lvds.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright 2020,2022 NXP 4 + */ 5 + 6 + #ifndef __PHY_LVDS_H_ 7 + #define __PHY_LVDS_H_ 8 + 9 + /** 10 + * struct phy_configure_opts_lvds - LVDS configuration set 11 + * @bits_per_lane_and_dclk_cycle: Number of bits per lane per differential 12 + * clock cycle. 13 + * @differential_clk_rate: Clock rate, in Hertz, of the LVDS 14 + * differential clock. 15 + * @lanes: Number of active, consecutive, 16 + * data lanes, starting from lane 0, 17 + * used for the transmissions. 18 + * @is_slave: Boolean, true if the phy is a slave 19 + * which works together with a master 20 + * phy to support dual link transmission, 21 + * otherwise a regular phy or a master phy. 22 + * 23 + * This structure is used to represent the configuration state of a LVDS phy. 24 + */ 25 + struct phy_configure_opts_lvds { 26 + unsigned int bits_per_lane_and_dclk_cycle; 27 + unsigned long differential_clk_rate; 28 + unsigned int lanes; 29 + bool is_slave; 30 + }; 31 + 32 + #endif /* __PHY_LVDS_H_ */
+4
include/linux/phy/phy.h
··· 17 17 #include <linux/regulator/consumer.h> 18 18 19 19 #include <linux/phy/phy-dp.h> 20 + #include <linux/phy/phy-lvds.h> 20 21 #include <linux/phy/phy-mipi-dphy.h> 21 22 22 23 struct phy; ··· 58 57 * the MIPI_DPHY phy mode. 59 58 * @dp: Configuration set applicable for phys supporting 60 59 * the DisplayPort protocol. 60 + * @lvds: Configuration set applicable for phys supporting 61 + * the LVDS phy mode. 61 62 */ 62 63 union phy_configure_opts { 63 64 struct phy_configure_opts_mipi_dphy mipi_dphy; 64 65 struct phy_configure_opts_dp dp; 66 + struct phy_configure_opts_lvds lvds; 65 67 }; 66 68 67 69 /**