Linux 4.16.11
[linux/fpc-iii.git] / drivers / soundwire / cadence_master.h
blobbeaf6c9804eb9269b366765ffea9bcf16e48d9c2
1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2 // Copyright(c) 2015-17 Intel Corporation.
4 #ifndef __SDW_CADENCE_H
5 #define __SDW_CADENCE_H
7 /**
8 * struct sdw_cdns - Cadence driver context
9 * @dev: Linux device
10 * @bus: Bus handle
11 * @instance: instance number
12 * @response_buf: SoundWire response buffer
13 * @tx_complete: Tx completion
14 * @defer: Defer pointer
15 * @registers: Cadence registers
16 * @link_up: Link status
17 * @msg_count: Messages sent on bus
19 struct sdw_cdns {
20 struct device *dev;
21 struct sdw_bus bus;
22 unsigned int instance;
24 u32 response_buf[0x80];
25 struct completion tx_complete;
26 struct sdw_defer *defer;
28 void __iomem *registers;
30 bool link_up;
31 unsigned int msg_count;
34 #define bus_to_cdns(_bus) container_of(_bus, struct sdw_cdns, bus)
36 /* Exported symbols */
38 int sdw_cdns_probe(struct sdw_cdns *cdns);
39 extern struct sdw_master_ops sdw_cdns_master_ops;
41 irqreturn_t sdw_cdns_irq(int irq, void *dev_id);
42 irqreturn_t sdw_cdns_thread(int irq, void *dev_id);
44 int sdw_cdns_init(struct sdw_cdns *cdns);
45 int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns);
48 #endif /* __SDW_CADENCE_H */