Re: SoC Camera driver and TV decoder
On Tue, 1 Feb 2011, Janusz Uzycki wrote: camera 0-0: Probing 0-0 sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0 tvp5150 0-005d: chip found @ 0xba (i2c-sh_mobile) tvp5150 0-005d: tvp5150am1 detected. sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0 There is no error 515 but the driver is still detached. Good, this is correct. It will be re-attached when you open it. Thanks Guennadi drivers/media/video/sh_mobile_ceu_camera.c: sh_mobile_ceu_remove_device() is called /* Called with .video_lock held */ static struct soc_camera_host_ops sh_mobile_ceu_host_ops = { .owner = THIS_MODULE, .add= sh_mobile_ceu_add_device, .remove = sh_mobile_ceu_remove_device, It seems sh_mobile_ceu_add_device() was failed. I will try to explore that. Janusz - Original Message - From: Guennadi Liakhovetski g.liakhovet...@gmx.de To: Janusz Uzycki janusz.uzy...@elproma.com.pl Cc: g.dani...@elproma.com.pl; Linux Media Mailing List linux-media@vger.kernel.org Sent: Tuesday, February 01, 2011 2:21 PM Subject: Re: SoC Camera driver and TV decoder On Tue, 1 Feb 2011, Janusz Uzycki wrote: include/linux/errno.h:#define ENOIOCTLCMD 515 /* No ioctl command */ What did I forget below? static const struct v4l2_subdev_video_ops tvp5150_video_ops = { .s_routing = tvp5150_s_routing, /* SoC camera: */ .s_stream = tvp5150_s_stream, .g_mbus_fmt = tvp5150_g_fmt, .s_mbus_fmt = tvp5150_s_fmt, .try_mbus_fmt = tvp5150_try_fmt, .enum_mbus_fmt = tvp5150_enum_fmt, /* .cropcap= tw9910_cropcap, .g_crop = tw9910_g_crop, .s_crop = tw9910_s_crop,*/ }; cropcap/g_crop/s_cros are necessary? why and when? cropcap and g_crop might be necessary - at least minimal static versions. Thanks Guennadi thanks Janusz On Thu, 27 Jan 2011, Janusz Uzycki wrote: Hello Guennadi again. I patched tvp5150.c according to tw9910 driver (without real cropping support yet). Unfortunately I got the messages: camera 0-0: Probing 0-0 sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0 tvp5150 0-005d: chip found @ 0xba (i2c-sh_mobile) tvp5150 0-005d: tvp5150am1 detected. This looks good - i2c to the chip works! sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0 camera: probe of 0-0 failed with error -515 This is strange, however - error code 515... Can you try to find out where it is coming from? Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: SoC Camera driver and TV decoder
@@if (debug 1)tvp5150_log_status(sd);++ if (icd) { /* attach SoC camera API */+ icl = to_soc_camera_link(icd);+ if (icl) {+ /*icl-priv - platform data*/+ icd-iface = icl-bus_id;+ icd-ops = tvp5150_soc_ops;+ ret = tvp5150_video_probe(icd, c, sd);+ if (ret) {+ icd-ops = NULL;+ return ret;+ }+ }+ }return 0; } static int tvp5150_remove(struct i2c_client *c) {struct v4l2_subdev *sd = i2c_get_clientdata(c);+ struct soc_camera_device *icd = c-dev.platform_data;v4l2_dbg(1, debug, sd,tvp5150.c: removing tvp5150 adapter on address 0x%x\n,c-addr 1);+ if (icd) icd-ops = NULL; /* detach SoC camera API */v4l2_device_unregister_subdev(sd);kfree(to_tvp5150(sd));return 0;- Original Message -From: Guennadi Liakhovetski g.liakhovet...@gmx.deTo: Janusz Uzycki janusz.uzy...@elproma.com.plCc: g.dani...@elproma.com.plSent: Wednesday, January 26, 2011 8:47 PMSubject: Re: SoC Camera driver and TV decoder On Wed, 26 Jan 2011, Janusz Uzycki wrote: Thanks for the help. I found your post at http://www.spinics.net/lists/linux-media/msg16346.html andhttp://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/11486/focus=11493 Do you remember some similar threads or guide? It will be better to read before to ask :) There have been a couple of threads with similar content, and no, there is no guide. Regards Guennadi best regards Janusz Uzycki ELPROMA - Original Message - From: Guennadi Liakhovetski g.liakhovet...@gmx.de To: Janusz Uzycki janusz.uzy...@elproma.com.pl Cc: g.dani...@elproma.com.pl Sent: Monday, January 24, 2011 5:25 PM Subject: Re: SoC Camera driver and TV decoder On Mon, 24 Jan 2011, Janusz Uzycki wrote:Hello. We are developing a customized system based on Renesas SH7724 CPU. In dev.kit of that CPU video input (TV decoder) is powered by TW9910chip. Our customized board contains TVP5150 chip instead. Unfortunately SoC-camera driver supports SH-mobile host but not the our client. TVP5150 is supported in Linux kernel via default video decodersdriver but we weren't able to link SoC-camera and V4L2 driver of TVP5150 to work together. Both modules are loaded but /dev/video0 has notappeared. Could you point how to do it right? Does we need to rewrite TVP5150 driver using TW9910 driver as template? Yes, you will have to adjust / extend the tvp5150.c driver to (also)work with soc-camera. Unfortunately, the soc-camera framework is still not completely compatible with the plain v4l2-subdev API. Yes, use any of existing soc-camera sensor or tv-decoder drivers as an example. Theonly soc-camera tv-decoder driver currently available, as you've correctly recognised, is tw9910. With more detailed questions please CC the Linux Media Mailing List linux-media@vger.kernel.org mailing list. Thanks Guennadi Current our part for SoC in /arch/sh/boards/mach-ecovec24/setup.c is: static struct i2c_board_info i2c_camera[] = { { I2C_BOARD_INFO(tvp5150, 0x5d), }, }; static struct soc_camera_link tvp5150_link = { .i2c_adapter_id = 0, .bus_id = 0, .board_info = i2c_camera[0],/*.priv = tw9910_info,*//* notsupported *//*.power = tw9910_power,*//* not supported*/ .module_name= tvp5150 }; static struct platform_device camera_devices[] = { { .name = soc-camera-pdrv, .id = 0, .dev= { .platform_data = tvp5150_link, }, }, }; kind regards Janusz Uzycki ELPROMA --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ --- Guennadi Liakhovetski -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: SoC Camera driver and TV decoder
On Thu, 27 Jan 2011, Janusz Uzycki wrote: Hello Guennadi again. I patched tvp5150.c according to tw9910 driver (without real cropping support yet). Unfortunately I got the messages: camera 0-0: Probing 0-0 sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0 tvp5150 0-005d: chip found @ 0xba (i2c-sh_mobile) tvp5150 0-005d: tvp5150am1 detected. This looks good - i2c to the chip works! sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0 camera: probe of 0-0 failed with error -515 This is strange, however - error code 515... Can you try to find out where it is coming from? Thanks Guennadi I have also found 2 patches here http://www.sleepyrobot.com/?cat=3 but it does not support soc camera also. My copy-paste patch in attachement this time. kind regards Janusz - Original Message - From: Guennadi Liakhovetski g.liakhovet...@gmx.de To: Janusz Uzycki janusz.uzy...@elproma.com.pl Cc: g.dani...@elproma.com.pl Sent: Wednesday, January 26, 2011 8:47 PM Subject: Re: SoC Camera driver and TV decoder On Wed, 26 Jan 2011, Janusz Uzycki wrote: Thanks for the help. I found your post at http://www.spinics.net/lists/linux-media/msg16346.html and http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/11486/focus=11493 Do you remember some similar threads or guide? It will be better to read before to ask :) There have been a couple of threads with similar content, and no, there is no guide. Regards Guennadi best regards Janusz Uzycki ELPROMA - Original Message - From: Guennadi Liakhovetski g.liakhovet...@gmx.de To: Janusz Uzycki janusz.uzy...@elproma.com.pl Cc: g.dani...@elproma.com.pl Sent: Monday, January 24, 2011 5:25 PM Subject: Re: SoC Camera driver and TV decoder On Mon, 24 Jan 2011, Janusz Uzycki wrote: Hello. We are developing a customized system based on Renesas SH7724 CPU. In dev.kit of that CPU video input (TV decoder) is powered by TW9910 chip. Our customized board contains TVP5150 chip instead. Unfortunately SoC-camera driver supports SH-mobile host but not the our client. TVP5150 is supported in Linux kernel via default video decoders driver but we weren't able to link SoC-camera and V4L2 driver of TVP5150 to work together. Both modules are loaded but /dev/video0 has not appeared. Could you point how to do it right? Does we need to rewrite TVP5150 driver using TW9910 driver as template? Yes, you will have to adjust / extend the tvp5150.c driver to (also) work with soc-camera. Unfortunately, the soc-camera framework is still not completely compatible with the plain v4l2-subdev API. Yes, use any of existing soc-camera sensor or tv-decoder drivers as an example. The only soc-camera tv-decoder driver currently available, as you've correctly recognised, is tw9910. With more detailed questions please CC the Linux Media Mailing List linux-media@vger.kernel.org mailing list. Thanks Guennadi Current our part for SoC in /arch/sh/boards/mach-ecovec24/setup.c is: static struct i2c_board_info i2c_camera[] = { { I2C_BOARD_INFO(tvp5150, 0x5d), }, }; static struct soc_camera_link tvp5150_link = { .i2c_adapter_id = 0, .bus_id = 0, .board_info = i2c_camera[0], /*.priv = tw9910_info,*//* not supported */ /*.power = tw9910_power,*//* not supported */ .module_name= tvp5150 }; static struct platform_device camera_devices[] = { { .name = soc-camera-pdrv, .id = 0, .dev= { .platform_data = tvp5150_link, }, }, }; kind regards Janusz Uzycki ELPROMA --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ --- Guennadi Liakhovetski --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: SoC Camera driver and TV decoder
sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0 camera: probe of 0-0 failed with error -515 This is strange, however - error code 515... Can you try to find out where it is coming from? Something is really wrong: drivers/base/dd.c: %s: probe of %s failed with error %d\n, in static int really_probe(struct device *dev, struct device_driver *drv) Bus probe or camera probe failed. regards Janusz -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html