[PATCH v4 1/3] power-domain: add power domain drivers for Rockchip platform

Varka Bhadram varkabhadram at gmail.com
Mon Oct 20 02:09:48 PDT 2014


On 10/20/2014 02:33 PM, jinkun.hong wrote:
> From: "jinkun.hong" <jinkun.hong at rock-chips.com>
>
> Add power domain drivers based on generic power domain for Rockchip platform,
> and support RK3288.
>
> Signed-off-by: Jack Dai <jack.dai at rock-chips.com>
> Signed-off-by: jinkun.hong <jinkun.hong at rock-chips.com>
>
> ---
>
(...)

> +static int rockchip_pd_power(struct rockchip_domain *pd, bool power_on)
> +{
> +	int i = 0;
> +	int ret = 0;
> +	struct rockchip_dev_entry *de;
> +
> +	spin_lock_irq(&pd->dev_lock);
> +
> +	list_for_each_entry(de, &pd->dev_list, node) {
> +		i += 1;
> +		pm_clk_resume(pd->dev);
> +	}
> +
> +	/* no clk, set power domain will fail */
> +	if (i == 0) {
> +		pr_err("%s: failed to on/off power domain!", __func__);

Missed terminating new line  :-)

> +		spin_unlock_irq(&pd->dev_lock);
> +		return ret;
> +	}
> +
> +	ret = rockchip_pmu_set_power_domain(pd, power_on);
> +
> +	list_for_each_entry(de, &pd->dev_list, node) {
> +		pm_clk_suspend(pd->dev);
> +	}
> +
> +	spin_unlock_irq(&pd->dev_lock);
> +
> +	return ret;
> +}
> +

(...)

> +static int rockchip_pm_domain_probe(struct platform_device *pdev)
> +{
> +	struct device_node *node;
> +	struct regmap *regmap_pmu;
> +	struct rockchip_domain *pd;
> +	const struct of_device_id *match;
> +
> +	match = of_match_node(rockchip_pm_domain_dt_match, pdev->dev.of_node);
> +	pd = (struct rockchip_domain *)match->data;
> +

Unnecessary one line space..

> +	if (!pd)
> +		return -ENOMEM;
> +
> +	node = of_parse_phandle(pdev->dev.of_node, "rockchip,pmu", 0);
> +	regmap_pmu = syscon_node_to_regmap(node);
> +	of_node_put(node);
> +	if (IS_ERR(regmap_pmu)) {
> +		pr_err("%s: failed to get regmap_pmu", __func__);

Terminating new line missed...  :-)

> +		return PTR_ERR(regmap_pmu);
> +	}
> +
> +	pd->regmap_pmu = regmap_pmu;
> +	pd->dev = &pdev->dev;
> +
> +	INIT_LIST_HEAD(&pd->dev_list);
> +
> +	spin_lock_init(&pd->idle_lock);
> +	spin_lock_init(&pd->pmu_lock);
> +	spin_lock_init(&pd->dev_lock);
> +
> +	pm_genpd_init(&pd->base, NULL, false);
> +
> +	return of_genpd_add_provider_simple(pdev->dev.of_node, &pd->base);
> +}
> +
>
-- 
Thanks and Regards,
Varka Bhadram.




More information about the Linux-rockchip mailing list