diff options
Diffstat (limited to 'drivers/media/platform/omap3isp/ispstat.c')
-rw-r--r-- | drivers/media/platform/omap3isp/ispstat.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c index 47cbc7e3d825..47353fee26c3 100644 --- a/drivers/media/platform/omap3isp/ispstat.c +++ b/drivers/media/platform/omap3isp/ispstat.c @@ -17,6 +17,7 @@ #include <linux/dma-mapping.h> #include <linux/slab.h> +#include <linux/timekeeping.h> #include <linux/uaccess.h> #include "isp.h" @@ -237,7 +238,7 @@ static int isp_stat_buf_queue(struct ispstat *stat) if (!stat->active_buf) return STAT_NO_BUF; - v4l2_get_timestamp(&stat->active_buf->ts); + ktime_get_ts64(&stat->active_buf->ts); stat->active_buf->buf_size = stat->buf_size; if (isp_stat_buf_check_magic(stat, stat->active_buf)) { @@ -370,7 +371,7 @@ static int isp_stat_bufs_alloc_one(struct device *dev, int ret; buf->virt_addr = dma_alloc_coherent(dev, size, &buf->dma_addr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!buf->virt_addr) return -ENOMEM; @@ -449,10 +450,8 @@ static int isp_stat_bufs_alloc(struct ispstat *stat, u32 size) buf->empty = 1; dev_dbg(stat->isp->dev, - "%s: buffer[%u] allocated. dma=0x%08lx virt=0x%08lx", - stat->subdev.name, i, - (unsigned long)buf->dma_addr, - (unsigned long)buf->virt_addr); + "%s: buffer[%u] allocated. dma=%pad virt=%p", + stat->subdev.name, i, &buf->dma_addr, buf->virt_addr); } return 0; @@ -500,7 +499,8 @@ int omap3isp_stat_request_statistics(struct ispstat *stat, return PTR_ERR(buf); } - data->ts = buf->ts; + data->ts.tv_sec = buf->ts.tv_sec; + data->ts.tv_usec = buf->ts.tv_nsec / NSEC_PER_USEC; data->config_counter = buf->config_counter; data->frame_number = buf->frame_number; data->buf_size = buf->buf_size; @@ -512,6 +512,23 @@ int omap3isp_stat_request_statistics(struct ispstat *stat, return 0; } +int omap3isp_stat_request_statistics_time32(struct ispstat *stat, + struct omap3isp_stat_data_time32 *data) +{ + struct omap3isp_stat_data data64; + int ret; + + ret = omap3isp_stat_request_statistics(stat, &data64); + if (ret) + return ret; + + data->ts.tv_sec = data64.ts.tv_sec; + data->ts.tv_usec = data64.ts.tv_usec; + memcpy(&data->buf, &data64.buf, sizeof(*data) - sizeof(data->ts)); + + return 0; +} + /* * omap3isp_stat_config - Receives new statistic engine configuration. * @new_conf: Pointer to config structure. @@ -527,12 +544,6 @@ int omap3isp_stat_config(struct ispstat *stat, void *new_conf) struct ispstat_generic_config *user_cfg = new_conf; u32 buf_size = user_cfg->buf_size; - if (!new_conf) { - dev_dbg(stat->isp->dev, "%s: configuration is NULL\n", - stat->subdev.name); - return -EINVAL; - } - mutex_lock(&stat->ioctl_lock); dev_dbg(stat->isp->dev, |