/** * ssp_common_buffer_postenable() - generic postenable callback for ssp buffer * * @indio_dev: iio device * * Returns 0 or negative value in case of error
*/ int ssp_common_buffer_postenable(struct iio_dev *indio_dev)
{ struct ssp_sensor_data *spd = iio_priv(indio_dev); struct ssp_data *data = dev_get_drvdata(indio_dev->dev.parent->parent);
/* the allocation is made in post because scan size is known in this * moment
* */
spd->buffer = kmalloc(indio_dev->scan_bytes, GFP_KERNEL | GFP_DMA); if (!spd->buffer) return -ENOMEM;
/** * ssp_common_process_data() - Common process data callback for ssp sensors * * @indio_dev: iio device * @buf: source buffer * @len: sensor data length * @timestamp: system timestamp * * Returns 0 or negative value in case of error
*/ int ssp_common_process_data(struct iio_dev *indio_dev, void *buf, unsignedint len, int64_t timestamp)
{
int64_t calculated_time; struct ssp_sensor_data *spd = iio_priv(indio_dev);
if (indio_dev->scan_bytes == 0) return 0;
/* * it always sends full set of samples, remember about available masks
*/
memcpy(spd->buffer, buf, len);
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.