blob: c9427cb6020b3edcb3f41e6ad482e44c79670c59 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2/* Copyright(c) 2015-17 Intel Corporation. */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00003
4#ifndef __SDW_INTEL_H
5#define __SDW_INTEL_H
6
7/**
8 * struct sdw_intel_ops: Intel audio driver callback ops
9 *
10 * @config_stream: configure the stream with the hw_params
David Brazdil0f672f62019-12-10 10:32:29 +000011 * the first argument containing the context is mandatory
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000012 */
13struct sdw_intel_ops {
14 int (*config_stream)(void *arg, void *substream,
David Brazdil0f672f62019-12-10 10:32:29 +000015 void *dai, void *hw_params, int stream_num);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016};
17
18/**
19 * struct sdw_intel_res - Soundwire Intel resource structure
20 * @mmio_base: mmio base of SoundWire registers
21 * @irq: interrupt number
22 * @handle: ACPI parent handle
23 * @parent: parent device
24 * @ops: callback ops
25 * @arg: callback arg
26 */
27struct sdw_intel_res {
28 void __iomem *mmio_base;
29 int irq;
30 acpi_handle handle;
31 struct device *parent;
32 const struct sdw_intel_ops *ops;
33 void *arg;
34};
35
36void *sdw_intel_init(acpi_handle *parent_handle, struct sdw_intel_res *res);
37void sdw_intel_exit(void *arg);
38
39#endif