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)
|
usb: chipidea: add ttctrl.ttha control interface
The register of ttctrl.ttha describes like below:
- Internal TT Hub Address Representation
- RW
- Default = 0000000b
This field is used to match against the Hub Address field in QH & siTD
to determine if the packet is routed to the internal TT for directly
attached FS/LS devices. If the Hub Address in the QH or siTD does not
match this address then the packet will be broadcast on the High Speed
ports destined for a downstream High Speed hub with the address in the QH/siTD.
In silicon RTL, this entry only affects QH and siTD, and the hub.addr at
both QH and siTD are 0 in ehci core for chipidea (with hcd->has_tt = 1).
So, for QH, if the "usage_tt" flag at RTL is 0, set CI_HDRC_SET_NON_ZERO_TTHA
will not affect QH (with non-hs device); for siTD, set this flag
will change remaining space requirement for the last transaction from 1023
bytes to 188 bytes, it can increase the number of transactions within one
frame, ehci periodic schedule code will not queue the packet if the frame space
is full, so it is safe to set this flag for siTD.
With this flag, it can fix the problem Alan Stern reported below:
http://www.spinics.net/lists/linux-usb/msg123125.html
And may fix Michael Tessier's problem too.
http://www.spinics.net/lists/linux-usb/msg118679.html
CC: stern@rowland.harvard.edu
CC: michael.tessier@axiontech.ca
Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-06-18 11:51:53 +08:00
|
|
|
#define CI_HDRC_SET_NON_ZERO_TTHA BIT(8)
|
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
|