Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1390887lqt; Wed, 20 Mar 2024 02:30:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+EqvPj0U+eyD3T9RTT2Y5+xOfeuXn/esdj50tLoR8T6wUhqaip/hzALmzyGyI1PhzQPyh9Q1z2XP9Ttwg6I+2u2NmbMHodOcZIxXH/w== X-Google-Smtp-Source: AGHT+IHZEg3OIxa/CtsXOdf5Rk1YTCMZeYv+P0vGUfYDO1bT/OHODMmebFdY2OQobCxPDnsDyJWn X-Received: by 2002:a05:6808:bd1:b0:3c3:7810:414b with SMTP id o17-20020a0568080bd100b003c37810414bmr18873576oik.29.1710927022583; Wed, 20 Mar 2024 02:30:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710927022; cv=pass; d=google.com; s=arc-20160816; b=sCEZogJFVqJCpxq/di4V05vQ2f/+SkCpoqvL9TvFOlBDEN3flpSEHVS1N8BX5dHpif nUtxzxsFR8SghcDM0Lpy6GNGUprbKN1MgNfMYtBaf//DrB7alLmJjyPXFN3Q3fZU4Om4 2GiM2i9hFg5N/+yFhqLPvU8G+olXP785QBgPOGTXEZew9RH0Q6uZjkUYo06/ib7POwCn pzkZ/y0SPGXHzahcCmgeNS6E8Fb9qcwCBs5wIAZi5BbzZrb/9DiTpngHqKN5FXV6DBzj Py5dEJZP4bhbES75KAGjoCtwDWgKkFraZwQHHd4OaVlYjItITJzr0MJ5m06/jGIr/rdM OqiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=J1KMm3bcETKmx2GlY8Sy+cywK4QQ2O/HxmwbrFSu9Os=; fh=n/ONzX9OkfGd3lXYjBhCd+C04ut+9aYyI2E86PY89Hs=; b=i95jMBIfTfFZVYrOyScN2dL1zSp4Y3DoftEwLaDPwYUj1Oty6+N4QcV3tASXkQfxA+ tZa1jhlCsAdfMpL6pAmrxRaL4K16Wo9H80JA0d90I1p1qPgdHcX629SVN0Rj7V47hx64 z9gs5tbmV5ThdNsUByB8ovb4iMqjdNDEdxVohIIkdX3rBY3UHVCxE6aT+T4s9NUqJ8xU s/B6ItScF1HO+hHzVyV/9xmOWz81i5eR0sABZ5EmW7TD4pc/dGg2HWwuZ1Uhb0Sd/cZB HAwPYGB405lrVGyut+mCW83CqCF8kXBMOfCeUlUjs+I/v7Zpps7K5sarlv7VdpHF3ElH z4wQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jE7D2BU/"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-108541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r5-20020aa78b85000000b006e6b68060acsi12542630pfd.115.2024.03.20.02.30.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 02:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jE7D2BU/"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-108541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 689CBB21F4C for ; Wed, 20 Mar 2024 07:29:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2D6F22318; Wed, 20 Mar 2024 07:29:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jE7D2BU/" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371D32BD01; Wed, 20 Mar 2024 07:29:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710919755; cv=none; b=GnFgWCTm2w4jsQ0eNawJzGVRJa2XHiGJvz01M2SAGXLqB9vlvzAGcyWsESusJ0TW2kPYRR8XPoPwG0XoQ8h9o7j6NTCIW+ZwGgXomh8B39VaCe+5dTtaZC51ejEuBK9W4BCkw6YTebULMTL878Vryotn5Wxw74utoEVapctxOs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710919755; c=relaxed/simple; bh=SIJLQWAZttGxLBgmyLL6igS6AuPkYTJuC02fay6r37E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LBWjF23BquCbWAL6CvAJIhC6e+RXN3T9Ckv3Hh9ZwuMJab2b3Yz+N7amFKbatu7mD0BlnpG2akyd2ca9Yty1XUwfIcdO8eXlHsOnd8qAnmGFnmqq2+hiPFelTG0Eg0gWmZgScosXFWgev4IxnDcgkE1zOsBt2NDklcRbI175/tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jE7D2BU/; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710919753; x=1742455753; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SIJLQWAZttGxLBgmyLL6igS6AuPkYTJuC02fay6r37E=; b=jE7D2BU/YpudfW/7il6RsJ/u0w0j+jDWDYtjQObqMiLBj1KtXdXJHiYL Kdh9zAGLPTwj3bbnpxdloZy0wEHg4mDyxPEWwMniIGTlBbtfV2UNdUsqr LiTiuhZ0nK3Ed/vA4eR+HDnPwUOxvWIcwTPtsqWac5CTnizB72+grqCm0 oRTnWWpgPLqj0MS+G80wHjuyQXyfIsN2cACaTNK0JZk7OM9WSrXS1agp9 6Oo9dXKn+sJFnJDngwzRT0mipGS80MZDVHFOUNySfqzRezInUyZbGsy0E /i+usOi6tdJBrlSbizdq2Hxa7mG22ebW+Oarieh9Hg3vpv7yht6VJl0a+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="9598536" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="9598536" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:29:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="51507652" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:29:04 -0700 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 6E3E911F853; Wed, 20 Mar 2024 09:29:01 +0200 (EET) Date: Wed, 20 Mar 2024 07:29:01 +0000 From: Sakari Ailus To: Zhi Mao Cc: mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, laurent.pinchart@ideasonboard.com, shengnan.wang@mediatek.com, yaya.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com, yunkec@chromium.org, conor+dt@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, jacopo.mondi@ideasonboard.com, 10572168@qq.com, hverkuil-cisco@xs4all.nl, heiko@sntech.de, jernej.skrabec@gmail.com, macromorgan@hotmail.com, linus.walleij@linaro.org, hdegoede@redhat.com, tomi.valkeinen@ideasonboard.com, gerald.loacker@wolfvision.net, andy.shevchenko@gmail.com, bingbu.cao@intel.com, dan.scally@ideasonboard.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v1 2/2] media: i2c: Add GC05A2 image sensor driver Message-ID: References: <20240316025253.2300-1-zhi.mao@mediatek.com> <20240316025253.2300-3-zhi.mao@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240316025253.2300-3-zhi.mao@mediatek.com> Hi Zhi, Thanks for the set. On Sat, Mar 16, 2024 at 10:52:53AM +0800, Zhi Mao wrote: > +static int gc05a2_set_ctrl(struct v4l2_ctrl *ctrl) > +{ > + struct gc05a2 *gc05a2 = > + container_of(ctrl->handler, struct gc05a2, ctrls); > + int ret = 0; > + s64 exposure_max; > + struct v4l2_subdev_state *state; > + const struct v4l2_mbus_framefmt *format; > + > + state = v4l2_subdev_get_locked_active_state(&gc05a2->sd); > + format = v4l2_subdev_state_get_format(state, 0); > + > + if (ctrl->id == V4L2_CID_VBLANK) { > + /* Update max exposure while meeting expected vblanking */ > + exposure_max = format->height + ctrl->val - GC05A2_EXP_MARGIN; > + __v4l2_ctrl_modify_range(gc05a2->exposure, > + gc05a2->exposure->minimum, > + exposure_max, gc05a2->exposure->step, > + exposure_max); > + } > + > + /* > + * Applying V4L2 control value only happens > + * when power is on for streaming. > + */ > + if (!pm_runtime_get_if_in_use(gc05a2->dev)) This should be pm_runtime_get_if_active(). Please assume it takes a single argument (the device)---see commit c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3. The same comment applies to the GC08A3 if it uses autosuspend, please post a new patch for that. -- Kind regards, Sakari Ailus