mirror of
https://github.com/torvalds/linux.git
synced 2026-04-28 11:32:28 -04:00
Support the graphics clock controller for Kaanapali for Graphics SW driver to use the clocks. GXCLKCTL (Graphics GX Clock Controller) is a block dedicated to managing clocks for the GPU subsystem on GX power domain. The GX clock controller driver manages only the GX GDSC and the rest of the resources of the controller are managed by the firmware. Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260107-kaanapali-mmcc-v3-v3-11-8e10adc236a8@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
77 lines
1.8 KiB
C
77 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
|
*/
|
|
|
|
#include <linux/clk-provider.h>
|
|
#include <linux/mod_devicetable.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/regmap.h>
|
|
|
|
#include <dt-bindings/clock/qcom,kaanapali-gxclkctl.h>
|
|
|
|
#include "common.h"
|
|
#include "gdsc.h"
|
|
|
|
enum {
|
|
DT_BI_TCXO,
|
|
};
|
|
|
|
static struct gdsc gx_clkctl_gx_gdsc = {
|
|
.gdscr = 0x4024,
|
|
.en_rest_wait_val = 0x2,
|
|
.en_few_wait_val = 0x2,
|
|
.clk_dis_wait_val = 0xf,
|
|
.pd = {
|
|
.name = "gx_clkctl_gx_gdsc",
|
|
.power_on = gdsc_gx_do_nothing_enable,
|
|
},
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
|
|
};
|
|
|
|
static struct gdsc *gx_clkctl_gdscs[] = {
|
|
[GX_CLKCTL_GX_GDSC] = &gx_clkctl_gx_gdsc,
|
|
};
|
|
|
|
static const struct regmap_config gx_clkctl_regmap_config = {
|
|
.reg_bits = 32,
|
|
.reg_stride = 4,
|
|
.val_bits = 32,
|
|
.max_register = 0x4038,
|
|
.fast_io = true,
|
|
};
|
|
|
|
static const struct qcom_cc_desc gx_clkctl_kaanapali_desc = {
|
|
.config = &gx_clkctl_regmap_config,
|
|
.gdscs = gx_clkctl_gdscs,
|
|
.num_gdscs = ARRAY_SIZE(gx_clkctl_gdscs),
|
|
.use_rpm = true,
|
|
};
|
|
|
|
static const struct of_device_id gx_clkctl_kaanapali_match_table[] = {
|
|
{ .compatible = "qcom,kaanapali-gxclkctl" },
|
|
{ }
|
|
};
|
|
MODULE_DEVICE_TABLE(of, gx_clkctl_kaanapali_match_table);
|
|
|
|
static int gx_clkctl_kaanapali_probe(struct platform_device *pdev)
|
|
{
|
|
return qcom_cc_probe(pdev, &gx_clkctl_kaanapali_desc);
|
|
}
|
|
|
|
static struct platform_driver gx_clkctl_kaanapali_driver = {
|
|
.probe = gx_clkctl_kaanapali_probe,
|
|
.driver = {
|
|
.name = "gxclkctl-kaanapali",
|
|
.of_match_table = gx_clkctl_kaanapali_match_table,
|
|
},
|
|
};
|
|
|
|
module_platform_driver(gx_clkctl_kaanapali_driver);
|
|
|
|
MODULE_DESCRIPTION("QTI GXCLKCTL Kaanapali Driver");
|
|
MODULE_LICENSE("GPL");
|