linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: tsens: qcom: do not create duplicate regmap debugfs entries
@ 2018-11-15 17:43 Srinivas Kandagatla
  2018-11-19 15:22 ` Amit Kucheria
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Kandagatla @ 2018-11-15 17:43 UTC (permalink / raw)
  To: amit.kucheria, edubezval
  Cc: linux-kernel, linux-arm-msm, linux-pm, daniel.lezcano,
	Srinivas Kandagatla

Regmap would use device name to create debugfs entries. If the device
has multiple regmaps it is recommended to use name field in regmap_config.
Fix this by providing name to the regmap configs correctly.

Without this patch we would see below error on DB820c.

qcom-tsens 4a9000.thermal-sensor: Failed to create 4a9000.thermal-sensor
debugfs directory

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/thermal/qcom/tsens-common.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
index 3be4be2e0465..78652cac7f3d 100644
--- a/drivers/thermal/qcom/tsens-common.c
+++ b/drivers/thermal/qcom/tsens-common.c
@@ -114,6 +114,14 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp)
 }
 
 static const struct regmap_config tsens_config = {
+	.name		= "tm",
+	.reg_bits	= 32,
+	.val_bits	= 32,
+	.reg_stride	= 4,
+};
+
+static const struct regmap_config tsens_srot_config = {
+	.name		= "srot",
 	.reg_bits	= 32,
 	.val_bits	= 32,
 	.reg_stride	= 4,
@@ -139,8 +147,8 @@ int __init init_common(struct tsens_device *tmdev)
 		if (IS_ERR(srot_base))
 			return PTR_ERR(srot_base);
 
-		tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev,
-							srot_base, &tsens_config);
+		tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, srot_base,
+							&tsens_srot_config);
 		if (IS_ERR(tmdev->srot_map))
 			return PTR_ERR(tmdev->srot_map);
 
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal: tsens: qcom: do not create duplicate regmap debugfs entries
  2018-11-15 17:43 [PATCH] thermal: tsens: qcom: do not create duplicate regmap debugfs entries Srinivas Kandagatla
@ 2018-11-19 15:22 ` Amit Kucheria
  0 siblings, 0 replies; 2+ messages in thread
From: Amit Kucheria @ 2018-11-19 15:22 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Eduardo Valentin, Linux Kernel Mailing List, linux-arm-msm,
	Linux PM list, Daniel Lezcano

On Thu, Nov 15, 2018 at 11:15 PM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> Regmap would use device name to create debugfs entries. If the device
> has multiple regmaps it is recommended to use name field in regmap_config.
> Fix this by providing name to the regmap configs correctly.
>
> Without this patch we would see below error on DB820c.
>
> qcom-tsens 4a9000.thermal-sensor: Failed to create 4a9000.thermal-sensor
> debugfs directory

Good catch!

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Acked-by: Amit Kucheria <amit.kucheria@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>

after a minor fix below...

> ---
>  drivers/thermal/qcom/tsens-common.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> index 3be4be2e0465..78652cac7f3d 100644
> --- a/drivers/thermal/qcom/tsens-common.c
> +++ b/drivers/thermal/qcom/tsens-common.c
> @@ -114,6 +114,14 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp)
>  }
>
>  static const struct regmap_config tsens_config = {

I suggest renaming this to tsens_tm_config and modifying the
corresponding devm_regmap_init_mmio below.

> +       .name           = "tm",
> +       .reg_bits       = 32,
> +       .val_bits       = 32,
> +       .reg_stride     = 4,
> +};
> +
> +static const struct regmap_config tsens_srot_config = {
> +       .name           = "srot",
>         .reg_bits       = 32,
>         .val_bits       = 32,
>         .reg_stride     = 4,
> @@ -139,8 +147,8 @@ int __init init_common(struct tsens_device *tmdev)
>                 if (IS_ERR(srot_base))
>                         return PTR_ERR(srot_base);
>
> -               tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev,
> -                                                       srot_base, &tsens_config);
> +               tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, srot_base,
> +                                                       &tsens_srot_config);
>                 if (IS_ERR(tmdev->srot_map))
>                         return PTR_ERR(tmdev->srot_map);
>
> --
> 2.19.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-19 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 17:43 [PATCH] thermal: tsens: qcom: do not create duplicate regmap debugfs entries Srinivas Kandagatla
2018-11-19 15:22 ` Amit Kucheria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).