Linux Audio

Check our new training course

Loading...
Note: File does not exist in v4.17.
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 4 * Copyright (C) 2018-2020 Linaro Ltd.
 5 */
 6#ifndef _IPA_CLOCK_H_
 7#define _IPA_CLOCK_H_
 8
 9struct device;
10
11struct ipa;
12struct ipa_clock_data;
13
14/**
15 * ipa_clock_rate() - Return the current IPA core clock rate
16 * @ipa:	IPA structure
17 *
18 * Return: The current clock rate (in Hz), or 0.
19 */
20u32 ipa_clock_rate(struct ipa *ipa);
21
22/**
23 * ipa_clock_init() - Initialize IPA clocking
24 * @dev:	IPA device
25 * @data:	Clock configuration data
26 *
27 * Return:	A pointer to an ipa_clock structure, or a pointer-coded error
28 */
29struct ipa_clock *ipa_clock_init(struct device *dev,
30				 const struct ipa_clock_data *data);
31
32/**
33 * ipa_clock_exit() - Inverse of ipa_clock_init()
34 * @clock:	IPA clock pointer
35 */
36void ipa_clock_exit(struct ipa_clock *clock);
37
38/**
39 * ipa_clock_get() - Get an IPA clock reference
40 * @ipa:	IPA pointer
41 *
42 * This call blocks if this is the first reference.
43 */
44void ipa_clock_get(struct ipa *ipa);
45
46/**
47 * ipa_clock_get_additional() - Get an IPA clock reference if not first
48 * @ipa:	IPA pointer
49 *
50 * This returns immediately, and only takes a reference if not the first
51 */
52bool ipa_clock_get_additional(struct ipa *ipa);
53
54/**
55 * ipa_clock_put() - Drop an IPA clock reference
56 * @ipa:	IPA pointer
57 *
58 * This drops a clock reference.  If the last reference is being dropped,
59 * the clock is stopped and RX endpoints are suspended.  This call will
60 * not block unless the last reference is dropped.
61 */
62void ipa_clock_put(struct ipa *ipa);
63
64#endif /* _IPA_CLOCK_H_ */