aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-samsung-usb.h
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-05-16 11:57:08 +0200
committerFelipe Balbi <balbi@ti.com>2013-05-28 20:06:39 +0300
commit0aa823a2ca02cd21c587713e8195a2ffb8bd7872 (patch)
tree74f6e7bdbc4a60f899d0bb504593fe1dab7cc8a3 /drivers/usb/phy/phy-samsung-usb.h
parentusb: phy: samsung: Use clk_get to get reference clock (diff)
downloadlinux-dev-0aa823a2ca02cd21c587713e8195a2ffb8bd7872.tar.xz
linux-dev-0aa823a2ca02cd21c587713e8195a2ffb8bd7872.zip
usb: phy: samsung: Consolidate reference clock rate handling
This patch cleans up handling of reference clock rate in Samsung USB PHY drivers. It is mostly a cosmetic change but improves error handling in case of failing to get reference clock or invalid clock rate. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-samsung-usb.h')
-rw-r--r--drivers/usb/phy/phy-samsung-usb.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-samsung-usb.h b/drivers/usb/phy/phy-samsung-usb.h
index 70a9cae5e37f..0336f6b02bc4 100644
--- a/drivers/usb/phy/phy-samsung-usb.h
+++ b/drivers/usb/phy/phy-samsung-usb.h
@@ -244,6 +244,8 @@ enum samsung_cpu_type {
TYPE_EXYNOS5250,
};
+struct samsung_usbphy;
+
/*
* struct samsung_usbphy_drvdata - driver data for various SoC variants
* @cpu_type: machine identifier
@@ -268,6 +270,7 @@ struct samsung_usbphy_drvdata {
int hostphy_en_mask;
u32 devphy_reg_offset;
u32 hostphy_reg_offset;
+ int (*rate_to_clksel)(struct samsung_usbphy *, unsigned long);
};
/*
@@ -325,3 +328,7 @@ extern void samsung_usbphy_cfg_sel(struct samsung_usbphy *sphy);
extern int samsung_usbphy_set_type(struct usb_phy *phy,
enum samsung_usb_phy_type phy_type);
extern int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy);
+extern int samsung_usbphy_rate_to_clksel_64xx(struct samsung_usbphy *sphy,
+ unsigned long rate);
+extern int samsung_usbphy_rate_to_clksel_4x12(struct samsung_usbphy *sphy,
+ unsigned long rate);