int buff_sample_pos; /* sample position of ALSA buffer */
int period_samples; /* sample number / 1 period */
int period_pos; /* current period position */
+ int sample_width; /* sample width */
int uerr_num;
int oerr_num;
io->buff_sample_pos = 0;
io->period_samples = fsi_frame2sample(fsi, runtime->period_size);
io->period_pos = 0;
+ io->sample_width = samples_to_bytes(runtime, 1);
io->oerr_num = -1; /* ignore 1st err */
io->uerr_num = -1; /* ignore 1st err */
spin_unlock_irqrestore(&master->lock, flags);
io->buff_sample_pos = 0;
io->period_samples = 0;
io->period_pos = 0;
+ io->sample_width = 0;
io->oerr_num = 0;
io->uerr_num = 0;
spin_unlock_irqrestore(&master->lock, flags);
int is_play = fsi_stream_is_play(stream);
struct fsi_stream *io = fsi_get_stream(fsi, is_play);
int sample_residues;
- int sample_width;
int samples;
int samples_max;
int over_period;
io->buff_sample_pos = 0;
}
- /* get 1 sample data width */
- sample_width = samples_to_bytes(runtime, 1);
-
/* get number of residue samples */
sample_residues = io->buff_sample_capa - io->buff_sample_pos;
samples = sample_residues;
- switch (sample_width) {
+ switch (io->sample_width) {
case 2:
fn = fsi_dma_soft_push16;
break;
samples_max = sample_residues;
samples = fsi_get_current_fifo_samples(fsi, is_play);
- switch (sample_width) {
+ switch (io->sample_width) {
case 2:
fn = fsi_dma_soft_pop16;
break;
return 0;
}
-static int fsi_runtime_nop(struct device *dev)
-{
- /* Runtime PM callback shared between ->runtime_suspend()
- * and ->runtime_resume(). Simply returns success.
- *
- * This driver re-initializes all registers after
- * pm_runtime_get_sync() anyway so there is no need
- * to save and restore registers here.
- */
- return 0;
-}
-
static struct dev_pm_ops fsi_pm_ops = {
.suspend = fsi_suspend,
.resume = fsi_resume,
- .runtime_suspend = fsi_runtime_nop,
- .runtime_resume = fsi_runtime_nop,
};
static struct fsi_core fsi1_core = {