mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
7acc9973e3
Add support for vbus detection and power supply. This code is more or less stolen from phy-gpio-vbus-usb.c, and aims at providing a detection mechanism for VBus (ie. usb cable plug) based on a GPIO line, and a power supply activation which draws current from the VBus. [ balbi@ti.com : fix build break ] Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
28 lines
654 B
C
28 lines
654 B
C
#ifndef _PHY_GENERIC_H_
|
|
#define _PHY_GENERIC_H_
|
|
|
|
#include <linux/usb/usb_phy_generic.h>
|
|
#include <linux/gpio/consumer.h>
|
|
#include <linux/regulator/consumer.h>
|
|
|
|
struct usb_phy_generic {
|
|
struct usb_phy phy;
|
|
struct device *dev;
|
|
struct clk *clk;
|
|
struct regulator *vcc;
|
|
struct gpio_desc *gpiod_reset;
|
|
struct gpio_desc *gpiod_vbus;
|
|
struct regulator *vbus_draw;
|
|
bool vbus_draw_enabled;
|
|
unsigned long mA;
|
|
unsigned int vbus;
|
|
};
|
|
|
|
int usb_gen_phy_init(struct usb_phy *phy);
|
|
void usb_gen_phy_shutdown(struct usb_phy *phy);
|
|
|
|
int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
|
|
struct usb_phy_generic_platform_data *pdata);
|
|
|
|
#endif
|