Skip to content

Commit 14e42ce

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Remove Set Channel Map api from binding
This API was required for CLSA0100 laptop, which did not have correct properties inside ACPI. The required values are now hardcoded inside the driver so this is no longer needed. Without this api, there CLSA0100 can now use the generic cs35l41 fixup, like the other laptops. All other laptops will read the Speaker Position from ACPI and set the channel map from within the driver. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220509214703.4482-4-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 775d667 commit 14e42ce

3 files changed

Lines changed: 1 addition & 56 deletions

File tree

sound/pci/hda/cs35l41_hda.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas
9292
comps->dev = dev;
9393
strscpy(comps->name, dev_name(dev), sizeof(comps->name));
9494
comps->playback_hook = cs35l41_hda_playback_hook;
95-
comps->set_channel_map = cs35l41_hda_channel_map;
9695

9796
return 0;
9897
}

sound/pci/hda/hda_component.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ struct hda_component {
1515
struct device *dev;
1616
char name[HDA_MAX_NAME_SIZE];
1717
void (*playback_hook)(struct device *dev, int action);
18-
int (*set_channel_map)(struct device *dev, unsigned int rx_num, unsigned int *rx_slot,
19-
unsigned int tx_num, unsigned int *tx_slot);
2018
};

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6582,18 +6582,6 @@ static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
65826582
}
65836583
}
65846584

6585-
static int find_comp_by_dev_name(struct alc_spec *spec, const char *name)
6586-
{
6587-
int i;
6588-
6589-
for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6590-
if (strcmp(spec->comps[i].name, name) == 0)
6591-
return i;
6592-
}
6593-
6594-
return -ENODEV;
6595-
}
6596-
65976585
static int comp_bind(struct device *dev)
65986586
{
65996587
struct hda_codec *cdc = dev_to_hda_codec(dev);
@@ -6668,50 +6656,10 @@ static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fix
66686656
cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 4);
66696657
}
66706658

6671-
static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6672-
struct snd_pcm_substream *sub, int action)
6673-
{
6674-
struct alc_spec *spec = cdc->spec;
6675-
unsigned int rx_slot;
6676-
int i;
6677-
6678-
switch (action) {
6679-
case HDA_GEN_PCM_ACT_PREPARE:
6680-
rx_slot = 0;
6681-
i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.0");
6682-
if (i >= 0)
6683-
spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
6684-
6685-
rx_slot = 1;
6686-
i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.1");
6687-
if (i >= 0)
6688-
spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
6689-
break;
6690-
}
6691-
6692-
comp_generic_playback_hook(hinfo, cdc, sub, action);
6693-
}
6694-
66956659
static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
66966660
int action)
66976661
{
6698-
struct device *dev = hda_codec_dev(cdc);
6699-
struct alc_spec *spec = cdc->spec;
6700-
int ret;
6701-
6702-
switch (action) {
6703-
case HDA_FIXUP_ACT_PRE_PROBE:
6704-
component_match_add(dev, &spec->match, component_compare_dev_name,
6705-
"i2c-CLSA0100:00-cs35l41-hda.0");
6706-
component_match_add(dev, &spec->match, component_compare_dev_name,
6707-
"i2c-CLSA0100:00-cs35l41-hda.1");
6708-
ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6709-
if (ret)
6710-
codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6711-
else
6712-
spec->gen.pcm_playback_hook = alc287_legion_16achg6_playback_hook;
6713-
break;
6714-
}
6662+
cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
67156663
}
67166664

67176665
/* for alc295_fixup_hp_top_speakers */

0 commit comments

Comments
 (0)