linux/drivers/greybus/svc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * SVC Greybus driver.
 *
 * Copyright 2015 Google Inc.
 * Copyright 2015 Linaro Ltd.
 */

#include <linux/debugfs.h>
#include <linux/kstrtox.h>
#include <linux/workqueue.h>
#include <linux/greybus.h>

#define SVC_INTF_EJECT_TIMEOUT
#define SVC_INTF_ACTIVATE_TIMEOUT
#define SVC_INTF_RESUME_TIMEOUT

struct gb_svc_deferred_request {};

static int gb_svc_queue_deferred_request(struct gb_operation *operation);

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

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

// FIXME
// This is a hack, we need to do this "right" and clean the interface up
// properly, not just forcibly yank the thing out of the system and hope for the
// best.  But for now, people want their modules to come out without having to
// throw the thing to the ground or get out a screwdriver.
static ssize_t intf_eject_store(struct device *dev,
				struct device_attribute *attr, const char *buf,
				size_t len)
{}
static DEVICE_ATTR_WO(intf_eject);

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

static ssize_t watchdog_store(struct device *dev,
			      struct device_attribute *attr, const char *buf,
			      size_t len)
{}
static DEVICE_ATTR_RW(watchdog);

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

static ssize_t watchdog_action_store(struct device *dev,
				     struct device_attribute *attr,
				     const char *buf, size_t len)
{}
static DEVICE_ATTR_RW(watchdog_action);

static int gb_svc_pwrmon_rail_count_get(struct gb_svc *svc, u8 *value)
{}

static int gb_svc_pwrmon_rail_names_get(struct gb_svc *svc,
		struct gb_svc_pwrmon_rail_names_get_response *response,
		size_t bufsize)
{}

static int gb_svc_pwrmon_sample_get(struct gb_svc *svc, u8 rail_id,
				    u8 measurement_type, u32 *value)
{}

int gb_svc_pwrmon_intf_sample_get(struct gb_svc *svc, u8 intf_id,
				  u8 measurement_type, u32 *value)
{}

static struct attribute *svc_attrs[] =;
ATTRIBUTE_GROUPS();

int gb_svc_intf_device_id(struct gb_svc *svc, u8 intf_id, u8 device_id)
{}

int gb_svc_intf_eject(struct gb_svc *svc, u8 intf_id)
{}

int gb_svc_intf_vsys_set(struct gb_svc *svc, u8 intf_id, bool enable)
{}

int gb_svc_intf_refclk_set(struct gb_svc *svc, u8 intf_id, bool enable)
{}

int gb_svc_intf_unipro_set(struct gb_svc *svc, u8 intf_id, bool enable)
{}

int gb_svc_intf_activate(struct gb_svc *svc, u8 intf_id, u8 *intf_type)
{}

int gb_svc_intf_resume(struct gb_svc *svc, u8 intf_id)
{}

int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
			u32 *value)
{}

int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
			u32 value)
{}

int gb_svc_connection_create(struct gb_svc *svc,
			     u8 intf1_id, u16 cport1_id,
			     u8 intf2_id, u16 cport2_id,
			     u8 cport_flags)
{}

void gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
			       u8 intf2_id, u16 cport2_id)
{}

/* Creates bi-directional routes between the devices */
int gb_svc_route_create(struct gb_svc *svc, u8 intf1_id, u8 dev1_id,
			u8 intf2_id, u8 dev2_id)
{}

/* Destroys bi-directional routes between the devices */
void gb_svc_route_destroy(struct gb_svc *svc, u8 intf1_id, u8 intf2_id)
{}

int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series,
			       u8 tx_mode, u8 tx_gear, u8 tx_nlanes,
			       u8 tx_amplitude, u8 tx_hs_equalizer,
			       u8 rx_mode, u8 rx_gear, u8 rx_nlanes,
			       u8 flags, u32 quirks,
			       struct gb_svc_l2_timer_cfg *local,
			       struct gb_svc_l2_timer_cfg *remote)
{}
EXPORT_SYMBOL_GPL();

int gb_svc_intf_set_power_mode_hibernate(struct gb_svc *svc, u8 intf_id)
{}

int gb_svc_ping(struct gb_svc *svc)
{}

static int gb_svc_version_request(struct gb_operation *op)
{}

static ssize_t pwr_debugfs_voltage_read(struct file *file, char __user *buf,
					size_t len, loff_t *offset)
{}

static ssize_t pwr_debugfs_current_read(struct file *file, char __user *buf,
					size_t len, loff_t *offset)
{}

static ssize_t pwr_debugfs_power_read(struct file *file, char __user *buf,
				      size_t len, loff_t *offset)
{}

static const struct file_operations pwrmon_debugfs_voltage_fops =;

static const struct file_operations pwrmon_debugfs_current_fops =;

static const struct file_operations pwrmon_debugfs_power_fops =;

static void gb_svc_pwrmon_debugfs_init(struct gb_svc *svc)
{}

static void gb_svc_debugfs_init(struct gb_svc *svc)
{}

static void gb_svc_debugfs_exit(struct gb_svc *svc)
{}

static int gb_svc_hello(struct gb_operation *op)
{}

static struct gb_interface *gb_svc_interface_lookup(struct gb_svc *svc,
						    u8 intf_id)
{}

static struct gb_module *gb_svc_module_lookup(struct gb_svc *svc, u8 module_id)
{}

static void gb_svc_process_hello_deferred(struct gb_operation *operation)
{}

static void gb_svc_process_module_inserted(struct gb_operation *operation)
{}

static void gb_svc_process_module_removed(struct gb_operation *operation)
{}

static void gb_svc_process_intf_oops(struct gb_operation *operation)
{}

static void gb_svc_process_intf_mailbox_event(struct gb_operation *operation)
{}

static void gb_svc_process_deferred_request(struct work_struct *work)
{}

static int gb_svc_queue_deferred_request(struct gb_operation *operation)
{}

static int gb_svc_intf_reset_recv(struct gb_operation *op)
{}

static int gb_svc_module_inserted_recv(struct gb_operation *op)
{}

static int gb_svc_module_removed_recv(struct gb_operation *op)
{}

static int gb_svc_intf_oops_recv(struct gb_operation *op)
{}

static int gb_svc_intf_mailbox_event_recv(struct gb_operation *op)
{}

static int gb_svc_request_handler(struct gb_operation *op)
{}

static void gb_svc_release(struct device *dev)
{}

const struct device_type greybus_svc_type =;

struct gb_svc *gb_svc_create(struct gb_host_device *hd)
{}

int gb_svc_add(struct gb_svc *svc)
{}

static void gb_svc_remove_modules(struct gb_svc *svc)
{}

void gb_svc_del(struct gb_svc *svc)
{}

void gb_svc_put(struct gb_svc *svc)
{}