intel_pmic_chtcrc.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Intel Cherry Trail Crystal Cove PMIC operation region driver
  4. *
  5. * Copyright (C) 2019 Hans de Goede <[email protected]>
  6. */
  7. #include <linux/acpi.h>
  8. #include <linux/init.h>
  9. #include <linux/mfd/intel_soc_pmic.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/regmap.h>
  12. #include "intel_pmic.h"
  13. /*
  14. * We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel
  15. * code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal
  16. * Cove Plus" PMIC and talks about Cherry Trail, so presumably that one
  17. * could be used to get register info for the regulators if we need to
  18. * implement regulator support in the future.
  19. *
  20. * For now the sole purpose of this driver is to make
  21. * intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a
  22. * CHT Crystal Cove PMIC.
  23. */
  24. static const struct intel_pmic_opregion_data intel_chtcrc_pmic_opregion_data = {
  25. .lpat_raw_to_temp = acpi_lpat_raw_to_temp,
  26. .pmic_i2c_address = 0x6e,
  27. };
  28. static int intel_chtcrc_pmic_opregion_probe(struct platform_device *pdev)
  29. {
  30. struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
  31. return intel_pmic_install_opregion_handler(&pdev->dev,
  32. ACPI_HANDLE(pdev->dev.parent), pmic->regmap,
  33. &intel_chtcrc_pmic_opregion_data);
  34. }
  35. static struct platform_driver intel_chtcrc_pmic_opregion_driver = {
  36. .probe = intel_chtcrc_pmic_opregion_probe,
  37. .driver = {
  38. .name = "cht_crystal_cove_pmic",
  39. },
  40. };
  41. builtin_platform_driver(intel_chtcrc_pmic_opregion_driver);