From: hdegoede@redhat•com (Hans de Goede)
To: linux-arm-kernel@lists•infradead.org
Subject: [linux-sunxi] Re: [PATCH] ARM: sunxi: Add driver for sunxi usb phy
Date: Thu, 16 Jan 2014 11:33:17 +0100 [thread overview]
Message-ID: <52D7B56D.8060403@redhat.com> (raw)
In-Reply-To: <CAGb2v65rSc7iAKCcPMYaQZ+q=m85RcSE2dmpgE6MoeXNgRCwfg@mail.gmail.com>
Hi,
On 01/16/2014 08:07 AM, Chen-Yu Tsai wrote:
> Hi Hans,
>
> On Wed, Jan 15, 2014 at 11:48 PM, Hans de Goede <hdegoede@redhat•com> wrote:
>> Hi,
>>
>>
>> On 01/15/2014 04:00 PM, Kishon Vijay Abraham I wrote:
>>>
>>> On Wednesday 15 January 2014 04:28 AM, Hans de Goede wrote:
> [...]
>>>> +static int sun4i_usb_phy_init(struct phy *_phy)
>>>> +{
>>>> + struct sun4i_usb_phy *phy = phy_get_drvdata(_phy);
>>>> + struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy);
>>>> + int ret;
>>>> +
>>>> + ret = clk_prepare_enable(data->clk);
>>>> + if (ret)
>>>> + return ret;
>>>> +
>>>> + ret = reset_control_deassert(phy->reset);
>>>> + if (ret) {
>>>> + clk_disable_unprepare(data->clk);
>>>> + return ret;
>>>> + }
>>>> +
>>>> + /* Adjust PHY's magnitude and rate */
>>>> + sun4i_usb_phy_write(phy, 0x20, 0x14, 5);
>>>
>>>
>>> No magic values. Use macros instead.
>>
>>
>> We don't have docs, these values come from the Android code (and the comment
>> above has been translated from Chinese). I can make up some random
>> macros for this, but seems counter-productive, it seems best to just leave
>> this as magic until the day we actually have documentation and thus can use
>> defines with the proper register names, etc.
>
> We have some names for the registers from Allwinner code:
> https://github.com/linux-sunxi/linux-sunxi/blob/lichee-3.0.8-sun4i/drivers/usb/sun4i_usb/usbc/usbc_phy.c#L39
Ah good catch, thanks. I'll use those in the next revision of the phy driver.
Regards,
Hans
next prev parent reply other threads:[~2014-01-16 10:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 22:58 [PATCH] ARM: sunxi: Add driver for sunxi usb phy Hans de Goede
2014-01-15 15:00 ` Kishon Vijay Abraham I
2014-01-15 15:48 ` Hans de Goede
2014-01-16 5:17 ` Kishon Vijay Abraham I
2014-01-16 7:07 ` [linux-sunxi] " Chen-Yu Tsai
2014-01-16 10:33 ` Hans de Goede [this message]
2014-02-07 15:57 ` Hans de Goede
2014-01-15 22:52 ` Maxime Ripard
2014-02-07 16:01 ` Hans de Goede
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=52D7B56D.8060403@redhat.com \
--to=hdegoede@redhat$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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