309-clk-gcc-add-tsens-child-node.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 856371ca1561ca9b3280cc323ff296c7c5e1fa93 Mon Sep 17 00:00:00 2001
  2. From: Pavel Kubelun <be.dissent@gmail.com>
  3. Date: Tue, 22 Nov 2016 17:37:56 +0300
  4. Subject: [PATCH] ipq806x: clk: gcc: add tsens child node
  5. Thermal sensors in ipq806x are inside a Global clock controller.
  6. Add a child node into it to be used by the TSENS driver.
  7. Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
  8. ---
  9. drivers/clk/qcom/gcc-ipq806x.c | 8 ++++++++
  10. 1 file changed, 8 insertions(+)
  11. --- a/drivers/clk/qcom/gcc-ipq806x.c
  12. +++ b/drivers/clk/qcom/gcc-ipq806x.c
  13. @@ -3109,6 +3109,7 @@ MODULE_DEVICE_TABLE(of, gcc_ipq806x_matc
  14. static int gcc_ipq806x_probe(struct platform_device *pdev)
  15. {
  16. struct device *dev = &pdev->dev;
  17. + struct platform_device *tsens;
  18. struct regmap *regmap;
  19. int ret;
  20. @@ -3138,6 +3139,13 @@ static int gcc_ipq806x_probe(struct plat
  21. regmap_write(regmap, 0x3cf8, 8);
  22. regmap_write(regmap, 0x3d18, 8);
  23. + tsens = platform_device_register_data(&pdev->dev, "qcom-tsens", -1,
  24. + NULL, 0);
  25. + if (IS_ERR(tsens))
  26. + return PTR_ERR(tsens);
  27. +
  28. + platform_set_drvdata(pdev, tsens);
  29. +
  30. return 0;
  31. }