coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
soundwire.c File Reference
#include <acpi/acpigen.h>
#include <acpi/acpi_device.h>
#include <acpi/acpi_soundwire.h>
#include <commonlib/helpers.h>
#include <device/soundwire.h>
#include <stddef.h>
Include dependency graph for soundwire.c:

Go to the source code of this file.

Data Structures

struct  soundwire_name_map
 struct soundwire_name_map - Map ACPI name to SoundWire property name. More...
 

Macros

#define SDW_PFX   "mipi-sdw-"
 
#define SDW_INT(__key, __val)    acpi_dp_add_integer(dsd, SDW_PFX __key, __val)
 
#define SDW_INT_ARRAY(__key, __val)    acpi_dp_add_integer_array(dsd, SDW_PFX __key, __val, __val##_count)
 

Functions

static void soundwire_gen_interface_revision (struct acpi_dp *dsd)
 
static void soundwire_gen_slave (struct acpi_dp *dsd, const struct soundwire_slave *prop)
 
static void soundwire_gen_multilane (struct acpi_dp *dsd, const struct soundwire_multilane *prop)
 
static void soundwire_gen_link (struct acpi_dp *dsd, const struct soundwire_link *prop)
 
static void soundwire_gen_bra_mode (struct acpi_dp *dsd, const struct soundwire_bra_mode *prop)
 
static void soundwire_gen_audio_mode (struct acpi_dp *dsd, const struct soundwire_audio_mode *prop)
 
static void soundwire_gen_dp0 (struct acpi_dp *dsd, const struct soundwire_dp0 *prop)
 
static void soundwire_gen_dpn (struct acpi_dp *dsd, const struct soundwire_dpn *prop)
 
void soundwire_gen_controller (struct acpi_dp *dsd, const struct soundwire_controller *prop, soundwire_link_prop_cb link_prop_cb)
 soundwire_gen_controller() - Generate SoundWire properties for master links. More...
 
void soundwire_gen_codec (struct acpi_dp *dsd, const struct soundwire_codec *codec, soundwire_dp_prop_cb dp_prop_cb)
 soundwire_gen_codec() - Generate SoundWire properties for codec device. More...
 

Variables

static const struct soundwire_name_map bra_mode_names []
 
static const struct soundwire_name_map audio_mode_names []
 
static const struct soundwire_name_map dpn_source_names []
 
static const struct soundwire_name_map dpn_sink_names []
 
static const struct soundwire_name_map link_names []
 
static const char *const multilane_names []
 
static const char *const multilane_master_lane_names []
 
static const char *const multilane_slave_link_names []
 
static const char *const multilane_bus_holder_names []
 

Macro Definition Documentation

◆ SDW_INT

#define SDW_INT (   __key,
  __val 
)     acpi_dp_add_integer(dsd, SDW_PFX __key, __val)

Definition at line 14 of file soundwire.c.

◆ SDW_INT_ARRAY

#define SDW_INT_ARRAY (   __key,
  __val 
)     acpi_dp_add_integer_array(dsd, SDW_PFX __key, __val, __val##_count)

Definition at line 18 of file soundwire.c.

◆ SDW_PFX

#define SDW_PFX   "mipi-sdw-"

Definition at line 11 of file soundwire.c.

Function Documentation

◆ soundwire_gen_audio_mode()

◆ soundwire_gen_bra_mode()

◆ soundwire_gen_codec()

void soundwire_gen_codec ( struct acpi_dp dsd,
const struct soundwire_codec codec,
soundwire_dp_prop_cb  dp_prop_cb 
)

◆ soundwire_gen_controller()

void soundwire_gen_controller ( struct acpi_dp dsd,
const struct soundwire_controller prop,
soundwire_link_prop_cb  link_prop_cb 
)

soundwire_gen_controller() - Generate SoundWire properties for master links.

@dsd: ACPI Device Property handle for controller. @prop: Properties for controller which includes all other properties. @link_prop_cb: Callback to allow custom link properties.

Definition at line 318 of file soundwire.c.

References acpi_dp_add_child(), acpi_dp_new_table(), link_names, soundwire_controller::master_list, soundwire_controller::master_list_count, SDW_INT, soundwire_gen_interface_revision(), soundwire_gen_link(), and SOUNDWIRE_MAX_LINK.

Referenced by intel_soundwire_fill_ssdt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ soundwire_gen_dp0()

◆ soundwire_gen_dpn()

◆ soundwire_gen_interface_revision()

static void soundwire_gen_interface_revision ( struct acpi_dp dsd)
static

Definition at line 134 of file soundwire.c.

References acpi_dp_add_integer(), SDW_PFX, and SOUNDWIRE_SW_VERSION_1_0.

Referenced by soundwire_gen_controller(), soundwire_gen_multilane(), and soundwire_gen_slave().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ soundwire_gen_link()

◆ soundwire_gen_multilane()

◆ soundwire_gen_slave()

Variable Documentation

◆ audio_mode_names

const struct soundwire_name_map audio_mode_names[]
static
Initial value:
= {
{ "MOD0", SDW_PFX "port-audio-mode-0" },
{ "MOD1", SDW_PFX "port-audio-mode-1" },
{ "MOD2", SDW_PFX "port-audio-mode-2" },
{ "MOD3", SDW_PFX "port-audio-mode-3" },
}
#define SDW_PFX
Definition: soundwire.c:11

Definition at line 1 of file soundwire.c.

Referenced by soundwire_gen_codec(), and soundwire_gen_dpn().

◆ bra_mode_names

const struct soundwire_name_map bra_mode_names[]
static
Initial value:
= {
{ "BRA0", SDW_PFX "port-bra-mode-0" },
{ "BRA1", SDW_PFX "port-bra-mode-1" },
{ "BRA2", SDW_PFX "port-bra-mode-2" },
{ "BRA3", SDW_PFX "port-bra-mode-3" },
}

Definition at line 1 of file soundwire.c.

Referenced by soundwire_gen_codec(), and soundwire_gen_dp0().

◆ dpn_sink_names

const struct soundwire_name_map dpn_sink_names[]
static
Initial value:
= {
{ "DP0", SDW_PFX "dp-0-subproperties" },
{ "SNK1", SDW_PFX "dp-1-sink-subproperties" },
{ "SNK2", SDW_PFX "dp-2-sink-subproperties" },
{ "SNK3", SDW_PFX "dp-3-sink-subproperties" },
{ "SNK4", SDW_PFX "dp-4-sink-subproperties" },
{ "SNK5", SDW_PFX "dp-5-sink-subproperties" },
{ "SNK6", SDW_PFX "dp-6-sink-subproperties" },
{ "SNK7", SDW_PFX "dp-7-sink-subproperties" },
{ "SNK8", SDW_PFX "dp-8-sink-subproperties" },
{ "SNK9", SDW_PFX "dp-9-sink-subproperties" },
{ "SNKA", SDW_PFX "dp-10-sink-subproperties" },
{ "SNKB", SDW_PFX "dp-11-sink-subproperties" },
{ "SNKC", SDW_PFX "dp-12-sink-subproperties" },
{ "SNKD", SDW_PFX "dp-13-sink-subproperties" }
}

Definition at line 1 of file soundwire.c.

Referenced by soundwire_gen_codec().

◆ dpn_source_names

const struct soundwire_name_map dpn_source_names[]
static
Initial value:
= {
{ "DP0", SDW_PFX "dp-0-subproperties" },
{ "SRC1", SDW_PFX "dp-1-source-subproperties" },
{ "SRC2", SDW_PFX "dp-2-source-subproperties" },
{ "SRC3", SDW_PFX "dp-3-source-subproperties" },
{ "SRC4", SDW_PFX "dp-4-source-subproperties" },
{ "SRC5", SDW_PFX "dp-5-source-subproperties" },
{ "SRC6", SDW_PFX "dp-6-source-subproperties" },
{ "SRC7", SDW_PFX "dp-7-source-subproperties" },
{ "SRC8", SDW_PFX "dp-8-source-subproperties" },
{ "SRC9", SDW_PFX "dp-9-source-subproperties" },
{ "SRCA", SDW_PFX "dp-10-source-subproperties" },
{ "SRCB", SDW_PFX "dp-11-source-subproperties" },
{ "SRCC", SDW_PFX "dp-12-source-subproperties" },
{ "SRCD", SDW_PFX "dp-13-source-subproperties" }
}

Definition at line 1 of file soundwire.c.

Referenced by soundwire_gen_codec().

◆ link_names

const struct soundwire_name_map link_names[]
static
Initial value:
= {
{ "LNK0", SDW_PFX "link-0-subproperties" },
{ "LNK1", SDW_PFX "link-1-subproperties" },
{ "LNK2", SDW_PFX "link-2-subproperties" },
{ "LNK3", SDW_PFX "link-3-subproperties" },
{ "LNK4", SDW_PFX "link-4-subproperties" },
{ "LNK5", SDW_PFX "link-5-subproperties" },
{ "LNK6", SDW_PFX "link-6-subproperties" },
{ "LNK7", SDW_PFX "link-7-subproperties" }
}

Definition at line 1 of file soundwire.c.

Referenced by soundwire_gen_controller().

◆ multilane_bus_holder_names

const char* const multilane_bus_holder_names[]
static
Initial value:
= {
SDW_PFX "lane-1-bus-holder",
SDW_PFX "lane-2-bus-holder",
SDW_PFX "lane-3-bus-holder",
SDW_PFX "lane-4-bus-holder",
SDW_PFX "lane-5-bus-holder",
SDW_PFX "lane-6-bus-holder",
SDW_PFX "lane-7-bus-holder",
SDW_PFX "lane-8-bus-holder"
}

Definition at line 123 of file soundwire.c.

Referenced by soundwire_gen_multilane().

◆ multilane_master_lane_names

const char* const multilane_master_lane_names[]
static
Initial value:
= {
SDW_PFX "master-lane-1",
SDW_PFX "master-lane-2",
SDW_PFX "master-lane-3",
SDW_PFX "master-lane-4",
SDW_PFX "master-lane-5",
SDW_PFX "master-lane-6",
SDW_PFX "master-lane-7",
SDW_PFX "master-lane-8"
}

Definition at line 101 of file soundwire.c.

Referenced by soundwire_gen_multilane().

◆ multilane_names

const char* const multilane_names[]
static
Initial value:
= {
SDW_PFX "lane-1-mapping",
SDW_PFX "lane-2-mapping",
SDW_PFX "lane-3-mapping",
SDW_PFX "lane-4-mapping",
SDW_PFX "lane-5-mapping",
SDW_PFX "lane-6-mapping",
SDW_PFX "lane-7-mapping",
SDW_PFX "lane-8-mapping"
}

Definition at line 90 of file soundwire.c.

Referenced by soundwire_gen_multilane().

◆ multilane_slave_link_names

const char* const multilane_slave_link_names[]
static
Initial value:
= {
SDW_PFX "slave-link-A",
SDW_PFX "slave-link-B",
SDW_PFX "slave-link-C",
SDW_PFX "slave-link-D",
SDW_PFX "slave-link-E",
SDW_PFX "slave-link-F",
SDW_PFX "slave-link-G",
SDW_PFX "slave-link-I"
}

Definition at line 112 of file soundwire.c.

Referenced by soundwire_gen_multilane().