2012-05-11 22:25:46 +08:00
|
|
|
/*
|
|
|
|
* Platform data for the chipidea USB dual role controller
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_USB_CHIPIDEA_H
|
|
|
|
#define __LINUX_USB_CHIPIDEA_H
|
|
|
|
|
2012-07-07 22:56:46 +08:00
|
|
|
#include <linux/usb/otg.h>
|
|
|
|
|
2013-06-24 19:46:36 +08:00
|
|
|
struct ci_hdrc;
|
|
|
|
struct ci_hdrc_platform_data {
|
2012-05-11 22:25:46 +08:00
|
|
|
const char *name;
|
|
|
|
/* offset of the capability registers */
|
|
|
|
uintptr_t capoffset;
|
2012-05-11 22:25:55 +08:00
|
|
|
unsigned power_budget;
|
2014-10-31 01:41:19 +08:00
|
|
|
struct phy *phy;
|
|
|
|
/* old usb_phy interface */
|
2014-10-31 01:41:16 +08:00
|
|
|
struct usb_phy *usb_phy;
|
2013-06-13 22:59:56 +08:00
|
|
|
enum usb_phy_interface phy_mode;
|
2012-05-11 22:25:46 +08:00
|
|
|
unsigned long flags;
|
2013-06-24 19:46:36 +08:00
|
|
|
#define CI_HDRC_REGS_SHARED BIT(0)
|
2015-02-11 12:44:45 +08:00
|
|
|
#define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2)
|
2013-06-24 19:46:36 +08:00
|
|
|
#define CI_HDRC_DISABLE_STREAMING BIT(3)
|
2013-08-14 17:44:08 +08:00
|
|
|
/*
|
|
|
|
* Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
|
|
|
|
* but otg is not supported (no register otgsc).
|
|
|
|
*/
|
|
|
|
#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
|
2014-01-10 13:51:27 +08:00
|
|
|
#define CI_HDRC_IMX28_WRITE_FIX BIT(5)
|
2014-02-19 13:41:43 +08:00
|
|
|
#define CI_HDRC_FORCE_FULLSPEED BIT(6)
|
2015-02-11 12:45:01 +08:00
|
|
|
#define CI_HDRC_TURN_VBUS_EARLY_ON BIT(7)
|
2013-06-13 22:59:57 +08:00
|
|
|
enum usb_dr_mode dr_mode;
|
2013-06-24 19:46:36 +08:00
|
|
|
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
|
|
|
|
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
|
|
|
|
void (*notify_event) (struct ci_hdrc *ci, unsigned event);
|
2013-08-14 17:44:03 +08:00
|
|
|
struct regulator *reg_vbus;
|
2014-08-19 09:51:56 +08:00
|
|
|
bool tpl_support;
|
2012-05-11 22:25:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Default offset of capability registers */
|
|
|
|
#define DEF_CAPOFFSET 0x100
|
|
|
|
|
2013-06-24 19:46:36 +08:00
|
|
|
/* Add ci hdrc device */
|
|
|
|
struct platform_device *ci_hdrc_add_device(struct device *dev,
|
2012-07-07 22:56:41 +08:00
|
|
|
struct resource *res, int nres,
|
2013-06-24 19:46:36 +08:00
|
|
|
struct ci_hdrc_platform_data *platdata);
|
|
|
|
/* Remove ci hdrc device */
|
|
|
|
void ci_hdrc_remove_device(struct platform_device *pdev);
|
2012-07-07 22:56:41 +08:00
|
|
|
|
2012-05-11 22:25:46 +08:00
|
|
|
#endif
|