Message ID | 20230129-ov2685-improvements-v1-2-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 s9csp1680888wrn; Sun, 29 Jan 2023 01:48:32 -0800 (PST) X-Google-Smtp-Source: AK7set+yKeW7e+k7hWIg8Oxgojs/rXNhuFMVkqlviNa+DJbWOlzv6C63F2k8q5JU1nrH4bGc3xhj X-Received: by 2002:a17:902:f682:b0:196:8292:e879 with SMTP id l2-20020a170902f68200b001968292e879mr206358plg.1.1674985712553; Sun, 29 Jan 2023 01:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674985712; cv=none; d=google.com; s=arc-20160816; b=kJdU6hp2LJdtoCKNSOTdmHdnBQX7khF/4fZCt0K3VMc1O5OBLpS/vQkZ6pXd0YvJ3X lZ0J8WQiYSbPqvo8T2c6tgcCiHcZ0WnMZmx2YmmADDUP3LTIWM3VR4wTVrirrNCPb/rd aPWJSQQY931cUEqCsIUWOsnhUVKcx86TXeWhvIkwgcHLKp/Elz66v7RAHGhfKT873z+e vBA5/akZpQpot2+m1kWliAJJcrbpF9MZ2hYSTDUdlxkWlcj2KlEQ6SsX2tKCsheP9g23 scYZ316u8GOZY2GRE9QH0C0MUSoo/kjqJqxHbHknBDWq8EbAkU58hx26nDTUpwGCkmI7 mu9Q== 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=YTL7CRdAXs8Pyl9kerGcE/pnuD8CiF76VaRu3T2KY38=; b=geVgx4HhlKgJ6/Pa+QSjNMTYMTwaVVGcTHQVnNkukNzPaK6SmiL3dBj2HanUTxUKCb Xqs+LlasCSPVnB7qhjkedPWXMU3O0O3DuxhnQgTxoBnUmlQeX6d256z2d1lQKnsiY9Zn 9mKrDaydGgS5OQxKHN7WFcq07E1jVsVrk+wuAbmj0a9tnMcQg/2AHLYuADu2a78JtcbT N119QNjvyXGrIR3+QwMBBz3U99obkUtQBnLQ5X/1cfnZjXRF3M0fQcxo/R7R9jqioYfE +Zstef+xkgv6kGoBVvrgzRHHyCqF6lzNx7n2JTehUx5uIBk32gjkdV1B4qF4Z5ipPCYY 9Sdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@z3ntu.xyz header.s=z3ntu header.b=PAjFT6mw; 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 q78-20020a632a51000000b00462a6f64703si10135630pgq.376.2023.01.29.01.48.20; Sun, 29 Jan 2023 01:48:32 -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=PAjFT6mw; 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 S231336AbjA2JnF (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Sun, 29 Jan 2023 04:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232759AbjA2Jm6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 29 Jan 2023 04:42:58 -0500 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E206EA2; Sun, 29 Jan 2023 01:42:53 -0800 (PST) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id DA49CCDE29; 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=1674985372; bh=fIplo9JpImpQeisw7bapzCgXeb9xPVwhFZKge8ht7KI=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=PAjFT6mwjS3L63nLMj10WYEUkN6ll5AQt/IXGx9zhBGCAMY7TUoZiYvqDmZ8eeJhX rbF8T3QfrTBf8d/CNrsNSuKi73B+OFlRqJVSXMWbF3gg3m8nhNv+gRUPxA7UHez2gJ G05jw65ZTIAMg/zrkpfTy7pIpkOU9OLfrlUlOE2s= From: Luca Weiss <luca@z3ntu.xyz> Date: Sun, 29 Jan 2023 10:42:36 +0100 Subject: [PATCH 2/4] media: i2c: ov2685: Add print for power on write failed MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230129-ov2685-improvements-v1-2-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=852; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=fIplo9JpImpQeisw7bapzCgXeb9xPVwhFZKge8ht7KI=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBj1j+YkQM6n+QsokVKigwFK5cBsCkYGjl+8gx6I8bu mnqR84qJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCY9Y/mAAKCRBy2EO4nU3XVtWbEA CFHa4eVdFWJ8fw5jhJA6GUKKjvGnkKmp8SPepUjCxRSp9SWvzZG4B+Am4tgUAjz303KwyiYd4CEetP Qhd5pPtPWmq+lxt39gc7nltKjLAwqktTtOrH3F3gytBi9+6cozRA9BFxlNknhGXWxa8ipGge41NC0r 01OIpLD+LWRCMUdUs8XzzOV/3+M5a+Yk0z7vNPM7b/IZvwyjIF3Q3VUM1PgJi4rX/71+ZZQJtByJUU oY0NJRMThJmIWu9ez69YQI5f8jtuLE+0o4yiuTEyFH7/ShdILqfmGMeBn+H0UFASF75p8DSonirkZr +67nc3SR15+azeZPYP7nChALEaN+nW7nv5u5a2keQ/AVAkKyEV7pgm30+Or1Aa5UivFQirbTdod951 7S1mwnCj6Nh7Z7pOynxvP1F9+mRUj54sWiMmCUqHay1SP+ZuvmJghCnWgkNe7YdJKXuec7UMqK3LKj wHgDqsC00j7L+bcg5yWDIUfqvAgv7dethCmvKqSAPYZTHqt/vJSGeCMs5C1OrnRM1yIfgOjUoNUeKQ mpg82wl6evHnTZVKYYQJP1QOZvDb5LcRomULoVjeCyn2czk+s5H241OgvHlq2SYEufGsj8yKtqTpZ+ zwsXfkNdfS7Cm+JfgRUaTP+w/KXWS24yarh5RKm1LLCwcxN2p8C0YdFmASLg== 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?1756349818130307411?= X-GMAIL-MSGID: =?utf-8?q?1756349818130307411?= |
Series |
Improvements for OmniVision OV2685 driver
|
|
Commit Message
Luca Weiss
Jan. 29, 2023, 9:42 a.m. UTC
If the sensor doens't power up correctly, for example due to incorrect
devicetree description, the power up i2c writes will fail.
Add an error print for this situation.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/media/i2c/ov2685.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Hi Luca On Sun, Jan 29, 2023 at 10:42:36AM +0100, Luca Weiss wrote: > If the sensor doens't power up correctly, for example due to incorrect > devicetree description, the power up i2c writes will fail. > > Add an error print for this situation. > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > --- > drivers/media/i2c/ov2685.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c > index a422f4c8a2eb..844a91dbc8e5 100644 > --- a/drivers/media/i2c/ov2685.c > +++ b/drivers/media/i2c/ov2685.c > @@ -419,8 +419,10 @@ static int __ov2685_power_on(struct ov2685 *ov2685) > * writing register before .s_stream() as a workaround > */ > ret = ov2685_write_array(ov2685->client, ov2685->cur_mode->reg_list); > - if (ret) > + if (ret) { > + dev_err(dev, "Failed to set regs for power on\n"); > goto disable_supplies; > + } This is fine. I would also consider if it's worth to fail loud in ov2685_write_reg(). Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > return 0; > > > -- > 2.39.1 >
diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index a422f4c8a2eb..844a91dbc8e5 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -419,8 +419,10 @@ static int __ov2685_power_on(struct ov2685 *ov2685) * writing register before .s_stream() as a workaround */ ret = ov2685_write_array(ov2685->client, ov2685->cur_mode->reg_list); - if (ret) + if (ret) { + dev_err(dev, "Failed to set regs for power on\n"); goto disable_supplies; + } return 0;