#define SHIM_PSI_CFG0_DST_TAG GENMASK(31, 16)
#define TI_CSI2RX_MAX_PIX_PER_CLK 4
-#define PSIL_WORD_SIZE_BYTES 16
/*
* There are no hard limits on the width or height. The DMA engine can handle
* all sizes. The max width and height are arbitrary numbers for this driver.
struct v4l2_format *v4l2_fmt)
{
struct v4l2_pix_format *pix = &v4l2_fmt->fmt.pix;
- unsigned int pixels_in_word;
-
- pixels_in_word = PSIL_WORD_SIZE_BYTES * 8 / csi_fmt->bpp;
/* Clamp width and height to sensible maximums (16K x 16K) */
pix->width = clamp_t(unsigned int, pix->width,
- pixels_in_word,
- MAX_WIDTH_BYTES * 8 / csi_fmt->bpp);
+ 1, MAX_WIDTH_BYTES * 8 / csi_fmt->bpp);
pix->height = clamp_t(unsigned int, pix->height, 1, MAX_HEIGHT_LINES);
- /* Width should be a multiple of transfer word-size */
- pix->width = rounddown(pix->width, pixels_in_word);
-
v4l2_fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
pix->pixelformat = csi_fmt->fourcc;
pix->bytesperline = pix->width * (csi_fmt->bpp / 8);
struct v4l2_frmsizeenum *fsize)
{
const struct ti_csi2rx_fmt *fmt;
- unsigned int pixels_in_word;
fmt = find_format_by_fourcc(fsize->pixel_format);
if (!fmt || fsize->index != 0)
return -EINVAL;
- /*
- * Number of pixels in one PSI-L word. The transfer happens in multiples
- * of PSI-L word sizes.
- */
- pixels_in_word = PSIL_WORD_SIZE_BYTES * 8 / fmt->bpp;
-
fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
- fsize->stepwise.min_width = pixels_in_word;
- fsize->stepwise.max_width = rounddown(MAX_WIDTH_BYTES * 8 / fmt->bpp,
- pixels_in_word);
- fsize->stepwise.step_width = pixels_in_word;
+ fsize->stepwise.min_width = 1;
+ fsize->stepwise.max_width = MAX_WIDTH_BYTES * 8 / fmt->bpp;
+ fsize->stepwise.step_width = 1;
fsize->stepwise.min_height = 1;
fsize->stepwise.max_height = MAX_HEIGHT_LINES;
fsize->stepwise.step_height = 1;