On Wednesday 06 of November 2013 13:48:13 Kishon Vijay Abraham I wrote:Hi,[snip]
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
Signed-off-by: Kamil Debski <k.debski@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
.../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
@@ -51,4 +51,25 @@ config PHY_EXYNOS_DP_VIDEO
Support for Display Port PHY found on Samsung EXYNOS SoCs.
+ tristate "Samsung USB 2.0 PHY driver"
+ 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
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.