blob: 25629948c84280a67cb304b707013bc9f383b503 [file] [log] [blame]
Alexander Shishkine443b332012-05-11 17:25:46 +03001/*
2 * Platform data for the chipidea USB dual role controller
3 */
4
5#ifndef __LINUX_USB_CHIPIDEA_H
6#define __LINUX_USB_CHIPIDEA_H
7
Richard Zhaoa2c3d692012-07-07 22:56:46 +08008#include <linux/usb/otg.h>
9
Alexander Shishkin8e229782013-06-24 14:46:36 +030010struct ci_hdrc;
11struct ci_hdrc_platform_data {
Alexander Shishkine443b332012-05-11 17:25:46 +030012 const char *name;
13 /* offset of the capability registers */
14 uintptr_t capoffset;
Alexander Shishkinbd841982012-05-11 17:25:55 +030015 unsigned power_budget;
Richard Zhaoa2c3d692012-07-07 22:56:46 +080016 struct usb_phy *phy;
Michael Grzeschik40dcd0e2013-06-13 17:59:56 +030017 enum usb_phy_interface phy_mode;
Alexander Shishkine443b332012-05-11 17:25:46 +030018 unsigned long flags;
Alexander Shishkin8e229782013-06-24 14:46:36 +030019#define CI_HDRC_REGS_SHARED BIT(0)
20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
21#define CI_HDRC_PULLUP_ON_VBUS BIT(2)
22#define CI_HDRC_DISABLE_STREAMING BIT(3)
Sascha Hauer691962d2013-06-13 17:59:57 +030023 enum usb_dr_mode dr_mode;
Alexander Shishkin8e229782013-06-24 14:46:36 +030024#define CI_HDRC_CONTROLLER_RESET_EVENT 0
25#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
26 void (*notify_event) (struct ci_hdrc *ci, unsigned event);
Alexander Shishkine443b332012-05-11 17:25:46 +030027};
28
29/* Default offset of capability registers */
30#define DEF_CAPOFFSET 0x100
31
Alexander Shishkin8e229782013-06-24 14:46:36 +030032/* Add ci hdrc device */
33struct platform_device *ci_hdrc_add_device(struct device *dev,
Richard Zhaocbc6dc22012-07-07 22:56:41 +080034 struct resource *res, int nres,
Alexander Shishkin8e229782013-06-24 14:46:36 +030035 struct ci_hdrc_platform_data *platdata);
36/* Remove ci hdrc device */
37void ci_hdrc_remove_device(struct platform_device *pdev);
Richard Zhaocbc6dc22012-07-07 22:56:41 +080038
Alexander Shishkine443b332012-05-11 17:25:46 +030039#endif