Source: opendevices.sony.net, "Open source archive for 73.1.A.2.74" (Xperia 1 VIII: XQ-GE74, XQ-GE54, SO-51G, SOG17, A601SO, XQ-GE44), unmodified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
76 lines
2.0 KiB
Diff
76 lines
2.0 KiB
Diff
--- before
|
|
+++ after
|
|
@@ -27,6 +27,10 @@
|
|
#include <linux/slab.h>
|
|
#include <linux/of.h>
|
|
#include <linux/regulator/of_regulator.h>
|
|
+#ifdef QTI_FIXED_REGULATOR
|
|
+#include <linux/regulator/debug-regulator.h>
|
|
+#include <linux/regulator/proxy-consumer.h>
|
|
+#endif
|
|
#include <linux/regulator/machine.h>
|
|
#include <linux/clk.h>
|
|
|
|
@@ -217,6 +221,24 @@ static const struct regulator_ops fixed_
|
|
.is_enabled = reg_is_enabled,
|
|
};
|
|
|
|
+#ifdef QTI_FIXED_REGULATOR
|
|
+static void qti_reg_fixed_voltage_init(struct device *dev,
|
|
+ struct regulator_dev *rdev)
|
|
+{
|
|
+ int ret;
|
|
+
|
|
+ ret = devm_regulator_proxy_consumer_register(dev, dev->of_node);
|
|
+ if (ret)
|
|
+ dev_err(dev, "failed to register proxy consumer, ret=%d\n",
|
|
+ ret);
|
|
+
|
|
+ ret = devm_regulator_debug_register(dev, rdev);
|
|
+ if (ret)
|
|
+ dev_err(dev, "failed to register debug regulator, ret=%d\n",
|
|
+ ret);
|
|
+}
|
|
+#endif
|
|
+
|
|
static int reg_fixed_voltage_probe(struct platform_device *pdev)
|
|
{
|
|
struct device *dev = &pdev->dev;
|
|
@@ -337,6 +359,10 @@ static int reg_fixed_voltage_probe(struc
|
|
|
|
platform_set_drvdata(pdev, drvdata);
|
|
|
|
+#ifdef QTI_FIXED_REGULATOR
|
|
+ qti_reg_fixed_voltage_init(dev, drvdata->dev);
|
|
+#endif
|
|
+
|
|
dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
|
|
drvdata->desc.fixed_uV);
|
|
|
|
@@ -361,6 +387,12 @@ static const struct fixed_dev_type fixed
|
|
};
|
|
|
|
static const struct of_device_id fixed_of_match[] = {
|
|
+#ifdef QTI_FIXED_REGULATOR
|
|
+ {
|
|
+ .compatible = "qti-regulator-fixed",
|
|
+ .data = &fixed_voltage_data,
|
|
+ },
|
|
+#endif
|
|
{
|
|
.compatible = "regulator-fixed",
|
|
.data = &fixed_voltage_data,
|
|
@@ -382,7 +414,12 @@ MODULE_DEVICE_TABLE(of, fixed_of_match);
|
|
static struct platform_driver regulator_fixed_voltage_driver = {
|
|
.probe = reg_fixed_voltage_probe,
|
|
.driver = {
|
|
+#ifdef QTI_FIXED_REGULATOR
|
|
+ .name = "qti-reg-fixed-voltage",
|
|
+ .sync_state = regulator_proxy_consumer_sync_state,
|
|
+#else
|
|
.name = "reg-fixed-voltage",
|
|
+#endif
|
|
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
|
.of_match_table = of_match_ptr(fixed_of_match),
|
|
},
|