Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp731379rdg; Wed, 11 Oct 2023 04:08:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENe39g7DOtMxxY1C9CAKvzDE9KXxub3z3lrLc6fZsoqV1KWY9qJvyrB1+/KIFTtK/DGnL+ X-Received: by 2002:a05:6a00:17a1:b0:690:c1a6:1c3b with SMTP id s33-20020a056a0017a100b00690c1a61c3bmr20798569pfg.33.1697022530771; Wed, 11 Oct 2023 04:08:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697022530; cv=pass; d=google.com; s=arc-20160816; b=F9KWfCat7sn+CmnuckeSPfY3Bi03yaVO+CSJh0WyBh+LEyXyoo+gGwuxDevC5YbZvc JRWc/JIvMBzxYK6l6iy28z9uZs/A+ZQQfGUutn9XLpF01/J/LNKhOeRipCZ7s/MOHMW/ aeoHe8uilAyE6bQPb/y/wFcC+qrwqU8Wsf5hC7PMCiAp58WkTN6v3cNWeqFnO3VNZmP4 3Kp7ijPHYuoLBBghwPextBG1MjHsJ6OPG9iBUM1wUfjc44oo9etC4RGmcyZzC+w8AI/m k+FPtQ/bTfU4vbnL5PaqKub+4wHpTpemYVmlfyoo6NAqkJn/0CJeG+pxpML2OXlsxWvr lF+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EmaAL5usRi4Ui8WzfPSbnayZGHaVdfiIz8XXq6gkdbU=; fh=Je028qsmlRvA/QUBLP3bIKF+0u8wNUkC41OVsVGh47Y=; b=IbMgJtJbMu4LzFpX4KVZluqqD7BYuZRPbsTuhH8o6ICOIiPLoEuFuMP40PFjCOv0ca U1YxfjNpgpsoe/5kp1/AiBGwCCAYEgtiQ/nRro7p7CTutUF85CxNj43dleXj5qfqJfjL WGMpfzdfBi56d20dydqPBf7F3fDdK9LxLH8LMHOK9hkQ2ApqS+kFAU2ZI1/71bGd3rEa wQc8eQeKG5EUbKwpW6lb6f5Bzxoowjkdc4m4fRRldbgh0vWYeYfWapk95Hy7sAKTfXLA xwtJ5kIfO9a+aquAv3EMSgY3OiMOQp4XHJAszbWVv57fjaZ3K0PgqY5O5nN8OZzcjDgT lUAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=N6jTUMCM; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g6-20020a056a0023c600b00690c6da95c4si12262859pfc.273.2023.10.11.04.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=N6jTUMCM; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EDEE0801B805; Wed, 11 Oct 2023 04:08:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234715AbjJKLIX (ORCPT + 99 others); Wed, 11 Oct 2023 07:08:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbjJKLIM (ORCPT ); Wed, 11 Oct 2023 07:08:12 -0400 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33D919B1; Wed, 11 Oct 2023 04:06:27 -0700 (PDT) Received: from hillosipuli.retiisi.eu (185-9-11-240.cust.suomicom.net [185.9.11.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sailus) by meesny.iki.fi (Postfix) with ESMTPSA id 4S591q2dYSzyYQ; Wed, 11 Oct 2023 14:06:20 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1697022385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EmaAL5usRi4Ui8WzfPSbnayZGHaVdfiIz8XXq6gkdbU=; b=N6jTUMCMfg8Y3c7+PejgtPAw3RFu0E4jkLF0fzcjQhcK5Un94dqeXfXeZhbCoWfGoihQ5D 0b65U5jjfkwLrKV1/p/hvTuopz3DZ0IwGG+Wgp+6beO2yjjAAzGAzU6ugogEQ0nkpZXXFc DDNmDooyda2L0yV8foAkfCm2bFdHpHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1697022385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EmaAL5usRi4Ui8WzfPSbnayZGHaVdfiIz8XXq6gkdbU=; b=cG6uMzlEyMOE4Ul9TnEN51ooSdzjqOyv33TAvdfPJFGoxloNDi6ss3Bt6kwaIAWcDeNCP9 CJx0GergxhJqHFZUdNwPWPsehmjBTqPcugSw5mUEQ64gZ/T/wjKejNQ2GGbB6zRyTXhKk2 SpMnYURxaEC4Nr+KTPRTNwxDfifk124= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sailus smtp.mailfrom=sakari.ailus@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1697022385; a=rsa-sha256; cv=none; b=C7cQiaw4zJHiDxcmmMMlUHfz1iw4VurZsgMNccMINm4n1n3m0No5Bbx9xJVMbVgOg9tIP9 /RSXcpdiPljQIdKiw0KueNqSYfIqY3IUouMEJkslHT2UPiWbtNOzeG5qJBfDDUIS24Y64x jughi7PbcHTO392tpihY4HZHBQVd+tk= Received: from valkosipuli.retiisi.eu (valkosipuli.localdomain [192.168.4.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id 8963D634CA9; Wed, 11 Oct 2023 14:06:19 +0300 (EEST) Date: Wed, 11 Oct 2023 11:06:19 +0000 From: Sakari Ailus To: Kieran Bingham Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, Sakari Ailus , "Paul J. Murphy" , Daniele Alessandrelli , Mauro Carvalho Chehab , open list Subject: Re: [PATCH 2/5] media: i2c: imx335: Enable regulator supplies Message-ID: References: <20231010005126.3425444-1-kieran.bingham@ideasonboard.com> <20231010005126.3425444-3-kieran.bingham@ideasonboard.com> <169701731909.277971.10840095252716847805@ping.linuxembedded.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <169701731909.277971.10840095252716847805@ping.linuxembedded.co.uk> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:08:48 -0700 (PDT) X-Spam-Level: ** Hi Kieran, On Wed, Oct 11, 2023 at 10:41:59AM +0100, Kieran Bingham wrote: > Quoting Sakari Ailus (2023-10-10 07:12:08) > > Hi Kieran, > > > > On Tue, Oct 10, 2023 at 01:51:23AM +0100, Kieran Bingham wrote: > > > Provide support for enabling and disabling regulator supplies to control > > > power to the camera sensor. > > > > > > Signed-off-by: Kieran Bingham > > > --- > > > drivers/media/i2c/imx335.c | 41 ++++++++++++++++++++++++++++++++++++-- > > > 1 file changed, 39 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c > > > index ec729126274b..bf12b9b69fce 100644 > > > --- a/drivers/media/i2c/imx335.c > > > +++ b/drivers/media/i2c/imx335.c > > > @@ -75,6 +75,19 @@ struct imx335_reg_list { > > > const struct imx335_reg *regs; > > > }; > > > > > > +static const char * const imx335_supply_name[] = { > > > + /* > > > + * Turn on the power supplies so that they rise in order of > > > + * 1.2v,-> 1.8 -> 2.9v > > > > This won't happen with regulator_bulk_enable(). Does the spec require this? > > Every camera I've ever seen handles this in hardware. (I know that's not > an excuse as somewhere there could be a device that routes each of these > separately). > > Perhaps I shouldn't have added the comment ;-) But I thought it was > useful while I was working through anyway, and could be important for > other devices indeed. > > The datasheet states: > > ``` > 1. Turn On the power supplies so that the power supplies rise in order > of 1.2 V power supply (DVDD1, DVDD2) → 1.8 V power supply (OVDD) → 2.9 V > power supply (AVDD1, AVDD2). In addition, all power supplies should > finish rising within 200 ms. That's an annoying requirement but I'd presume this to work just fine in practice. The device is reset in any case (as you describe below). Some boards might not wire the reset GPIO though, and then it's when it gets interesting. To literally implement the documented sequence, you should separately enable the regulators one by one. Although I don't object just removing the comment either. -- Regards, Sakari Ailus