switch.c (a3cfebdc1b3ab379646f61f095102f7d2b8f6f31) switch.c (54e418106c765c5f3c378c770b0f8518632830da)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt driver - switch/port utility functions
4 *
5 * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
6 * Copyright (C) 2018, Intel Corporation
7 */
8

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

2512 if (sw->rpm) {
2513 pm_runtime_set_autosuspend_delay(&sw->dev, TB_AUTOSUSPEND_DELAY);
2514 pm_runtime_use_autosuspend(&sw->dev);
2515 pm_runtime_mark_last_busy(&sw->dev);
2516 pm_runtime_enable(&sw->dev);
2517 pm_request_autosuspend(&sw->dev);
2518 }
2519
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt driver - switch/port utility functions
4 *
5 * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
6 * Copyright (C) 2018, Intel Corporation
7 */
8

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

2512 if (sw->rpm) {
2513 pm_runtime_set_autosuspend_delay(&sw->dev, TB_AUTOSUSPEND_DELAY);
2514 pm_runtime_use_autosuspend(&sw->dev);
2515 pm_runtime_mark_last_busy(&sw->dev);
2516 pm_runtime_enable(&sw->dev);
2517 pm_request_autosuspend(&sw->dev);
2518 }
2519
2520 tb_switch_debugfs_init(sw);
2520 return 0;
2521}
2522
2523/**
2524 * tb_switch_remove() - Remove and release a switch
2525 * @sw: Switch to remove
2526 *
2527 * This will remove the switch from the domain and release it after last
2528 * reference count drops to zero. If there are switches connected below
2529 * this switch, they will be removed as well.
2530 */
2531void tb_switch_remove(struct tb_switch *sw)
2532{
2533 struct tb_port *port;
2534
2521 return 0;
2522}
2523
2524/**
2525 * tb_switch_remove() - Remove and release a switch
2526 * @sw: Switch to remove
2527 *
2528 * This will remove the switch from the domain and release it after last
2529 * reference count drops to zero. If there are switches connected below
2530 * this switch, they will be removed as well.
2531 */
2532void tb_switch_remove(struct tb_switch *sw)
2533{
2534 struct tb_port *port;
2535
2536 tb_switch_debugfs_remove(sw);
2537
2535 if (sw->rpm) {
2536 pm_runtime_get_sync(&sw->dev);
2537 pm_runtime_disable(&sw->dev);
2538 }
2539
2540 /* port 0 is the switch itself and never has a remote */
2541 tb_switch_for_each_port(sw, port) {
2542 if (tb_port_has_remote(port)) {

--- 361 unchanged lines hidden ---
2538 if (sw->rpm) {
2539 pm_runtime_get_sync(&sw->dev);
2540 pm_runtime_disable(&sw->dev);
2541 }
2542
2543 /* port 0 is the switch itself and never has a remote */
2544 tb_switch_for_each_port(sw, port) {
2545 if (tb_port_has_remote(port)) {

--- 361 unchanged lines hidden ---