Merge tag 's5pv210-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux...
[deliverable/linux.git] / drivers / phy / phy-samsung-usb2.h
CommitLineData
06fb0137
KD
1/*
2 * Samsung SoC USB 1.1/2.0 PHY driver
3 *
4 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
5 * Author: Kamil Debski <k.debski@samsung.com>
6 *
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.
10 */
11
12#ifndef _PHY_EXYNOS_USB2_H
13#define _PHY_EXYNOS_USB2_H
14
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>
20
21#define KHZ 1000
22#define MHZ (KHZ * KHZ)
23
24struct samsung_usb2_phy_driver;
25struct samsung_usb2_phy_instance;
26struct samsung_usb2_phy_config;
27
28struct samsung_usb2_phy_instance {
29 const struct samsung_usb2_common_phy *cfg;
30 struct phy *phy;
31 struct samsung_usb2_phy_driver *drv;
32 bool enabled;
33};
34
35struct samsung_usb2_phy_driver {
36 const struct samsung_usb2_phy_config *cfg;
37 struct clk *clk;
38 struct clk *ref_clk;
39 unsigned long ref_rate;
40 u32 ref_reg_val;
41 struct device *dev;
42 void __iomem *reg_phy;
43 struct regmap *reg_pmu;
44 struct regmap *reg_sys;
45 spinlock_t lock;
46 struct samsung_usb2_phy_instance instances[0];
47};
48
49struct samsung_usb2_common_phy {
50 int (*power_on)(struct samsung_usb2_phy_instance *);
51 int (*power_off)(struct samsung_usb2_phy_instance *);
52 unsigned int id;
53 char *label;
54};
55
56
57struct 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;
61 bool has_mode_switch;
62};
63
949ccc3a 64extern const struct samsung_usb2_phy_config s5pv210_usb2_phy_config;
06fb0137
KD
65extern const struct samsung_usb2_phy_config exynos4210_usb2_phy_config;
66extern const struct samsung_usb2_phy_config exynos4x12_usb2_phy_config;
64bf2b23 67extern const struct samsung_usb2_phy_config exynos5250_usb2_phy_config;
06fb0137 68#endif
This page took 0.067312 seconds and 5 git commands to generate.