phy-samsung-usb2.h (1882B)
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Samsung SoC USB 1.1/2.0 PHY driver 4 * 5 * Copyright (C) 2013 Samsung Electronics Co., Ltd. 6 * Author: Kamil Debski <k.debski@samsung.com> 7 */ 8 9#ifndef _PHY_EXYNOS_USB2_H 10#define _PHY_EXYNOS_USB2_H 11 12#include <linux/clk.h> 13#include <linux/phy/phy.h> 14#include <linux/device.h> 15#include <linux/regmap.h> 16#include <linux/spinlock.h> 17#include <linux/regulator/consumer.h> 18 19#define KHZ 1000 20#define MHZ (KHZ * KHZ) 21 22struct samsung_usb2_phy_driver; 23struct samsung_usb2_phy_instance; 24struct samsung_usb2_phy_config; 25 26struct samsung_usb2_phy_instance { 27 const struct samsung_usb2_common_phy *cfg; 28 struct phy *phy; 29 struct samsung_usb2_phy_driver *drv; 30 int int_cnt; 31 int ext_cnt; 32}; 33 34struct samsung_usb2_phy_driver { 35 const struct samsung_usb2_phy_config *cfg; 36 struct clk *clk; 37 struct clk *ref_clk; 38 struct regulator *vbus; 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[]; 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 bool has_refclk_sel; 63}; 64 65extern const struct samsung_usb2_phy_config exynos3250_usb2_phy_config; 66extern const struct samsung_usb2_phy_config exynos4210_usb2_phy_config; 67extern const struct samsung_usb2_phy_config exynos4x12_usb2_phy_config; 68extern const struct samsung_usb2_phy_config exynos5250_usb2_phy_config; 69extern const struct samsung_usb2_phy_config exynos5420_usb2_phy_config; 70extern const struct samsung_usb2_phy_config s5pv210_usb2_phy_config; 71#endif