cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

pm_clock.h (2637B)


      1/* SPDX-License-Identifier: GPL-2.0-only */
      2/*
      3 * pm_clock.h - Definitions and headers related to device clocks.
      4 *
      5 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
      6 */
      7
      8#ifndef _LINUX_PM_CLOCK_H
      9#define _LINUX_PM_CLOCK_H
     10
     11#include <linux/device.h>
     12#include <linux/notifier.h>
     13
     14struct pm_clk_notifier_block {
     15	struct notifier_block nb;
     16	struct dev_pm_domain *pm_domain;
     17	char *con_ids[];
     18};
     19
     20struct clk;
     21
     22#ifdef CONFIG_PM
     23extern int pm_clk_runtime_suspend(struct device *dev);
     24extern int pm_clk_runtime_resume(struct device *dev);
     25#define USE_PM_CLK_RUNTIME_OPS \
     26	.runtime_suspend = pm_clk_runtime_suspend, \
     27	.runtime_resume = pm_clk_runtime_resume,
     28#else
     29#define USE_PM_CLK_RUNTIME_OPS
     30#endif
     31
     32#ifdef CONFIG_PM_CLK
     33static inline bool pm_clk_no_clocks(struct device *dev)
     34{
     35	return dev && dev->power.subsys_data
     36		&& list_empty(&dev->power.subsys_data->clock_list);
     37}
     38
     39extern void pm_clk_init(struct device *dev);
     40extern int pm_clk_create(struct device *dev);
     41extern void pm_clk_destroy(struct device *dev);
     42extern int pm_clk_add(struct device *dev, const char *con_id);
     43extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
     44extern int of_pm_clk_add_clk(struct device *dev, const char *name);
     45extern int of_pm_clk_add_clks(struct device *dev);
     46extern void pm_clk_remove(struct device *dev, const char *con_id);
     47extern void pm_clk_remove_clk(struct device *dev, struct clk *clk);
     48extern int pm_clk_suspend(struct device *dev);
     49extern int pm_clk_resume(struct device *dev);
     50extern int devm_pm_clk_create(struct device *dev);
     51#else
     52static inline bool pm_clk_no_clocks(struct device *dev)
     53{
     54	return true;
     55}
     56static inline void pm_clk_init(struct device *dev)
     57{
     58}
     59static inline int pm_clk_create(struct device *dev)
     60{
     61	return -EINVAL;
     62}
     63static inline void pm_clk_destroy(struct device *dev)
     64{
     65}
     66static inline int pm_clk_add(struct device *dev, const char *con_id)
     67{
     68	return -EINVAL;
     69}
     70
     71static inline int pm_clk_add_clk(struct device *dev, struct clk *clk)
     72{
     73	return -EINVAL;
     74}
     75static inline int of_pm_clk_add_clks(struct device *dev)
     76{
     77	return -EINVAL;
     78}
     79static inline void pm_clk_remove(struct device *dev, const char *con_id)
     80{
     81}
     82#define pm_clk_suspend	NULL
     83#define pm_clk_resume	NULL
     84static inline void pm_clk_remove_clk(struct device *dev, struct clk *clk)
     85{
     86}
     87static inline int devm_pm_clk_create(struct device *dev)
     88{
     89	return -EINVAL;
     90}
     91#endif
     92
     93#ifdef CONFIG_HAVE_CLK
     94extern void pm_clk_add_notifier(struct bus_type *bus,
     95					struct pm_clk_notifier_block *clknb);
     96#else
     97static inline void pm_clk_add_notifier(struct bus_type *bus,
     98					struct pm_clk_notifier_block *clknb)
     99{
    100}
    101#endif
    102
    103#endif