aboutsummaryrefslogtreecommitdiff
path: root/SOURCES/rog-ally-alsa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'SOURCES/rog-ally-alsa.patch')
-rw-r--r--SOURCES/rog-ally-alsa.patch243
1 files changed, 0 insertions, 243 deletions
diff --git a/SOURCES/rog-ally-alsa.patch b/SOURCES/rog-ally-alsa.patch
index a756928..6cfa703 100644
--- a/SOURCES/rog-ally-alsa.patch
+++ b/SOURCES/rog-ally-alsa.patch
@@ -4,42 +4,6 @@ From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
Stefan Binding, Charles Keepax, Vitaly Rodionov
Cc: alsa-devel, patches, linux-kernel, kernel
-The return code of regmap_multi_reg_write() call related to "MDSYNC
-down" sequence is shadowed by the subsequent
-wait_for_completion_timeout() invocation, which is expected to time
-timeout in case the write operation failed.
-
-Let cs35l41_global_enable() return the correct error code instead of
--ETIMEDOUT.
-
-Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
-Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
----
- sound/soc/codecs/cs35l41-lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c
-index 4ec306cd2f47..a018f1d98428 100644
---- a/sound/soc/codecs/cs35l41-lib.c
-+++ b/sound/soc/codecs/cs35l41-lib.c
-@@ -1243,7 +1243,7 @@ int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l4
- cs35l41_mdsync_down_seq[2].def = pwr_ctrl1;
- ret = regmap_multi_reg_write(regmap, cs35l41_mdsync_down_seq,
- ARRAY_SIZE(cs35l41_mdsync_down_seq));
-- if (!enable)
-+ if (ret || !enable)
- break;
-
- if (!pll_lock)
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
The return code of regmap_multi_reg_write() call related to "MDSYNC up"
sequence is shadowed by the subsequent regmap_read_poll_timeout()
invocation, which will hit a timeout in case the write operation above
@@ -98,47 +62,6 @@ From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
Stefan Binding, Charles Keepax, Vitaly Rodionov
Cc: alsa-devel, patches, linux-kernel, kernel
-Technically, an interrupt handler can be called before probe() finishes
-its execution, hence ensure the pll_lock completion object is always
-initialized before being accessed in cs35l41_irq().
-
-Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
-Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
----
- sound/soc/codecs/cs35l41.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
-index 722b69a6de26..fe5376b3e01b 100644
---- a/sound/soc/codecs/cs35l41.c
-+++ b/sound/soc/codecs/cs35l41.c
-@@ -1273,6 +1273,8 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *
- regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK3, CS35L41_INT3_PLL_LOCK_MASK,
- 0 << CS35L41_INT3_PLL_LOCK_SHIFT);
-
-+ init_completion(&cs35l41->pll_lock);
-+
- ret = devm_request_threaded_irq(cs35l41->dev, cs35l41->irq, NULL, cs35l41_irq,
- IRQF_ONESHOT | IRQF_SHARED | irq_pol,
- "cs35l41", cs35l41);
-@@ -1295,8 +1297,6 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *
- if (ret < 0)
- goto err;
-
-- init_completion(&cs35l41->pll_lock);
--
- pm_runtime_set_autosuspend_delay(cs35l41->dev, 3000);
- pm_runtime_use_autosuspend(cs35l41->dev);
- pm_runtime_mark_last_busy(cs35l41->dev);
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
Enabling the active/passive shared boosts requires setting SYNC_EN, but
*not* before receiving the PLL Lock signal.
@@ -402,98 +325,6 @@ From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
Stefan Binding, Charles Keepax, Vitaly Rodionov
Cc: alsa-devel, patches, linux-kernel, kernel
-The interrupt handler invokes pm_runtime_get_sync() without checking the
-returned error code.
-
-Add a proper verification and switch to pm_runtime_resume_and_get(), to
-avoid the need to call pm_runtime_put_noidle() for decrementing the PM
-usage counter before returning from the error condition.
-
-Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
-Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
----
- sound/soc/codecs/cs35l41.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
-index 12327b4c3d56..a31cb9ba7f7d 100644
---- a/sound/soc/codecs/cs35l41.c
-+++ b/sound/soc/codecs/cs35l41.c
-@@ -386,10 +386,18 @@ static irqreturn_t cs35l41_irq(int irq, void *data)
- struct cs35l41_private *cs35l41 = data;
- unsigned int status[4] = { 0, 0, 0, 0 };
- unsigned int masks[4] = { 0, 0, 0, 0 };
-- int ret = IRQ_NONE;
- unsigned int i;
-+ int ret;
-
-- pm_runtime_get_sync(cs35l41->dev);
-+ ret = pm_runtime_resume_and_get(cs35l41->dev);
-+ if (ret < 0) {
-+ dev_err(cs35l41->dev,
-+ "pm_runtime_resume_and_get failed in %s: %d\n",
-+ __func__, ret);
-+ return IRQ_NONE;
-+ }
-+
-+ ret = IRQ_NONE;
-
- for (i = 0; i < ARRAY_SIZE(status); i++) {
- regmap_read(cs35l41->regmap,
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
-According to the documentation, drivers are responsible for undoing at
-removal time all runtime PM changes done during probing.
-
-Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
-are necessary for undoing pm_runtime_use_autosuspend().
-
-Note this would have been handled implicitly by
-devm_pm_runtime_enable(), but there is a need to continue using
-pm_runtime_enable()/pm_runtime_disable() in order to ensure the runtime
-PM is disabled as soon as the remove() callback is entered.
-
-Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
----
- sound/soc/codecs/cs35l41.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
-index a31cb9ba7f7d..5456e6bfa242 100644
---- a/sound/soc/codecs/cs35l41.c
-+++ b/sound/soc/codecs/cs35l41.c
-@@ -1334,6 +1334,7 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *
- return 0;
-
- err_pm:
-+ pm_runtime_dont_use_autosuspend(cs35l41->dev);
- pm_runtime_disable(cs35l41->dev);
- pm_runtime_put_noidle(cs35l41->dev);
-
-@@ -1350,6 +1351,7 @@ EXPORT_SYMBOL_GPL(cs35l41_probe);
- void cs35l41_remove(struct cs35l41_private *cs35l41)
- {
- pm_runtime_get_sync(cs35l41->dev);
-+ pm_runtime_dont_use_autosuspend(cs35l41->dev);
- pm_runtime_disable(cs35l41->dev);
-
- regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, 0xFFFFFFFF);
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
Use dev_err_probe() helper where possible, to simplify error handling
during probe.
@@ -797,80 +628,6 @@ From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
Stefan Binding, Charles Keepax, Vitaly Rodionov
Cc: alsa-devel, patches, linux-kernel, kernel
-If component_add() fails, probe() returns without calling
-pm_runtime_put(), which leaves the runtime PM usage counter incremented.
-
-Fix the issue by jumping to err_pm label and drop the now unnecessary
-pm_runtime_disable() call.
-
-Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
----
- sound/pci/hda/cs35l41_hda.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
-index 09a9c135d9b6..6fd827093c92 100644
---- a/sound/pci/hda/cs35l41_hda.c
-+++ b/sound/pci/hda/cs35l41_hda.c
-@@ -1625,8 +1625,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
- ret = component_add(cs35l41->dev, &cs35l41_hda_comp_ops);
- if (ret) {
- dev_err(cs35l41->dev, "Register component failed: %d\n", ret);
-- pm_runtime_disable(cs35l41->dev);
-- goto err;
-+ goto err_pm;
- }
-
- dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", regid, reg_revid);
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
-According to the documentation, drivers are responsible for undoing at
-removal time all runtime PM changes done during probing.
-
-Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
-are necessary for undoing pm_runtime_use_autosuspend().
-
-Fixes: 1873ebd30cc8 ("ALSA: hda: cs35l41: Support Hibernation during Suspend")
-Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
----
- sound/pci/hda/cs35l41_hda.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
-index 6fd827093c92..565f7b897436 100644
---- a/sound/pci/hda/cs35l41_hda.c
-+++ b/sound/pci/hda/cs35l41_hda.c
-@@ -1633,6 +1633,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
- return 0;
-
- err_pm:
-+ pm_runtime_dont_use_autosuspend(cs35l41->dev);
- pm_runtime_disable(cs35l41->dev);
- pm_runtime_put_noidle(cs35l41->dev);
-
-@@ -1651,6 +1652,7 @@ void cs35l41_hda_remove(struct device *dev)
- struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
-
- pm_runtime_get_sync(cs35l41->dev);
-+ pm_runtime_dont_use_autosuspend(cs35l41->dev);
- pm_runtime_disable(cs35l41->dev);
-
- if (cs35l41->halo_initialized)
---
-2.41.0
-From: Cristian Ciocaltea @ 2023-09-07 17:10 UTC (permalink / raw)
- To: James Schulman, David Rhodes, Richard Fitzgerald,
- Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
- Stefan Binding, Charles Keepax, Vitaly Rodionov
- Cc: alsa-devel, patches, linux-kernel, kernel
-
Replace the remaining dev_err() calls in probe() with dev_err_probe(),
to improve consistency.