linux/drivers/soundwire/sysfs_slave.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright(c) 2015-2020 Intel Corporation.

#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include "bus.h"
#include "sysfs_local.h"

/*
 * Slave sysfs
 */

/*
 * The sysfs for Slave reflects the MIPI description as given
 * in the MIPI DisCo spec.
 * status and device_number come directly from the MIPI SoundWire
 * 1.x specification.
 *
 * Base file is device
 *	|---- status
 *	|---- device_number
 *	|---- modalias
 *	|---- dev-properties
 *		|---- mipi_revision
 *		|---- wake_capable
 *		|---- test_mode_capable
 *		|---- clk_stop_mode1
 *		|---- simple_clk_stop_capable
 *		|---- clk_stop_timeout
 *		|---- ch_prep_timeout
 *		|---- reset_behave
 *		|---- high_PHY_capable
 *		|---- paging_support
 *		|---- bank_delay_support
 *		|---- p15_behave
 *		|---- master_count
 *		|---- source_ports
 *		|---- sink_ports
 *	|---- dp0
 *		|---- max_word
 *		|---- min_word
 *		|---- words
 *		|---- BRA_flow_controlled
 *		|---- simple_ch_prep_sm
 *		|---- imp_def_interrupts
 *	|---- dpN_<sink/src>
 *		|---- max_word
 *		|---- min_word
 *		|---- words
 *		|---- type
 *		|---- max_grouping
 *		|---- simple_ch_prep_sm
 *		|---- ch_prep_timeout
 *		|---- imp_def_interrupts
 *		|---- min_ch
 *		|---- max_ch
 *		|---- channels
 *		|---- ch_combinations
 *		|---- max_async_buffer
 *		|---- block_pack_mode
 *		|---- port_encoding
 *
 */

#define sdw_slave_attr(field, format_string)

sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();
sdw_slave_attr();

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

static struct attribute *slave_attrs[] =;

static const struct attribute_group slave_attr_group =;

static struct attribute *slave_dev_attrs[] =;

static const struct attribute_group sdw_slave_dev_attr_group =;

/*
 * DP0 sysfs
 */

#define sdw_dp0_attr(field, format_string)

sdw_dp0_attr();
sdw_dp0_attr();
sdw_dp0_attr();
sdw_dp0_attr();
sdw_dp0_attr();

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

static struct attribute *dp0_attrs[] =;

static umode_t dp0_attr_visible(struct kobject *kobj, struct attribute *attr,
			      int n)
{}

static bool dp0_group_visible(struct kobject *kobj)
{}
DEFINE_SYSFS_GROUP_VISIBLE(dp0);

static const struct attribute_group dp0_group =;

const struct attribute_group *sdw_attr_groups[] =;

/*
 * the status is shown in capital letters for UNATTACHED and RESERVED
 * on purpose, to highligh users to the fact that these status values
 * are not expected.
 */
static const char *const slave_status[] =;

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

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

static struct attribute *slave_status_attrs[] =;

/*
 * we don't use ATTRIBUTES_GROUP here since the group is used in a
 * separate file and can't be handled as a static.
 */
static const struct attribute_group sdw_slave_status_attr_group =;

const struct attribute_group *sdw_slave_status_attr_groups[] =;