forked from luck/tmp_suning_uos_patched
soc: ti: K2G: provide APIs to support driver probe deferral
This patch provide APIs to allow client drivers to support probe deferral. On K2G SoC, devices can be probed only after the ti_sci_pm_domains driver is probed and ready. As drivers may get probed at different order, any driver that depends on knav dma and qmss drivers, for example netcp network driver, needs to defer probe until knav devices are probed and ready to service. To do this, add an API to query the device ready status from the knav dma and qmss devices. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
350601b4f7
commit
a2dd6877b4
|
@ -134,6 +134,13 @@ struct knav_dma_chan {
|
|||
|
||||
static struct knav_dma_pool_device *kdev;
|
||||
|
||||
static bool device_ready;
|
||||
bool knav_dma_device_ready(void)
|
||||
{
|
||||
return device_ready;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(knav_dma_device_ready);
|
||||
|
||||
static bool check_config(struct knav_dma_chan *chan, struct knav_dma_cfg *cfg)
|
||||
{
|
||||
if (!memcmp(&chan->cfg, cfg, sizeof(*cfg)))
|
||||
|
@ -773,6 +780,7 @@ static int knav_dma_probe(struct platform_device *pdev)
|
|||
debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
|
||||
&knav_dma_debug_ops);
|
||||
|
||||
device_ready = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,13 @@ static DEFINE_MUTEX(knav_dev_lock);
|
|||
*/
|
||||
const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin"};
|
||||
|
||||
static bool device_ready;
|
||||
bool knav_qmss_device_ready(void)
|
||||
{
|
||||
return device_ready;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(knav_qmss_device_ready);
|
||||
|
||||
/**
|
||||
* knav_queue_notify: qmss queue notfier call
|
||||
*
|
||||
|
@ -1849,6 +1856,7 @@ static int knav_queue_probe(struct platform_device *pdev)
|
|||
|
||||
debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
|
||||
&knav_queue_debug_ops);
|
||||
device_ready = true;
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
|
|
@ -167,6 +167,8 @@ struct knav_dma_desc {
|
|||
void *knav_dma_open_channel(struct device *dev, const char *name,
|
||||
struct knav_dma_cfg *config);
|
||||
void knav_dma_close_channel(void *channel);
|
||||
int knav_dma_get_flow(void *channel);
|
||||
bool knav_dma_device_ready(void);
|
||||
#else
|
||||
static inline void *knav_dma_open_channel(struct device *dev, const char *name,
|
||||
struct knav_dma_cfg *config)
|
||||
|
@ -176,6 +178,16 @@ static inline void *knav_dma_open_channel(struct device *dev, const char *name,
|
|||
static inline void knav_dma_close_channel(void *channel)
|
||||
{}
|
||||
|
||||
static inline int knav_dma_get_flow(void *channel)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline bool knav_dma_device_ready(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __SOC_TI_KEYSTONE_NAVIGATOR_DMA_H__ */
|
||||
|
|
|
@ -86,5 +86,6 @@ int knav_pool_desc_map(void *ph, void *desc, unsigned size,
|
|||
void *knav_pool_desc_unmap(void *ph, dma_addr_t dma, unsigned dma_sz);
|
||||
dma_addr_t knav_pool_desc_virt_to_dma(void *ph, void *virt);
|
||||
void *knav_pool_desc_dma_to_virt(void *ph, dma_addr_t dma);
|
||||
bool knav_qmss_device_ready(void);
|
||||
|
||||
#endif /* __SOC_TI_KNAV_QMSS_H__ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user