linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Cixi Geng <cixi.geng@linux.dev>,
	gregkh@linuxfoundation.org, orsonzhai@gmail.com,
	zhang.lyra@gmail.com, arnd@arndb.de, tony@atomide.com,
	felipe.balbi@linux.intel.com, paul@crapouillou.net,
	linus.walleij@linaro.org, cixi.geng1@unisoc.com,
	gengcixi@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [RFC PATCH v1] usb/phy add sprd ums512 usbphy
Date: Tue, 21 Mar 2023 10:03:44 +0800	[thread overview]
Message-ID: <cc819e9b-c613-b3c1-4ea2-8ef828e97508@linux.alibaba.com> (raw)
In-Reply-To: <be5ddb68b247b8d3b7305ef46d703d0ba2b3753a.camel@linux.dev>



On 3/18/2023 11:37 PM, Cixi Geng wrote:
> On Mon, 2023-03-13 at 17:11 +0800, Baolin Wang wrote:
>>
>>

...

>>> +
>>> +MODULE_DESCRIPTION("UNISOC USB PHY driver");
>>> +MODULE_LICENSE("GPL");
>>> diff --git a/drivers/usb/phy/phy-sprd-ums512.h
>>> b/drivers/usb/phy/phy-sprd-ums512.h
>>> new file mode 100644
>>> index 000000000000..903da0573eae
>>> --- /dev/null
>>> +++ b/drivers/usb/phy/phy-sprd-ums512.h
>>> @@ -0,0 +1,39 @@
>>> +/* SPDX-License-Identifier: GPL-2.0+ OR MIT */
>>> +/*
>>> + * Spreadtrum UMS512 SOC USB registers file
>>> + *
>>> + * Copyright C 2022, Spreadtrum Communications Inc.
>>> + */
>>> +
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_DATABUS16_8
>>>      0x10000000
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_DMPULLDOWN                 0x8
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_DPPULLDOWN                 0x10
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_ISO_SW_EN                  0x1
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_PS_PD_L                    0x8
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_PS_PD_S                    0x10
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_RESERVED                   0xff
>>> ff
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_TFREGRES                   0x1f
>>> 80000
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_TUNEHSAMP                  0x60
>>> 00000
>>> +#define
>>> MASK_ANLG_PHY_G2_ANALOG_USB20_USB20_VBUSVLDEXT                 0x10
>>> 000
>>> +#define
>>> MASK_ANLG_PHY_G2_DBG_SEL_ANALOG_USB20_USB20_DMPULLDOWN         0x2
>>> +#define
>>> MASK_ANLG_PHY_G2_DBG_SEL_ANALOG_USB20_USB20_DPPULLDOWN         0x4
>>> +#define
>>> MASK_AON_APB_ANA_EB                                            0x10
>>> 00
>>> +#define
>>> MASK_AON_APB_CGM_DPHY_REF_EN                                   0x40
>>> 0
>>> +#define
>>> MASK_AON_APB_CGM_OTG_REF_EN                                    0x10
>>> 00
>>> +#define
>>> MASK_AON_APB_OTG_PHY_SOFT_RST                                  0x20
>>> 0
>>> +#define
>>> MASK_AON_APB_OTG_UTMI_EB                                       0x10
>>> 0
>>> +#define
>>> MASK_AON_APB_OTG_UTMI_SOFT_RST                                 0x10
>>> 0
>>> +#define
>>> MASK_AON_APB_OTG_VBUS_VALID_PHYREG                             0x10
>>> 00000
>>> +#define
>>> MASK_AON_APB_USB2_PHY_IDDIG                                    0x8
>>> +#define
>>> MASK_AON_APB_UTMI_WIDTH_SEL                                    0x40
>>> 000000
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_USB20_BATTER_PLL                  0x00
>>> 5c
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_USB20_ISO_SW                      0x00
>>> 70
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_USB20_TRIMMING                    0x00
>>> 64
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_USB20_UTMI_CTL1                   0x00
>>> 58
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_USB20_UTMI_CTL2                   0x00
>>> 60
>>> +#define
>>> REG_ANLG_PHY_G2_ANALOG_USB20_REG_SEL_CFG_0                     0x00
>>> 74
>>> +#define
>>> REG_AON_APB_APB_EB1                                            0x00
>>> 04
>>> +#define
>>> REG_AON_APB_APB_RST1                                           0x00
>>> 10
>>> +#define
>>> REG_AON_APB_CGM_REG1                                           0x01
>>> 38
>>> +#define
>>> REG_AON_APB_OTG_PHY_CTRL                                       0x02
>>> 08
>>> +#define
>>> REG_AON_APB_OTG_PHY_TEST                                       0x02
>>> 04
>>
>> Move them to the driver file and please rename the ugly macro names,
>> too
>> long :(
>>
>> And why not move the usb phy driver to be a generic phy driver? I
>> mean
>> move it to the drivers/phy.
> Do you mean all the usb-phy need move to driver/phy? or just this
> driver?

If I remember correctly, new phy drivers should go to the generic phy 
framework unless there are some reasons to prevent.

Greg, how do you think?

      reply	other threads:[~2023-03-21  2:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 17:14 [RFC PATCH v1] usb/phy add sprd ums512 usbphy Cixi Geng
2023-03-13  6:31 ` Greg KH
2023-03-18 15:15   ` Cixi Geng
2023-03-13  9:11 ` Baolin Wang
2023-03-18 15:37   ` Cixi Geng
2023-03-21  2:03     ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc819e9b-c613-b3c1-4ea2-8ef828e97508@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=arnd@arndb.de \
    --cc=cixi.geng1@unisoc.com \
    --cc=cixi.geng@linux.dev \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gengcixi@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=paul@crapouillou.net \
    --cc=tony@atomide.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).