mtu3_dr.c (03d8bfc13089e657faf2ea73884ec3c726d8a6f9) mtu3_dr.c (ae07809255d3e3419205b673aba6d1dce16a0d65)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * mtu3_dr.c - dual role switch and host glue layer
4 *
5 * Copyright (C) 2016 MediaTek Inc.
6 *
7 * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8 */

--- 365 unchanged lines hidden (view full) ---

374 .write = ssusb_vbus_write,
375 .read = seq_read,
376 .llseek = seq_lseek,
377 .release = single_release,
378};
379
380static void ssusb_debugfs_init(struct ssusb_mtk *ssusb)
381{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * mtu3_dr.c - dual role switch and host glue layer
4 *
5 * Copyright (C) 2016 MediaTek Inc.
6 *
7 * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8 */

--- 365 unchanged lines hidden (view full) ---

374 .write = ssusb_vbus_write,
375 .read = seq_read,
376 .llseek = seq_lseek,
377 .release = single_release,
378};
379
380static void ssusb_debugfs_init(struct ssusb_mtk *ssusb)
381{
382 struct dentry *root;
382 struct dentry *root = ssusb->dbgfs_root;
383
383
384 root = debugfs_create_dir(dev_name(ssusb->dev), usb_debug_root);
385 ssusb->dbgfs_root = root;
386
387 debugfs_create_file("mode", 0644, root, ssusb, &ssusb_mode_fops);
388 debugfs_create_file("vbus", 0644, root, ssusb, &ssusb_vbus_fops);
389}
390
384 debugfs_create_file("mode", 0644, root, ssusb, &ssusb_mode_fops);
385 debugfs_create_file("vbus", 0644, root, ssusb, &ssusb_vbus_fops);
386}
387
391static void ssusb_debugfs_exit(struct ssusb_mtk *ssusb)
392{
393 debugfs_remove_recursive(ssusb->dbgfs_root);
394}
395
396void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
397 enum mtu3_dr_force_mode mode)
398{
399 u32 value;
400
401 value = mtu3_readl(ssusb->ippc_base, SSUSB_U2_CTRL(0));
402 switch (mode) {
403 case MTU3_DR_FORCE_DEVICE:

--- 27 unchanged lines hidden (view full) ---

431
432 return ret;
433}
434
435void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
436{
437 struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
438
388void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
389 enum mtu3_dr_force_mode mode)
390{
391 u32 value;
392
393 value = mtu3_readl(ssusb->ippc_base, SSUSB_U2_CTRL(0));
394 switch (mode) {
395 case MTU3_DR_FORCE_DEVICE:

--- 27 unchanged lines hidden (view full) ---

423
424 return ret;
425}
426
427void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
428{
429 struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
430
439 if (otg_sx->manual_drd_enabled)
440 ssusb_debugfs_exit(ssusb);
441
442 cancel_work_sync(&otg_sx->id_work);
443 cancel_work_sync(&otg_sx->vbus_work);
444}
431 cancel_work_sync(&otg_sx->id_work);
432 cancel_work_sync(&otg_sx->vbus_work);
433}