mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
msm: kgsl: Add support for multiple ddr tables
The lahaina device can have either LP4X or LP5 DDR. So look for the corresponding ddr table in the device tree. If ddr specific table is not found, fall back to a generic table for devices that may have only one type of ddr. Change-Id: I92cb802820eeb61e4afd0a79ed38a7f8b4a5916d Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
parent
73db5bb07d
commit
e91214d3d4
1 changed files with 17 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/interconnect.h>
|
||||
|
|
@ -147,15 +147,28 @@ u32 *kgsl_bus_get_table(struct platform_device *pdev,
|
|||
int kgsl_bus_init(struct kgsl_device *device, struct platform_device *pdev)
|
||||
{
|
||||
struct kgsl_pwrctrl *pwr = &device->pwrctrl;
|
||||
int ret, count;
|
||||
int count;
|
||||
int ddr = of_fdt_get_ddrtype();
|
||||
|
||||
if (ddr >= 0) {
|
||||
char str[32];
|
||||
|
||||
snprintf(str, sizeof(str), "qcom,bus-table-ddr%d", ddr);
|
||||
|
||||
pwr->ddr_table = kgsl_bus_get_table(pdev, str, &count);
|
||||
if (!IS_ERR(pwr->ddr_table))
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Look if a generic table is present */
|
||||
pwr->ddr_table = kgsl_bus_get_table(pdev, "qcom,bus-table-ddr", &count);
|
||||
if (IS_ERR(pwr->ddr_table)) {
|
||||
ret = PTR_ERR(pwr->ddr_table);
|
||||
int ret = PTR_ERR(pwr->ddr_table);
|
||||
|
||||
pwr->ddr_table = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
done:
|
||||
pwr->ddr_table_count = count;
|
||||
|
||||
validate_pwrlevels(device, pwr->ddr_table, pwr->ddr_table_count);
|
||||
|
|
|
|||
Loading…
Reference in a new issue