mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "mfd: qcom-spmi-pmic: add support for slow SPMI busses"
This commit is contained in:
commit
bfa3f5f979
1 changed files with 14 additions and 4 deletions
|
|
@ -1,7 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
/* Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. */
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
|
|
@ -116,11 +114,23 @@ 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;
|
||||
|
||||
regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config);
|
||||
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…
Reference in a new issue