clk: msm: Add reset support in dummy clock driver
Some pass-through devices on msm8996 virtual platform need dummy clock reset. Change-Id: I88f4028fe56e428f12b2149a4413c3328da880bb Signed-off-by: Ramachandran Venkataramani <ramavenk@codeaurora.org> Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
This commit is contained in:
parent
9d5748ab14
commit
19d543a972
1 changed files with 53 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011,2013-2014 The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011,2013-2014,2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -14,6 +14,53 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <soc/qcom/msm-clock-controller.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#define DUMMY_RESET_NR 20
|
||||
|
||||
static int dummy_reset_assert(struct reset_controller_dev *rcdev,
|
||||
unsigned long id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_reset_deassert(struct reset_controller_dev *rcdev,
|
||||
unsigned long id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_reset(struct reset_controller_dev *rcdev, unsigned long id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct reset_control_ops dummy_reset_ops = {
|
||||
.reset = dummy_reset,
|
||||
.assert = dummy_reset_assert,
|
||||
.deassert = dummy_reset_deassert,
|
||||
};
|
||||
|
||||
static int dummy_reset_controller_register(struct platform_device *pdev)
|
||||
{
|
||||
struct reset_controller_dev *prcdev;
|
||||
int ret = 0;
|
||||
|
||||
prcdev = devm_kzalloc(&pdev->dev, sizeof(*prcdev), GFP_KERNEL);
|
||||
if (!prcdev)
|
||||
return -ENOMEM;
|
||||
|
||||
prcdev->of_node = pdev->dev.of_node;
|
||||
prcdev->ops = &dummy_reset_ops;
|
||||
prcdev->owner = pdev->dev.driver->owner;
|
||||
prcdev->nr_resets = DUMMY_RESET_NR;
|
||||
|
||||
ret = reset_controller_register(prcdev);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "Failed to register reset controller\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dummy_clk_reset(struct clk *clk, enum clk_reset_action action)
|
||||
{
|
||||
|
@ -99,7 +146,11 @@ static int msm_clock_dummy_probe(struct platform_device *pdev)
|
|||
|
||||
ret = of_clk_add_provider(pdev->dev.of_node, of_dummy_get, NULL);
|
||||
if (ret)
|
||||
return -ENOMEM;
|
||||
return ret;
|
||||
|
||||
ret = dummy_reset_controller_register(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dev_info(&pdev->dev, "Registered DUMMY provider.\n");
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue