ssusb             328 drivers/usb/mtu3/mtu3.h 	struct ssusb_mtk *ssusb;
ssusb             422 drivers/usb/mtu3/mtu3.h int ssusb_check_clocks(struct ssusb_mtk *ssusb, u32 ex_clks);
ssusb             113 drivers/usb/mtu3/mtu3_core.c 	if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) {
ssusb             120 drivers/usb/mtu3/mtu3_core.c 	return ssusb_check_clocks(mtu->ssusb, check_clk);
ssusb             134 drivers/usb/mtu3/mtu3_core.c 	if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG)
ssusb             826 drivers/usb/mtu3/mtu3_core.c int ssusb_gadget_init(struct ssusb_mtk *ssusb)
ssusb             828 drivers/usb/mtu3/mtu3_core.c 	struct device *dev = ssusb->dev;
ssusb             852 drivers/usb/mtu3/mtu3_core.c 	mtu->ippc_base = ssusb->ippc_base;
ssusb             853 drivers/usb/mtu3/mtu3_core.c 	ssusb->mac_base	= mtu->mac_base;
ssusb             854 drivers/usb/mtu3/mtu3_core.c 	ssusb->u3d = mtu;
ssusb             855 drivers/usb/mtu3/mtu3_core.c 	mtu->ssusb = ssusb;
ssusb             905 drivers/usb/mtu3/mtu3_core.c 	if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG)
ssusb             908 drivers/usb/mtu3/mtu3_core.c 	ssusb_dev_debugfs_init(ssusb);
ssusb             920 drivers/usb/mtu3/mtu3_core.c 	ssusb->u3d = NULL;
ssusb             926 drivers/usb/mtu3/mtu3_core.c void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
ssusb             928 drivers/usb/mtu3/mtu3_core.c 	struct mtu3 *mtu = ssusb->u3d;
ssusb             931 drivers/usb/mtu3/mtu3_core.c 	device_init_wakeup(ssusb->dev, false);
ssusb              29 drivers/usb/mtu3/mtu3_debug.h void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
ssusb              30 drivers/usb/mtu3/mtu3_debug.h void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb);
ssusb              31 drivers/usb/mtu3/mtu3_debug.h void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
ssusb              32 drivers/usb/mtu3/mtu3_debug.h void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
ssusb              35 drivers/usb/mtu3/mtu3_debug.h static inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
ssusb              36 drivers/usb/mtu3/mtu3_debug.h static inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {}
ssusb              37 drivers/usb/mtu3/mtu3_debug.h static inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
ssusb              38 drivers/usb/mtu3/mtu3_debug.h static inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
ssusb             351 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = mtu->ssusb;
ssusb             356 drivers/usb/mtu3/mtu3_debugfs.c 	dir_prb = debugfs_create_dir("probe", ssusb->dbgfs_root);
ssusb             388 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = mtu->ssusb;
ssusb             392 drivers/usb/mtu3/mtu3_debugfs.c 	dir_eps = debugfs_create_dir("eps", ssusb->dbgfs_root);
ssusb             400 drivers/usb/mtu3/mtu3_debugfs.c void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb)
ssusb             402 drivers/usb/mtu3/mtu3_debugfs.c 	struct mtu3 *mtu = ssusb->u3d;
ssusb             405 drivers/usb/mtu3/mtu3_debugfs.c 	dir_regs = debugfs_create_dir("regs", ssusb->dbgfs_root);
ssusb             423 drivers/usb/mtu3/mtu3_debugfs.c 	debugfs_create_file("link-state", 0444, ssusb->dbgfs_root,
ssusb             425 drivers/usb/mtu3/mtu3_debugfs.c 	debugfs_create_file("ep-used", 0444, ssusb->dbgfs_root,
ssusb             431 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = sf->private;
ssusb             434 drivers/usb/mtu3/mtu3_debugfs.c 		   ssusb->is_host ? "host" : "device",
ssusb             435 drivers/usb/mtu3/mtu3_debugfs.c 		   ssusb->otg_switch.manual_drd_enabled ? "manual" : "auto");
ssusb             449 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = sf->private;
ssusb             455 drivers/usb/mtu3/mtu3_debugfs.c 	if (!strncmp(buf, "host", 4) && !ssusb->is_host) {
ssusb             456 drivers/usb/mtu3/mtu3_debugfs.c 		ssusb_mode_switch(ssusb, 1);
ssusb             457 drivers/usb/mtu3/mtu3_debugfs.c 	} else if (!strncmp(buf, "device", 6) && ssusb->is_host) {
ssusb             458 drivers/usb/mtu3/mtu3_debugfs.c 		ssusb_mode_switch(ssusb, 0);
ssusb             460 drivers/usb/mtu3/mtu3_debugfs.c 		dev_err(ssusb->dev, "wrong or duplicated setting\n");
ssusb             477 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = sf->private;
ssusb             478 drivers/usb/mtu3/mtu3_debugfs.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             495 drivers/usb/mtu3/mtu3_debugfs.c 	struct ssusb_mtk *ssusb = sf->private;
ssusb             496 drivers/usb/mtu3/mtu3_debugfs.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             504 drivers/usb/mtu3/mtu3_debugfs.c 		dev_err(ssusb->dev, "wrong setting\n");
ssusb             521 drivers/usb/mtu3/mtu3_debugfs.c void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb)
ssusb             523 drivers/usb/mtu3/mtu3_debugfs.c 	struct dentry *root = ssusb->dbgfs_root;
ssusb             525 drivers/usb/mtu3/mtu3_debugfs.c 	debugfs_create_file("mode", 0644, root, ssusb, &ssusb_mode_fops);
ssusb             526 drivers/usb/mtu3/mtu3_debugfs.c 	debugfs_create_file("vbus", 0644, root, ssusb, &ssusb_vbus_fops);
ssusb             529 drivers/usb/mtu3/mtu3_debugfs.c void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb)
ssusb             531 drivers/usb/mtu3/mtu3_debugfs.c 	ssusb->dbgfs_root =
ssusb             532 drivers/usb/mtu3/mtu3_debugfs.c 		debugfs_create_dir(dev_name(ssusb->dev), usb_debug_root);
ssusb             535 drivers/usb/mtu3/mtu3_debugfs.c void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb)
ssusb             537 drivers/usb/mtu3/mtu3_debugfs.c 	debugfs_remove_recursive(ssusb->dbgfs_root);
ssusb             538 drivers/usb/mtu3/mtu3_debugfs.c 	ssusb->dbgfs_root = NULL;
ssusb              42 drivers/usb/mtu3/mtu3_dr.c static void toggle_opstate(struct ssusb_mtk *ssusb)
ssusb              44 drivers/usb/mtu3/mtu3_dr.c 	if (!ssusb->otg_switch.is_u3_drd) {
ssusb              45 drivers/usb/mtu3/mtu3_dr.c 		mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION);
ssusb              46 drivers/usb/mtu3/mtu3_dr.c 		mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN);
ssusb              51 drivers/usb/mtu3/mtu3_dr.c static int ssusb_port0_switch(struct ssusb_mtk *ssusb,
ssusb              54 drivers/usb/mtu3/mtu3_dr.c 	void __iomem *ibase = ssusb->ippc_base;
ssusb              57 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "%s (switch u%d port0 to %s)\n", __func__,
ssusb              89 drivers/usb/mtu3/mtu3_dr.c static void switch_port_to_host(struct ssusb_mtk *ssusb)
ssusb              93 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "%s\n", __func__);
ssusb              95 drivers/usb/mtu3/mtu3_dr.c 	ssusb_port0_switch(ssusb, USB2_PORT, true);
ssusb              97 drivers/usb/mtu3/mtu3_dr.c 	if (ssusb->otg_switch.is_u3_drd) {
ssusb              98 drivers/usb/mtu3/mtu3_dr.c 		ssusb_port0_switch(ssusb, USB3_PORT, true);
ssusb             102 drivers/usb/mtu3/mtu3_dr.c 	ssusb_check_clocks(ssusb, check_clk);
ssusb             105 drivers/usb/mtu3/mtu3_dr.c 	toggle_opstate(ssusb);
ssusb             108 drivers/usb/mtu3/mtu3_dr.c static void switch_port_to_device(struct ssusb_mtk *ssusb)
ssusb             112 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "%s\n", __func__);
ssusb             114 drivers/usb/mtu3/mtu3_dr.c 	ssusb_port0_switch(ssusb, USB2_PORT, false);
ssusb             116 drivers/usb/mtu3/mtu3_dr.c 	if (ssusb->otg_switch.is_u3_drd) {
ssusb             117 drivers/usb/mtu3/mtu3_dr.c 		ssusb_port0_switch(ssusb, USB3_PORT, false);
ssusb             121 drivers/usb/mtu3/mtu3_dr.c 	ssusb_check_clocks(ssusb, check_clk);
ssusb             126 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb =
ssusb             135 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "%s: turn %s\n", __func__, is_on ? "on" : "off");
ssusb             140 drivers/usb/mtu3/mtu3_dr.c 			dev_err(ssusb->dev, "vbus regulator enable failed\n");
ssusb             157 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb =
ssusb             159 drivers/usb/mtu3/mtu3_dr.c 	struct mtu3 *mtu = ssusb->u3d;
ssusb             161 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "mailbox %s\n", mailbox_state_string(status));
ssusb             162 drivers/usb/mtu3/mtu3_dr.c 	mtu3_dbg_trace(ssusb->dev, "mailbox %s", mailbox_state_string(status));
ssusb             166 drivers/usb/mtu3/mtu3_dr.c 		switch_port_to_host(ssusb);
ssusb             168 drivers/usb/mtu3/mtu3_dr.c 		ssusb->is_host = true;
ssusb             171 drivers/usb/mtu3/mtu3_dr.c 		ssusb->is_host = false;
ssusb             173 drivers/usb/mtu3/mtu3_dr.c 		switch_port_to_device(ssusb);
ssusb             177 drivers/usb/mtu3/mtu3_dr.c 		pm_relax(ssusb->dev);
ssusb             181 drivers/usb/mtu3/mtu3_dr.c 		pm_stay_awake(ssusb->dev);
ssusb             185 drivers/usb/mtu3/mtu3_dr.c 		dev_err(ssusb->dev, "invalid state\n");
ssusb             241 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb =
ssusb             251 drivers/usb/mtu3/mtu3_dr.c 	ret = devm_extcon_register_notifier(ssusb->dev, edev, EXTCON_USB,
ssusb             254 drivers/usb/mtu3/mtu3_dr.c 		dev_err(ssusb->dev, "failed to register notifier for USB\n");
ssusb             259 drivers/usb/mtu3/mtu3_dr.c 	ret = devm_extcon_register_notifier(ssusb->dev, edev, EXTCON_USB_HOST,
ssusb             262 drivers/usb/mtu3/mtu3_dr.c 		dev_err(ssusb->dev, "failed to register notifier for USB-HOST\n");
ssusb             266 drivers/usb/mtu3/mtu3_dr.c 	dev_dbg(ssusb->dev, "EXTCON_USB: %d, EXTCON_USB_HOST: %d\n",
ssusb             285 drivers/usb/mtu3/mtu3_dr.c void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host)
ssusb             287 drivers/usb/mtu3/mtu3_dr.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             290 drivers/usb/mtu3/mtu3_dr.c 		ssusb_set_force_mode(ssusb, MTU3_DR_FORCE_HOST);
ssusb             294 drivers/usb/mtu3/mtu3_dr.c 		ssusb_set_force_mode(ssusb, MTU3_DR_FORCE_DEVICE);
ssusb             300 drivers/usb/mtu3/mtu3_dr.c void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
ssusb             305 drivers/usb/mtu3/mtu3_dr.c 	value = mtu3_readl(ssusb->ippc_base, SSUSB_U2_CTRL(0));
ssusb             320 drivers/usb/mtu3/mtu3_dr.c 	mtu3_writel(ssusb->ippc_base, SSUSB_U2_CTRL(0), value);
ssusb             325 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb = dev_get_drvdata(dev);
ssusb             331 drivers/usb/mtu3/mtu3_dr.c 	if (to_host ^ ssusb->is_host)
ssusb             332 drivers/usb/mtu3/mtu3_dr.c 		ssusb_mode_switch(ssusb, to_host);
ssusb             339 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb = dev_get_drvdata(dev);
ssusb             342 drivers/usb/mtu3/mtu3_dr.c 	role = ssusb->is_host ? USB_ROLE_HOST : USB_ROLE_DEVICE;
ssusb             350 drivers/usb/mtu3/mtu3_dr.c 	struct ssusb_mtk *ssusb =
ssusb             358 drivers/usb/mtu3/mtu3_dr.c 	role_sx_desc.fwnode = dev_fwnode(ssusb->dev);
ssusb             359 drivers/usb/mtu3/mtu3_dr.c 	otg_sx->role_sw = usb_role_switch_register(ssusb->dev, &role_sx_desc);
ssusb             364 drivers/usb/mtu3/mtu3_dr.c int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
ssusb             366 drivers/usb/mtu3/mtu3_dr.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             373 drivers/usb/mtu3/mtu3_dr.c 		ssusb_dr_debugfs_init(ssusb);
ssusb             382 drivers/usb/mtu3/mtu3_dr.c void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
ssusb             384 drivers/usb/mtu3/mtu3_dr.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb              15 drivers/usb/mtu3/mtu3_dr.h int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn);
ssusb              16 drivers/usb/mtu3/mtu3_dr.h void ssusb_host_exit(struct ssusb_mtk *ssusb);
ssusb              17 drivers/usb/mtu3/mtu3_dr.h int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
ssusb              19 drivers/usb/mtu3/mtu3_dr.h int ssusb_host_enable(struct ssusb_mtk *ssusb);
ssusb              20 drivers/usb/mtu3/mtu3_dr.h int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend);
ssusb              21 drivers/usb/mtu3/mtu3_dr.h void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable);
ssusb              25 drivers/usb/mtu3/mtu3_dr.h static inline int ssusb_host_init(struct ssusb_mtk *ssusb,
ssusb              32 drivers/usb/mtu3/mtu3_dr.h static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
ssusb              36 drivers/usb/mtu3/mtu3_dr.h 	struct ssusb_mtk *ssusb, struct device_node *dn)
ssusb              41 drivers/usb/mtu3/mtu3_dr.h static inline int ssusb_host_enable(struct ssusb_mtk *ssusb)
ssusb              46 drivers/usb/mtu3/mtu3_dr.h static inline int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
ssusb              51 drivers/usb/mtu3/mtu3_dr.h static inline void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable)
ssusb              58 drivers/usb/mtu3/mtu3_dr.h int ssusb_gadget_init(struct ssusb_mtk *ssusb);
ssusb              59 drivers/usb/mtu3/mtu3_dr.h void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
ssusb              61 drivers/usb/mtu3/mtu3_dr.h static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
ssusb              66 drivers/usb/mtu3/mtu3_dr.h static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
ssusb              72 drivers/usb/mtu3/mtu3_dr.h int ssusb_otg_switch_init(struct ssusb_mtk *ssusb);
ssusb              73 drivers/usb/mtu3/mtu3_dr.h void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb);
ssusb              74 drivers/usb/mtu3/mtu3_dr.h void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host);
ssusb              76 drivers/usb/mtu3/mtu3_dr.h void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
ssusb              81 drivers/usb/mtu3/mtu3_dr.h static inline int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
ssusb              86 drivers/usb/mtu3/mtu3_dr.h static inline void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
ssusb              89 drivers/usb/mtu3/mtu3_dr.h static inline void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host)
ssusb              98 drivers/usb/mtu3/mtu3_dr.h ssusb_set_force_mode(struct ssusb_mtk *ssusb, enum mtu3_dr_force_mode mode)
ssusb             531 drivers/usb/mtu3/mtu3_gadget.c 	if (mtu->ssusb->dr_mode == USB_DR_MODE_PERIPHERAL)
ssusb             585 drivers/usb/mtu3/mtu3_gadget.c 	if (mtu->ssusb->dr_mode == USB_DR_MODE_PERIPHERAL)
ssusb              41 drivers/usb/mtu3/mtu3_host.c static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
ssusb              45 drivers/usb/mtu3/mtu3_host.c 	switch (ssusb->uwk_vers) {
ssusb              47 drivers/usb/mtu3/mtu3_host.c 		reg = ssusb->uwk_reg_base + PERI_WK_CTRL1;
ssusb              52 drivers/usb/mtu3/mtu3_host.c 		reg = ssusb->uwk_reg_base + PERI_SSUSB_SPM_CTRL;
ssusb              59 drivers/usb/mtu3/mtu3_host.c 	regmap_update_bits(ssusb->uwk, reg, msk, val);
ssusb              62 drivers/usb/mtu3/mtu3_host.c int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
ssusb              69 drivers/usb/mtu3/mtu3_host.c 	ssusb->uwk_en = of_property_read_bool(dn, "wakeup-source");
ssusb              70 drivers/usb/mtu3/mtu3_host.c 	if (!ssusb->uwk_en)
ssusb              78 drivers/usb/mtu3/mtu3_host.c 	ssusb->uwk_reg_base = args.args[0];
ssusb              79 drivers/usb/mtu3/mtu3_host.c 	ssusb->uwk_vers = args.args[1];
ssusb              80 drivers/usb/mtu3/mtu3_host.c 	ssusb->uwk = syscon_node_to_regmap(args.np);
ssusb              82 drivers/usb/mtu3/mtu3_host.c 	dev_info(ssusb->dev, "uwk - reg:0x%x, version:%d\n",
ssusb              83 drivers/usb/mtu3/mtu3_host.c 			ssusb->uwk_reg_base, ssusb->uwk_vers);
ssusb              85 drivers/usb/mtu3/mtu3_host.c 	return PTR_ERR_OR_ZERO(ssusb->uwk);
ssusb              88 drivers/usb/mtu3/mtu3_host.c void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable)
ssusb              90 drivers/usb/mtu3/mtu3_host.c 	if (ssusb->uwk_en)
ssusb              91 drivers/usb/mtu3/mtu3_host.c 		ssusb_wakeup_ip_sleep_set(ssusb, enable);
ssusb              94 drivers/usb/mtu3/mtu3_host.c static void host_ports_num_get(struct ssusb_mtk *ssusb)
ssusb              98 drivers/usb/mtu3/mtu3_host.c 	xhci_cap = mtu3_readl(ssusb->ippc_base, U3D_SSUSB_IP_XHCI_CAP);
ssusb              99 drivers/usb/mtu3/mtu3_host.c 	ssusb->u2_ports = SSUSB_IP_XHCI_U2_PORT_NUM(xhci_cap);
ssusb             100 drivers/usb/mtu3/mtu3_host.c 	ssusb->u3_ports = SSUSB_IP_XHCI_U3_PORT_NUM(xhci_cap);
ssusb             102 drivers/usb/mtu3/mtu3_host.c 	dev_dbg(ssusb->dev, "host - u2_ports:%d, u3_ports:%d\n",
ssusb             103 drivers/usb/mtu3/mtu3_host.c 		 ssusb->u2_ports, ssusb->u3_ports);
ssusb             107 drivers/usb/mtu3/mtu3_host.c int ssusb_host_enable(struct ssusb_mtk *ssusb)
ssusb             109 drivers/usb/mtu3/mtu3_host.c 	void __iomem *ibase = ssusb->ippc_base;
ssusb             110 drivers/usb/mtu3/mtu3_host.c 	int num_u3p = ssusb->u3_ports;
ssusb             111 drivers/usb/mtu3/mtu3_host.c 	int num_u2p = ssusb->u2_ports;
ssusb             123 drivers/usb/mtu3/mtu3_host.c 		if ((0x1 << i) & ssusb->u3p_dis_msk) {
ssusb             146 drivers/usb/mtu3/mtu3_host.c 	return ssusb_check_clocks(ssusb, check_clk);
ssusb             149 drivers/usb/mtu3/mtu3_host.c int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
ssusb             151 drivers/usb/mtu3/mtu3_host.c 	void __iomem *ibase = ssusb->ippc_base;
ssusb             152 drivers/usb/mtu3/mtu3_host.c 	int num_u3p = ssusb->u3_ports;
ssusb             153 drivers/usb/mtu3/mtu3_host.c 	int num_u2p = ssusb->u2_ports;
ssusb             160 drivers/usb/mtu3/mtu3_host.c 		if ((0x1 << i) & ssusb->u3p_dis_msk)
ssusb             187 drivers/usb/mtu3/mtu3_host.c 		dev_err(ssusb->dev, "ip sleep failed!!!\n");
ssusb             192 drivers/usb/mtu3/mtu3_host.c static void ssusb_host_setup(struct ssusb_mtk *ssusb)
ssusb             194 drivers/usb/mtu3/mtu3_host.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             196 drivers/usb/mtu3/mtu3_host.c 	host_ports_num_get(ssusb);
ssusb             202 drivers/usb/mtu3/mtu3_host.c 	ssusb_host_enable(ssusb);
ssusb             205 drivers/usb/mtu3/mtu3_host.c 		ssusb_set_force_mode(ssusb, MTU3_DR_FORCE_HOST);
ssusb             208 drivers/usb/mtu3/mtu3_host.c 	ssusb_set_vbus(&ssusb->otg_switch, 1);
ssusb             211 drivers/usb/mtu3/mtu3_host.c static void ssusb_host_cleanup(struct ssusb_mtk *ssusb)
ssusb             213 drivers/usb/mtu3/mtu3_host.c 	if (ssusb->is_host)
ssusb             214 drivers/usb/mtu3/mtu3_host.c 		ssusb_set_vbus(&ssusb->otg_switch, 0);
ssusb             216 drivers/usb/mtu3/mtu3_host.c 	ssusb_host_disable(ssusb, false);
ssusb             225 drivers/usb/mtu3/mtu3_host.c int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn)
ssusb             227 drivers/usb/mtu3/mtu3_host.c 	struct device *parent_dev = ssusb->dev;
ssusb             230 drivers/usb/mtu3/mtu3_host.c 	ssusb_host_setup(ssusb);
ssusb             244 drivers/usb/mtu3/mtu3_host.c void ssusb_host_exit(struct ssusb_mtk *ssusb)
ssusb             246 drivers/usb/mtu3/mtu3_host.c 	of_platform_depopulate(ssusb->dev);
ssusb             247 drivers/usb/mtu3/mtu3_host.c 	ssusb_host_cleanup(ssusb);
ssusb              22 drivers/usb/mtu3/mtu3_plat.c int ssusb_check_clocks(struct ssusb_mtk *ssusb, u32 ex_clks)
ssusb              24 drivers/usb/mtu3/mtu3_plat.c 	void __iomem *ibase = ssusb->ippc_base;
ssusb              34 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "clks of sts1 are not stable!\n");
ssusb              41 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "mac2 clock is not stable\n");
ssusb              48 drivers/usb/mtu3/mtu3_plat.c static int ssusb_phy_init(struct ssusb_mtk *ssusb)
ssusb              53 drivers/usb/mtu3/mtu3_plat.c 	for (i = 0; i < ssusb->num_phys; i++) {
ssusb              54 drivers/usb/mtu3/mtu3_plat.c 		ret = phy_init(ssusb->phys[i]);
ssusb              62 drivers/usb/mtu3/mtu3_plat.c 		phy_exit(ssusb->phys[i - 1]);
ssusb              67 drivers/usb/mtu3/mtu3_plat.c static int ssusb_phy_exit(struct ssusb_mtk *ssusb)
ssusb              71 drivers/usb/mtu3/mtu3_plat.c 	for (i = 0; i < ssusb->num_phys; i++)
ssusb              72 drivers/usb/mtu3/mtu3_plat.c 		phy_exit(ssusb->phys[i]);
ssusb              77 drivers/usb/mtu3/mtu3_plat.c static int ssusb_phy_power_on(struct ssusb_mtk *ssusb)
ssusb              82 drivers/usb/mtu3/mtu3_plat.c 	for (i = 0; i < ssusb->num_phys; i++) {
ssusb              83 drivers/usb/mtu3/mtu3_plat.c 		ret = phy_power_on(ssusb->phys[i]);
ssusb              91 drivers/usb/mtu3/mtu3_plat.c 		phy_power_off(ssusb->phys[i - 1]);
ssusb              96 drivers/usb/mtu3/mtu3_plat.c static void ssusb_phy_power_off(struct ssusb_mtk *ssusb)
ssusb             100 drivers/usb/mtu3/mtu3_plat.c 	for (i = 0; i < ssusb->num_phys; i++)
ssusb             101 drivers/usb/mtu3/mtu3_plat.c 		phy_power_off(ssusb->phys[i]);
ssusb             104 drivers/usb/mtu3/mtu3_plat.c static int ssusb_clks_enable(struct ssusb_mtk *ssusb)
ssusb             108 drivers/usb/mtu3/mtu3_plat.c 	ret = clk_prepare_enable(ssusb->sys_clk);
ssusb             110 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to enable sys_clk\n");
ssusb             114 drivers/usb/mtu3/mtu3_plat.c 	ret = clk_prepare_enable(ssusb->ref_clk);
ssusb             116 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to enable ref_clk\n");
ssusb             120 drivers/usb/mtu3/mtu3_plat.c 	ret = clk_prepare_enable(ssusb->mcu_clk);
ssusb             122 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to enable mcu_clk\n");
ssusb             126 drivers/usb/mtu3/mtu3_plat.c 	ret = clk_prepare_enable(ssusb->dma_clk);
ssusb             128 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to enable dma_clk\n");
ssusb             135 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->mcu_clk);
ssusb             137 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->ref_clk);
ssusb             139 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->sys_clk);
ssusb             144 drivers/usb/mtu3/mtu3_plat.c static void ssusb_clks_disable(struct ssusb_mtk *ssusb)
ssusb             146 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->dma_clk);
ssusb             147 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->mcu_clk);
ssusb             148 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->ref_clk);
ssusb             149 drivers/usb/mtu3/mtu3_plat.c 	clk_disable_unprepare(ssusb->sys_clk);
ssusb             152 drivers/usb/mtu3/mtu3_plat.c static int ssusb_rscs_init(struct ssusb_mtk *ssusb)
ssusb             156 drivers/usb/mtu3/mtu3_plat.c 	ret = regulator_enable(ssusb->vusb33);
ssusb             158 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to enable vusb33\n");
ssusb             162 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_clks_enable(ssusb);
ssusb             166 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_phy_init(ssusb);
ssusb             168 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to init phy\n");
ssusb             172 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_phy_power_on(ssusb);
ssusb             174 drivers/usb/mtu3/mtu3_plat.c 		dev_err(ssusb->dev, "failed to power on phy\n");
ssusb             181 drivers/usb/mtu3/mtu3_plat.c 	ssusb_phy_exit(ssusb);
ssusb             183 drivers/usb/mtu3/mtu3_plat.c 	ssusb_clks_disable(ssusb);
ssusb             185 drivers/usb/mtu3/mtu3_plat.c 	regulator_disable(ssusb->vusb33);
ssusb             190 drivers/usb/mtu3/mtu3_plat.c static void ssusb_rscs_exit(struct ssusb_mtk *ssusb)
ssusb             192 drivers/usb/mtu3/mtu3_plat.c 	ssusb_clks_disable(ssusb);
ssusb             193 drivers/usb/mtu3/mtu3_plat.c 	regulator_disable(ssusb->vusb33);
ssusb             194 drivers/usb/mtu3/mtu3_plat.c 	ssusb_phy_power_off(ssusb);
ssusb             195 drivers/usb/mtu3/mtu3_plat.c 	ssusb_phy_exit(ssusb);
ssusb             198 drivers/usb/mtu3/mtu3_plat.c static void ssusb_ip_sw_reset(struct ssusb_mtk *ssusb)
ssusb             201 drivers/usb/mtu3/mtu3_plat.c 	mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST);
ssusb             203 drivers/usb/mtu3/mtu3_plat.c 	mtu3_clrbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST);
ssusb             211 drivers/usb/mtu3/mtu3_plat.c 	mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN);
ssusb             214 drivers/usb/mtu3/mtu3_plat.c static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
ssusb             217 drivers/usb/mtu3/mtu3_plat.c 	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
ssusb             223 drivers/usb/mtu3/mtu3_plat.c 	ssusb->vusb33 = devm_regulator_get(dev, "vusb33");
ssusb             224 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->vusb33)) {
ssusb             226 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->vusb33);
ssusb             229 drivers/usb/mtu3/mtu3_plat.c 	ssusb->sys_clk = devm_clk_get(dev, "sys_ck");
ssusb             230 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->sys_clk)) {
ssusb             232 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->sys_clk);
ssusb             235 drivers/usb/mtu3/mtu3_plat.c 	ssusb->ref_clk = devm_clk_get_optional(dev, "ref_ck");
ssusb             236 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->ref_clk))
ssusb             237 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->ref_clk);
ssusb             239 drivers/usb/mtu3/mtu3_plat.c 	ssusb->mcu_clk = devm_clk_get_optional(dev, "mcu_ck");
ssusb             240 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->mcu_clk))
ssusb             241 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->mcu_clk);
ssusb             243 drivers/usb/mtu3/mtu3_plat.c 	ssusb->dma_clk = devm_clk_get_optional(dev, "dma_ck");
ssusb             244 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->dma_clk))
ssusb             245 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->dma_clk);
ssusb             247 drivers/usb/mtu3/mtu3_plat.c 	ssusb->num_phys = of_count_phandle_with_args(node,
ssusb             249 drivers/usb/mtu3/mtu3_plat.c 	if (ssusb->num_phys > 0) {
ssusb             250 drivers/usb/mtu3/mtu3_plat.c 		ssusb->phys = devm_kcalloc(dev, ssusb->num_phys,
ssusb             251 drivers/usb/mtu3/mtu3_plat.c 					sizeof(*ssusb->phys), GFP_KERNEL);
ssusb             252 drivers/usb/mtu3/mtu3_plat.c 		if (!ssusb->phys)
ssusb             255 drivers/usb/mtu3/mtu3_plat.c 		ssusb->num_phys = 0;
ssusb             258 drivers/usb/mtu3/mtu3_plat.c 	for (i = 0; i < ssusb->num_phys; i++) {
ssusb             259 drivers/usb/mtu3/mtu3_plat.c 		ssusb->phys[i] = devm_of_phy_get_by_index(dev, node, i);
ssusb             260 drivers/usb/mtu3/mtu3_plat.c 		if (IS_ERR(ssusb->phys[i])) {
ssusb             262 drivers/usb/mtu3/mtu3_plat.c 			return PTR_ERR(ssusb->phys[i]);
ssusb             267 drivers/usb/mtu3/mtu3_plat.c 	ssusb->ippc_base = devm_ioremap_resource(dev, res);
ssusb             268 drivers/usb/mtu3/mtu3_plat.c 	if (IS_ERR(ssusb->ippc_base))
ssusb             269 drivers/usb/mtu3/mtu3_plat.c 		return PTR_ERR(ssusb->ippc_base);
ssusb             271 drivers/usb/mtu3/mtu3_plat.c 	ssusb->dr_mode = usb_get_dr_mode(dev);
ssusb             272 drivers/usb/mtu3/mtu3_plat.c 	if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN)
ssusb             273 drivers/usb/mtu3/mtu3_plat.c 		ssusb->dr_mode = USB_DR_MODE_OTG;
ssusb             275 drivers/usb/mtu3/mtu3_plat.c 	if (ssusb->dr_mode == USB_DR_MODE_PERIPHERAL)
ssusb             279 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_wakeup_of_property_parse(ssusb, node);
ssusb             287 drivers/usb/mtu3/mtu3_plat.c 			     &ssusb->u3p_dis_msk);
ssusb             295 drivers/usb/mtu3/mtu3_plat.c 	if (ssusb->dr_mode == USB_DR_MODE_HOST)
ssusb             305 drivers/usb/mtu3/mtu3_plat.c 		otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
ssusb             307 drivers/usb/mtu3/mtu3_plat.c 			dev_err(ssusb->dev, "couldn't get extcon device\n");
ssusb             314 drivers/usb/mtu3/mtu3_plat.c 		ssusb->dr_mode, otg_sx->is_u3_drd, ssusb->u3p_dis_msk,
ssusb             324 drivers/usb/mtu3/mtu3_plat.c 	struct ssusb_mtk *ssusb;
ssusb             328 drivers/usb/mtu3/mtu3_plat.c 	ssusb = devm_kzalloc(dev, sizeof(*ssusb), GFP_KERNEL);
ssusb             329 drivers/usb/mtu3/mtu3_plat.c 	if (!ssusb)
ssusb             338 drivers/usb/mtu3/mtu3_plat.c 	platform_set_drvdata(pdev, ssusb);
ssusb             339 drivers/usb/mtu3/mtu3_plat.c 	ssusb->dev = dev;
ssusb             341 drivers/usb/mtu3/mtu3_plat.c 	ret = get_ssusb_rscs(pdev, ssusb);
ssusb             345 drivers/usb/mtu3/mtu3_plat.c 	ssusb_debugfs_create_root(ssusb);
ssusb             352 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_rscs_init(ssusb);
ssusb             356 drivers/usb/mtu3/mtu3_plat.c 	ssusb_ip_sw_reset(ssusb);
ssusb             359 drivers/usb/mtu3/mtu3_plat.c 		ssusb->dr_mode = USB_DR_MODE_HOST;
ssusb             361 drivers/usb/mtu3/mtu3_plat.c 		ssusb->dr_mode = USB_DR_MODE_PERIPHERAL;
ssusb             364 drivers/usb/mtu3/mtu3_plat.c 	ssusb->is_host = !(ssusb->dr_mode == USB_DR_MODE_PERIPHERAL);
ssusb             366 drivers/usb/mtu3/mtu3_plat.c 	switch (ssusb->dr_mode) {
ssusb             368 drivers/usb/mtu3/mtu3_plat.c 		ret = ssusb_gadget_init(ssusb);
ssusb             375 drivers/usb/mtu3/mtu3_plat.c 		ret = ssusb_host_init(ssusb, node);
ssusb             382 drivers/usb/mtu3/mtu3_plat.c 		ret = ssusb_gadget_init(ssusb);
ssusb             388 drivers/usb/mtu3/mtu3_plat.c 		ret = ssusb_host_init(ssusb, node);
ssusb             394 drivers/usb/mtu3/mtu3_plat.c 		ret = ssusb_otg_switch_init(ssusb);
ssusb             401 drivers/usb/mtu3/mtu3_plat.c 		dev_err(dev, "unsupported mode: %d\n", ssusb->dr_mode);
ssusb             409 drivers/usb/mtu3/mtu3_plat.c 	ssusb_host_exit(ssusb);
ssusb             411 drivers/usb/mtu3/mtu3_plat.c 	ssusb_gadget_exit(ssusb);
ssusb             413 drivers/usb/mtu3/mtu3_plat.c 	ssusb_rscs_exit(ssusb);
ssusb             417 drivers/usb/mtu3/mtu3_plat.c 	ssusb_debugfs_remove_root(ssusb);
ssusb             424 drivers/usb/mtu3/mtu3_plat.c 	struct ssusb_mtk *ssusb = platform_get_drvdata(pdev);
ssusb             426 drivers/usb/mtu3/mtu3_plat.c 	switch (ssusb->dr_mode) {
ssusb             428 drivers/usb/mtu3/mtu3_plat.c 		ssusb_gadget_exit(ssusb);
ssusb             431 drivers/usb/mtu3/mtu3_plat.c 		ssusb_host_exit(ssusb);
ssusb             434 drivers/usb/mtu3/mtu3_plat.c 		ssusb_otg_switch_exit(ssusb);
ssusb             435 drivers/usb/mtu3/mtu3_plat.c 		ssusb_gadget_exit(ssusb);
ssusb             436 drivers/usb/mtu3/mtu3_plat.c 		ssusb_host_exit(ssusb);
ssusb             442 drivers/usb/mtu3/mtu3_plat.c 	ssusb_rscs_exit(ssusb);
ssusb             445 drivers/usb/mtu3/mtu3_plat.c 	ssusb_debugfs_remove_root(ssusb);
ssusb             456 drivers/usb/mtu3/mtu3_plat.c 	struct ssusb_mtk *ssusb = dev_get_drvdata(dev);
ssusb             461 drivers/usb/mtu3/mtu3_plat.c 	if (!ssusb->is_host)
ssusb             464 drivers/usb/mtu3/mtu3_plat.c 	ssusb_host_disable(ssusb, true);
ssusb             465 drivers/usb/mtu3/mtu3_plat.c 	ssusb_phy_power_off(ssusb);
ssusb             466 drivers/usb/mtu3/mtu3_plat.c 	ssusb_clks_disable(ssusb);
ssusb             467 drivers/usb/mtu3/mtu3_plat.c 	ssusb_wakeup_set(ssusb, true);
ssusb             474 drivers/usb/mtu3/mtu3_plat.c 	struct ssusb_mtk *ssusb = dev_get_drvdata(dev);
ssusb             479 drivers/usb/mtu3/mtu3_plat.c 	if (!ssusb->is_host)
ssusb             482 drivers/usb/mtu3/mtu3_plat.c 	ssusb_wakeup_set(ssusb, false);
ssusb             483 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_clks_enable(ssusb);
ssusb             487 drivers/usb/mtu3/mtu3_plat.c 	ret = ssusb_phy_power_on(ssusb);
ssusb             491 drivers/usb/mtu3/mtu3_plat.c 	ssusb_host_enable(ssusb);
ssusb             496 drivers/usb/mtu3/mtu3_plat.c 	ssusb_clks_disable(ssusb);