Message ID | 1323941987-23428-1-git-send-email-javier.martin@vista-silicon.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1Rb7nB-00064i-P6; Thu, 15 Dec 2011 10:40:01 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1Rb7nA-0005Dv-Ca; Thu, 15 Dec 2011 10:39:57 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756149Ab1LOJjy (ORCPT <rfc822;hunold@linuxtv.org> + 4 others); Thu, 15 Dec 2011 04:39:54 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:57613 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990Ab1LOJjx (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 15 Dec 2011 04:39:53 -0500 Received: by wgbdr13 with SMTP id dr13so3732677wgb.1 for <linux-media@vger.kernel.org>; Thu, 15 Dec 2011 01:39:52 -0800 (PST) Received: by 10.216.138.210 with SMTP id a60mr826771wej.32.1323941992043; Thu, 15 Dec 2011 01:39:52 -0800 (PST) Received: from localhost.localdomain (128.50.18.95.dynamic.jazztel.es. [95.18.50.128]) by mx.google.com with ESMTPS id dw6sm7453155wib.12.2011.12.15.01.39.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 01:39:51 -0800 (PST) From: Javier Martin <javier.martin@vista-silicon.com> To: linux-media@vger.kernel.org Cc: mchehab@infradead.org, hverkuil@xs4all.nl, Javier Martin <javier.martin@vista-silicon.com> Subject: [PATCH 1/2] media: tvp5150 Fix default input selection. Date: Thu, 15 Dec 2011 10:39:46 +0100 Message-Id: <1323941987-23428-1-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.15.92714 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_900_999 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham |
Commit Message
Javier Martin
Dec. 15, 2011, 9:39 a.m. UTC
In page 23 of the datasheet of this chip (SLES098A)
it is stated that de default input for this chip
is Composite AIP1A which is the same as COMPOSITE0
in the driver.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
drivers/media/video/tvp5150.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Comments
On 15-12-2011 07:39, Javier Martin wrote: > In page 23 of the datasheet of this chip (SLES098A) > it is stated that de default input for this chip > is Composite AIP1A which is the same as COMPOSITE0 > in the driver. > > Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> > --- > drivers/media/video/tvp5150.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c > index e927d25..26cc75b 100644 > --- a/drivers/media/video/tvp5150.c > +++ b/drivers/media/video/tvp5150.c > @@ -993,7 +993,7 @@ static int tvp5150_probe(struct i2c_client *c, > } > > core->norm = V4L2_STD_ALL; /* Default is autodetect */ > - core->input = TVP5150_COMPOSITE1; > + core->input = TVP5150_COMPOSITE0; > core->enable = 1; > > v4l2_ctrl_handler_init(&core->hdl, 4); Changing this could break em28xx that might be expecting it to be set to composite1. On a quick look, the code there seems to be doing the right thing: during the probe procedure, it explicitly calls s_routing, in order to initialize the device input to the first input type found at the cards structure. So, this patch is likely harmless. Yet, why do you need to change it? Any bridge driver that uses it should be doing the same: at initialization, it should set the input to a value that it is compatible with the way the device is wired, and not to assume a particular arrangement. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> Changing this could break em28xx that might be expecting it > to be set to composite1. On a quick look, the code there seems to be > doing the right thing: during the probe procedure, it explicitly > calls s_routing, in order to initialize the device input to the > first input type found at the cards structure. So, this patch > is likely harmless. > > Yet, why do you need to change it? Any bridge driver that uses it should > be doing the same: at initialization, it should set the input to a > value that it is compatible with the way the device is wired, and not > to assume a particular arrangement. What I'm trying to do with these patches and my previous one related to mx2_camera, is to be able to use mx2_camera host driver with tvp5150 video decoder. I'm not sure how mx2_camera could be aware that the sensor or decoder attached to it needs s_routing function to be called with a certain parameter without making it too board specific. The only solution I could think of was assuming that if s_routing function was not called at all, the enabled input in tvp5150 would be the default COMPOSITE0 as it is specified in the datasheet. However, If you or anyone suggests a cleaner approach I'm totally open. But still, changing default value of the selected input in tvp5150 probe function is a bit dirty IMHO. Thank you.
On 15-12-2011 08:24, javier Martin wrote: >> Changing this could break em28xx that might be expecting it >> to be set to composite1. On a quick look, the code there seems to be >> doing the right thing: during the probe procedure, it explicitly >> calls s_routing, in order to initialize the device input to the >> first input type found at the cards structure. So, this patch >> is likely harmless. >> >> Yet, why do you need to change it? Any bridge driver that uses it should >> be doing the same: at initialization, it should set the input to a >> value that it is compatible with the way the device is wired, and not >> to assume a particular arrangement. > > What I'm trying to do with these patches and my previous one related > to mx2_camera, > is to be able to use mx2_camera host driver with tvp5150 video decoder. > > I'm not sure how mx2_camera could be aware that the sensor or decoder > attached to it > needs s_routing function to be called with a certain parameter without > making it too board specific. > The only solution I could think of was assuming that if s_routing > function was not called at all, > the enabled input in tvp5150 would be the default COMPOSITE0 as it is > specified in the datasheet. > > However, If you or anyone suggests a cleaner approach I'm totally > open. But still, changing default > value of the selected input in tvp5150 probe function is a bit dirty IMHO. Board-specific information is needed anyway, if someone wants to use any driver. It doesn't matter if the pipelines are set via libv4l, via direct calls or whatever. On em28xx, the board-specific info is stored in Kernel. It would be possible to put that info on userspace, but that would require some code at libv4l. The mx2_camera needs some code to forward calls to S_INPUT/S_ROUTING to tvp5150, in order to set the pipelines there. The libv4l plugin also needs to know about that. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> The mx2_camera needs some code to forward calls to S_INPUT/S_ROUTING to > tvp5150, in order to set the pipelines there. This sounds like a sensible solution I will work on that soon. Regards.
On 15 December 2011 13:01, javier Martin <javier.martin@vista-silicon.com> wrote: >> The mx2_camera needs some code to forward calls to S_INPUT/S_ROUTING to >> tvp5150, in order to set the pipelines there. > > This sounds like a sensible solution I will work on that soon. > Hi Mauro, regarding this subject it seems soc-camera assumes the attached sensor has only one input: input 0. This means I am not able to forward S_INPUT/S_ROUTING as you suggested: http://lxr.linux.no/#linux+v3.1.5/drivers/media/video/soc_camera.c#L213 This trick is clearly a loss of functionality because it restricts sensors to output 0, but it should work since the subsystem can assume a sensor whose inputs have not been configured has input 0 as the one selected. However, this trick in the tvp5150 which selects input 1 (instead of 0) as the default input is breaking that assumption. The solution could be either apply my patch to set input 0 (COMPOSITE0) as default or swap input numbers so that COMPOSITE1 input is input 0. Personally I find my approach more convenient since it matches with the default behavior expected in the datasheet. Regards.
On 15-12-2011 10:33, javier Martin wrote: > On 15 December 2011 13:01, javier Martin > <javier.martin@vista-silicon.com> wrote: >>> The mx2_camera needs some code to forward calls to S_INPUT/S_ROUTING to >>> tvp5150, in order to set the pipelines there. >> >> This sounds like a sensible solution I will work on that soon. >> > > Hi Mauro, > regarding this subject it seems soc-camera assumes the attached sensor > has only one input: input 0. This means I am not able to forward > S_INPUT/S_ROUTING as you suggested: > http://lxr.linux.no/#linux+v3.1.5/drivers/media/video/soc_camera.c#L213 Then, you need to submit a patch for soc_camera, in order to allow it to work with devices that provide more than one input. > This trick is clearly a loss of functionality because it restricts > sensors to output 0, but it should work since the subsystem can assume > a sensor whose inputs have not been configured has input 0 as the one > selected. > > However, this trick in the tvp5150 which selects input 1 (instead of > 0) as the default input is breaking that assumption. The solution > could be either apply my patch to set input 0 (COMPOSITE0) as default > or swap input numbers so that COMPOSITE1 input is input 0. > > Personally I find my approach more convenient since it matches with > the default behavior expected in the datasheet. Both of your described ways are just hacks. tvp5150 has more than one input. So, the bridge should be supporting the selection between them. Regards, Mauro > > Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index e927d25..26cc75b 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -993,7 +993,7 @@ static int tvp5150_probe(struct i2c_client *c, } core->norm = V4L2_STD_ALL; /* Default is autodetect */ - core->input = TVP5150_COMPOSITE1; + core->input = TVP5150_COMPOSITE0; core->enable = 1; v4l2_ctrl_handler_init(&core->hdl, 4);