2 * Samsung SoC USB 1.1/2.0 PHY driver
4 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
5 * Author: Kamil Debski <k.debski@samsung.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef _PHY_EXYNOS_USB2_H
13 #define _PHY_EXYNOS_USB2_H
15 #include <linux/clk.h>
16 #include <linux/phy/phy.h>
17 #include <linux/device.h>
18 #include <linux/regmap.h>
19 #include <linux/spinlock.h>
22 #define MHZ (KHZ * KHZ)
24 struct samsung_usb2_phy_driver;
25 struct samsung_usb2_phy_instance;
26 struct samsung_usb2_phy_config;
28 struct samsung_usb2_phy_instance {
29 const struct samsung_usb2_common_phy *cfg;
31 struct samsung_usb2_phy_driver *drv;
35 struct samsung_usb2_phy_driver {
36 const struct samsung_usb2_phy_config *cfg;
39 unsigned long ref_rate;
42 void __iomem *reg_phy;
43 struct regmap *reg_pmu;
44 struct regmap *reg_sys;
46 struct samsung_usb2_phy_instance instances[0];
49 struct samsung_usb2_common_phy {
50 int (*power_on)(struct samsung_usb2_phy_instance *);
51 int (*power_off)(struct samsung_usb2_phy_instance *);
57 struct samsung_usb2_phy_config {
58 const struct samsung_usb2_common_phy *phys;
59 int (*rate_to_clk)(unsigned long, u32 *);
60 unsigned int num_phys;
64 extern const struct samsung_usb2_phy_config s5pv210_usb2_phy_config;
65 extern const struct samsung_usb2_phy_config exynos4210_usb2_phy_config;
66 extern const struct samsung_usb2_phy_config exynos4x12_usb2_phy_config;
67 extern const struct samsung_usb2_phy_config exynos5250_usb2_phy_config;