Unverified Commit c822e308 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Yet another round of SDCA fixes

Charles Keepax <ckeepax@opensource.cirrus.com> says:

Another round of SDCA fixes a couple of fix to the IRQ cleanup
from Richard, and a minor tweak to the IRQ handling from me.
parents f4ee8a88 87ceac0a
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ properties:
    maxItems: 1
    description: gpio pin to enable/disable the device

  '#sound-dai-cells':
    const: 0

required:
  - compatible
  - reg
@@ -41,7 +44,10 @@ required:
  - iovdd-supply
  - avdd-supply

additionalProperties: false
allOf:
  - $ref: dai-common.yaml#

unevaluatedProperties: false

examples:
  - |
@@ -54,6 +60,7 @@ examples:
        audio-codec@41 {
            compatible = "ti,tas2552";
            reg = <0x41>;
            #sound-dai-cells = <0>;
            vbat-supply = <&reg_vbat>;
            iovdd-supply = <&reg_iovdd>;
            avdd-supply = <&reg_avdd>;
+5 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ struct sdca_interrupt_info {
int sdca_irq_request(struct device *dev, struct sdca_interrupt_info *interrupt_info,
		     int sdca_irq, const char *name, irq_handler_t handler,
		     void *data);
void sdca_irq_free(struct device *dev, struct sdca_interrupt_info *interrupt_info,
		   int sdca_irq, const char *name, void *data);
int sdca_irq_data_populate(struct device *dev, struct regmap *function_regmap,
			   struct snd_soc_component *component,
			   struct sdca_function_data *function,
@@ -81,6 +83,9 @@ int sdca_irq_populate_early(struct device *dev, struct regmap *function_regmap,
int sdca_irq_populate(struct sdca_function_data *function,
		      struct snd_soc_component *component,
		      struct sdca_interrupt_info *info);
void sdca_irq_cleanup(struct device *dev,
		      struct sdca_function_data *function,
		      struct sdca_interrupt_info *info);
struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
					      struct regmap *regmap, int irq);

+20 −4
Original line number Diff line number Diff line
@@ -99,17 +99,33 @@ static const struct dmi_system_id soc_sdw_quirk_table[] = {
		.callback = soc_sdw_quirk_cb,
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "21YW"),
			DMI_MATCH(DMI_PRODUCT_SKU, "21YW"),
		},
		.driver_data = (void *)(ASOC_SDW_CODEC_SPKR),
		.driver_data = (void *)((ASOC_SDW_CODEC_SPKR) | (ASOC_SDW_ACP_DMIC)),
	},
	{
		.callback = soc_sdw_quirk_cb,
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "21YX"),
			DMI_MATCH(DMI_PRODUCT_SKU, "21YX"),
		},
		.driver_data = (void *)(ASOC_SDW_CODEC_SPKR),
		.driver_data = (void *)((ASOC_SDW_CODEC_SPKR) | (ASOC_SDW_ACP_DMIC)),
	},
	{
		.callback = soc_sdw_quirk_cb,
		.matches = { /* Lenovo P16s G5 AMD */
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_SKU, "21XG"),
		},
		.driver_data = (void *)(ASOC_SDW_ACP_DMIC),
	},
	{
		.callback = soc_sdw_quirk_cb,
		.matches = { /* Lenovo P16s G5 AMD */
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_SKU, "21XH"),
		},
		.driver_data = (void *)(ASOC_SDW_ACP_DMIC),
	},
	{
		.callback = soc_sdw_quirk_cb,
+8 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ static bool nau8325_readable_reg(struct device *dev, unsigned int reg)
static bool nau8325_writeable_reg(struct device *dev, unsigned int reg)
{
	switch (reg) {
	case NAU8325_R00_HARDWARE_RST:
	case NAU8325_R00_HARDWARE_RST ... NAU8325_R01_SOFTWARE_RST:
	case NAU8325_R03_CLK_CTRL ... NAU8325_R06_INT_CLR_STATUS:
	case NAU8325_R09_IRQOUT ... NAU8325_R13_DAC_VOLUME:
	case NAU8325_R29_DAC_CTRL1 ... NAU8325_R2A_DAC_CTRL2:
@@ -670,6 +670,12 @@ static void nau8325_reset_chip(struct regmap *regmap)
	regmap_write(regmap, NAU8325_R00_HARDWARE_RST, 0x0000);
}

static void nau8325_software_reset(struct regmap *regmap)
{
	regmap_write(regmap, NAU8325_R01_SOFTWARE_RST, 0x0000);
	regmap_write(regmap, NAU8325_R01_SOFTWARE_RST, 0x0000);
}

static void nau8325_init_regs(struct nau8325 *nau8325)
{
	struct regmap *regmap = nau8325->regmap;
@@ -856,6 +862,7 @@ static int nau8325_i2c_probe(struct i2c_client *i2c)
	nau8325_print_device_properties(nau8325);

	nau8325_reset_chip(nau8325->regmap);
	nau8325_software_reset(nau8325->regmap);
	ret = regmap_read(nau8325->regmap, NAU8325_R02_DEVICE_ID, &value);
	if (ret) {
		dev_dbg(dev, "Failed to read device id (%d)", ret);
+6 −3
Original line number Diff line number Diff line
@@ -520,7 +520,8 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev)
	if (num_elems > max_ssps) {
		dev_err(adev->dev, "board supports only %d SSP, %d specified\n",
			max_ssps, num_elems);
		return -EINVAL;
		ret = -EINVAL;
		goto exit;
	}

	for (ssp_port = 0; ssp_port < num_elems; ssp_port++) {
@@ -528,11 +529,13 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev)
		for_each_set_bit(tdm_slot, &tdm_slots, 16) {
			ret = avs_register_i2s_test_board(adev, ssp_port, tdm_slot);
			if (ret)
				return ret;
				goto exit;
		}
	}

	return 0;
exit:
	kfree(array);
	return ret;
}

static int avs_register_i2s_board(struct avs_dev *adev, struct snd_soc_acpi_mach *mach)
Loading