2020-03-05 21:28:19 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
|
|
|
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
|
net: ipa: include some standard header files
Some IPA header files use types defined in <linux/types.h>, but do
not include that file:
- In "ipa_mem.h", the ipa_mem structure has u16 and u32 fields
- In "ipa_power.h", ipa_power_retention() takes a bool argument,
and ipa_core_clock_rate() returns u32
- In "ipa_version.h", ipa_version_supported() returns bool
Include it in these files to satisfy their dependencies.
The ipa_qmi structure (defined in "ipa_qmi.h") contains a work
structure, so include <linux/workqueue.h> in there.
All of the data and register definition files, as well as "reg.h",
use the ARRAY_SIZE() macro. Include <linux/array_size.h> everywhere
it's used.
Similarly, all register definition files (and a few others) use the
GENMASK() macro, so include <linux/bits.h> to ensure it's defined
where used. BIT() becomes available by including this file also.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-04-16 16:10:12 -07:00
|
|
|
* Copyright (C) 2018-2024 Linaro Ltd.
|
2020-03-05 21:28:19 -07:00
|
|
|
*/
|
2021-08-20 09:01:29 -07:00
|
|
|
#ifndef _IPA_POWER_H_
|
|
|
|
#define _IPA_POWER_H_
|
2020-03-05 21:28:19 -07:00
|
|
|
|
net: ipa: include some standard header files
Some IPA header files use types defined in <linux/types.h>, but do
not include that file:
- In "ipa_mem.h", the ipa_mem structure has u16 and u32 fields
- In "ipa_power.h", ipa_power_retention() takes a bool argument,
and ipa_core_clock_rate() returns u32
- In "ipa_version.h", ipa_version_supported() returns bool
Include it in these files to satisfy their dependencies.
The ipa_qmi structure (defined in "ipa_qmi.h") contains a work
structure, so include <linux/workqueue.h> in there.
All of the data and register definition files, as well as "reg.h",
use the ARRAY_SIZE() macro. Include <linux/array_size.h> everywhere
it's used.
Similarly, all register definition files (and a few others) use the
GENMASK() macro, so include <linux/bits.h> to ensure it's defined
where used. BIT() becomes available by including this file also.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-04-16 16:10:12 -07:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2020-03-05 21:28:19 -07:00
|
|
|
struct device;
|
|
|
|
|
|
|
|
struct ipa;
|
2021-08-20 09:01:28 -07:00
|
|
|
struct ipa_power_data;
|
2020-03-05 21:28:19 -07:00
|
|
|
|
2021-08-04 08:36:24 -07:00
|
|
|
/* IPA device power management function block */
|
|
|
|
extern const struct dev_pm_ops ipa_pm_ops;
|
|
|
|
|
2020-07-03 14:23:34 -07:00
|
|
|
/**
|
2021-08-20 09:01:28 -07:00
|
|
|
* ipa_core_clock_rate() - Return the current IPA core clock rate
|
2020-07-03 14:23:34 -07:00
|
|
|
* @ipa: IPA structure
|
|
|
|
*
|
|
|
|
* Return: The current clock rate (in Hz), or 0.
|
|
|
|
*/
|
2021-08-20 09:01:28 -07:00
|
|
|
u32 ipa_core_clock_rate(struct ipa *ipa);
|
2020-07-03 14:23:34 -07:00
|
|
|
|
2022-02-01 08:02:05 -07:00
|
|
|
/**
|
|
|
|
* ipa_power_retention() - Control register retention on power collapse
|
|
|
|
* @ipa: IPA pointer
|
|
|
|
* @enable: Whether retention should be enabled or disabled
|
|
|
|
*/
|
|
|
|
void ipa_power_retention(struct ipa *ipa, bool enable);
|
|
|
|
|
2020-03-05 21:28:19 -07:00
|
|
|
/**
|
2021-08-20 09:01:28 -07:00
|
|
|
* ipa_power_init() - Initialize IPA power management
|
2020-03-05 21:28:19 -07:00
|
|
|
* @dev: IPA device
|
2020-11-19 15:40:39 -07:00
|
|
|
* @data: Clock configuration data
|
2020-03-05 21:28:19 -07:00
|
|
|
*
|
2021-08-20 09:01:28 -07:00
|
|
|
* Return: A pointer to an ipa_power structure, or a pointer-coded error
|
2020-03-05 21:28:19 -07:00
|
|
|
*/
|
2021-08-20 09:01:28 -07:00
|
|
|
struct ipa_power *ipa_power_init(struct device *dev,
|
|
|
|
const struct ipa_power_data *data);
|
2020-03-05 21:28:19 -07:00
|
|
|
|
|
|
|
/**
|
2021-08-20 09:01:28 -07:00
|
|
|
* ipa_power_exit() - Inverse of ipa_power_init()
|
|
|
|
* @power: IPA power pointer
|
2020-03-05 21:28:19 -07:00
|
|
|
*/
|
2021-08-20 09:01:28 -07:00
|
|
|
void ipa_power_exit(struct ipa_power *power);
|
2020-03-05 21:28:19 -07:00
|
|
|
|
2021-08-20 09:01:29 -07:00
|
|
|
#endif /* _IPA_POWER_H_ */
|