Lines Matching refs:cs35l41
138 static int cs35l41_add_gpios(struct cs35l41_hda *cs35l41, struct device *physdev, int reset_gpio, in cs35l41_add_gpios() argument
152 if (cs35l41->dacpi->driver_gpios) in cs35l41_add_gpios()
232 static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physdev, int id, in generic_dsd_config() argument
235 struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; in generic_dsd_config()
244 if (!strcasecmp(cfg->ssid, cs35l41->acpi_subsystem_id)) in generic_dsd_config()
251 if (!cs35l41->dacpi || cs35l41->dacpi != ACPI_COMPANION(physdev)) { in generic_dsd_config()
252 dev_err(cs35l41->dev, "ACPI Device does not match, cannot override _DSD.\n"); in generic_dsd_config()
256 dev_info(cs35l41->dev, "Adding DSD properties for %s\n", cs35l41->acpi_subsystem_id); in generic_dsd_config()
258 dsd_found = acpi_dev_has_props(cs35l41->dacpi); in generic_dsd_config()
261 ret = cs35l41_add_gpios(cs35l41, physdev, cfg->reset_gpio_index, in generic_dsd_config()
265 dev_err(cs35l41->dev, "Error adding GPIO mapping: %d\n", ret); in generic_dsd_config()
269 dev_warn(cs35l41->dev, "Cannot add Reset/Speaker ID/SPI CS GPIO Mapping, " in generic_dsd_config()
273 if (cs35l41->control_bus == SPI) { in generic_dsd_config()
274 cs35l41->index = id; in generic_dsd_config()
285 spi = to_spi_device(cs35l41->dev); in generic_dsd_config()
288 dev_warn(cs35l41->dev, in generic_dsd_config()
292 dev_warn(cs35l41->dev, in generic_dsd_config()
301 dev_err(cs35l41->dev, in generic_dsd_config()
307 cs35l41->cs_gpio = cs_gpiod; in generic_dsd_config()
321 cs35l41->index = id - 0x40; in generic_dsd_config()
324 cs35l41->index = id == 0x40 ? 0 : 1; in generic_dsd_config()
327 cs35l41->reset_gpio = fwnode_gpiod_get_index(acpi_fwnode_handle(cs35l41->dacpi), "reset", in generic_dsd_config()
328 cs35l41->index, GPIOD_OUT_LOW, in generic_dsd_config()
330 cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, cs35l41->index, cfg->num_amps, -1); in generic_dsd_config()
332 hw_cfg->spk_pos = cfg->channel[cs35l41->index]; in generic_dsd_config()
334 cs35l41->channel_index = 0; in generic_dsd_config()
335 for (i = 0; i < cs35l41->index; i++) in generic_dsd_config()
337 cs35l41->channel_index++; in generic_dsd_config()
366 static int hp_i2c_int_2amp_dual_spkid(struct cs35l41_hda *cs35l41, struct device *physdev, int id, in hp_i2c_int_2amp_dual_spkid() argument
369 struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; in hp_i2c_int_2amp_dual_spkid()
372 if (acpi_dev_has_props(cs35l41->dacpi)) in hp_i2c_int_2amp_dual_spkid()
376 cs35l41->index = id == 0x40 ? 0 : 1; in hp_i2c_int_2amp_dual_spkid()
377 cs35l41->channel_index = 0; in hp_i2c_int_2amp_dual_spkid()
378 cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); in hp_i2c_int_2amp_dual_spkid()
379 if (cs35l41->index == 0) in hp_i2c_int_2amp_dual_spkid()
380 cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 1); in hp_i2c_int_2amp_dual_spkid()
382 cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 2); in hp_i2c_int_2amp_dual_spkid()
383 hw_cfg->spk_pos = cs35l41->index; in hp_i2c_int_2amp_dual_spkid()
405 static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *physdev, int id, in lenovo_legion_no_acpi() argument
408 struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; in lenovo_legion_no_acpi()
411 cs35l41->index = id == 0x40 ? 0 : 1; in lenovo_legion_no_acpi()
412 cs35l41->channel_index = 0; in lenovo_legion_no_acpi()
413 cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); in lenovo_legion_no_acpi()
414 cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 2); in lenovo_legion_no_acpi()
415 hw_cfg->spk_pos = cs35l41->index; in lenovo_legion_no_acpi()
431 static int missing_speaker_id_gpio2(struct cs35l41_hda *cs35l41, struct device *physdev, int id, in missing_speaker_id_gpio2() argument
436 ret = cs35l41_add_gpios(cs35l41, physdev, -1, 2, -1, 2); in missing_speaker_id_gpio2()
438 dev_err(cs35l41->dev, "Error adding GPIO mapping: %d\n", ret); in missing_speaker_id_gpio2()
442 return cs35l41_hda_parse_acpi(cs35l41, physdev, id); in missing_speaker_id_gpio2()
448 int (*add_prop)(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
558 int cs35l41_add_dsd_properties(struct cs35l41_hda *cs35l41, struct device *physdev, int id, in cs35l41_add_dsd_properties() argument
566 (cs35l41->acpi_subsystem_id && in cs35l41_add_dsd_properties()
567 !strcasecmp(model->ssid, cs35l41->acpi_subsystem_id)))) in cs35l41_add_dsd_properties()
568 return model->add_prop(cs35l41, physdev, id, hid); in cs35l41_add_dsd_properties()