[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf9537d3-3b86-aa23-74fe-9cd49987c845@wanyeetech.com>
Date: Wed, 23 Sep 2020 21:52:10 +0800
From: Zhou Yanjie <zhouyanjie@...yeetech.com>
To: Vinod Koul <vkoul@...nel.org>
Cc: balbi@...nel.org, gregkh@...uxfoundation.org, kishon@...com,
paul@...pouillou.net, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, christophe.jaillet@...adoo.fr,
dongsheng.qiu@...enic.com, aric.pzqi@...enic.com,
rick.tyliu@...enic.com, yanfei.li@...enic.com,
sernia.zhou@...mail.com, zhenwenjin@...il.com
Subject: Re: [PATCH v5 2/2] PHY: Ingenic: Add USB PHY driver using generic PHY
framework.
Hello Vinod,
在 2020/9/23 下午1:35, Vinod Koul 写道:
> On 22-09-20, 00:24, 周琰杰 (Zhou Yanjie) wrote:
>
>> +#define USBPCR_IDPULLUP_LSB 28
>> +#define USBPCR_IDPULLUP_MASK GENMASK(29, USBPCR_IDPULLUP_LSB)
>> +#define USBPCR_IDPULLUP_ALWAYS (0x2 << USBPCR_IDPULLUP_LSB)
>> +#define USBPCR_IDPULLUP_SUSPEND (0x1 << USBPCR_IDPULLUP_LSB)
>> +#define USBPCR_IDPULLUP_OTG (0x0 << USBPCR_IDPULLUP_LSB)
> why not define these as 0, 1, 2 and then use
> FIELD_PREP(value, USBPCR_IDPULLUP_MASK), please do this for rest as
> well.
Sure.
>> +static int ingenic_usb_phy_set_mode(struct phy *phy,
>> + enum phy_mode mode, int submode)
>> +{
>> + struct ingenic_usb_phy *priv = phy_get_drvdata(phy);
>> + u32 reg;
>> +
>> + switch (mode) {
>> + case PHY_MODE_USB_HOST:
>> + reg = readl(priv->base + REG_USBPCR_OFFSET);
>> + reg &= ~(USBPCR_VBUSVLDEXT | USBPCR_VBUSVLDEXTSEL | USBPCR_OTG_DISABLE);
> use u32_encode_bits or u32p_replace_bit to program registers using mask
> defined
Sure.
Thanks and best regards!
Powered by blists - more mailing lists