From: Tomasz Figa <t.figa@samsung.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Kamil Debski <k.debski@samsung.com>,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm@vger.kernel.org, kyungmin.park@samsung.com,
s.nawrocki@samsung.com, m.szyprowski@samsung.com,
gautam.vivek@samsung.com, mat.krawczuk@gmail.com,
yulgon.kim@samsung.com, p.paneri@samsung.com,
av.tikhomirov@samsung.com, jg1.han@samsung.com,
galak@codeaurora.org
Subject: Re: [PATCH v3 1/3] phy: Add new Exynos USB PHY driver
Date: Wed, 06 Nov 2013 13:58:45 +0100 [thread overview]
Message-ID: <2413995.ezl3Ca2YTh@amdc1227> (raw)
In-Reply-To: <527A3B1C.50200@ti.com>
On Wednesday 06 of November 2013 18:20:36 Kishon Vijay Abraham I wrote:
> Hi,
>
> On Wednesday 06 November 2013 05:08 PM, Tomasz Figa wrote:
> > Hi Kishon
> >
> > On Wednesday 06 of November 2013 13:48:13 Kishon Vijay Abraham I wrote:
> >> Hi,
> >>
> >> On Tuesday 05 November 2013 09:43 PM, Kamil Debski wrote:
> >>> Add a new driver for the Exynos USB PHY. The new driver uses the generic
> >>> PHY framework. The driver includes support for the Exynos 4x10 and 4x12
> >>> SoC families.
> >>>
> >>> Signed-off-by: Kamil Debski <k.debski@samsung.com>
> >>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >>> ---
> >>> .../devicetree/bindings/phy/samsung-usbphy.txt | 52 ++++
> >>> drivers/phy/Kconfig | 23 +-
> >>> drivers/phy/Makefile | 4 +
> >>> drivers/phy/phy-exynos-usb2.c | 234 ++++++++++++++
> >>> drivers/phy/phy-exynos-usb2.h | 87 ++++++
> >>> drivers/phy/phy-exynos4210-usb2.c | 272 ++++++++++++++++
> >>> drivers/phy/phy-exynos4212-usb2.c | 324 ++++++++++++++++++++
> >>> 7 files changed, 995 insertions(+), 1 deletion(-)
> >>> create mode 100644 Documentation/devicetree/bindings/phy/samsung-usbphy.txt
> >>> create mode 100644 drivers/phy/phy-exynos-usb2.c
> >>> create mode 100644 drivers/phy/phy-exynos-usb2.h
> >>> create mode 100644 drivers/phy/phy-exynos4210-usb2.c
> >>> create mode 100644 drivers/phy/phy-exynos4212-usb2.c
> > [snip]
> >>> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> >>> index a344f3d..bdf0fab 100644
> >>> --- a/drivers/phy/Kconfig
> >>> +++ b/drivers/phy/Kconfig
> > [snip]
> >>> @@ -51,4 +51,25 @@ config PHY_EXYNOS_DP_VIDEO
> >>> help
> >>> Support for Display Port PHY found on Samsung EXYNOS SoCs.
> >>>
> >>> +config PHY_EXYNOS_USB2
> >>> + tristate "Samsung USB 2.0 PHY driver"
> >>> + help
> >>> + Enable this to support Samsung USB phy helper driver for Samsung SoCs.
> >>> + This driver provides common interface to interact, for Samsung
> >>> + USB 2.0 PHY driver.
> >>
> >> I still think we can get rid of this helper driver and have a single
> >> driver for both PHY_EXYNOS4210_USB2 and PHY_EXYNOS4212_USB2.
> >
> > This helper driver is a really nice way to avoid code duplication, while
> > still leaving the code clean and readable.
> >
> > All the Samsung USB 2.0 PHYs require exactly the same semantics
> > (isolation, reference rate configuration, power up, power on), but each
> > one has completely different layout of registers and bits inside
> > registers.
>
> I just did a diff of registers in exynos 4210 and 4212 PHY drivers [1]
> and couldn't find that big a difference in register layout. Of course
> there are a few changes in HSIC bit fields and PHYFSEL but that's only
> minimal and could well be handled in a single driver.
>
> [1] -> http://diffchecker.com/py3tp68m
This is quite a lot of differences, especially including shifted
bitfields... In addition there is another set of available PHYs
and inter-dependencies between them.
> >
> > Making a big single driver would end up being identical to the old Exynos
> > USB2PHY driver with a lot of if and switch statements inside most of
> > functions, which is not only ugly but makes any further extension hard.
>
> Probably we shouldn't try to over design and just convert the old exynos
> usb2 phy driver to the generic phy framework to begin with?
The old exynos USB2 PHY driver is incomplete and has very limited
functionality. It needs a complete redesign to support remaining features
and this is the reason we decided to develop a new driver from scratch.
I believe the way Kamil's driver is designed is definitely the way to go
with Samsung's USB2 PHY drivers, especially considering that support for
more SoCs using the same framework will be added - S3C64xx, S5PV210,
and Exynos5250.
Best regards.
Tomasz
next prev parent reply other threads:[~2013-11-06 12:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 16:13 [PATCH v3 0/3] phy: Add new Exynos USB 2.0 PHY driver Kamil Debski
[not found] ` <1383668001-19141-1-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-05 16:13 ` [PATCH v3 1/3] phy: Add new Exynos USB " Kamil Debski
2013-11-06 1:02 ` Jingoo Han
2013-11-06 10:56 ` Kamil Debski
2013-11-06 8:18 ` Kishon Vijay Abraham I
[not found] ` <5279FB45.3010808-l0cyMroinI0@public.gmane.org>
2013-11-06 11:38 ` Tomasz Figa
2013-11-06 12:50 ` Kishon Vijay Abraham I
2013-11-06 12:58 ` Tomasz Figa [this message]
2013-11-06 13:03 ` David Laight
2013-11-06 13:23 ` Tomasz Figa
[not found] ` <1383668001-19141-2-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-10 16:28 ` Tomasz Figa
2013-11-21 13:36 ` Yuvaraj Cd
2013-11-05 16:13 ` [PATCH v3 2/3] usb: ehci-s5p: Change to use phy provided by the generic phy framework Kamil Debski
2013-11-06 1:09 ` Jingoo Han
2013-11-10 16:44 ` Tomasz Figa
2013-11-05 16:13 ` [PATCH v3 3/3] usb: s3c-hsotg: Use the new Exynos USB phy driver with " Kamil Debski
2013-11-10 16:46 ` Tomasz Figa
2013-11-25 18:41 ` Matt Porter
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=2413995.ezl3Ca2YTh@amdc1227 \
--to=t.figa@samsung.com \
--cc=av.tikhomirov@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gautam.vivek@samsung.com \
--cc=jg1.han@samsung.com \
--cc=k.debski@samsung.com \
--cc=kishon@ti.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=p.paneri@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=yulgon.kim@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;
as well as URLs for NNTP newsgroup(s).