Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: omap-usb2: Clean up exported header

Move private definitions from header to phy-omap-usb2.c file.
Get rid of unused data structures usb_dpll_params and omap_usb_phy_type.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200515080518.26870-2-rogerq@ti.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Roger Quadros and committed by
Kishon Vijay Abraham I
81530a38 728ac1ba

+58 -71
+56 -4
drivers/phy/ti/phy-omap-usb2.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * omap-usb2.c - USB PHY, talking to musb controller in OMAP. 3 + * omap-usb2.c - USB PHY, talking to USB controller on TI SoCs. 4 4 * 5 - * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com 5 + * Copyright (C) 2012-2020 Texas Instruments Incorporated - http://www.ti.com 6 6 * Author: Kishon Vijay Abraham I <kishon@ti.com> 7 7 */ 8 8 ··· 23 23 #include <linux/regmap.h> 24 24 #include <linux/of_platform.h> 25 25 26 - #define USB2PHY_DISCON_BYP_LATCH (1 << 31) 27 - #define USB2PHY_ANA_CONFIG1 0x4c 26 + #define USB2PHY_ANA_CONFIG1 0x4c 27 + #define USB2PHY_DISCON_BYP_LATCH BIT(31) 28 28 29 + /* SoC Specific USB2_OTG register definitions */ 29 30 #define AM654_USB2_OTG_PD BIT(8) 30 31 #define AM654_USB2_VBUS_DET_EN BIT(5) 31 32 #define AM654_USB2_VBUSVALID_DET_EN BIT(4) 33 + 34 + #define OMAP_DEV_PHY_PD BIT(0) 35 + #define OMAP_USB2_PHY_PD BIT(28) 36 + 37 + #define AM437X_USB2_PHY_PD BIT(0) 38 + #define AM437X_USB2_OTG_PD BIT(1) 39 + #define AM437X_USB2_OTGVDET_EN BIT(19) 40 + #define AM437X_USB2_OTGSESSEND_EN BIT(20) 41 + 42 + /* Driver Flags */ 43 + #define OMAP_USB2_HAS_START_SRP BIT(0) 44 + #define OMAP_USB2_HAS_SET_VBUS BIT(1) 45 + #define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT BIT(2) 46 + 47 + struct omap_usb { 48 + struct usb_phy phy; 49 + struct phy_companion *comparator; 50 + void __iomem *pll_ctrl_base; 51 + void __iomem *phy_base; 52 + struct device *dev; 53 + struct device *control_dev; 54 + struct clk *wkupclk; 55 + struct clk *optclk; 56 + u8 flags; 57 + struct regmap *syscon_phy_power; /* ctrl. reg. acces */ 58 + unsigned int power_reg; /* power reg. index within syscon */ 59 + u32 mask; 60 + u32 power_on; 61 + u32 power_off; 62 + }; 63 + 64 + #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 65 + 66 + struct usb_phy_data { 67 + const char *label; 68 + u8 flags; 69 + u32 mask; 70 + u32 power_on; 71 + u32 power_off; 72 + }; 73 + 74 + static inline u32 omap_usb_readl(void __iomem *addr, unsigned int offset) 75 + { 76 + return __raw_readl(addr + offset); 77 + } 78 + 79 + static inline void omap_usb_writel(void __iomem *addr, unsigned int offset, 80 + u32 data) 81 + { 82 + __raw_writel(data, addr + offset); 83 + } 32 84 33 85 /** 34 86 * omap_usb2_set_comparator - links the comparator present in the sytem with
+2 -67
include/linux/phy/omap_usb.h
··· 2 2 /* 3 3 * omap_usb.h -- omap usb2 phy header file 4 4 * 5 - * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com 5 + * Copyright (C) 2012-2020 Texas Instruments Incorporated - http://www.ti.com 6 6 * Author: Kishon Vijay Abraham I <kishon@ti.com> 7 7 */ 8 8 9 9 #ifndef __DRIVERS_OMAP_USB2_H 10 10 #define __DRIVERS_OMAP_USB2_H 11 11 12 - #include <linux/io.h> 13 - #include <linux/usb/otg.h> 14 - 15 - struct usb_dpll_params { 16 - u16 m; 17 - u8 n; 18 - u8 freq:3; 19 - u8 sd; 20 - u32 mf; 21 - }; 22 - 23 - enum omap_usb_phy_type { 24 - TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ 25 - TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ 26 - TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ 27 - }; 28 - 29 - struct omap_usb { 30 - struct usb_phy phy; 31 - struct phy_companion *comparator; 32 - void __iomem *pll_ctrl_base; 33 - void __iomem *phy_base; 34 - struct device *dev; 35 - struct device *control_dev; 36 - struct clk *wkupclk; 37 - struct clk *optclk; 38 - u8 flags; 39 - enum omap_usb_phy_type type; 40 - struct regmap *syscon_phy_power; /* ctrl. reg. acces */ 41 - unsigned int power_reg; /* power reg. index within syscon */ 42 - u32 mask; 43 - u32 power_on; 44 - u32 power_off; 45 - }; 46 - 47 - struct usb_phy_data { 48 - const char *label; 49 - u8 flags; 50 - u32 mask; 51 - u32 power_on; 52 - u32 power_off; 53 - }; 54 - 55 - /* Driver Flags */ 56 - #define OMAP_USB2_HAS_START_SRP (1 << 0) 57 - #define OMAP_USB2_HAS_SET_VBUS (1 << 1) 58 - #define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2) 59 - 60 - #define OMAP_DEV_PHY_PD BIT(0) 61 - #define OMAP_USB2_PHY_PD BIT(28) 62 - 63 - #define AM437X_USB2_PHY_PD BIT(0) 64 - #define AM437X_USB2_OTG_PD BIT(1) 65 - #define AM437X_USB2_OTGVDET_EN BIT(19) 66 - #define AM437X_USB2_OTGSESSEND_EN BIT(20) 12 + #include <linux/usb/phy_companion.h> 67 13 68 14 #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 69 15 ··· 21 75 return -ENODEV; 22 76 } 23 77 #endif 24 - 25 - static inline u32 omap_usb_readl(void __iomem *addr, unsigned offset) 26 - { 27 - return __raw_readl(addr + offset); 28 - } 29 - 30 - static inline void omap_usb_writel(void __iomem *addr, unsigned offset, 31 - u32 data) 32 - { 33 - __raw_writel(data, addr + offset); 34 - } 35 78 36 79 #endif /* __DRIVERS_OMAP_USB_H */