Usually the controls for IEC958 devices are implemented via
the control interface. There is a macro to compose a name string for
IEC958 controls, SNDRV_CTL_NAME_IEC958()
defined in <include/asound.h>
.
There are some standard controls for IEC958 status bits. These
controls use the type SNDRV_CTL_ELEM_TYPE_IEC958,
and the size of element is fixed as 4 bytes array
(value.iec958.status[x]). For the info
callback, you don't specify
the value field for this type (the count field must be set,
though).
“IEC958 Playback Con Mask” is used to return the
bit-mask for the IEC958 status bits of consumer mode. Similarly,
“IEC958 Playback Pro Mask” returns the bitmask for
professional mode. They are read-only controls, and are defined
as MIXER controls (iface =
SNDRV_CTL_ELEM_IFACE_MIXER
).
Meanwhile, “IEC958 Playback Default” control is
defined for getting and setting the current default IEC958
bits. Note that this one is usually defined as a PCM control
(iface = SNDRV_CTL_ELEM_IFACE_PCM
),
although in some places it's defined as a MIXER control.
In addition, you can define the control switches to
enable/disable or to set the raw bit mode. The implementation
will depend on the chip, but the control should be named as
“IEC958 xxx”, preferably using
the SNDRV_CTL_NAME_IEC958()
macro.
You can find several cases, for example,
pci/emu10k1
,
pci/ice1712
, or
pci/cmipci.c
.