Message ID | 20230129-ov2685-improvements-v1-1-f281bd49399c@z3ntu.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1689846wrn; Sun, 29 Jan 2023 02:22:06 -0800 (PST) X-Google-Smtp-Source: AK7set/M+PSLuRqhgoi6iScCKoI48nYtnOIWeQ7Hcho7nMWoU4nAp+B9kZ8mn4RipsbT5hyMmFej X-Received: by 2002:a17:902:e14d:b0:194:d78a:fc80 with SMTP id d13-20020a170902e14d00b00194d78afc80mr3724655pla.61.1674987726342; Sun, 29 Jan 2023 02:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674987726; cv=none; d=google.com; s=arc-20160816; b=YohSui6nYcW47RLGEEusgOXV9F8cIE5VEiZBSHadVofNMcK0Ugxlz6/dcjM/OmUFBe 3iP89mYOh39tTgJ6QwIB+0iYLPd7pp5PTz4bFIjJXFQrke07pozqj/4b5+JyJLyiY9Sc rZipMyKPzMvIKvxv6EpkpGVy+tTDfsVDQf441FFTW8u9h5DTKwzaWICmDCA6KA3ioTbK LRN0GeHW5qRpF7Lu9obRuqIFyBblmbgDRWiCcVap4A46Bh37lLPIfwEa7Wu/3+w1H291 1bXBtCbVdx3GdQDAydHB2gTZyc/b3ANWZZuY+o6Fddo2pceLGnPY2tEm9txXzofz2JhA +szg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=E6B2aH34g6KXWjZuydpb5EgoV6jPXjQCvmNo5MaNj8o=; b=cQSSzSsfOynImJhQQReYi5hggW00Cfm6okLUZ1h1mpFkD7/i90LT4effMGmGFXzInL GgzbmKFJrFNrWjWSNL7wi4vKZa29+PYGILPjiLmVRng0khaPopg5BRQiDdxkVSFAWtZY x6mI+VB4FmWAvM0H0CjJdLnJCbNCP2MgRJbgXi9QwN13z9Vl9bBHv2mUOdsIjUaJ/1L9 XY5a/g8hQnNtRgLE/ZCNGmhcDlmDeIpVjny3Iqf5XOdX/FwrXBl76PjNbnHXhqpUMwCO iNrufCHg2xLIBdCpjrGwGYM4xUM048uNZeuTxJFsYDIjImldC5CV+Q4VX3tXEfOPU8pZ eV7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@z3ntu.xyz header.s=z3ntu header.b=ivN5DlAa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170903230900b0017808c0aa8bsi11305392plh.115.2023.01.29.02.21.53; Sun, 29 Jan 2023 02:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@z3ntu.xyz header.s=z3ntu header.b=ivN5DlAa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234573AbjA2Jnz (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Sun, 29 Jan 2023 04:43:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjA2Jnw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 29 Jan 2023 04:43:52 -0500 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4BA23326; Sun, 29 Jan 2023 01:43:32 -0800 (PST) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id A38ABCDE1D; Sun, 29 Jan 2023 09:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1674985371; bh=R9ZNv09De8WL7qrMjmRnJkXWIPy46lSI3OBIO9SIMXw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ivN5DlAay/Hh9eYY92OY3MiwQqPK1AZ7vS/IK61LJjgNMI6thBRPgHCA5D2b+LGxb NCP0ts+2Ma8ytP9ZE8hebnc0y2dqimIG9T1O2LB7pBlym9mAsv//tZwbr8Tv2F2zez 96/JiNP5DRVYD1P0FPccJPzeXtv3wLVLO9bQL0pI= From: Luca Weiss <luca@z3ntu.xyz> Date: Sun, 29 Jan 2023 10:42:35 +0100 Subject: [PATCH 1/4] media: i2c: ov2685: Make reset gpio optional MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230129-ov2685-improvements-v1-1-f281bd49399c@z3ntu.xyz> References: <20230129-ov2685-improvements-v1-0-f281bd49399c@z3ntu.xyz> In-Reply-To: <20230129-ov2685-improvements-v1-0-f281bd49399c@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Shunqian Zheng <zhengsq@rock-chips.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Jacopo Mondi <jacopo.mondi@ideasonboard.com> Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss <luca@z3ntu.xyz> X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=894; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=R9ZNv09De8WL7qrMjmRnJkXWIPy46lSI3OBIO9SIMXw=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBj1j+Xi0vA9+m7kad3e3/xYUSgehrk6D7zWpUwkTFv iITbT3KJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCY9Y/lwAKCRBy2EO4nU3XVoIVD/ 983IJ5BCQZ0Uw820dThLSGKfcgcUMb1aHUe5yyai4hN92eHKNAfpkEN9h2/xtYCW8CyTfzEci07FYv eONEJWos9uWfzxoC4juKEhAJ70KMPOicze6zCVX+c5++oEht045JWULh/9rjM+Sk2qHalWwOHTlQ+H N6FKv7Ya1eJtzzhvr5SuOf0DqpF+NXcqQmVKtmAQ1BuvAo1LV+PGDWElLi9lvOAREJmRelQMMScgtS nKJPSdGI+jvd+hER+/qTvvbm67Q6GSi7YsnFKUIcgFFe72yzqQ5IpEARyPpKqqcZ3y4E4nMU/NLYrz bWO4JtHyAM5866EX81uL5JYoziFPSgq62Exf7Fa4FdgUuieAMAD8ARKg+Muz/2yH5CmvlkH71VuvTh sp2MLlk9ekO4bPGVSJUkLUXU5Fd75XSiDxCnk0DZAis+nnDJNHAcjgZo1T1rdzbu5iwh2fWh5qT8P6 /oqjc49GMZljZxcVNFMeJRmrXGkjgb6hJgCPYDv7vhP7483tr+qNeyll/h8eJrtVzfakw8xll78lGV +kD2QuDihaxxWxXwI5cZHMOzuptkpo5NM9jPEHYGE7pKKzBDX9IH34XmymTO7TfvEcNobxkt8UnqHf ZSZ4R4C8RXog4eSqzxviCtVhPEHd+KVCsttRqp/rrOl+C1W6nSjYBMJyJHLQ== X-Developer-Key: i=luca@z3ntu.xyz; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, SPF_HELO_NONE,SPF_PASS,T_PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756351929715062013?= X-GMAIL-MSGID: =?utf-8?q?1756351929715062013?= |
Series |
Improvements for OmniVision OV2685 driver
|
|
Commit Message
Luca Weiss
Jan. 29, 2023, 9:42 a.m. UTC
In some setups XSHUTDOWN is connected to DOVDD when it's unused,
therefore treat the reset gpio as optional.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/media/i2c/ov2685.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Luca On Sun, Jan 29, 2023 at 10:42:35AM +0100, Luca Weiss wrote: > In some setups XSHUTDOWN is connected to DOVDD when it's unused, > therefore treat the reset gpio as optional. I don't have a datasheet for this sensor, but OV sensors usually have to gpio lines to control powerdown and reset. Datasheets usually suggest to hook one of the 2 to DOVDD and control the other from the SoC. How is the sensor hooked up in your design ? No gpio lines is controlled by the SoC ? Another question is if we need to software-reset the sensor if no gpio line is hooked up to XSHUTDOWN. > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > --- > drivers/media/i2c/ov2685.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c > index a3b524f15d89..a422f4c8a2eb 100644 > --- a/drivers/media/i2c/ov2685.c > +++ b/drivers/media/i2c/ov2685.c > @@ -734,7 +734,7 @@ static int ov2685_probe(struct i2c_client *client, > if (clk_get_rate(ov2685->xvclk) != OV2685_XVCLK_FREQ) > dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n"); > > - ov2685->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); > + ov2685->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > if (IS_ERR(ov2685->reset_gpio)) { > dev_err(dev, "Failed to get reset-gpios\n"); > return -EINVAL; > > -- > 2.39.1 >
On Sonntag, 29. Jänner 2023 12:22:49 CET Jacopo Mondi wrote: > Hi Luca > > On Sun, Jan 29, 2023 at 10:42:35AM +0100, Luca Weiss wrote: > > In some setups XSHUTDOWN is connected to DOVDD when it's unused, > > therefore treat the reset gpio as optional. > > I don't have a datasheet for this sensor, but OV sensors usually have > to gpio lines to control powerdown and reset. Datasheets usually > suggest to hook one of the 2 to DOVDD and control the other from the > SoC. How is the sensor hooked up in your design ? No gpio lines is > controlled by the SoC ? It looks like this sensor only has XSHUTDOWN pin and no extra reset pin. In my setup there's the normal I2C & CSI & mclk hookups, but the supply lines and shutdown line are all just connected to regulator-fixed, so gpio- controlled on/off regulators. > > Another question is if we need to software-reset the sensor if no gpio > line is hooked up to XSHUTDOWN. The datasheet mentions it resets itself during power up (so when the supplies are turned on), so I don't think we need to add anything. Regards Luca > > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > > --- > > > > drivers/media/i2c/ov2685.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c > > index a3b524f15d89..a422f4c8a2eb 100644 > > --- a/drivers/media/i2c/ov2685.c > > +++ b/drivers/media/i2c/ov2685.c > > @@ -734,7 +734,7 @@ static int ov2685_probe(struct i2c_client *client, > > > > if (clk_get_rate(ov2685->xvclk) != OV2685_XVCLK_FREQ) > > > > dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n"); > > > > - ov2685->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); > > + ov2685->reset_gpio = devm_gpiod_get_optional(dev, "reset", > > GPIOD_OUT_LOW);> > > if (IS_ERR(ov2685->reset_gpio)) { > > > > dev_err(dev, "Failed to get reset-gpios\n"); > > return -EINVAL; > > > > -- > > 2.39.1
Hi Luca On Sun, Jan 29, 2023 at 12:49:03PM +0100, Luca Weiss wrote: > On Sonntag, 29. Jänner 2023 12:22:49 CET Jacopo Mondi wrote: > > Hi Luca > > > > On Sun, Jan 29, 2023 at 10:42:35AM +0100, Luca Weiss wrote: > > > In some setups XSHUTDOWN is connected to DOVDD when it's unused, > > > therefore treat the reset gpio as optional. > > > > I don't have a datasheet for this sensor, but OV sensors usually have > > to gpio lines to control powerdown and reset. Datasheets usually > > suggest to hook one of the 2 to DOVDD and control the other from the > > SoC. How is the sensor hooked up in your design ? No gpio lines is > > controlled by the SoC ? > > It looks like this sensor only has XSHUTDOWN pin and no extra reset pin. > Ack, I see the same for OV2680 (for which I have a datasheet) > In my setup there's the normal I2C & CSI & mclk hookups, but the supply lines > and shutdown line are all just connected to regulator-fixed, so gpio- > controlled on/off regulators. > > > > > Another question is if we need to software-reset the sensor if no gpio > > line is hooked up to XSHUTDOWN. > > The datasheet mentions it resets itself during power up (so when the supplies > are turned on), so I don't think we need to add anything. > Thanks for the clarification! Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thanks j > Regards > Luca > > > > > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > > > --- > > > > > > drivers/media/i2c/ov2685.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c > > > index a3b524f15d89..a422f4c8a2eb 100644 > > > --- a/drivers/media/i2c/ov2685.c > > > +++ b/drivers/media/i2c/ov2685.c > > > @@ -734,7 +734,7 @@ static int ov2685_probe(struct i2c_client *client, > > > > > > if (clk_get_rate(ov2685->xvclk) != OV2685_XVCLK_FREQ) > > > > > > dev_warn(dev, "xvclk mismatched, modes are based on > 24MHz\n"); > > > > > > - ov2685->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); > > > + ov2685->reset_gpio = devm_gpiod_get_optional(dev, "reset", > > > GPIOD_OUT_LOW);> > > > if (IS_ERR(ov2685->reset_gpio)) { > > > > > > dev_err(dev, "Failed to get reset-gpios\n"); > > > return -EINVAL; > > > > > > -- > > > 2.39.1 > > > >
diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index a3b524f15d89..a422f4c8a2eb 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -734,7 +734,7 @@ static int ov2685_probe(struct i2c_client *client, if (clk_get_rate(ov2685->xvclk) != OV2685_XVCLK_FREQ) dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n"); - ov2685->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + ov2685->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ov2685->reset_gpio)) { dev_err(dev, "Failed to get reset-gpios\n"); return -EINVAL;