2019-05-01 18:57:25 +03:00
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/* Copyright(c) 2015-17 Intel Corporation. */
2017-12-14 08:49:43 +03:00
# ifndef __SDW_INTEL_LOCAL_H
# define __SDW_INTEL_LOCAL_H
/**
2019-12-12 04:45:01 +03:00
* struct sdw_intel_link_res - Soundwire Intel link resource structure ,
* typically populated by the controller driver .
* @ mmio_base : mmio base of SoundWire registers
2017-12-14 08:49:43 +03:00
* @ registers : Link IO registers base
* @ shim : Audio shim pointer
* @ alh : ALH ( Audio Link Hub ) pointer
* @ irq : Interrupt line
2018-04-26 16:09:05 +03:00
* @ ops : Shim callback ops
2019-12-12 04:45:02 +03:00
* @ dev : device implementing hw_params and free callbacks
2020-07-16 18:09:40 +03:00
* @ shim_lock : mutex to handle access to shared SHIM registers
* @ shim_mask : global pointer to check SHIM register initialization
2020-08-17 18:29:18 +03:00
* @ clock_stop_quirks : mask defining requested behavior on pm_suspend
2020-09-01 18:05:55 +03:00
* @ link_mask : global mask needed for power - up / down sequences
2020-07-16 18:09:45 +03:00
* @ cdns : Cadence master descriptor
* @ list : used to walk - through all masters exposed by the same controller
2017-12-14 08:49:43 +03:00
*/
struct sdw_intel_link_res {
2019-12-12 04:45:01 +03:00
void __iomem * mmio_base ; /* not strictly needed, useful for debug */
2017-12-14 08:49:43 +03:00
void __iomem * registers ;
void __iomem * shim ;
void __iomem * alh ;
int irq ;
2018-04-26 16:09:05 +03:00
const struct sdw_intel_ops * ops ;
2019-12-12 04:45:02 +03:00
struct device * dev ;
2020-07-16 18:09:40 +03:00
struct mutex * shim_lock ; /* protect shared registers */
u32 * shim_mask ;
2020-08-17 18:29:18 +03:00
u32 clock_stop_quirks ;
2020-09-01 18:05:55 +03:00
u32 link_mask ;
2020-07-16 18:09:45 +03:00
struct sdw_cdns * cdns ;
struct list_head list ;
2017-12-14 08:49:43 +03:00
} ;
2020-05-31 21:20:57 +03:00
struct sdw_intel {
struct sdw_cdns cdns ;
int instance ;
struct sdw_intel_link_res * link_res ;
2021-08-18 05:49:53 +03:00
bool startup_done ;
2020-05-31 21:20:57 +03:00
# ifdef CONFIG_DEBUG_FS
struct dentry * debugfs ;
# endif
} ;
2021-05-11 08:21:32 +03:00
int intel_link_startup ( struct auxiliary_device * auxdev ) ;
int intel_link_process_wakeen_event ( struct auxiliary_device * auxdev ) ;
struct sdw_intel_link_dev {
struct auxiliary_device auxdev ;
struct sdw_intel_link_res link_res ;
} ;
# define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \
container_of ( auxiliary_dev , struct sdw_intel_link_dev , auxdev )
2020-05-31 21:21:02 +03:00
2017-12-14 08:49:43 +03:00
# endif /* __SDW_INTEL_LOCAL_H */