Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp102753lqh; Wed, 27 Mar 2024 16:36:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZsQ1gbsOaL3Pb5bSa53jy8tEIit5T4egp2gSMt0mf/3Ru6Hf+mv8oZRK18DzVWxIQJJsmSYDZMWt+iAxz1unvDcjl8S7v8G47wb7BZw== X-Google-Smtp-Source: AGHT+IHB55E320hDmfOEt3UuhZvRT+zcHwWniyeGmlg1bqvTQ53A/1o2MUIen4JZQ5F5cYY7FxxQ X-Received: by 2002:a17:902:f641:b0:1e1:214:1b68 with SMTP id m1-20020a170902f64100b001e102141b68mr1516230plg.22.1711582562894; Wed, 27 Mar 2024 16:36:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711582562; cv=pass; d=google.com; s=arc-20160816; b=lKG5rE8v7dht6tYPR2KBNKOJ97GCsLdYCTieKtdyucD43PaiKLkctBuRmXphIl6IZG fNQ0epR4elUf5mnWHbDBXqPxvehv4vjKT7kEYWj4viyQuK6E3XidQ3BWrXBJFTUF5ORp Ov0Naucm+e/QMbHnHVn1TZzxkqdxp3LpXpLCT412UJBDQsVjDQ5+3tf1gEbPOle+1rCq wZi+qaBlyk3/i/+kElBOd18FsQa1kAUjV3Cc5ASciWU6ypbFk+cr/6Alac4Uf2t3spGN jEqaKvZ9m9r9FPUsuHqtmK60WCbUStcn211tpAEdUGhEB/w2z87akqM/EPJQjIo6s5OT 39VA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MWmmMzvpB7rAQwa1TAxwPfh+Zj5RVzbFzB4BAQpgxHA=; fh=zsnVypYi1jV7NeC/3VcVRjyPykaaos/xhW4+C3vOkss=; b=d0btPFl1RKUnc1C27eM2QADroaiwS9wTNlVmo9jBYu7e56A8YCDXS9HRcJjB9w13cM u1bBwCts51Gvsu16i61HFrbgXVK+AnPcmj/vCrrjzlOtC0rWzRCfRwm7MxW4f8ZJnZd0 daM2mrBoFlhNgH4+H6WBX5FQsF7s/EVC1+nqVkiqGYy2ZklJrjaP619iHPgxdC45ua/o hrfbtD9cW/ORFBrtdvYOtVjTV73cr/aOIT2SH16MZnj+vIvTrQl+jXjqf1W2cfkidips nquHxcBaMAf6/h7cPx17kFQuDnCgB3ZhqfT1JpF1gtsKzxHWWpwRYmUCiRBxJ1qLPKge sOZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=HJ1eg5oN; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-122176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122176-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f5-20020a17090274c500b001e0e8e576a4si148358plt.462.2024.03.27.16.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 16:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=HJ1eg5oN; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-122176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122176-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 654562A4AF3 for ; Wed, 27 Mar 2024 23:25:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9761F15687F; Wed, 27 Mar 2024 23:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="HJ1eg5oN" Received: from mail-108-mta123.mxroute.com (mail-108-mta123.mxroute.com [136.175.108.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DD1C156669 for ; Wed, 27 Mar 2024 23:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711581807; cv=none; b=Lp09sb4TXvgP3CDt4i1frTcOvkxcmRZcijrGXTUZTtExCTYMsZhTBnT7KkjXO1i6RdVOIkjPVId0aDoyUHWsBf/yD6Vk5zZpoIm743H5MdttCRyEb1ugnsr5CMa4YFcZpYHcMW2ErVICa5B+qoZ/MYon592doNiCjmmq6n9uP9k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711581807; c=relaxed/simple; bh=6+2wz7C48VzI3IyZhlih65O+oIcytRh3P8S1DW3VqYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WWqtEZB+n5DNZRhB7WIiePm1BEoqBksY0epsZxZd89GqQKYh2aLq2WAf1ry2Pk72ElNNoya/ZwG17EGLtSWOZFTrvNByyz4bSYfoc/Y1nzeXsk1iAoFKnpbKKxwICv8qLfnoUoLuUhGokxMng5atJ/ChKNw0qm6KceKPWixWj88= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com; spf=pass smtp.mailfrom=luigi311.com; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b=HJ1eg5oN; arc=none smtp.client-ip=136.175.108.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=luigi311.com Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta123.mxroute.com (ZoneMTA) with ESMTPSA id 18e823488ac0003bea.00f for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 27 Mar 2024 23:17:44 +0000 X-Zone-Loop: 772719196a745200371b9d60c1a9d2c9fccf6a25e704 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MWmmMzvpB7rAQwa1TAxwPfh+Zj5RVzbFzB4BAQpgxHA=; b=HJ1eg5oNFBw6ptNnK6DZzTUMzV eizEzmCukzFA5ZssZ1MdX5BAte3cGofJ/hqCj6uVuVQxWdTOIcAB6FGDKE420+IytRo4HNswQy6FN QQADfHQLAFNW88ni8/35rUCXtevGG3wkSdJK5pAfyDJMbTpTd5RI3/bhay2IZ3FQA7bkxvabqSlx+ Yu2Gy8YQnWQauI3NjagAnxbq/LJlYm3VrFd3rVRaiTMrMnUvrTzeCLfwdC1qakl1Y3LHSgiGoJFVH CxcosMAqcgoF1xgeaL3Js5On987dUVbavhEkf4YpNn4jsogebyYaEjxb3q9lwlbmMvhrJAiok8oFr EOelcVUg==; From: git@luigi311.com To: linux-media@vger.kernel.org Cc: dave.stevenson@raspberrypi.com, jacopo.mondi@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/23] media: i2c: imx258: Issue reset before starting streaming Date: Wed, 27 Mar 2024 17:17:00 -0600 Message-ID: <20240327231710.53188-15-git@luigi311.com> In-Reply-To: <20240327231710.53188-1-git@luigi311.com> References: <20240327231710.53188-1-git@luigi311.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: personal@luigi311.com From: Dave Stevenson Whilst not documented, register 0x0103 bit 0 is the soft reset for the sensor, so send it before trying to configure the sensor. Signed-off-by: Dave Stevenson --- drivers/media/i2c/imx258.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index c2c5e819ddc0..a62ed8c26663 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -20,6 +20,8 @@ #define IMX258_MODE_STANDBY 0x00 #define IMX258_MODE_STREAMING 0x01 +#define IMX258_REG_RESET 0x0103 + /* Chip ID */ #define IMX258_REG_CHIP_ID 0x0016 #define IMX258_CHIP_ID 0x0258 @@ -1059,6 +1061,16 @@ static int imx258_start_streaming(struct imx258 *imx258) const struct imx258_link_freq_config *link_freq_cfg; int ret, link_freq_index; + ret = imx258_write_reg(imx258, IMX258_REG_RESET, IMX258_REG_VALUE_08BIT, + 0x01); + if (ret) { + dev_err(&client->dev, "%s failed to reset sensor\n", __func__); + return ret; + } + + /* 12ms is required from poweron to standby */ + fsleep(12000); + /* Setup PLL */ link_freq_index = imx258->cur_mode->link_freq_index; link_freq_cfg = &imx258->link_freq_configs[link_freq_index]; -- 2.42.0