phy: phy-rockchip-snps-pcie3: add support submode
Change-Id: I23d0750a60ffde30f434e1c676916d4bc4772400 Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
@@ -76,6 +76,15 @@ config PHY_ROCKCHIP_PCIE
|
||||
help
|
||||
Enable this to support the Rockchip PCIe PHY.
|
||||
|
||||
config PHY_ROCKCHIP_SNPS_PCIE3
|
||||
tristate "Rockchip Snps PCIe3 PHY Driver"
|
||||
depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST
|
||||
depends on HAS_IOMEM
|
||||
select GENERIC_PHY
|
||||
select MFD_SYSCON
|
||||
help
|
||||
Enable this to support the Rockchip snps PCIe3 PHY.
|
||||
|
||||
config PHY_ROCKCHIP_TYPEC
|
||||
tristate "Rockchip TYPEC PHY Driver"
|
||||
depends on OF && (ARCH_ROCKCHIP || COMPILE_TEST)
|
||||
|
||||
@@ -7,5 +7,6 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_NANENG_USB2) += phy-rockchip-naneng-usb2.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o
|
||||
obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/phy/pcie.h>
|
||||
#include <linux/phy/phy.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset.h>
|
||||
@@ -34,12 +35,12 @@ struct rockchip_p3phy_priv {
|
||||
bool is_bifurcation;
|
||||
};
|
||||
|
||||
static int rockchip_p3phy_set_mode(struct phy *phy, enum phy_mode mode)
|
||||
static int rockchip_p3phy_set_mode(struct phy *phy, enum phy_mode mode, int submode)
|
||||
{
|
||||
struct rockchip_p3phy_priv *priv = phy_get_drvdata(phy);
|
||||
|
||||
/* Acutally We don't care EP/RC mode, but just record it */
|
||||
switch (mode) {
|
||||
switch (submode) {
|
||||
case PHY_MODE_PCIE_RC:
|
||||
priv->mode = PHY_MODE_PCIE_RC;
|
||||
break;
|
||||
|
||||
12
include/linux/phy/pcie.h
Normal file
12
include/linux/phy/pcie.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2021 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
#ifndef __PHY_PCIE_H
|
||||
#define __PHY_PCIE_H
|
||||
|
||||
#define PHY_MODE_PCIE_RC 20
|
||||
#define PHY_MODE_PCIE_EP 21
|
||||
#define PHY_MODE_PCIE_BIFURCATION 22
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user