Lines Matching +full:timeout +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-only
13 #include <linux/io-64-nonatomic-lo-hi.h>
16 #include "sst-dsp.h"
17 #include "sst-dsp-priv.h"
20 #include <trace/events/intel-sst.h>
22 /* Internal generic low-level SST IO functions - can be overidden */
52 spin_lock_irqsave(&sst->spinlock, flags); in sst_dsp_shim_write()
53 sst->ops->write(sst->addr.shim, offset, value); in sst_dsp_shim_write()
54 spin_unlock_irqrestore(&sst->spinlock, flags); in sst_dsp_shim_write()
63 spin_lock_irqsave(&sst->spinlock, flags); in sst_dsp_shim_read()
64 val = sst->ops->read(sst->addr.shim, offset); in sst_dsp_shim_read()
65 spin_unlock_irqrestore(&sst->spinlock, flags); in sst_dsp_shim_read()
73 sst->ops->write(sst->addr.shim, offset, value); in sst_dsp_shim_write_unlocked()
79 return sst->ops->read(sst->addr.shim, offset); in sst_dsp_shim_read_unlocked()
125 spin_lock_irqsave(&sst->spinlock, flags); in sst_dsp_shim_update_bits()
127 spin_unlock_irqrestore(&sst->spinlock, flags); in sst_dsp_shim_update_bits()
138 spin_lock_irqsave(&sst->spinlock, flags); in sst_dsp_shim_update_bits_forced()
140 spin_unlock_irqrestore(&sst->spinlock, flags); in sst_dsp_shim_update_bits_forced()
148 unsigned long timeout; in sst_dsp_register_poll() local
154 * Phase 1(first 5ms): min sleep 0.5ms; max sleep 1ms. in sst_dsp_register_poll()
155 * Phase 2:( 5ms to 10ms) : min sleep 0.5ms; max sleep 10ms in sst_dsp_register_poll()
158 * Phase 3: (beyond 10 ms) min sleep 5ms; max sleep 10ms. in sst_dsp_register_poll()
161 timeout = jiffies + msecs_to_jiffies(time); in sst_dsp_register_poll()
163 && time_before(jiffies, timeout)) { in sst_dsp_register_poll()
172 dev_dbg(ctx->dev, "FW Poll Status: reg=%#x %s successful\n", in sst_dsp_register_poll()
178 dev_dbg(ctx->dev, "FW Poll Status: reg=%#x %s timedout\n", in sst_dsp_register_poll()
180 return -ETIME; in sst_dsp_register_poll()
187 sst->mailbox.in_base = sst->addr.lpe + inbox_offset; in sst_dsp_mailbox_init()
188 sst->mailbox.out_base = sst->addr.lpe + outbox_offset; in sst_dsp_mailbox_init()
189 sst->mailbox.in_size = inbox_size; in sst_dsp_mailbox_init()
190 sst->mailbox.out_size = outbox_size; in sst_dsp_mailbox_init()
201 memcpy_toio(sst->mailbox.out_base, message, bytes); in sst_dsp_outbox_write()
214 memcpy_fromio(message, sst->mailbox.out_base, bytes); in sst_dsp_outbox_read()
227 memcpy_toio(sst->mailbox.in_base, message, bytes); in sst_dsp_inbox_write()
240 memcpy_fromio(message, sst->mailbox.in_base, bytes); in sst_dsp_inbox_read()