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

Commit ce6d2aa8 authored by Chinmay Sawarkar's avatar Chinmay Sawarkar Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Read OPP tables for each bus config



Kernel 4.19 requires that each DEVFREQ device must be associated
with a corresponding OPP table with atleast one operation point.

CRs-Fixed: 2381570
Change-Id: I5aefec4d79509cd09c2d6ab64123af859c03f510
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent e5d4b86d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */

#include <asm/dma-iommu.h>
@@ -432,6 +432,11 @@ static int msm_vidc_populate_bus(struct device *dev,
	if (!strcmp(bus->governor, PERF_GOV))
		bus->is_prfm_gov_used = true;

	if (of_find_property(dev->of_node, "operating-points-v2", NULL))
		bus->has_freq_table = true;
	else
		bus->has_freq_table = false;

	rc = of_property_read_u32_array(dev->of_node, "qcom,bus-range-kbps",
			range, ARRAY_SIZE(range));
	if (rc) {
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 */

#ifndef __MSM_VIDC_RESOURCES_H__
@@ -100,6 +100,7 @@ struct bus_info {
	struct devfreq *devfreq;
	struct msm_bus_client_handle *client;
	bool is_prfm_gov_used;
	bool has_freq_table;
};

struct bus_set {
+7 −0
Original line number Diff line number Diff line
@@ -3994,6 +3994,13 @@ static int __init_bus(struct venus_hfi_device *device)
				dev_name(bus->dev));
		dev_set_drvdata(bus->dev, device);

		if (bus->has_freq_table) {
			rc = dev_pm_opp_of_add_table(bus->dev);
			if (rc)
				dprintk(VIDC_ERR, "Failed to add %s OPP table",
						bus->name);
		}

		bus->client = msm_bus_scale_register(bus->master, bus->slave,
				bus->name, false);
		if (IS_ERR_OR_NULL(bus->client)) {