Lines Matching full:sdb
33 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_update_data_size() local
37 sdb->buf_hw_base; in smb_update_data_size()
40 if (buf_wrptr == sdb->buf_rdptr && smb_buffer_not_empty(drvdata)) { in smb_update_data_size()
41 sdb->data_size = sdb->buf_size; in smb_update_data_size()
46 sdb->data_size = CIRC_CNT(buf_wrptr, sdb->buf_rdptr, in smb_update_data_size()
47 sdb->buf_size); in smb_update_data_size()
57 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_update_read_ptr() local
59 sdb->buf_rdptr += nbytes; in smb_update_read_ptr()
60 sdb->buf_rdptr %= sdb->buf_size; in smb_update_read_ptr()
61 writel(sdb->buf_hw_base + sdb->buf_rdptr, in smb_update_read_ptr()
64 sdb->data_size -= nbytes; in smb_update_read_ptr()
69 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_reset_buffer() local
85 if (!write_ptr || write_ptr == sdb->buf_rdptr + sdb->buf_hw_base) in smb_reset_buffer()
93 sdb->buf_rdptr = write_ptr - sdb->buf_hw_base; in smb_reset_buffer()
120 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_read() local
127 if (!sdb->data_size) in smb_read()
130 to_copy = min(sdb->data_size, len); in smb_read()
133 if (sdb->buf_rdptr + to_copy > sdb->buf_size) in smb_read()
134 to_copy = sdb->buf_size - sdb->buf_rdptr; in smb_read()
136 if (copy_to_user(data, sdb->buf_base + sdb->buf_rdptr, to_copy)) { in smb_read()
143 if (!sdb->data_size) in smb_read()
173 return sysfs_emit(buf, "0x%lx\n", drvdata->sdb.buf_size); in buf_size_show()
336 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_sync_perf_buffer() local
344 while (sdb->data_size) { in smb_sync_perf_buffer()
347 to_copy = min(sdb->data_size, pg_space); in smb_sync_perf_buffer()
350 if (sdb->buf_rdptr + to_copy > sdb->buf_size) in smb_sync_perf_buffer()
351 to_copy = sdb->buf_size - sdb->buf_rdptr; in smb_sync_perf_buffer()
354 sdb->buf_base + sdb->buf_rdptr, to_copy); in smb_sync_perf_buffer()
373 struct smb_data_buffer *sdb = &drvdata->sdb; in smb_update_buffer() local
395 if (sdb->data_size > handle->size) { in smb_update_buffer()
396 smb_update_read_ptr(drvdata, sdb->data_size - handle->size); in smb_update_buffer()
400 data_size = sdb->data_size; in smb_update_buffer()
421 struct smb_data_buffer *sdb) in smb_init_data_buffer() argument
432 sdb->buf_rdptr = 0; in smb_init_data_buffer()
433 sdb->buf_hw_base = FIELD_GET(SMB_BUF_ADDR_LO_MSK, res->start); in smb_init_data_buffer()
434 sdb->buf_size = resource_size(res); in smb_init_data_buffer()
435 if (sdb->buf_size == 0) in smb_init_data_buffer()
442 base = devm_memremap(&pdev->dev, sdb->buf_hw_base, sdb->buf_size, in smb_init_data_buffer()
447 sdb->buf_base = base; in smb_init_data_buffer()
554 ret = smb_init_data_buffer(pdev, &drvdata->sdb); in smb_probe()