Advertisement
xmixahlx

linux-0002-rockchip-from-5.6_manjaro.diff

Feb 16th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. --- linux-0002-rockchip-from-5.6.patch 2020-02-14 05:37:04.106673608 -0800
  2. +++ linux-0002-rockchip-from-5.6_manjaro.patch 2020-02-16 14:53:55.428311191 -0800
  3. @@ -790,106 +790,6 @@
  4. status = "okay";
  5. };
  6.  
  7. -From bfec0931eb1f99325fd415c5259dcace70328460 Mon Sep 17 00:00:00 2001
  8. -From: Jerome Brunet <jbrunet@baylibre.com>
  9. -Date: Fri, 6 Dec 2019 11:35:42 +0100
  10. -Subject: [PATCH] ASoC: hdmi-codec: re-introduce mutex locking again
  11. -
  12. -The dai codec needs to ensure that on one dai is used at any time.
  13. -This is currently protected by bit atomic operation. With this change,
  14. -it done with a mutex instead.
  15. -
  16. -This change is not about functionality or efficiency. It is done with
  17. -the hope that it help maintainability in the future.
  18. -
  19. -Suggested-by: Mark Brown <broonie@kernel.org>
  20. -Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
  21. -Link: https://lore.kernel.org/r/20191206103542.485224-1-jbrunet@baylibre.com
  22. -Signed-off-by: Mark Brown <broonie@kernel.org>
  23. -(cherry picked from commit 1442842952ccfe4178602c7a8459ac2ecb9d9e1a)
  24. ----
  25. - sound/soc/codecs/hdmi-codec.c | 32 +++++++++++++++++++-------------
  26. - 1 file changed, 19 insertions(+), 13 deletions(-)
  27. -
  28. -diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
  29. -index f8b5b960e597..543363102d03 100644
  30. ---- a/sound/soc/codecs/hdmi-codec.c
  31. -+++ b/sound/soc/codecs/hdmi-codec.c
  32. -@@ -274,7 +274,8 @@ struct hdmi_codec_priv {
  33. - uint8_t eld[MAX_ELD_BYTES];
  34. - struct snd_pcm_chmap *chmap_info;
  35. - unsigned int chmap_idx;
  36. -- unsigned long busy;
  37. -+ struct mutex lock;
  38. -+ bool busy;
  39. - struct snd_soc_jack *jack;
  40. - unsigned int jack_status;
  41. - };
  42. -@@ -390,9 +391,10 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
  43. - struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
  44. - int ret = 0;
  45. -
  46. -- ret = test_and_set_bit(0, &hcp->busy);
  47. -- if (ret) {
  48. -+ mutex_lock(&hcp->lock);
  49. -+ if (hcp->busy) {
  50. - dev_err(dai->dev, "Only one simultaneous stream supported!\n");
  51. -+ mutex_unlock(&hcp->lock);
  52. - return -EINVAL;
  53. - }
  54. -
  55. -@@ -405,21 +407,21 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
  56. - if (hcp->hcd.ops->get_eld) {
  57. - ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data,
  58. - hcp->eld, sizeof(hcp->eld));
  59. -+ if (ret)
  60. -+ goto err;
  61. -+
  62. -+ ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld);
  63. -+ if (ret)
  64. -+ goto err;
  65. -
  66. -- if (!ret) {
  67. -- ret = snd_pcm_hw_constraint_eld(substream->runtime,
  68. -- hcp->eld);
  69. -- if (ret)
  70. -- goto err;
  71. -- }
  72. - /* Select chmap supported */
  73. - hdmi_codec_eld_chmap(hcp);
  74. - }
  75. -- return 0;
  76. -+
  77. -+ hcp->busy = true;
  78. -
  79. - err:
  80. -- /* Release the exclusive lock on error */
  81. -- clear_bit(0, &hcp->busy);
  82. -+ mutex_unlock(&hcp->lock);
  83. - return ret;
  84. - }
  85. -
  86. -@@ -431,7 +433,9 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
  87. - hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
  88. - hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);
  89. -
  90. -- clear_bit(0, &hcp->busy);
  91. -+ mutex_lock(&hcp->lock);
  92. -+ hcp->busy = false;
  93. -+ mutex_unlock(&hcp->lock);
  94. - }
  95. -
  96. - static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
  97. -@@ -811,6 +815,8 @@ static int hdmi_codec_probe(struct platform_device *pdev)
  98. - return -ENOMEM;
  99. -
  100. - hcp->hcd = *hcd;
  101. -+ mutex_init(&hcp->lock);
  102. -+
  103. - daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL);
  104. - if (!daidrv)
  105. - return -ENOMEM;
  106. -
  107. From b4129cd81f128d1e538ed222a1f4e5201671cb59 Mon Sep 17 00:00:00 2001
  108. From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
  109. Date: Wed, 27 Nov 2019 14:39:09 -0800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement