linux/drivers/thunderbolt/tmu.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Thunderbolt Time Management Unit (TMU) support
 *
 * Copyright (C) 2019, Intel Corporation
 * Authors: Mika Westerberg <[email protected]>
 *	    Rajmohan Mani <[email protected]>
 */

#include <linux/delay.h>

#include "tb.h"

static const unsigned int tmu_rates[] =;

static const struct {} tmu_params[] =;

static const char *tmu_mode_name(enum tb_switch_tmu_mode mode)
{}

static bool tb_switch_tmu_enhanced_is_supported(const struct tb_switch *sw)
{}

static int tb_switch_set_tmu_mode_params(struct tb_switch *sw,
					 enum tb_switch_tmu_mode mode)
{}

static bool tb_switch_tmu_ucap_is_supported(struct tb_switch *sw)
{}

static int tb_switch_tmu_rate_read(struct tb_switch *sw)
{}

static int tb_switch_tmu_rate_write(struct tb_switch *sw, int rate)
{}

static int tb_port_tmu_write(struct tb_port *port, u8 offset, u32 mask,
			     u32 value)
{}

static int tb_port_tmu_set_unidirectional(struct tb_port *port,
					  bool unidirectional)
{}

static inline int tb_port_tmu_unidirectional_disable(struct tb_port *port)
{}

static inline int tb_port_tmu_unidirectional_enable(struct tb_port *port)
{}

static bool tb_port_tmu_is_unidirectional(struct tb_port *port)
{}

static bool tb_port_tmu_is_enhanced(struct tb_port *port)
{}

/* Can be called to non-v2 lane adapters too */
static int tb_port_tmu_enhanced_enable(struct tb_port *port, bool enable)
{}

static int tb_port_set_tmu_mode_params(struct tb_port *port,
				       enum tb_switch_tmu_mode mode)
{}

/* Can be called to non-v2 lane adapters too */
static int tb_port_tmu_rate_write(struct tb_port *port, int rate)
{}

static int tb_port_tmu_time_sync(struct tb_port *port, bool time_sync)
{}

static int tb_port_tmu_time_sync_disable(struct tb_port *port)
{}

static int tb_port_tmu_time_sync_enable(struct tb_port *port)
{}

static int tb_switch_tmu_set_time_disruption(struct tb_switch *sw, bool set)
{}

static int tmu_mode_init(struct tb_switch *sw)
{}

/**
 * tb_switch_tmu_init() - Initialize switch TMU structures
 * @sw: Switch to initialized
 *
 * This function must be called before other TMU related functions to
 * makes the internal structures are filled in correctly. Does not
 * change any hardware configuration.
 */
int tb_switch_tmu_init(struct tb_switch *sw)
{}

/**
 * tb_switch_tmu_post_time() - Update switch local time
 * @sw: Switch whose time to update
 *
 * Updates switch local time using time posting procedure.
 */
int tb_switch_tmu_post_time(struct tb_switch *sw)
{}

static int disable_enhanced(struct tb_port *up, struct tb_port *down)
{}

/**
 * tb_switch_tmu_disable() - Disable TMU of a switch
 * @sw: Switch whose TMU to disable
 *
 * Turns off TMU of @sw if it is enabled. If not enabled does nothing.
 */
int tb_switch_tmu_disable(struct tb_switch *sw)
{}

/* Called only when there is failure enabling requested mode */
static void tb_switch_tmu_off(struct tb_switch *sw)
{}

/*
 * This function is called when the previous TMU mode was
 * TB_SWITCH_TMU_MODE_OFF.
 */
static int tb_switch_tmu_enable_bidirectional(struct tb_switch *sw)
{}

/* Only needed for Titan Ridge */
static int tb_switch_tmu_disable_objections(struct tb_switch *sw)
{}

/*
 * This function is called when the previous TMU mode was
 * TB_SWITCH_TMU_MODE_OFF.
 */
static int tb_switch_tmu_enable_unidirectional(struct tb_switch *sw)
{}

/*
 * This function is called when the previous TMU mode was
 * TB_SWITCH_TMU_RATE_OFF.
 */
static int tb_switch_tmu_enable_enhanced(struct tb_switch *sw)
{}

static void tb_switch_tmu_change_mode_prev(struct tb_switch *sw)
{}

static int tb_switch_tmu_change_mode(struct tb_switch *sw)
{}

/**
 * tb_switch_tmu_enable() - Enable TMU on a router
 * @sw: Router whose TMU to enable
 *
 * Enables TMU of a router to be in uni-directional Normal/HiFi or
 * bi-directional HiFi mode. Calling tb_switch_tmu_configure() is
 * required before calling this function.
 */
int tb_switch_tmu_enable(struct tb_switch *sw)
{}

/**
 * tb_switch_tmu_configure() - Configure the TMU mode
 * @sw: Router whose mode to change
 * @mode: Mode to configure
 *
 * Selects the TMU mode that is enabled when tb_switch_tmu_enable() is
 * next called.
 *
 * Returns %0 in success and negative errno otherwise. Specifically
 * returns %-EOPNOTSUPP if the requested mode is not possible (not
 * supported by the router and/or topology).
 */
int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_mode mode)
{}