/* Enable channels we support */
solo_reg_write(solo_dev, SOLO_VI_CH_ENA,
(1 << solo_dev->nr_chans) - 1);
}
staticint solo_dma_vin_region(struct solo_dev *solo_dev, u32 off,
u16 val, int reg_size)
{
__le16 *buf; constint n = 64, size = n * sizeof(*buf); int i, ret = 0;
buf = kmalloc(size, GFP_KERNEL); if (!buf) return -ENOMEM;
for (i = 0; i < n; i++)
buf[i] = cpu_to_le16(val);
for (i = 0; i < reg_size; i += size) {
ret = solo_p2m_dma(solo_dev, 1, buf,
SOLO_MOTION_EXT_ADDR(solo_dev) + off + i,
size, 0, 0);
if (ret) break;
}
kfree(buf); return ret;
}
int solo_set_motion_threshold(struct solo_dev *solo_dev, u8 ch, u16 val)
{ if (ch > solo_dev->nr_chans) return -EINVAL;
int solo_set_motion_block(struct solo_dev *solo_dev, u8 ch, const u16 *thresholds)
{ constunsigned size = sizeof(u16) * 64;
u32 off = SOLO_MOT_FLAG_AREA + ch * SOLO_MOT_THRESH_SIZE * 2;
__le16 *buf; int x, y; int ret = 0;
buf = kzalloc(size, GFP_KERNEL); if (buf == NULL) return -ENOMEM; for (y = 0; y < SOLO_MOTION_SZ; y++) { for (x = 0; x < SOLO_MOTION_SZ; x++)
buf[x] = cpu_to_le16(thresholds[y * SOLO_MOTION_SZ + x]);
ret |= solo_p2m_dma(solo_dev, 1, buf,
SOLO_MOTION_EXT_ADDR(solo_dev) + off + y * size,
size, 0, 0);
}
kfree(buf); return ret;
}
/* First 8k is motion flag (512 bytes * 16). Following that is an 8k+8k *thresholdandworkingtableforeachchannel.Atleastthat'swhatthe *specsays.However,thiscode(takenfromrdk)hassomemystery8k
* block right after the flag area, before the first thresh table. */ staticvoid solo_motion_config(struct solo_dev *solo_dev)
{ int i;
for (i = 0; i < solo_dev->nr_chans; i++) { /* Clear motion flag area */
solo_dma_vin_region(solo_dev, i * SOLO_MOT_FLAG_SIZE, 0x0000,
SOLO_MOT_FLAG_SIZE);
/* Clear working cache table */
solo_dma_vin_region(solo_dev, SOLO_MOT_FLAG_AREA +
(i * SOLO_MOT_THRESH_SIZE * 2) +
SOLO_MOT_THRESH_SIZE, 0x0000,
SOLO_MOT_THRESH_SIZE);
/* Set default threshold table */
solo_set_motion_threshold(solo_dev, i, SOLO_DEF_MOT_THRESH);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.