From patchwork Wed Jun 7 16:47:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 92409 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1q6wLE-00Gsfe-1I; Wed, 07 Jun 2023 16:49:00 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbjFGQs4 (ORCPT + 1 other); Wed, 7 Jun 2023 12:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjFGQsy (ORCPT ); Wed, 7 Jun 2023 12:48:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F39231FF7 for ; Wed, 7 Jun 2023 09:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686156487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9B1rK5UfcHEOjKUJC2Q5QVvKWLxtIFz6U9xsTm5O3kE=; b=EsAWYzE+B0aGy7+PbISnUmLtJBMyqmMbIUtwD/DryxQ6DvPkqlsDLMFYyfHcFtben9sxNs A6qnP4EU74oegAfqmgxxwyzvmIYDWs6Gb+XrbXgoclB7pET4L4hYb4UnWnpmSjZiSrsrwe Oez1ODd5m8mIRXM2em6x78sWK+DExFM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-fxHfouVGPGGLDwjtpmqsKQ-1; Wed, 07 Jun 2023 12:48:04 -0400 X-MC-Unique: fxHfouVGPGGLDwjtpmqsKQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A93C51C08DA9; Wed, 7 Jun 2023 16:48:03 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E867C0004B; Wed, 7 Jun 2023 16:48:02 +0000 (UTC) From: Hans de Goede To: Daniel Scally , Laurent Pinchart , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Kate Hsuan , linux-media@vger.kernel.org Subject: [PATCH 28/28] media: ov2680: Read and log sensor revision during probe Date: Wed, 7 Jun 2023 18:47:12 +0200 Message-Id: <20230607164712.63579-29-hdegoede@redhat.com> In-Reply-To: <20230607164712.63579-1-hdegoede@redhat.com> References: <20230607164712.63579-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Read and log sensor revision during probe. Since this means that the driver will now already log a message on successful probe drop the "ov2680 init correctly" log message. Signed-off-by: Hans de Goede --- drivers/media/i2c/ov2680.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 8872898ff2c4..399959cccd44 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -32,6 +32,7 @@ #define OV2680_REG_SOFT_RESET CCI_REG8(0x0103) #define OV2680_REG_CHIP_ID CCI_REG16(0x300a) +#define OV2680_REG_SC_CMMN_SUB_ID CCI_REG8(0x302a) #define OV2680_REG_PLL_MULTIPLIER CCI_REG16(0x3081) #define OV2680_REG_EXPOSURE_PK CCI_REG24(0x3500) @@ -913,10 +914,11 @@ static int ov2680_get_regulators(struct ov2680_dev *sensor) static int ov2680_check_id(struct ov2680_dev *sensor) { - u32 chip_id; - int ret; + u32 chip_id, rev; + int ret = 0; - ret = cci_read(sensor->regmap, OV2680_REG_CHIP_ID, &chip_id, NULL); + cci_read(sensor->regmap, OV2680_REG_CHIP_ID, &chip_id, &ret); + cci_read(sensor->regmap, OV2680_REG_SC_CMMN_SUB_ID, &rev, &ret); if (ret < 0) { dev_err(sensor->dev, "failed to read chip id\n"); return -ENODEV; @@ -928,6 +930,8 @@ static int ov2680_check_id(struct ov2680_dev *sensor) return -ENODEV; } + dev_info(sensor->dev, "sensor_revision id = 0x%x, rev= %d\n", chip_id, rev & 0x0f); + return 0; } @@ -1058,8 +1062,6 @@ static int ov2680_probe(struct i2c_client *client) pm_runtime_use_autosuspend(&client->dev); pm_runtime_put_autosuspend(&client->dev); - dev_info(dev, "ov2680 init correctly\n"); - return 0; err_pm_runtime: