1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 2 // Copyright(c) 2015-17 Intel Corporation. 3 4 #ifndef __SDW_CADENCE_H 5 #define __SDW_CADENCE_H 6 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 18 */ 19 struct sdw_cdns { 20 struct device *dev; 21 struct sdw_bus bus; 22 unsigned int instance; 23 24 u32 response_buf[0x80]; 25 struct completion tx_complete; 26 struct sdw_defer *defer; 27 28 void __iomem *registers; 29 30 bool link_up; 31 unsigned int msg_count; 32 }; 33 34 #define bus_to_cdns(_bus) container_of(_bus, struct sdw_cdns, bus) 35 36 /* Exported symbols */ 37 38 int sdw_cdns_probe(struct sdw_cdns *cdns); 39 extern struct sdw_master_ops sdw_cdns_master_ops; 40 41 irqreturn_t sdw_cdns_irq(int irq, void *dev_id); 42 irqreturn_t sdw_cdns_thread(int irq, void *dev_id); 43 44 int sdw_cdns_init(struct sdw_cdns *cdns); 45 int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns); 46 47 48 #endif /* __SDW_CADENCE_H */ 49