aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Gautam <gautam.vivek@samsung.com>2013-03-12 16:40:47 +0530
committerAndrey Konovalov <andrey.konovalov@linaro.org>2014-02-28 17:30:56 +0400
commit1ce1c3878f8359392019e23cc955cf7b2a3eed65 (patch)
tree73f87a18f93dc09123bcc7b6556826ce34c7778e
parent19ad1b134dae1feb023fda845614fdafbde10547 (diff)
usb: phy: samsung-usb2: Adding exynos5420-usb2phy to device-id
Adding another device-id for exynos-5420 type SoC, to facilitate separate driver data. BUG=chrome-os-partner:19007 TEST=build and boot on smdk5420 and peach pit; tested usb HID devices and mass storage devices on USB 2.0 and USB 3.0 ports. Change-Id: I127d382982da88caeef4f2878e4d89c6c67fac67 Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Reviewed-on: https://gerrit.chromium.org/gerrit/56396 Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/usb/samsung-usbphy.txt8
-rw-r--r--drivers/usb/phy/phy-samsung-usb.c16
-rw-r--r--drivers/usb/phy/phy-samsung-usb.h2
-rw-r--r--drivers/usb/phy/phy-samsung-usb2.c19
4 files changed, 42 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
index 33fd3543f3f8..4abcff8ad0b8 100644
--- a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
+++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
@@ -23,6 +23,14 @@ Exynos5250:
- reg : base physical address of the phy registers and length of memory mapped
region.
+Exynos5420:
+- compatible : should be "samsung,exynos5420-usb2phy"
+- reg : base physical address of the phy registers and length of memory mapped
+ region.
+- clocks: Clock IDs array as required by the controller.
+- clock-names: names of clock correseponding IDs clock property as requested
+ by the controller driver.
+
Optional properties:
- #address-cells: should be '1' when usbphy node has a child node with 'reg'
property.
diff --git a/drivers/usb/phy/phy-samsung-usb.c b/drivers/usb/phy/phy-samsung-usb.c
index ac025ca08425..d9a2288f98c3 100644
--- a/drivers/usb/phy/phy-samsung-usb.c
+++ b/drivers/usb/phy/phy-samsung-usb.c
@@ -217,15 +217,27 @@ int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy)
struct clk *ref_clk;
unsigned long rate;
int refclk_freq;
+ int cpu_type = sphy->drv_data->cpu_type;
/*
* In exynos5250 USB host and device PHY use
* external crystal clock XXTI
*/
- if (sphy->drv_data->cpu_type == TYPE_EXYNOS5250)
+ switch (cpu_type) {
+ case TYPE_EXYNOS5420:
+ /* fall through */
+ case TYPE_EXYNOS5250:
ref_clk = clk_get(sphy->dev, "ext_xtal");
- else
+ break;
+ case TYPE_EXYNOS4210:
+ /* fall through */
+ case TYPE_S3C64XX:
ref_clk = clk_get(sphy->dev, "xusbxti");
+ break;
+ default:
+ break;
+ }
+
if (IS_ERR(ref_clk)) {
dev_err(sphy->dev, "Failed to get reference clock\n");
return PTR_ERR(ref_clk);
diff --git a/drivers/usb/phy/phy-samsung-usb.h b/drivers/usb/phy/phy-samsung-usb.h
index 68771bfd1825..b2c9b78e9407 100644
--- a/drivers/usb/phy/phy-samsung-usb.h
+++ b/drivers/usb/phy/phy-samsung-usb.h
@@ -244,6 +244,7 @@
#endif
#define EXYNOS_USBHOST_PHY_CTRL_OFFSET (0x4)
+#define EXYNOS5420_USBHOST_PHY_CTRL_OFFSET (0x8)
#define S3C64XX_USBPHY_ENABLE (0x1 << 16)
#define EXYNOS_USBPHY_ENABLE (0x1 << 0)
#define EXYNOS_USB20PHY_CFG_HOST_LINK (0x1 << 0)
@@ -253,6 +254,7 @@ enum samsung_cpu_type {
TYPE_EXYNOS4210,
TYPE_EXYNOS4X12,
TYPE_EXYNOS5250,
+ TYPE_EXYNOS5420,
};
struct samsung_usbphy;
diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c
index b3ba86627b72..219e8f6586b3 100644
--- a/drivers/usb/phy/phy-samsung-usb2.c
+++ b/drivers/usb/phy/phy-samsung-usb2.c
@@ -382,7 +382,8 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
drv_data = samsung_usbphy_get_driver_data(pdev);
- if (drv_data->cpu_type == TYPE_EXYNOS5250)
+ if (drv_data->cpu_type == TYPE_EXYNOS5250 ||
+ drv_data->cpu_type == TYPE_EXYNOS5420)
clk = devm_clk_get(dev, "usbhost");
else
clk = devm_clk_get(dev, "otg");
@@ -483,6 +484,16 @@ static struct samsung_usbphy_drvdata usb2phy_exynos5 = {
.phy_disable = samsung_exynos5_usb2phy_disable,
};
+static struct samsung_usbphy_drvdata usb2phy_exynos5420 = {
+ .cpu_type = TYPE_EXYNOS5420,
+ .hostphy_en_mask = EXYNOS_USBPHY_ENABLE,
+ .hostphy_reg_offset = EXYNOS5420_USBHOST_PHY_CTRL_OFFSET,
+ .rate_to_clksel = samsung_usbphy_rate_to_clksel_4x12,
+ .set_isolation = samsung_usbphy_set_isolation_4210,
+ .phy_enable = samsung_exynos5_usb2phy_enable,
+ .phy_disable = samsung_exynos5_usb2phy_disable,
+};
+
#ifdef CONFIG_OF
static const struct of_device_id samsung_usbphy_dt_match[] = {
{
@@ -497,6 +508,9 @@ static const struct of_device_id samsung_usbphy_dt_match[] = {
}, {
.compatible = "samsung,exynos5250-usb2phy",
.data = &usb2phy_exynos5
+ }, {
+ .compatible = "samsung,exynos5420-usb2phy",
+ .data = &usb2phy_exynos5420
},
{},
};
@@ -516,6 +530,9 @@ static struct platform_device_id samsung_usbphy_driver_ids[] = {
}, {
.name = "exynos5250-usb2phy",
.driver_data = (unsigned long)&usb2phy_exynos5,
+ }, {
+ .name = "exynos5420-usb2phy",
+ .driver_data = (unsigned long)&usb2phy_exynos5420,
},
{},
};