2021-10-20 09:03:19

by Lucas Tanure

[permalink] [raw]
Subject: [RFC PATCH v2 0/3] Add support for Legion 7 16ACHg6 laptop

Hi,

I would like to get some guidance about this solution to
support the 16ACHg6 laptop.

Hardware:
- The 16ACHg6 laptop has two CS35L41 amplifiers, connected
to Realtek ALC287 by an I2S bus and by and direct I2C to the CPU.
- The ALC287 codec is connected to the CPU by an HDA bus.
- The CS35L41 has a DSP which will require firmware to be loaded.

Architecture:
- To load the firmware for CS35L41, this solution will require
the wm_adsp library, which requires regmap, header definitions and
register tables.
- The HDA machine driver will find the registered ASoC by its
dai name.
- To minimize the duplication of the code, the HDA will call
snd_soc_dai_ops from the ASoC driver.

Notes:
- This is a work in progress, so the code is not functional, its
only intent is to demonstrate the overall solution

Changes from V1:

- Split into multiple patches, separating ACPI, ASoC and HDA patches
- Removed CS35L41 exported functions, moved code to snd_soc_dai_ops
- Patch realtek uses dai ops functions

Lucas Tanure (3):
sound: cs35l41: Allow HDA systems to use CS35l41 ASoC driver
ALSA: hda/realtek: Add support for Legion 7 16ACHg6 laptop Speakers
ACPI / scan: Create platform device for INT3515 ACPI nodes

drivers/acpi/scan.c | 1 +
drivers/platform/x86/i2c-multi-instantiate.c | 7 +
include/sound/cs35l41.h | 1 +
sound/pci/hda/patch_realtek.c | 109 ++++++++++++++-
sound/soc/codecs/cs35l41.c | 139 +++++++++++++++++--
sound/soc/codecs/cs35l41.h | 1 +
6 files changed, 249 insertions(+), 9 deletions(-)

--
2.33.1


2021-10-20 09:04:21

by Lucas Tanure

[permalink] [raw]
Subject: [RFC PATCH v2 3/3] ACPI / scan: Create platform device for INT3515 ACPI nodes

The ACPI device with CLSA0100 is a sound card with multiple
instances of CS35L41.

We add an ID to the I2C multi instantiate list to enumerate
all I2C slaves correctly.

Signed-off-by: Lucas Tanure <[email protected]>
---
drivers/acpi/scan.c | 1 +
drivers/platform/x86/i2c-multi-instantiate.c | 7 +++++++
2 files changed, 8 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 5b54c80b9d32..c1c27a408420 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1703,6 +1703,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
{"BSG2150", },
{"INT33FE", },
{"INT3515", },
+ {"CLSA0100", },
{}
};

diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index a50153ecd560..b61f7e30d42a 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -139,6 +139,12 @@ static const struct i2c_inst_data bsg2150_data[] = {
{}
};

+static const struct i2c_inst_data clsa0100_data[] = {
+ { "cs35l41", IRQ_RESOURCE_GPIO, 0 },
+ { "cs35l41", IRQ_RESOURCE_GPIO, 0 },
+ {}
+};
+
/*
* Device with _HID INT3515 (TI PD controllers) has some unresolved interrupt
* issues. The most common problem seen is interrupt flood.
@@ -170,6 +176,7 @@ static const struct i2c_inst_data bsg2150_data[] = {
static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
{ "BSG1160", (unsigned long)bsg1160_data },
{ "BSG2150", (unsigned long)bsg2150_data },
+ { "CLSA0100", (unsigned long)clsa0100_data },
{ }
};
MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
--
2.33.1