Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6809820ybf; Fri, 6 Mar 2020 05:04:24 -0800 (PST) X-Google-Smtp-Source: ADFU+vsFLfzQovjCZNqw5vv8XKj+OeooxkKyNa8N1f9fs8r9aeSr3qhJSS27mddK+zSu5ygmWUJH X-Received: by 2002:a9d:6744:: with SMTP id w4mr2333656otm.163.1583499864476; Fri, 06 Mar 2020 05:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583499864; cv=none; d=google.com; s=arc-20160816; b=rWZbQPokJELHDd8T5UnNVlFt9MmMs+Ee0YlHq3tQ4ih5Ci1p6vX9iUt9X8LHwzpR7e wRpyrKrrt1Hz+hHciCSyDkxbR6TUmi3hUY6dB28GDx9WqCrLCWj6NJnS++gQthfeQHzh Xhh++z4c//IVeirmnMpRVC/nkILIqH5OTcTVg3vD2KG/IJ3eCkOZUjG6jJSuvSPRxogO HN0yQNGBaqaRA/ecEEhEC7SNboGg1fUwFpUsIr55UAQsgQFJ1Eh9c3pVvp1Ji10jzhPK zE4HSUWOaOJuQNvJjHS5ghUuW+U4ENwrhC9t/yM+uMmISfoS6ttkzew/MpUN6OzbC88Z PjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=X5TastwJnrVeQNVKcB2ayuhPbdTnWUMfIHdacFVQq3Q=; b=MDIeEbh8IUC1oQ9S9l3no0InuOhiBJcBUKvd4p6cnhOlY1jRUrkTz669aXhalBxNnP 9N0lHInN2+emiT2Y8+v3gLQU5ks4C2Y0uNjNwV8uYA3S3/4JMsFKokPIOanOH4aHBqZX x36f6z0dDkLa7CCwGXedGyjSFGv6++sLYJLqQCwgUnjRPR9vZbw9OWPowujPb/xXZb6w yCmg/Ua5W2cPCdwyVoM5Z1AHddIBLOv4oYwPlrikBywGw5XZMpWObVc9WXtJofWYJKfW c+1DD9iu+bzz4lkmoO+t/BrI0GV+FvJ567fvXvJQmzkNa7p/kzLUMpt+LPbmyKbqSQYe eD1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=BMtYlKzJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si1218139oii.21.2020.03.06.05.03.58; Fri, 06 Mar 2020 05:04:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=BMtYlKzJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727073AbgCFNB7 (ORCPT + 99 others); Fri, 6 Mar 2020 08:01:59 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45290 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbgCFNB6 (ORCPT ); Fri, 6 Mar 2020 08:01:58 -0500 Received: by mail-wr1-f68.google.com with SMTP id v2so2232074wrp.12 for ; Fri, 06 Mar 2020 05:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X5TastwJnrVeQNVKcB2ayuhPbdTnWUMfIHdacFVQq3Q=; b=BMtYlKzJjRuyW8XSL9YB+oMlM9yQuU5vNYIAowLfzpYb749vtpM9fnQXSnZq3d45nP 8W7BgfYBAby0seDVDrYWzGvY9FdBcnbIRkDX39pgULNpQpKn4xNVioydBPlYTaGgPdIl hE+EBWzV8I9Wm/mU8k4WNSaO38XFafy8sKj2hnWSbJKQhIDaFpnM1ycw3hvdq+UdI8o5 ZrRIU6HasJI4D8ZQuczRe8/xxrLYW44/C4g1GGWgxLVYtCgG+xhqQzFCRRkecsgd4Rq3 i0KgZHXXS30Hk2Yu9YVnPo4zrKnr55g5H/Br1gHt4lfBtaO8v4kDtApGYMFQVYGrrb8g kr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X5TastwJnrVeQNVKcB2ayuhPbdTnWUMfIHdacFVQq3Q=; b=HnTzDZtgXTExybSnNEIVouzExjX1AtOre5iM+01PrN7MWfGPsXrm4rUDveCFGHm/zk LL033kR9xe4sdVuDx4sGPuwcI+7CFQP3uZa+KSaT0F5mmpotoe+8x2vE21KluSX/8RM1 xiC2+sXcmCeIHFqaZ7rqFXMHbkNIXPphF3XgiNsFkN6DrSYYyOszlTE7P7kEkjBTAj2b TZx73MNx/+gp49muPOYj/nRD9SQ16Kohdovtac09+jF9JBztH/lZDch0Gj2z7r6963j1 wJIPcCqrFA9CyGXug8QoofivToUONQePVPn7x/OR8PSbT0AWw0MbM1u/Sh3WffuLzfez rCzg== X-Gm-Message-State: ANhLgQ0ypcE/q2RVZetcBA0LKzYJVeFYgSzNf8GB8nJBdySxkSWnzVxt PWwlAjJ5MySy8YsrY3r6fqefKW1rUaRnGzBII1+qMw== X-Received: by 2002:a5d:69cb:: with SMTP id s11mr3830315wrw.47.1583499716386; Fri, 06 Mar 2020 05:01:56 -0800 (PST) MIME-Version: 1.0 References: <20200306103246.22213-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200306103246.22213-2-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20200306103246.22213-2-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Dave Stevenson Date: Fri, 6 Mar 2020 13:01:39 +0000 Message-ID: Subject: Re: [PATCH v2 1/3] media: i2c: imx219: Fix power sequence To: Lad Prabhakar Cc: Mauro Carvalho Chehab , Sakari Ailus , Linux Media Mailing List , linux-kernel@vger.kernel.org, Lad Prabhakar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar. Thanks for the update. On Fri, 6 Mar 2020 at 10:32, Lad Prabhakar wrote: > > When supporting Rpi Camera v2 Module on the RZ/G2E, found the driver had > some issues with rcar mipi-csi driver. The sensor never entered into LP-11 > state. > > The powerup sequence in the datasheet[1] shows the sensor entering into > LP-11 in streaming mode, so to fix this issue transitions are performed > from "streaming -> standby" in the probe() after power up. > > With this commit the sensor is able to enter LP-11 mode during power up, > as expected by some CSI-2 controllers. > > [1] https://publiclab.org/system/images/photos/000/023/294/original/ > RASPBERRY_PI_CAMERA_V2_DATASHEET_IMX219PQH5_7.0.0_Datasheet_XXX.PDF > > Signed-off-by: Lad Prabhakar Acked-by: Dave Stevenson > --- > drivers/media/i2c/imx219.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index f1effb5a5f66..16010ca1781a 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -1224,6 +1224,23 @@ static int imx219_probe(struct i2c_client *client) > /* Set default mode to max resolution */ > imx219->mode = &supported_modes[0]; > > + /* sensor doesn't enter LP-11 state upon power up until and unless > + * streaming is started, so upon power up switch the modes to: > + * streaming -> standby > + */ > + ret = imx219_write_reg(imx219, IMX219_REG_MODE_SELECT, > + IMX219_REG_VALUE_08BIT, IMX219_MODE_STREAMING); > + if (ret < 0) > + goto error_power_off; > + usleep_range(100, 110); > + > + /* put sensor back to standby mode */ > + ret = imx219_write_reg(imx219, IMX219_REG_MODE_SELECT, > + IMX219_REG_VALUE_08BIT, IMX219_MODE_STANDBY); > + if (ret < 0) > + goto error_power_off; > + usleep_range(100, 110); > + > ret = imx219_init_controls(imx219); > if (ret) > goto error_power_off; > -- > 2.20.1 >