From: Kishon Vijay Abraham I <kishon@ti.com>
To: Kamil Debski <k.debski@samsung.com>
Cc: "'Vivek Gautam'" <gautamvivek1987@gmail.com>,
<linux-kernel@vger.kernel.org>,
<linux-samsung-soc@vger.kernel.org>,
"'Linux USB Mailing List'" <linux-usb@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-arm@vger.kernel.org>,
"'Kyungmin Park'" <kyungmin.park@samsung.com>,
Tomasz Figa <t.figa@samsung.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
"'Vivek Gautam'" <gautam.vivek@samsung.com>,
"'Mateusz Krawczuk'" <mat.krawczuk@gmail.com>
Subject: Re: [RFC PATCH 2/5] phy: Add WIP Exynos 5250 support to the Exynos USB PHY driver
Date: Tue, 29 Oct 2013 16:21:21 +0530 [thread overview]
Message-ID: <526F9329.7090901@ti.com> (raw)
In-Reply-To: <030b01ced48f$b1e17e00$15a47a00$%debski@samsung.com>
Hi,
On Tuesday 29 October 2013 03:44 PM, Kamil Debski wrote:
> Hi,
>
>> From: Kishon Vijay Abraham I [mailto:kishon@ti.com]
>> Sent: Tuesday, October 29, 2013 10:55 AM
>>
>> Hi,
>>
>> On Monday 28 October 2013 08:11 PM, Vivek Gautam wrote:
>>> Hi Kishon,
>>>
>>>
>>> On Fri, Oct 25, 2013 at 9:13 PM, Kishon Vijay Abraham I
>> <kishon@ti.com> wrote:
>>>> Hi,
>>>>
>>>> On Friday 25 October 2013 07:45 PM, Kamil Debski wrote:
>>>>> Add support for Exynos 5250. This is work-in-progress commit. Not
>>>>> for merging.
>>>>>
>>>>> Signed-off-by: Kamil Debski <k.debski@samsung.com>
>>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>>> ---
>>>>> drivers/phy/Kconfig | 7 +
>>>>> drivers/phy/Makefile | 1 +
>>>>> drivers/phy/phy-exynos-usb.c | 10 +
>>>>> drivers/phy/phy-exynos-usb.h | 1 +
>>>>> drivers/phy/phy-exynos5250-usb.c | 411
>>>>> ++++++++++++++++++++++++++++++++++++++
>>>>> 5 files changed, 430 insertions(+)
>>>>> create mode 100644 drivers/phy/phy-exynos5250-usb.c
>>>>>
>>>>> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index
>>>>> 2f7ac0a..0f598d0 100644
>>>>> --- a/drivers/phy/Kconfig
>>>>> +++ b/drivers/phy/Kconfig
>>>>> @@ -36,4 +36,11 @@ config PHY_EXYNOS4212_USB
>>>>> help
>>>>> Enable USB PHY support for Exynos 4212
>>>>>
>>>>> +config PHY_EXYNOS5250_USB
>>>>> + bool "Support for Exynos 5250"
>>>>> + depends on PHY_EXYNOS_USB
>>>>
>>>> This should be a separate driver. Not necessary to use
>> PHY_EXYNOS_USB.
>>>>> + depends on SOC_EXYNOS5250
>>>>> + help
>>>>> + Enable USB PHY support for Exynos 5250
>>>>> +
>>>>> endmenu
>>>>> diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index
>>>>> ca3dc82..0dff0dd 100644
>>>>> --- a/drivers/phy/Makefile
>>>>> +++ b/drivers/phy/Makefile
>>>>> @@ -6,3 +6,4 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o
>>>>> obj-$(CONFIG_PHY_EXYNOS_USB) += phy-exynos-usb.o
>>>>> obj-$(CONFIG_PHY_EXYNOS4210_USB) += phy-exynos4210-usb.o
>>>>> obj-$(CONFIG_PHY_EXYNOS4212_USB) += phy-exynos4212-usb.o
>>>>> +obj-$(CONFIG_PHY_EXYNOS5250_USB) += phy-exynos5250-usb.o
>>>>> diff --git a/drivers/phy/phy-exynos-usb.c
>>>>> b/drivers/phy/phy-exynos-usb.c index d4a26df..172b774 100644
>>>>> --- a/drivers/phy/phy-exynos-usb.c
>>>>> +++ b/drivers/phy/phy-exynos-usb.c
>>>>> @@ -212,6 +212,10 @@ extern const struct uphy_config
>>>>> exynos4210_uphy_config; extern const struct uphy_config
>>>>> exynos4212_uphy_config; #endif
>>>>>
>>>>> +#ifdef CONFIG_PHY_EXYNOS5250_USB
>>>>> +extern const struct uphy_config exynos5250_uphy_config; #endif
>>>>> +
>>>>> static const struct of_device_id exynos_uphy_of_match[] =
>> { #ifdef
>>>>> CONFIG_PHY_EXYNOS4210_USB
>>>>> {
>>>>> @@ -225,6 +229,12 @@ static const struct of_device_id
>> exynos_uphy_of_match[] = {
>>>>> .data = &exynos4212_uphy_config,
>>>>> },
>>>>> #endif
>>>>> +#ifdef CONFIG_PHY_EXYNOS5250_USB
>>>>> + {
>>>>> + .compatible = "samsung,exynos5250-usbphy",
>>>>> + .data = &exynos5250_uphy_config,
>>>>> + },
>>>>> +#endif
>>>>> { },
>>>>> };
>>>>>
>>>>> diff --git a/drivers/phy/phy-exynos-usb.h
>>>>> b/drivers/phy/phy-exynos-usb.h index f45cb3c..a9febfa 100644
>>>>> --- a/drivers/phy/phy-exynos-usb.h
>>>>> +++ b/drivers/phy/phy-exynos-usb.h
>>>>> @@ -42,6 +42,7 @@ enum samsung_cpu_type {
>>>>> TYPE_S3C64XX,
>>>>> TYPE_EXYNOS4210,
>>>>> TYPE_EXYNOS4212,
>>>>> + TYPE_EXYNOS5250,
>>>>
>>>> No cpu types here.
>>>
>>> One question here.
>>> In case we move to single driver for Exynos4 SoCs (4210, 4212 and
>> 4412
>>> later) as well as S5PV210,
>>> there will be certain things changing from one SoC to another, how
>>> should we target that in case we don't have CPU types ?
>>> May be i am misinterpreting your suggestion ?
>>
>> We should be using the IP revision register or check for compatible
>> values.
>>
>
> In case of this driver the compatible is checked. Maybe it is not as
> straight forward, but the choice is based on compatible value.
> Compatible is matched to an appropriate data entry in the of_device_id
> table. The data entry contains a cpu field which contains the information
> which PHY version we have. Maybe the "cpu" name is confusing and should be
> changed to something like "version" or "revision".
you don't have a revision register in the PHY IP which can be used?
>
> For example:
> "samsung,exynos4212-usbphy" compatible is matched to exynos4212_uphy_config
> via data field of of_device_id, and the cpu field of exynos4212_uphy_config
> is equal to TYPE_EXYNOS4212.
> This way in the code all what is needed is to check the value of cpu field.
> It already got matched through the compatible.
>
> Still, Tomasz Figa's idea sound good - using a boolean flag
> "has_mode_switch".
hmm, could be.
Thanks
Kishon
next prev parent reply other threads:[~2013-10-29 10:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 14:15 [PATCH 0/5] phy: Add new Exynos USB PHY driver Kamil Debski
2013-10-25 14:15 ` [PATCH v2 1/5] " Kamil Debski
2013-10-25 15:39 ` Kishon Vijay Abraham I
2013-10-28 13:52 ` Kamil Debski
2013-10-28 20:00 ` Tomasz Figa
2013-10-29 10:16 ` Kamil Debski
2013-10-29 9:52 ` Kishon Vijay Abraham I
2013-10-25 21:36 ` Kumar Gala
2013-10-28 13:52 ` Kamil Debski
2013-10-25 14:15 ` [RFC PATCH 2/5] phy: Add WIP Exynos 5250 support to the " Kamil Debski
2013-10-25 15:43 ` Kishon Vijay Abraham I
2013-10-28 13:52 ` Kamil Debski
2013-10-28 14:41 ` Vivek Gautam
2013-10-29 9:55 ` Kishon Vijay Abraham I
2013-10-29 10:14 ` Kamil Debski
2013-10-29 10:51 ` Kishon Vijay Abraham I [this message]
2013-10-25 14:15 ` [PATCH 3/5] phy: Add support for S5PV210 " Kamil Debski
2013-10-25 15:50 ` Kishon Vijay Abraham I
2013-10-26 1:40 ` Jingoo Han
2013-10-25 14:15 ` [PATCH 4/5] usb: ehci-s5p: Change to use phy provided by the generic phy framework Kamil Debski
2013-10-25 15:52 ` Kishon Vijay Abraham I
2013-10-26 1:27 ` Jingoo Han
2013-10-28 13:52 ` Kamil Debski
2013-10-26 9:41 ` Vivek Gautam
2013-10-28 13:53 ` Kamil Debski
2013-10-28 14:36 ` Vivek Gautam
2013-10-25 14:15 ` [PATCH 5/5] usb: s3c-hsotg: Use the new Exynos USB phy driver with " Kamil Debski
2013-10-25 15:53 ` Kishon Vijay Abraham I
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=526F9329.7090901@ti.com \
--to=kishon@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=gautam.vivek@samsung.com \
--cc=gautamvivek1987@gmail.com \
--cc=k.debski@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mat.krawczuk@gmail.com \
--cc=s.nawrocki@samsung.com \
--cc=t.figa@samsung.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