/* Find the best match for a requested image capture size. The best match is chosen as the nearest match that has the same number or fewer pixels as the requested size, or the smallest image size if the requested size has fewer pixels than the smallest image.  */
static enum image_size tcm825x_find_size(struct v4l2_int_device *s, unsigned int width, unsigned int height)
/* Find the best match for a requested image capture size. The best match is chosen as the nearest match that has the same number or fewer pixels as the requested size, or the smallest image size if the requested size has fewer pixels than the smallest image.  */
static enum image_size tcm825x_find_size(struct v4l2_int_device *s, unsigned int width, unsigned int height)
{
	enum image_size isize;
	unsigned long pixels = width * height;
	struct tcm825x_sensor *sensor = s->priv;
	for (isize = subQCIF; isize < VGA; isize++) {
		if (tcm825x_sizes[isize + 1].height
		    * tcm825x_sizes[isize + 1].width > pixels) {
			dev_dbg(&sensor->i2c_client->dev, "size %d\n", isize);
			return isize;
		}
	}
	dev_dbg(&sensor->i2c_client->dev, "format default VGA\n");
	return VGA;
}