[linuxtv-media:master 534/537] drivers/media/i2c/soc_camera/ov2640.c:1057:3: error: implicit declaration of function 'gpiod_direction_output'
tree: git://linuxtv.org/media_tree.git master head: 739cfd9be9af6bbbe4c652077add59409adf2225 commit: 4e65172f7bd20fcbfa87453d1e5711ad129d4216 [534/537] [media] media: ov2640: add primary dt support config: m68k-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 4e65172f7bd20fcbfa87453d1e5711ad129d4216 # save the attached .config to linux build tree make.cross ARCH=m68k All error/warnings: drivers/media/i2c/soc_camera/ov2640.c: In function 'ov2640_hw_power': drivers/media/i2c/soc_camera/ov2640.c:1057:3: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration] gpiod_direction_output(priv-pwdn_gpio, !on); ^ drivers/media/i2c/soc_camera/ov2640.c: In function 'ov2640_probe_dt': drivers/media/i2c/soc_camera/ov2640.c:1081:2: error: implicit declaration of function 'devm_gpiod_get_optional' [-Werror=implicit-function-declaration] priv-resetb_gpio = devm_gpiod_get_optional(client-dev, resetb, ^ drivers/media/i2c/soc_camera/ov2640.c:1082:4: error: 'GPIOD_OUT_LOW' undeclared (first use in this function) GPIOD_OUT_LOW); ^ drivers/media/i2c/soc_camera/ov2640.c:1082:4: note: each undeclared identifier is reported only once for each function it appears in drivers/media/i2c/soc_camera/ov2640.c:1090:4: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function) GPIOD_OUT_HIGH); ^ cc1: some warnings being treated as errors vim +/gpiod_direction_output +1057 drivers/media/i2c/soc_camera/ov2640.c 1051 struct ov2640_priv *priv = to_ov2640(client); 1052 1053 dev_dbg(client-dev, %s: %s the camera\n, 1054 __func__, on ? ENABLE : DISABLE); 1055 1056 if (priv-pwdn_gpio) 1057 gpiod_direction_output(priv-pwdn_gpio, !on); 1058 1059 return 0; 1060 } 1061 1062 static int ov2640_hw_reset(struct device *dev) 1063 { 1064 struct i2c_client *client = to_i2c_client(dev); 1065 struct ov2640_priv *priv = to_ov2640(client); 1066 1067 if (priv-resetb_gpio) { 1068 /* Active the resetb pin to perform a reset pulse */ 1069 gpiod_direction_output(priv-resetb_gpio, 1); 1070 usleep_range(3000, 5000); 1071 gpiod_direction_output(priv-resetb_gpio, 0); 1072 } 1073 1074 return 0; 1075 } 1076 1077 static int ov2640_probe_dt(struct i2c_client *client, 1078 struct ov2640_priv *priv) 1079 { 1080 /* Request the reset GPIO deasserted */ 1081 priv-resetb_gpio = devm_gpiod_get_optional(client-dev, resetb, 1082 GPIOD_OUT_LOW); 1083 if (!priv-resetb_gpio) 1084 dev_dbg(client-dev, resetb gpio is not assigned!\n); 1085 else if (IS_ERR(priv-resetb_gpio)) 1086 return PTR_ERR(priv-resetb_gpio); 1087 1088 /* Request the power down GPIO asserted */ 1089 priv-pwdn_gpio = devm_gpiod_get_optional(client-dev, pwdn, 1090 GPIOD_OUT_HIGH); 1091 if (!priv-pwdn_gpio) 1092 dev_dbg(client-dev, pwdn gpio is not assigned!\n); 1093 else if (IS_ERR(priv-pwdn_gpio)) --- 0-DAY kernel test infrastructureOpen Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation # # Automatically generated file; DO NOT EDIT. # Linux/m68k 4.0.0-rc1 Kernel Configuration # CONFIG_M68K=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_LOW_RES=y CONFIG_NO_IOPORT_MAP=y # CONFIG_NO_DMA is not set CONFIG_ZONE_DMA=y CONFIG_HZ=100 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y # # General setup # CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE= CONFIG_COMPILE_TEST=y CONFIG_LOCALVERSION= CONFIG_LOCALVERSION_AUTO=y CONFIG_DEFAULT_HOSTNAME=(none) CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y CONFIG_USELIB=y CONFIG_AUDIT=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_SHOW=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_DEBUG=y CONFIG_ARCH_USES_GETTIMEOFFSET=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y # # RCU Subsystem # CONFIG_TINY_RCU=y CONFIG_SRCU=y CONFIG_TASKS_RCU=y CONFIG_RCU_STALL_COMMON=y # CONFIG_TREE_RCU_TRACE is not set CONFIG_RCU_KTHREAD_PRIO=0 CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m
[PATCH 48/68] [media] soc_camera/ov2640: Don't use a temp var for an unused value
drivers/media/i2c/soc_camera/ov2640.c:899:32: warning: variable 'win' set but not used [-Wunused-but-set-variable] Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com --- drivers/media/i2c/soc_camera/ov2640.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/soc_camera/ov2640.c b/drivers/media/i2c/soc_camera/ov2640.c index d2d298b..30cf6d8 100644 --- a/drivers/media/i2c/soc_camera/ov2640.c +++ b/drivers/media/i2c/soc_camera/ov2640.c @@ -896,12 +896,10 @@ static int ov2640_s_fmt(struct v4l2_subdev *sd, static int ov2640_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) { - const struct ov2640_win_size *win; - /* -* select suitable win +* select suitable win, but don't store it */ - win = ov2640_select_win(mf-width, mf-height); + ov2640_select_win(mf-width, mf-height); mf-field = V4L2_FIELD_NONE; -- 1.7.11.7 -- 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: OV2640
Hi Guennadi, On 12/8/09, Alan Carvalho de Assis acas...@gmail.com wrote: Hi Guennadi, ... I am trying to use an OV2640 camera with soc_camera. I'm using ov772x driver as base, but it needs too much modification to work with ov2640. I don't know that sensor specifically, but they can be quite different. Yes, in fact ov2640 appears quite different compared to ov772x and ov9640. The OV2640 chip remaps all registers when register 0xFF is 1 or when it is 0. This is not unusual. There are a few ways to implement this, for example, drivers/media/video/rj54n1cb0c.c uses 16-bit addresses, and decodes them to bank:register pairs in its reg_read() and reg_write() routines. Ok, I will try to implement it this way, case nobody suggests me a better approach. I got mx27_camera from pengutronix tree and modified it to work with kernel 2.6.32 (few modifications). I added platform data/device on my board using pcm970-baseboard.c as example. In the kernel config I selected: CONFIG_VIDEO_MX27 CONFIG_SOC_CAMERA_OV9640 I noticed a strange behavior: the ov9640 driver is called before mx27_camera: Linux video capture interface: v2.00 Probe OK until now, going to ProbeVideo Probing OV9640 Parent missing or invalid! Driver for 1-wire Dallas network protocol. i.MX SDHC driver usbcore: registered new interface driver usbhid usbhid: v2.6:USB HID core driver oprofile: using timer interrupt. TCP cubic registered NET: Registered protocol family 17 mx27-camera mx27-camera.0: initialising mx27_camera: IRQ request OK! mx27_camera: pcdev OK! mx27_camera: clk_csi OK! mx27-camera mx27-camera.0: Camera clock frequency: 2660 mx27_camera: DMA request OK! mx27-camera mx27-camera.0: Using EMMA mx27_camera: probe OK until now! mx27-camera mx27-camera.0: Non-NULL drvdata on register mx27_camera: soc_camera_host_register returned 0! Then ov9640 returns error because icd-dev.parent doesn't exist. Did you already see this issue? Best Regards, Alan -- 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: OV2640
On Fri, 11 Dec 2009, Alan Carvalho de Assis wrote: Hi Guennadi, On 12/8/09, Alan Carvalho de Assis acas...@gmail.com wrote: Hi Guennadi, ... I am trying to use an OV2640 camera with soc_camera. I'm using ov772x driver as base, but it needs too much modification to work with ov2640. I don't know that sensor specifically, but they can be quite different. Yes, in fact ov2640 appears quite different compared to ov772x and ov9640. The OV2640 chip remaps all registers when register 0xFF is 1 or when it is 0. This is not unusual. There are a few ways to implement this, for example, drivers/media/video/rj54n1cb0c.c uses 16-bit addresses, and decodes them to bank:register pairs in its reg_read() and reg_write() routines. Ok, I will try to implement it this way, case nobody suggests me a better approach. I got mx27_camera from pengutronix tree and modified it to work with kernel 2.6.32 (few modifications). Sorry, I cannot help you with an out-of-tree driver, and generally I would expect significant changes when going to 2.6.32. I added platform data/device on my board using pcm970-baseboard.c as example. In the kernel config I selected: CONFIG_VIDEO_MX27 CONFIG_SOC_CAMERA_OV9640 I noticed a strange behavior: the ov9640 driver is called before mx27_camera: Linux video capture interface: v2.00 Probe OK until now, going to ProbeVideo Probing OV9640 Parent missing or invalid! Driver for 1-wire Dallas network protocol. i.MX SDHC driver usbcore: registered new interface driver usbhid usbhid: v2.6:USB HID core driver oprofile: using timer interrupt. TCP cubic registered NET: Registered protocol family 17 mx27-camera mx27-camera.0: initialising mx27_camera: IRQ request OK! mx27_camera: pcdev OK! mx27_camera: clk_csi OK! mx27-camera mx27-camera.0: Camera clock frequency: 2660 mx27_camera: DMA request OK! mx27-camera mx27-camera.0: Using EMMA mx27_camera: probe OK until now! mx27-camera mx27-camera.0: Non-NULL drvdata on register mx27_camera: soc_camera_host_register returned 0! Then ov9640 returns error because icd-dev.parent doesn't exist. Did you already see this issue? Thanks Guennadi --- 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: OV2640
Hi Guennadi, On 12/11/09, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: On Fri, 11 Dec 2009, Alan Carvalho de Assis wrote: I got mx27_camera from pengutronix tree and modified it to work with kernel 2.6.32 (few modifications). Sorry, I cannot help you with an out-of-tree driver, and generally I would expect significant changes when going to 2.6.32. Right, I can post a patch to add mx27_camera on mainstream kernel since Sascha (original author) let me do it. Sascha, can I submit it? Best Regards, Alan -- 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: OV2640
Hi Guennadi, On 12/7/09, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: Hi Alan On Mon, 7 Dec 2009, Alan Carvalho de Assis wrote: It's always better to cc a suitable list, in this case it is Linux Media Mailing List linux-media@vger.kernel.org Sure, here we go. I am trying to use an OV2640 camera with soc_camera. I'm using ov772x driver as base, but it needs too much modification to work with ov2640. I don't know that sensor specifically, but they can be quite different. Yes, in fact ov2640 appears quite different compared to ov772x and ov9640. The OV2640 chip remaps all registers when register 0xFF is 1 or when it is 0. This is not unusual. There are a few ways to implement this, for example, drivers/media/video/rj54n1cb0c.c uses 16-bit addresses, and decodes them to bank:register pairs in its reg_read() and reg_write() routines. Ok, I will try to implement it this way, case nobody suggests me a better approach. Best Regards, Alan -- 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