Loading Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ Optional properties for peripheral child nodes: see: Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt - interrupt-names: Corresponding interrupt name to the interrupts property - qcom,can-sleep: Boolean flag indicating that processes waiting on SPMI transactions may sleep Each child node of SPMI slave id represents a function of the PMIC. In the example below the rtc device node represents a peripheral of pm8941 Loading arch/arm64/configs/sm8150-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,7 @@ CONFIG_SPI=y CONFIG_SPI_QCOM_GENI=y CONFIG_SPI_SPIDEV=y CONFIG_SPMI=y CONFIG_SPMI_MSM_PMIC_ARB_DEBUG=y CONFIG_SPMI_SIMULATOR=y CONFIG_PM855_PMIC_SIMULATOR=y CONFIG_PM855B_PMIC_SIMULATOR=y Loading arch/arm64/configs/sm8150_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ CONFIG_SPI=y CONFIG_SPI_QCOM_GENI=y CONFIG_SPI_SPIDEV=y CONFIG_SPMI=y CONFIG_SPMI_MSM_PMIC_ARB_DEBUG=y CONFIG_SPMI_SIMULATOR=y CONFIG_PM855_PMIC_SIMULATOR=y CONFIG_PM855B_PMIC_SIMULATOR=y Loading drivers/mfd/qcom-spmi-pmic.c +14 −2 Original line number Diff line number Diff line /* * Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -118,10 +118,22 @@ static const struct regmap_config spmi_regmap_config = { .fast_io = true, }; static const struct regmap_config spmi_regmap_can_sleep_config = { .reg_bits = 16, .val_bits = 8, .max_register = 0xffff, .fast_io = false, }; static int pmic_spmi_probe(struct spmi_device *sdev) { struct device_node *root = sdev->dev.of_node; struct regmap *regmap; if (of_property_read_bool(root, "qcom,can-sleep")) regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_can_sleep_config); else regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config); if (IS_ERR(regmap)) return PTR_ERR(regmap); Loading Loading
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ Optional properties for peripheral child nodes: see: Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt - interrupt-names: Corresponding interrupt name to the interrupts property - qcom,can-sleep: Boolean flag indicating that processes waiting on SPMI transactions may sleep Each child node of SPMI slave id represents a function of the PMIC. In the example below the rtc device node represents a peripheral of pm8941 Loading
arch/arm64/configs/sm8150-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,7 @@ CONFIG_SPI=y CONFIG_SPI_QCOM_GENI=y CONFIG_SPI_SPIDEV=y CONFIG_SPMI=y CONFIG_SPMI_MSM_PMIC_ARB_DEBUG=y CONFIG_SPMI_SIMULATOR=y CONFIG_PM855_PMIC_SIMULATOR=y CONFIG_PM855B_PMIC_SIMULATOR=y Loading
arch/arm64/configs/sm8150_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ CONFIG_SPI=y CONFIG_SPI_QCOM_GENI=y CONFIG_SPI_SPIDEV=y CONFIG_SPMI=y CONFIG_SPMI_MSM_PMIC_ARB_DEBUG=y CONFIG_SPMI_SIMULATOR=y CONFIG_PM855_PMIC_SIMULATOR=y CONFIG_PM855B_PMIC_SIMULATOR=y Loading
drivers/mfd/qcom-spmi-pmic.c +14 −2 Original line number Diff line number Diff line /* * Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -118,10 +118,22 @@ static const struct regmap_config spmi_regmap_config = { .fast_io = true, }; static const struct regmap_config spmi_regmap_can_sleep_config = { .reg_bits = 16, .val_bits = 8, .max_register = 0xffff, .fast_io = false, }; static int pmic_spmi_probe(struct spmi_device *sdev) { struct device_node *root = sdev->dev.of_node; struct regmap *regmap; if (of_property_read_bool(root, "qcom,can-sleep")) regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_can_sleep_config); else regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config); if (IS_ERR(regmap)) return PTR_ERR(regmap); Loading