Merge pull request #5837 from knaerzche/rk-alsa-conf-rework

Rockchip: rework alsa configs
This commit is contained in:
Christian Hewitt 2021-11-09 15:52:38 +04:00 committed by GitHub
commit 10578c0b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 60 deletions

View File

@ -1,34 +0,0 @@
#
# Configuration for HDMI
#
<confdir:pcm/hdmi.conf>
HDMI.pcm.hdmi.0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@args.AES1 { type integer }
@args.AES2 { type integer }
@args.AES3 { type integer }
type hooks
slave.pcm {
type hw
card $CARD
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
interface MIXER
name "IEC958 Playback Default"
lock true
preserve true
optional true
value [ $AES0 $AES1 $AES2 $AES3 ]
}
]
}
hint.device 0
}

View File

@ -1,12 +0,0 @@
#
# Configuration for I2S
#
<confdir:pcm/front.conf>
I2S.pcm.front.0 {
@args [ CARD ]
@args.CARD { type string }
type hw
card $CARD
}

View File

@ -21,7 +21,7 @@ SPDIF.pcm.iec958.0 {
type ctl_elems
hook_args [
{
interface MIXER
interface PCM
name "IEC958 Playback Default"
lock true
preserve true

View File

@ -4,6 +4,9 @@
<confdir:pcm/hdmi.conf>
simple-card.pcm.hdmi."hdmi-sound" "cards.simple-card.pcm.hdmi.HDMI"
simple-card.pcm.hdmi."rockchip_tinker-codec" "cards.simple-card.pcm.hdmi.HDMI"
simple-card.pcm.hdmi."HDMI" {
@args [ CARD DEVICE AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@ -22,7 +25,7 @@ simple-card.pcm.hdmi."HDMI" {
type ctl_elems
hook_args [
{
interface MIXER
interface PCM
name "IEC958 Playback Default"
lock true
preserve true
@ -41,7 +44,6 @@ simple-card.pcm.hdmi.0 {
@args.AES1 { type integer }
@args.AES2 { type integer }
@args.AES3 { type integer }
@func refer
name {
@func concat
@ -62,7 +64,6 @@ simple-card.pcm.hdmi.0 {
device 999
hint.device 999
}
}
#
@ -89,7 +90,7 @@ simple-card.pcm.iec958."SPDIF" {
type ctl_elems
hook_args [
{
interface MIXER
interface PCM
name "IEC958 Playback Default"
lock true
preserve true
@ -165,6 +166,8 @@ simple-card.pcm.iec958.1 {
<confdir:pcm/front.conf>
simple-card.pcm.front."I2S" "cards.simple-card.pcm.front.Analog"
simple-card.pcm.front."Analog" {
@args [ CARD DEVICE ]
@args.CARD { type string }
@ -174,15 +177,6 @@ simple-card.pcm.front."Analog" {
hint.device $DEVICE
}
simple-card.pcm.front."I2S" {
@args [ CARD ]
@args.CARD { type string }
@args.DEVICE { type integer }
type hw
card $CARD
hint.device $DEVICE
}
simple-card.pcm.front.0 {
@args [ CARD ]
@args.CARD { type string }

View File

@ -647,3 +647,44 @@ index 3d98e2251ea5..b201700ccc8a 100644
.num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alex Bee <knaerzche@gmail.com>
Date: Sat, 30 Oct 2021 12:19:19 +0200
Subject: [PATCH] WIP: drm: bridge: dw-hdmi: switch from .hw_parmas to .prepare
for i2s
Seems to be the only way to get AES bits correctly as set by
userspace.
TODO: check other consequences.
Signed-off-by: Alex Bee <knaerzche@gmail.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
index feb04f127b55..f7631f2e34c5 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
@@ -34,9 +34,9 @@ static inline u8 hdmi_read(struct dw_hdmi_i2s_audio_data *audio, int offset)
return audio->read(hdmi, offset);
}
-static int dw_hdmi_i2s_hw_params(struct device *dev, void *data,
- struct hdmi_codec_daifmt *fmt,
- struct hdmi_codec_params *hparms)
+static int dw_hdmi_i2s_prepare(struct device *dev, void *data,
+ struct hdmi_codec_daifmt *fmt,
+ struct hdmi_codec_params *hparms)
{
struct dw_hdmi_i2s_audio_data *audio = data;
struct dw_hdmi *hdmi = audio->hdmi;
@@ -171,7 +171,7 @@ static int dw_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
}
static const struct hdmi_codec_ops dw_hdmi_i2s_ops = {
- .hw_params = dw_hdmi_i2s_hw_params,
+ .prepare = dw_hdmi_i2s_prepare,
.audio_startup = dw_hdmi_i2s_audio_startup,
.audio_shutdown = dw_hdmi_i2s_audio_shutdown,
.get_eld = dw_hdmi_i2s_get_eld,