1 From 23316be8a9d450f33a21f1efe7d89570becbec58 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Sun, 16 Jul 2023 04:28:04 +0200
4 Subject: [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO
7 Commit 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older
8 SoCs") introduced and made regmap_config mandatory in the of_data struct
9 but didn't add the regmap_config for sfpb based devices.
11 SFPB based devices can both use the legacy syscon way to probe or the
12 new MMIO way and currently device that use the MMIO way are broken as
13 they lack the definition of the now required regmap_config and always
14 return -EINVAL (and indirectly makes fail probing everything that
15 depends on it, smem, nandc with smem-parser...)
17 Fix this by correctly adding the missing regmap_config and restore
18 function of hwspinlock on SFPB based devices with MMIO implementation.
20 Cc: stable@vger.kernel.org
21 Fixes: 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs")
22 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 Link: https://lore.kernel.org/r/20230716022804.21239-1-ansuelsmth@gmail.com
24 Signed-off-by: Bjorn Andersson <andersson@kernel.org>
26 drivers/hwspinlock/qcom_hwspinlock.c | 9 +++++++++
27 1 file changed, 9 insertions(+)
29 --- a/drivers/hwspinlock/qcom_hwspinlock.c
30 +++ b/drivers/hwspinlock/qcom_hwspinlock.c
31 @@ -69,9 +69,18 @@ static const struct hwspinlock_ops qcom_
32 .unlock = qcom_hwspinlock_unlock,
35 +static const struct regmap_config sfpb_mutex_config = {
39 + .max_register = 0x100,
43 static const struct qcom_hwspinlock_of_data of_sfpb_mutex = {
46 + .regmap_config = &sfpb_mutex_config,
49 static const struct regmap_config tcsr_msm8226_mutex_config = {