drivers/soundwire: Support Realtek ALC712 codec
Update SoundWire driver to support ALC712 audio codec. reference datasheet: Realtek ALC712-VB-CG Rev. 0.24 BUG=b:378629979 TEST=emerge-fatcat coreboot A sound can be heard from the speaker, the test instructions are as follows: amixer -c 0 cset name='rt712 OT23 L Switch' on amixer -c 0 cset name=''rt712 OT23 R Switch' on amixer -c 0 cset name='rt1320-1 OT23 L Switch' on amixer -c 0 cset name='rt1320-1 OT23 R Switch' on amixer -c 0 cset name='Speaker Switch' on speaker-test -D hw:0,2 -c 2 -t sine -f 440 Change-Id: Ib79896a9fe23f2f66d6ee3a24f5a62bfa0f7a649 Signed-off-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85571 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Mac Chiang <mac.chiang@intel.com>
This commit is contained in:
parent
3e0f35b23a
commit
68da65b2a5
3 changed files with 23 additions and 1 deletions
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
#include "chip.h"
|
||||
|
||||
static struct soundwire_multilane alc711_multilane = {
|
||||
};
|
||||
|
||||
static struct soundwire_slave alc711_slave = {
|
||||
.wake_up_unavailable = false,
|
||||
.test_mode_supported = false,
|
||||
|
|
@ -87,7 +90,8 @@ static const struct soundwire_codec alc711_codec = {
|
|||
.port = 2,
|
||||
.source = &alc711_dp
|
||||
}
|
||||
}
|
||||
},
|
||||
.multilane = &alc711_multilane
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -96,6 +100,7 @@ static void soundwire_alc711_fill_ssdt(const struct device *dev)
|
|||
struct drivers_soundwire_alc711_config *config = dev->chip_info;
|
||||
const char *scope = acpi_device_scope(dev);
|
||||
struct acpi_dp *dsd;
|
||||
size_t lane_mapping_count, audio_mode_count;
|
||||
|
||||
if (!scope)
|
||||
return;
|
||||
|
|
@ -112,6 +117,20 @@ static void soundwire_alc711_fill_ssdt(const struct device *dev)
|
|||
acpigen_write_name_string("_DDN", config->desc ? : dev->chip_ops->name);
|
||||
acpigen_write_STA(acpi_device_status(dev));
|
||||
|
||||
/* Overlay multilane config, if provided. */
|
||||
lane_mapping_count = MIN(ARRAY_SIZE(config->multilane.lane_mapping), SOUNDWIRE_MAX_LANE);
|
||||
if (lane_mapping_count > 0) {
|
||||
alc711_multilane.lane_mapping_count = lane_mapping_count;
|
||||
memcpy(&alc711_multilane.lane_mapping, &config->multilane.lane_mapping,
|
||||
sizeof(struct soundwire_multilane_map) * lane_mapping_count);
|
||||
}
|
||||
|
||||
/* Overlay Audio Mode config, if provided. */
|
||||
audio_mode_count = MIN(ARRAY_SIZE(config->audio_mode), SOUNDWIRE_MAX_MODE);
|
||||
if (audio_mode_count > 0)
|
||||
/* Currently only 1 audio mode is supported. */
|
||||
memcpy(&alc711_audio_mode, &config->audio_mode, sizeof(struct soundwire_audio_mode));
|
||||
|
||||
dsd = acpi_dp_new_table("_DSD");
|
||||
soundwire_gen_codec(dsd, &alc711_codec, NULL);
|
||||
acpi_dp_write(dsd);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ struct drivers_soundwire_alc711_config {
|
|||
const char *name;
|
||||
const char *desc;
|
||||
struct soundwire_address alc711_address;
|
||||
struct soundwire_audio_mode audio_mode[SOUNDWIRE_MAX_MODE];
|
||||
struct soundwire_multilane multilane;
|
||||
};
|
||||
|
||||
#endif /* __DRIVERS_SOUNDWIRE_ALC711_CHIP_H__ */
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#define MIPI_MFG_ID_REALTEK 0x025d
|
||||
#define MIPI_DEV_ID_REALTEK_ALC5682 0x5682
|
||||
#define MIPI_DEV_ID_REALTEK_ALC711 0x0711
|
||||
#define MIPI_DEV_ID_REALTEK_ALC712 0x0712
|
||||
#define MIPI_DEV_ID_REALTEK_ALC721 0x0721
|
||||
#define MIPI_DEV_ID_REALTEK_ALC722 0x0722
|
||||
#define MIPI_DEV_ID_REALTEK_ALC1308 0x1308
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue