linux-stable/drivers/net/ipa/ipa_clock.h
Alex Elder ba764c4dad soc: qcom: ipa: clocking, interrupts, and memory
This patch incorporates three source files (and their headers).  They're
grouped into one patch mainly for the purpose of making the number and
size of patches in this series somewhat reasonable.

  - "ipa_clock.c" and "ipa_clock.h" implement clocking for the IPA device.
    The IPA has a single core clock managed by the common clock framework.
    In addition, the IPA has three buses whose bandwidth is managed by the
    Linux interconnect framework.  At this time the core clock and all
    three buses are either on or off; we don't yet do any more fine-grained
    management than that.  The core clock and interconnects are enabled
    and disabled as a unit, using a unified clock-like abstraction,
    ipa_clock_get()/ipa_clock_put().

  - "ipa_interrupt.c" and "ipa_interrupt.h" implement IPA interrupts.
    There are two hardware IRQs used by the IPA driver (the other is
    the GSI interrupt, described in a separate patch).  Several types
    of interrupt are handled by the IPA IRQ handler; these are not part
    of data/fast path.

  - The IPA has a region of local memory that is accessible by the AP
    (and modem).  Within that region are areas with certain defined
    purposes.  "ipa_mem.c" and "ipa_mem.h" define those regions, and
    implement their initialization.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-08 22:07:09 -07:00

53 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
* Copyright (C) 2018-2020 Linaro Ltd.
*/
#ifndef _IPA_CLOCK_H_
#define _IPA_CLOCK_H_
struct device;
struct ipa;
/**
* ipa_clock_init() - Initialize IPA clocking
* @dev: IPA device
*
* @Return: A pointer to an ipa_clock structure, or a pointer-coded error
*/
struct ipa_clock *ipa_clock_init(struct device *dev);
/**
* ipa_clock_exit() - Inverse of ipa_clock_init()
* @clock: IPA clock pointer
*/
void ipa_clock_exit(struct ipa_clock *clock);
/**
* ipa_clock_get() - Get an IPA clock reference
* @ipa: IPA pointer
*
* This call blocks if this is the first reference.
*/
void ipa_clock_get(struct ipa *ipa);
/**
* ipa_clock_get_additional() - Get an IPA clock reference if not first
* @ipa: IPA pointer
*
* This returns immediately, and only takes a reference if not the first
*/
bool ipa_clock_get_additional(struct ipa *ipa);
/**
* ipa_clock_put() - Drop an IPA clock reference
* @ipa: IPA pointer
*
* This drops a clock reference. If the last reference is being dropped,
* the clock is stopped and RX endpoints are suspended. This call will
* not block unless the last reference is dropped.
*/
void ipa_clock_put(struct ipa *ipa);
#endif /* _IPA_CLOCK_H_ */