History log of /openbsd-current/sys/dev/fdt/simpleaudio.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.7 28-Oct-2022 kn

Replace audio(9) get_props() with duplex check in open() in non-duplex drivers

Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO
in their open() if full-duplex mode was requested.

This way, sys/dev/audio.c:audio_open() will fail immediately rather than
later through the to-be-removed get_props() check.

These are all drivers which simply don't support full-duplex mode.

In device-tree based drivers like simpleaudio(4)/rkiis(4) and newer Apple
ones like aplaudio(4)/aplmca(4), this adds a new open() stub to the
low-level drivers which merely does the duplex check.

My Pinebook Pro keeps playing audio and recording silence with this diff
just like before (rkiis(4) is currently play-only):
simpleaudio0 at mainbus0
simpleaudio1 at mainbus0
audio0 at simpleaudio1

$ aucat -i song69.wav -o rec.wav

OK ratchov miod


Revision tags: OPENBSD_7_2_BASE
# 1.6 01-Aug-2022 kettenis

KNF


# 1.5 06-Apr-2022 naddy

constify struct cfattach


Revision tags: OPENBSD_7_1_BASE
# 1.4 21-Mar-2022 miod

Constify struct {audio,midi,radio,video}_hw_if. No functional change.

ok mpi@ ratchov@ "More const is good" deraadt@


# 1.3 16-Feb-2022 anton

Make room for a cookie argument passed to audio_attach_mi(). Currently
unused but intended to be used to correlate audio and wskbd devices.

ok ratchov@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.2 05-Apr-2021 kn

Set sysclk before using it

simpleaudio_set_params() calls set_params() which reads sysclk off the
"i2s_clk" property before it sets that very clock's rate with
dd_set_sysclk() (in case there's multiplier specified).

Hence reverse the order so set_params() can pick up the newly set rate.

The rate is still off on the Pinebook Pro, but I came across this when
reading the code; this also matches NetBSD's sys/dev/fdt/ausoc.c r1.6
"Set sysclk rate at set_format time, so the link set_format callback can
read the new sysclk".

OK kettenis patrick


Revision tags: OPENBSD_6_8_BASE
# 1.1 10-Jun-2020 patrick

Add simpleaudio(4), a driver for "simple audio cards". This is
just a wrapper that connects the I2S controller, the codec and
some aux devices, and provides the information needed to set all
those devices up to use the same settings.

With help from ratchov@
ok kettenis@


# 1.6 01-Aug-2022 kettenis

KNF


# 1.5 06-Apr-2022 naddy

constify struct cfattach


Revision tags: OPENBSD_7_1_BASE
# 1.4 21-Mar-2022 miod

Constify struct {audio,midi,radio,video}_hw_if. No functional change.

ok mpi@ ratchov@ "More const is good" deraadt@


# 1.3 16-Feb-2022 anton

Make room for a cookie argument passed to audio_attach_mi(). Currently
unused but intended to be used to correlate audio and wskbd devices.

ok ratchov@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.2 05-Apr-2021 kn

Set sysclk before using it

simpleaudio_set_params() calls set_params() which reads sysclk off the
"i2s_clk" property before it sets that very clock's rate with
dd_set_sysclk() (in case there's multiplier specified).

Hence reverse the order so set_params() can pick up the newly set rate.

The rate is still off on the Pinebook Pro, but I came across this when
reading the code; this also matches NetBSD's sys/dev/fdt/ausoc.c r1.6
"Set sysclk rate at set_format time, so the link set_format callback can
read the new sysclk".

OK kettenis patrick


Revision tags: OPENBSD_6_8_BASE
# 1.1 10-Jun-2020 patrick

Add simpleaudio(4), a driver for "simple audio cards". This is
just a wrapper that connects the I2S controller, the codec and
some aux devices, and provides the information needed to set all
those devices up to use the same settings.

With help from ratchov@
ok kettenis@


# 1.5 06-Apr-2022 naddy

constify struct cfattach


Revision tags: OPENBSD_7_1_BASE
# 1.4 21-Mar-2022 miod

Constify struct {audio,midi,radio,video}_hw_if. No functional change.

ok mpi@ ratchov@ "More const is good" deraadt@


# 1.3 16-Feb-2022 anton

Make room for a cookie argument passed to audio_attach_mi(). Currently
unused but intended to be used to correlate audio and wskbd devices.

ok ratchov@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.2 05-Apr-2021 kn

Set sysclk before using it

simpleaudio_set_params() calls set_params() which reads sysclk off the
"i2s_clk" property before it sets that very clock's rate with
dd_set_sysclk() (in case there's multiplier specified).

Hence reverse the order so set_params() can pick up the newly set rate.

The rate is still off on the Pinebook Pro, but I came across this when
reading the code; this also matches NetBSD's sys/dev/fdt/ausoc.c r1.6
"Set sysclk rate at set_format time, so the link set_format callback can
read the new sysclk".

OK kettenis patrick


Revision tags: OPENBSD_6_8_BASE
# 1.1 10-Jun-2020 patrick

Add simpleaudio(4), a driver for "simple audio cards". This is
just a wrapper that connects the I2S controller, the codec and
some aux devices, and provides the information needed to set all
those devices up to use the same settings.

With help from ratchov@
ok kettenis@