All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [Trivial] staging: go7007: Framesizes features
@ 2012-04-21 13:04 my84
  2012-04-21 13:49 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: my84 @ 2012-04-21 13:04 UTC (permalink / raw)
  To: my84
  Cc: linux-kernel, devel, linux-media, justinmattock, dhowells,
	gregkh, mchehab


Correct framesizes

Signed-off-by Volokh Konstantin <my84@bk.ru>
---
 drivers/staging/media/go7007/go7007-v4l2.c |   79 +++++++++++++++++++++++++++-
 1 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 3ef4cd8..4759441 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1065,10 +1065,85 @@ static int vidioc_enum_framesizes(struct file *filp, void *priv,
 	struct go7007 *go = ((struct go7007_file *) priv)->go;
 
 	/* Return -EINVAL, if it is a TV board */
-	if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) ||
-	    (go->board_info->sensor_flags & GO7007_SENSOR_TV))
+	if (go->board_info->flags & GO7007_BOARD_HAS_TUNER)
 		return -EINVAL;
 
+	if (go->board_info->sensor_flags & GO7007_SENSOR_TV) {
+		switch (go->standard) {
+		case GO7007_STD_NTSC:
+			switch (fsize->pixel_format) {
+			case V4L2_PIX_FMT_MJPEG:
+			case V4L2_PIX_FMT_MPEG:
+			case V4L2_PIX_FMT_H263:
+				switch (fsize->index) {
+				case 0:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 720;
+					fsize->discrete.height = 480;
+					break;
+				case 1:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 640;
+					fsize->discrete.height = 480;
+					break;
+				case 2:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 352;
+					fsize->discrete.height = 240;
+					break;
+				case 3:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 320;
+					fsize->discrete.height = 240;
+					break;
+				case 4:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 176;
+					fsize->discrete.height = 112;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			default:
+				return -EINVAL;
+			}
+			break;
+		case GO7007_STD_PAL:
+			switch (fsize->pixel_format) {
+			case V4L2_PIX_FMT_MJPEG:
+			case V4L2_PIX_FMT_MPEG:
+			case V4L2_PIX_FMT_H263:
+				switch (fsize->index) {
+				case 0:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 720;
+					fsize->discrete.height = 576;
+					break;
+				case 1:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 352;
+					fsize->discrete.height = 288;
+					break;
+				case 2:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 176;
+					fsize->discrete.height = 144;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			default:
+				return -EINVAL;
+			}
+			break;
+		default:
+			return -EINVAL;
+		}
+		return 0;
+	}
+
 	if (fsize->index > 0)
 		return -EINVAL;
 
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [Trivial] staging: go7007: Framesizes features
  2012-04-21 13:04 [PATCH] [Trivial] staging: go7007: Framesizes features my84
@ 2012-04-21 13:49 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2012-04-21 13:49 UTC (permalink / raw)
  To: my84
  Cc: devel, gregkh, linux-kernel, mchehab, dhowells, justinmattock,
	linux-media

On Sat, Apr 21, 2012 at 05:04:03PM +0400, my84@bk.ru wrote:
> 
> Correct framesizes
> 
> Signed-off-by Volokh Konstantin <my84@bk.ru>
>

Looks good.  But could you write a proper changelog?  What is the
effect for the user?  How did you find these numbers?  Have you
tested the changes?  It should mention something about that this
affects boards with GO7007_SENSOR_TV.

Btw, how many boards are their that have a GO7007_SENSOR_TV but
don't have a GO7007_BOARD_HAS_TUNER?  Should the comment be updated?

The changelog says it "Correct framesizes" but it doesn't actually
correct anything, it just adds new features that weren't supported
before.

Don't put [Trivial] in the subject line.  Trivial patches are things
like spelling mistakes in comments.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] [Trivial] staging: go7007: Framesizes features
@ 2012-04-24 15:03 volokh
  0 siblings, 0 replies; 3+ messages in thread
From: volokh @ 2012-04-24 15:03 UTC (permalink / raw)
  To: my84; +Cc: linux-kernel, devel, linux-media

Hi, Can anybody help me to recieve "Video Interface Port VIP2.0"
datasheet for free.

Huge Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-24 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21 13:04 [PATCH] [Trivial] staging: go7007: Framesizes features my84
2012-04-21 13:49 ` Dan Carpenter
2012-04-24 15:03 volokh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.