Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp254289rwl; Thu, 23 Mar 2023 15:51:22 -0700 (PDT) X-Google-Smtp-Source: AKy350bY5EYLpY8MLjL7FJAGHmNc3vmzzeJ4Lhni2qT2BYxmovqxnvV8gsBAnwdma00C123dJ7cn X-Received: by 2002:a17:902:c407:b0:1a1:a5e7:a7cd with SMTP id k7-20020a170902c40700b001a1a5e7a7cdmr646194plk.5.1679611882542; Thu, 23 Mar 2023 15:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679611882; cv=none; d=google.com; s=arc-20160816; b=dTa43SlSqHJyKLcGlyo+2zsO7nXNEXFJKEbWuSGctepNyUxXsGNoWdQQzArukVk6Vb QG1aK1pPfKNjXnvRIbN9nE6il6BQINRqnWqQJckxWQ81s39MS6zIXQiFTSRRnjXX7juq tEUyqqYQPHVIkWdMwycasu+27zJnHHbff9yl5HppT9lCwIDEUjRjuaVSeeB5xJriMJ53 aKgLlsBECb13V7j+DlfXTl/NjYmlPDfcz4/S5nspxA21PEBDO6S8ILtOFZke6zp+EgF7 eNt+RGm7SKFDFs81qXdsAP6JDhieMarpx5OL7Ke1fr6JUGpS5qqv7rzgTHOs28HHr+D9 0YAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=CdTVHjsADgrUtpOwBKbWNa8pioeAM2MXvG5m5DIb414=; b=DZnjR9bZZpdLU2LOxrX5zlz6XZH/XGzBGtvlEWF9K+aTmxGtpNLxusIl7Nw4FbWpsn yNAXdlUHP+UJ2BSoHD+7nMKlRidVdP+RQpbZ1Ibk7HfluTOVFrfaQegjF2gEJM03L1aG 7CdF5vFWkBleVtaKG+IxuTYtIX4p/Cmii/9eQilq2ZV/P5EufDYglVpWbESCq0yt0MIP 4ypLS5Amp6yk2JnjoMOH8QnfYtudNEymxclY9s/01OtqP74egU1n5+QL6ycUvc+/Moeg 4cxLKGjEs1dOjXXj5J0C0qgMLxuY6WWzXC95SDB5b+azgPzXJ3kAarkRG4CrwiScET4c PpJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AIwzE2gW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a17090adb8700b0023b4158aaf1si2788351pjv.62.2023.03.23.15.51.11; Thu, 23 Mar 2023 15:51:22 -0700 (PDT) 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=pass header.i=@chromium.org header.s=google header.b=AIwzE2gW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjCWWoe (ORCPT + 99 others); Thu, 23 Mar 2023 18:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbjCWWod (ORCPT ); Thu, 23 Mar 2023 18:44:33 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4ADBD536 for ; Thu, 23 Mar 2023 15:44:31 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id y4so1173657edo.2 for ; Thu, 23 Mar 2023 15:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679611470; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=CdTVHjsADgrUtpOwBKbWNa8pioeAM2MXvG5m5DIb414=; b=AIwzE2gWam3D++FFiSRHrZNXHgSo1VxpihXId3P6pZlHiOBzWXAMWJ4L8dzVEp6t2W pKQP/XWRlkU3DdEDT1RW4LSYaCX2/kyNQwqHGjEi5C9JfqKreH1ea4SYiOMQYJgBhU1E q4fGN4pQlOB0ukBhe4ZfKxTrQxIMM38h0TEjQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679611470; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CdTVHjsADgrUtpOwBKbWNa8pioeAM2MXvG5m5DIb414=; b=mYZbGD7xvtE5+bktyhuUdUNX0gI/FJXBU/AXRCryQdOtAlrSJWK9I33Wk/tWbVqby3 NoSh599/l1W3Iqa8hXMxbl2j+IOUgbWHxbIhBwbD4vFi8b0dMAZuLgd9WJgC9qTLey90 MvaCFbhwdc28OsvBkxNN9b7vP8Z3N2GtjBhEfhUbuCMjegLHciEcGwP7+t+vF1vKmnAU 21WoIS0q36ynjom8WJ3AyX99NJpB78vKw9U7NRB1KdNzd8FuXrEQNGiX3umqSH3EaoGJ VrjtBffuVQv5IoSBh2WltB/uauvi+6bTtx/O8NPEO7joCxxLZRf5THzaHYFhb/SaCOtB lMTg== X-Gm-Message-State: AAQBX9chB1uI94Ne2kw+a83/JKf/vJLGsWBNwbuaamigg8l2lWkPbAHb rFZ+zQaORiHbLvgTn4kQHvBaCQ== X-Received: by 2002:a17:906:27c4:b0:931:c2f0:9437 with SMTP id k4-20020a17090627c400b00931c2f09437mr699584ejc.8.1679611469871; Thu, 23 Mar 2023 15:44:29 -0700 (PDT) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id 12-20020a170906310c00b00926d614b890sm9142408ejx.204.2023.03.23.15.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 15:44:29 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 23 Mar 2023 23:44:20 +0100 Subject: [PATCH] media: ov8856: Do not check for for module version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230323-ov8856-otp-v1-0-604f7fd23729@chromium.org> To: Mauro Carvalho Chehab , Bingbu Cao , Dongchun Zhu , Sakari Ailus Cc: Jimmy Su , stable@vger.kernel.org, Ricardo Ribalda , Mauro Carvalho Chehab , Max Staudt , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=2803; i=ribalda@chromium.org; h=from:subject:message-id; bh=cPmW9PIAQV0oW1FFn7JevApQXapAZ6JE7zWGVu77Wy0=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBkHNZHIMdRe56gkWocjJataai80hqI5TEZVZSNly25 Ts/uY3CJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCZBzWRwAKCRDRN9E+zzrEiJO+D/ 9II07gziHMA171jdsHqZ9+/rGuhg0AK2NG0ghAZ+0my0yCPcSSLrxJwYfQxYMS9NcFBV4sBz1/AkwI 3orZcbylZAVIJvZxvOmhUgeZotIqj1+A8OCbYkMW8Gy8SFXdds5Y5YT3nGL8GO2WdWHs+AaC316jW0 BJ8jBlVFGEt8jG3lxmiw0iESS+rl8EBL85CpYbCM/UgSiu6QcOuUiJwnPy9R1jm54ZE6amhC+u7J7T GVN3sB+KWlxXzDlX8V4eeH9ti+7axyDQWGaNk508KUymqgXAEnhFWP6L51vOJt9HoxJNyLZtCyKaSb +Y8R53bwpWcE4gM7yN9MmbgB89Gf40XEVQeAGyk24AvYdqze5xY2XR3nXDMaGW5bu2C1bcM3vkBc22 A0QwdqhHkyTyjVkZb+u7yz1s6Q+6OAqYFPV70CzPtcNAJxAa2yMKRw8c+sb3Zu+LK1Zz7ldpFXC7XN Xt5c+LEezeA0DPcjGw6cXXQoNsB3y8YGoaN3is4lYG/72hpdMUihGua33yTW+BbCHO3RHpxTRzbLEe OdetfsHBoTwYrYPYgRfUgEWbkLJuby5LVQsgsqjbD2bg+n+3qNycWPe7WRNKe/BvEl/wPSt506yY3H AOCxSPxtnJVf38k1UT6La4Aw8igQiT3fvqOtVXWu7GY3mP8ZDx+rE1wlqekw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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-kernel@vger.kernel.org It the device is probed in non-zero ACPI D state, the module identification is delayed until the first streamon. The module identification has two parts: deviceID and version. To rea the version we have to enable OTP read. This cannot be done during streamon, becase it modifies REG_MODE_SELECT. Since the driver has the same behaviour for all the module versions, do not read the module version from the sensor's OTP. Cc: stable@vger.kernel.org Fixes: 0e014f1a8d54 ("media: ov8856: support device probe in non-zero ACPI D state") Signed-off-by: Ricardo Ribalda --- To: Dongchun Zhu To: Mauro Carvalho Chehab To: Sakari Ailus To: Bingbu Cao Cc: Max Staudt Cc: Jimmy Su Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/media/i2c/ov8856.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index cf8384e09413..b5c7881383ca 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -1709,46 +1709,6 @@ static int ov8856_identify_module(struct ov8856 *ov8856) return -ENXIO; } - ret = ov8856_write_reg(ov8856, OV8856_REG_MODE_SELECT, - OV8856_REG_VALUE_08BIT, OV8856_MODE_STREAMING); - if (ret) - return ret; - - ret = ov8856_write_reg(ov8856, OV8856_OTP_MODE_CTRL, - OV8856_REG_VALUE_08BIT, OV8856_OTP_MODE_AUTO); - if (ret) { - dev_err(&client->dev, "failed to set otp mode"); - return ret; - } - - ret = ov8856_write_reg(ov8856, OV8856_OTP_LOAD_CTRL, - OV8856_REG_VALUE_08BIT, - OV8856_OTP_LOAD_CTRL_ENABLE); - if (ret) { - dev_err(&client->dev, "failed to enable load control"); - return ret; - } - - ret = ov8856_read_reg(ov8856, OV8856_MODULE_REVISION, - OV8856_REG_VALUE_08BIT, &val); - if (ret) { - dev_err(&client->dev, "failed to read module revision"); - return ret; - } - - dev_info(&client->dev, "OV8856 revision %x (%s) at address 0x%02x\n", - val, - val == OV8856_2A_MODULE ? "2A" : - val == OV8856_1B_MODULE ? "1B" : "unknown revision", - client->addr); - - ret = ov8856_write_reg(ov8856, OV8856_REG_MODE_SELECT, - OV8856_REG_VALUE_08BIT, OV8856_MODE_STANDBY); - if (ret) { - dev_err(&client->dev, "failed to exit streaming mode"); - return ret; - } - ov8856->identified = true; return 0; --- base-commit: 9fd6ba5420ba2b637d1ecc6de8613ec8b9c87e5a change-id: 20230323-ov8856-otp-112f3cdc74b1 Best regards, -- Ricardo Ribalda