From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752566AbdBIKNT (ORCPT ); Thu, 9 Feb 2017 05:13:19 -0500 Received: from smtprelay2.synopsys.com ([198.182.60.111]:54999 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbdBIKNQ (ORCPT ); Thu, 9 Feb 2017 05:13:16 -0500 Subject: Re: [PATCH RESEND v7 2/2] Add support for OV5647 sensor. To: Sakari Ailus , Ramiro Oliveira References: <26e5a587f1ba9e2fbbc04284408305bc8cf8c5c0.1486136893.git.roliveir@synopsys.com> <20170203201729.GA18086@kekkonen.localdomain> <20170207173116.GC13854@valkosipuli.retiisi.org.uk> <20170209100254.GH13854@valkosipuli.retiisi.org.uk> CC: Sakari Ailus , , , , , "David S. Miller" , Geert Uytterhoeven , Greg Kroah-Hartman , Guenter Roeck , Hans Verkuil , Mark Rutland , Mauro Carvalho Chehab , "Pavel Machek" , Robert Jarzmik , Rob Herring , Steve Longerbeam From: Ramiro Oliveira Message-ID: <3d8368f8-0cae-934b-fc6a-0ead79db14aa@synopsys.com> Date: Thu, 9 Feb 2017 10:13:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170209100254.GH13854@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.107.25.136] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari On 2/9/2017 10:02 AM, Sakari Ailus wrote: > Hi Ramiro, > > On Wed, Feb 08, 2017 at 09:56:12AM +0000, Ramiro Oliveira wrote: >> Hi Sakari >> >> On 2/7/2017 5:31 PM, Sakari Ailus wrote: >>> Hi Ramiro, >>> >>> On Mon, Feb 06, 2017 at 11:38:28AM +0000, Ramiro Oliveira wrote: >>> ... >>>>>> + ret = ov5647_write_array(sd, ov5647_640x480, >>>>>> + ARRAY_SIZE(ov5647_640x480)); >>>>>> + if (ret < 0) { >>>>>> + dev_err(&client->dev, "write sensor_default_regs error\n"); >>>>>> + return ret; >>>>>> + } >>>>>> + >>>>>> + ov5647_set_virtual_channel(sd, 0); >>>>>> + >>>>>> + ov5647_read(sd, 0x0100, &resetval); >>>>>> + if (!(resetval & 0x01)) { >>>>> >>>>> Can this ever happen? Streaming start is at the end of the register list. >>>>> >>>> >>>> I'm not sure it can happen. It was just a safeguard, but I can remove it if you >>>> think it's not necessary >>> >>> You're not reading back the other registers either, albeit I'd check that >>> the I2C accesses actually succeed. Generally the return values are ignored. >>> >> >> So you're recommending I perform a random I2C access after power on to check the >> system, and discard the read value? Or just drop this piece of code entirely? >> > > I'm not. What I'm saying that you're mostly not checking whether I2C > accesses succeed or not. > I think I'm understanding what you're saying now. You want me to check more often the return value from write/read functions? That makes sense. I'll add more checks to the code -- Best Regards Ramiro Oliveira Ramiro.Oliveira@synopsys.com