From: Frank Wang Date: Wed, 29 Apr 2020 09:24:03 +0800 Subject: [PATCH 5/8] phy: rockchip: add a new driver for type-c phy In-Reply-To: References: <20200428062747.8349-1-frank.wang@rock-chips.com> <20200428063139.8447-1-frank.wang@rock-chips.com> Message-ID: <10e9e2e6-07f5-4864-e975-1bb28f7e64e7@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jagan, All ack related will be fixed in the next patches. BR, Frank On 2020/4/28 17:27, Jagan Teki wrote: > On Tue, Apr 28, 2020 at 12:01 PM Frank Wang wrote: >> This implements the Type-C PHY driver for Rockchip platform >> with Cadence IP block. >> >> Signed-off-by: Frank Wang >> Signed-off-by: William Wu >> --- >> drivers/phy/Kconfig | 6 + >> drivers/phy/Makefile | 1 + >> drivers/phy/phy-rockchip-typec.c | 534 +++++++++++++++++++++++++ >> include/linux/usb/rockchip_phy_typec.h | 52 +++ >> 4 files changed, 593 insertions(+) >> create mode 100644 drivers/phy/phy-rockchip-typec.c >> create mode 100644 include/linux/usb/rockchip_phy_typec.h >> >> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig >> index a72f34f0d4..c8472ef245 100644 >> --- a/drivers/phy/Kconfig >> +++ b/drivers/phy/Kconfig >> @@ -90,6 +90,12 @@ config PHY_DA8XX_USB >> help >> Enable this to support the USB PHY on DA8xx SoCs. >> >> +config PHY_ROCKCHIP_TYPEC >> + bool "Support Rockchip TYPEC PHY Driver" >> + depends on PHY && ARCH_ROCKCHIP > This has to select PHY otherwise enabling PHY_ROCKCHIP_TYPEC won't > enable the driver itself it require explicit PHY enablement. ACK >> [...] >> >> diff --git a/drivers/phy/phy-rockchip-typec.c b/drivers/phy/phy-rockchip-typec.c >> new file mode 100644 >> index 0000000000..cd0f055bd4 >> --- /dev/null >> +++ b/drivers/phy/phy-rockchip-typec.c >> @@ -0,0 +1,534 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * Copyright (C) 2020 Rockchip Electronics Co., Ltd >> + * >> + * Based on drivers/phy/rockchip/phy-rockchip-typec.c in Linux Kernel. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > This has to be > #include This driver refer some macros that defined in , not in . >> [...] >> >> +static int _rockchip_usb3_phy_power_on(struct rockchip_typec_phy *tcphy) >> +{ >> + struct rockchip_usb3phy_port_cfg *cfg = &tcphy->port_cfgs; >> + const struct usb3phy_reg *reg = &cfg->pipe_status; >> + int timeout, new_mode, ret = 0; >> + u32 val; >> + >> + mutex_lock(&tcphy->lock); > No mutex in u-boot, please drop. ACK for all mutex related. >> [...] >> >> + if (tries && !ret) >> + dev_err(tcphy->dev, "Needed %d loops to turn on\n", tries); > Please include #include ACK >> [...] >> >> + printf("Rockchip Type-C PHY is initialized\n"); > Mark it dev_dbg or debug,print won't be required. ACK > Jagan.