Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp606054lqj; Sun, 2 Jun 2024 13:23:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdYUtngxpWxqGYdV0EtjBdkt9gy+T9VONhg61b23sxH8HPXY5TWjUF3mhiOX2kftOfOm7oaJcZIAxmpfiXC/svaCSZzoIG6Pij14SWRQ== X-Google-Smtp-Source: AGHT+IGBfWLwd6rt7pe7//W6SA8lKeh4Sn11gGpW4Xxe77hkmEOmn8LWJ8aG9eCh0fm4RuIUNh9s X-Received: by 2002:a05:620a:280c:b0:792:91bb:9ca3 with SMTP id af79cd13be357-794f5c89a1dmr944698385a.37.1717359821884; Sun, 02 Jun 2024 13:23:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717359821; cv=pass; d=google.com; s=arc-20160816; b=OJ8RF8Rlqkj/fhsYGvduHB2JbmagDfAsbaN5IyNa9elUdDyf2VjQZDL2U5Y06iJl9l e7dmokLFLcqdlcT8dfTW6w7w2k6MFIaJw1ZXzhFSzcwa80QDWMPeXc/qAruLQrTVnBlL Xet2aMqFXxBgcpye+Z71eX6+5cjVPSFM75JLLz2NF4yUBKP+5vVNUgUBDv14NuP/H1zH 1UTLpaYN/SbMmGeKAWvDvubMFxMrhe9rDrFEoJagnfgrzy+5RBpxM3zskFvuKi9r3W5q dqBOCbMhjHBsbMk7vA57utrEyUw1ZhDJjGl/iB5cgNAfn1kUkZOEA7jkLu6CN84C8HNh n23w== 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=Mc+RbIL+DgqYcfe/mLvPif24eMzEBPY7cltm4NspsTE=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=kFtAt7kHtP/XFomMDQZb1MBO+dp1eFqOJ7AB+6OMST7r739BVhwx1S4OjBL4YtyCdf AS2Zhj/FygPDkNeCINDVOEpBo/ka5gAVXMD5JBusigDfp1NpIFQwRbuVfQFCYMnXOUmv qye9gu2duLUlkk8ZQYbARwmmHqo9IIlDOl2qB1EenGu1DTRl+d9+Z0odNg5c4a3mUxCy a3wT+cjsAtGTZqkWiFAPEIYPpjdN0pNSAxVkfLlt3keatLNv9WYgJBSej/VhUUxDIYwr uxEoe7CxJodEE2DKlYFLA4tRIKjecwRXBen1ForbCIFNMQPHGJo9v4KHBrHCCBINbj1n NhgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=r1pmuNLg; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198418-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f3188ed8si700731485a.475.2024.06.02.13.23.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=r1pmuNLg; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198418-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A3D41C21FED for ; Sun, 2 Jun 2024 20:23:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE5EE84E10; Sun, 2 Jun 2024 20:20:26 +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="r1pmuNLg" Received: from mail-108-mta31.mxroute.com (mail-108-mta31.mxroute.com [136.175.108.31]) (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 4F10184DF6 for ; Sun, 2 Jun 2024 20:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.31 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359625; cv=none; b=dLca+4JEEUYJ4GxnpVxEOVrpnNdoWVI/dXcuArxy6vbLNGxZTGudTjkwuQ7mIASIN9zTGS6YbQ3AiF5t36KhUPqS3neONnZjg16E5zqUfpU9nD9MMmNWi3UjqhSF1+bQf/0nRiDQUoQ3nTpUaIwTaOl79gjwwGZAw99p65I388c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359625; c=relaxed/simple; bh=t0DpAm14I63PD+zKjpelnQ5UomdKi3PfstUiSulsvmk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JFlvoRUGQlkvPAr8fEs5NU8UjPqkYQFZUTwXxTB3smIhTWz5rNZz70fPZf12ViEMc4M+3JXI0YccBOZKc8vYxGnD1MIo5ItZ86bXX7A160S4leYe15kYe4GYClyLUy1aLBFgpC/ptBRXpElLx7l9sHEuRnijbW9axUq+o84JgLY= 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=r1pmuNLg; arc=none smtp.client-ip=136.175.108.31 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.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta31.mxroute.com (ZoneMTA) with ESMTPSA id 18fda96bc57000e2b6.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 02 Jun 2024 20:14:22 +0000 X-Zone-Loop: d6d3d5012de4b0dac9a72e32abcf66ebf3694608a6ea 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=Mc+RbIL+DgqYcfe/mLvPif24eMzEBPY7cltm4NspsTE=; b=r1pmuNLgrmVRdy3DspwaEwSbql yEc1bf+nm9x08MET0M1CrqWtVKqF3DKQ6XvFgCl0P3lEkUhNp/H+G21OoASACXJO+5u5yjDuS+FJA JjhRiS8zsBKqSSu8Nt6GYSexcf3KtHf/dgr1qBdhpGfVgRdh5s7MBNVqWzn5CvfwSXZHmoUsWhRFF 9MjaOGtzKEeHPiL3sVjpXYrNZIYLIWdJMtE7KPRLGeyDJq+r7aDKsDUbIWFoxBypxX+v2CZL9QYba b4pAiwpajpBSlSfTqZv4V1c0NywisI2IbYoSnwa4uDkvTpht3nnrIrvPSv3iyIH/vfGD2q9bj0kHS 2ZCL/8bw==; 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, pavel@ucw.cz, phone-devel@vger.kernel.org, Luis Garcia Subject: [PATCH v6 14/23] media: i2c: imx258: Issue reset before starting streaming Date: Sun, 2 Jun 2024 14:13:36 -0600 Message-ID: <20240602201345.328737-15-git@luigi311.com> In-Reply-To: <20240602201345.328737-1-git@luigi311.com> References: <20240602201345.328737-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 Signed-off-by: Luis Garcia Reviewed-by: Pavel Machek --- 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 c1a2c2406aaa..9c83ba1232fa 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 @@ -1052,6 +1054,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.44.0