linux/drivers/thunderbolt/retimer.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Thunderbolt/USB4 retimer support.
 *
 * Copyright (C) 2020, Intel Corporation
 * Authors: Kranthi Kuntala <[email protected]>
 *	    Mika Westerberg <[email protected]>
 */

#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <linux/sched/signal.h>

#include "sb_regs.h"
#include "tb.h"

#if IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING)
#define TB_MAX_RETIMER_INDEX
#else
#define TB_MAX_RETIMER_INDEX
#endif

/**
 * tb_retimer_nvm_read() - Read contents of retimer NVM
 * @rt: Retimer device
 * @address: NVM address (in bytes) to start reading
 * @buf: Data read from NVM is stored here
 * @size: Number of bytes to read
 *
 * Reads retimer NVM and copies the contents to @buf. Returns %0 if the
 * read was successful and negative errno in case of failure.
 */
int tb_retimer_nvm_read(struct tb_retimer *rt, unsigned int address, void *buf,
			size_t size)
{}

static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes)
{}

static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes)
{}

static int tb_retimer_nvm_add(struct tb_retimer *rt)
{}

static int tb_retimer_nvm_validate_and_write(struct tb_retimer *rt)
{}

static int tb_retimer_nvm_authenticate(struct tb_retimer *rt, bool auth_only)
{}

static ssize_t device_show(struct device *dev, struct device_attribute *attr,
			   char *buf)
{}
static DEVICE_ATTR_RO(device);

static ssize_t nvm_authenticate_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static void tb_retimer_nvm_authenticate_status(struct tb_port *port, u32 *status)
{}

static void tb_retimer_set_inbound_sbtx(struct tb_port *port)
{}

static void tb_retimer_unset_inbound_sbtx(struct tb_port *port)
{}

static ssize_t nvm_authenticate_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(nvm_authenticate);

static ssize_t nvm_version_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(nvm_version);

static ssize_t vendor_show(struct device *dev, struct device_attribute *attr,
			   char *buf)
{}
static DEVICE_ATTR_RO(vendor);

static struct attribute *retimer_attrs[] =;

static const struct attribute_group retimer_group =;

static const struct attribute_group *retimer_groups[] =;

static void tb_retimer_release(struct device *dev)
{}

const struct device_type tb_retimer_type =;

static int tb_retimer_add(struct tb_port *port, u8 index, u32 auth_status,
			  bool on_board)
{}

static void tb_retimer_remove(struct tb_retimer *rt)
{}

struct tb_retimer_lookup {};

static int retimer_match(struct device *dev, void *data)
{}

static struct tb_retimer *tb_port_find_retimer(struct tb_port *port, u8 index)
{}

/**
 * tb_retimer_scan() - Scan for on-board retimers under port
 * @port: USB4 port to scan
 * @add: If true also registers found retimers
 *
 * Brings the sideband into a state where retimers can be accessed.
 * Then Tries to enumerate on-board retimers connected to @port. Found
 * retimers are registered as children of @port if @add is set.  Does
 * not scan for cable retimers for now.
 */
int tb_retimer_scan(struct tb_port *port, bool add)
{}

static int remove_retimer(struct device *dev, void *data)
{}

/**
 * tb_retimer_remove_all() - Remove all retimers under port
 * @port: USB4 port whose retimers to remove
 *
 * This removes all previously added retimers under @port.
 */
void tb_retimer_remove_all(struct tb_port *port)
{}