Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6ae9f82 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "pwm: qti-lpg: Fix erroneous clearing of LUT"

parents 466f5757 9f5b5d01
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017, 2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017, 2019-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/device.h>
@@ -137,8 +137,6 @@ static int sdam_probe(struct platform_device *pdev)
	sdam->size = val * 32;

	sdam_config->dev = &pdev->dev;
	sdam_config->name = "spmi_sdam";
	sdam_config->id = pdev->id;
	sdam_config->owner = THIS_MODULE,
	sdam_config->stride = 1;
	sdam_config->word_size = 1;
+16 −9
Original line number Diff line number Diff line
@@ -1477,11 +1477,12 @@ static int qpnp_lpg_parse_dt(struct qpnp_lpg_chip *chip)
		}
	}

	chip->lut = devm_kmalloc(chip->dev, sizeof(*chip->lut), GFP_KERNEL);
	if (of_find_property(chip->dev->of_node, "nvmem", NULL)) {
		chip->lut = devm_kmalloc(chip->dev, sizeof(*chip->lut),
				GFP_KERNEL);
		if (!chip->lut)
			return -ENOMEM;

	if (of_find_property(chip->dev->of_node, "nvmem", NULL)) {
		chip->sdam_nvmem = devm_nvmem_device_get(chip->dev, "ppg_sdam");
		if (IS_ERR_OR_NULL(chip->sdam_nvmem)) {
			rc = PTR_ERR(chip->sdam_nvmem);
@@ -1514,13 +1515,19 @@ static int qpnp_lpg_parse_dt(struct qpnp_lpg_chip *chip)
			return rc;
		}
	} else if (lut_is_defined(chip, &addr)) {
		chip->lut = devm_kmalloc(chip->dev, sizeof(*chip->lut),
				GFP_KERNEL);
		if (!chip->lut)
			return -ENOMEM;

		chip->lut->reg_base = be32_to_cpu(*addr);
		return qpnp_lpg_parse_pattern_dt(chip, LPG_LUT_COUNT_MAX);
	}

		rc = qpnp_lpg_parse_pattern_dt(chip, LPG_LUT_COUNT_MAX);
		if (rc < 0)
			return rc;
	} else {
		pr_debug("Neither SDAM nor LUT specified\n");
	devm_kfree(chip->dev, chip->lut);
	chip->lut = NULL;
	}

	return 0;
}