[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220105095834.GD18506@ediswmail.ad.cirrus.com>
Date: Wed, 5 Jan 2022 09:58:34 +0000
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Lucas Tanure <tanureal@...nsource.cirrus.com>
CC: "Rafael J . Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Mark Brown <broonie@...nel.org>, Takashi Iwai <tiwai@...e.com>,
<alsa-devel@...a-project.org>, <linux-acpi@...r.kernel.org>,
<patches@...nsource.cirrus.com>,
<platform-driver-x86@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 07/10] hda: cs35l41: Add support for CS35L41 in HDA
systems
On Fri, Dec 17, 2021 at 11:57:05AM +0000, Lucas Tanure wrote:
> Add support for CS35L41 using a new separated driver
> that can be used in all upcoming designs
>
> Signed-off-by: Lucas Tanure <tanureal@...nsource.cirrus.com>
> ---
> + mtl_revid = reg_revid & CS35L41_MTLREVID_MASK;
> +
> + chipid = (mtl_revid % 2) ? CS35L41R_CHIP_ID : CS35L41_CHIP_ID;
> + if (regid != chipid) {
> + dev_err(cs35l41->dev, "CS35L41 Device ID (%X). Expected ID %X\n", regid, chipid);
> + ret = -ENODEV;
> + goto err;
> + }
> +
> + ret = cs35l41_register_errata_patch(cs35l41->dev, cs35l41->regmap, reg_revid);
> + if (ret)
> + goto err;
> +
> + ret = cs35l41_otp_unpack(cs35l41->dev, cs35l41->regmap);
> + if (ret) {
> + dev_err(cs35l41->dev, "OTP Unpack failed: %d\n", ret);
> + goto err;
> + }
> +
> + ret = cs35l41_hda_apply_properties(cs35l41, acpi_hw_cfg);
> + if (ret)
> + goto err;
> + kfree(acpi_hw_cfg);
> +
> + if (cs35l41->reg_seq->probe) {
> + ret = regmap_register_patch(cs35l41->regmap, cs35l41->reg_seq->probe,
> + cs35l41->reg_seq->num_probe);
> + if (ret) {
> + dev_err(cs35l41->dev, "Fail to apply probe reg patch: %d\n", ret);
> + goto err;
> + }
> + }
Probably shouldn't use regmap_register_patch here,
cs35l41_register_errata_patch has already registered a patch to
the regmap, and this will then overwrite that patch. Probably
better to do this stuff as a multi-write.
Thanks,
Charles
Powered by blists - more mailing lists