Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1977734ybb; Fri, 29 Mar 2019 15:38:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdxMqEmhtqwWR0MCJ/kH4nOtOUb1FS+XWaINnIp79x7NoQaRGqTu/2bBEyYOePf+xK7VqR X-Received: by 2002:aa7:9193:: with SMTP id x19mr41035364pfa.108.1553899097159; Fri, 29 Mar 2019 15:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553899097; cv=none; d=google.com; s=arc-20160816; b=sR/Z4P7z6opgL0V+7hrAQm3E8lca5jPNXzneffAeoNgu2AzkboaalXddd8hOqfDj0i oFI6Tx6WKmbYjNP9+k+/KZRM6YQyCdCqxZoeM2G7IjJN4GR+FuOty8URdOgvsQC4gZiw neiqvZb1+1eI8ARbdgvILVNarEYYSV5BK6sHiotvYWueWvziL/a4o0ZCLH2KxBLc005B U27tS8vod9S2cHC+sP6n9ezviSBSn//iaY5OLf013exSZ3IWErEtfrJwOiozMXOX8nQ8 J1Qhn6BXUKI0BiciFVsGMBTbzp51bYjcDRwfo1zKhIr6jvY6XuHenMsKoTzMAJfo9HWs i8YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IgSk+/O6FmRC2rkPkn7ggOKKFgMxCImf/qsC76MDlMI=; b=vYbJjYFoDBf21Kmjbnt1JcwupcVNuxiV8O0bePHMhQtPSlWjts9CJFNYm+SblzyO/0 91aTiah2kfeqAqalID5eIP1gQoxe3+kRwrpXuMC17nhW9tFewt0kj9ZNPJC+O4NsEzR+ 34DD+WG8KNL6i7UGhxq0Z29UJdfmY3ECYknNBEJtbtkjPPxe2kB9f0dngd3BbYRuThbh +dNqf/in4A1gU9CK0xwYj9XYp5bWzloLt0gWo5IIWGBe65kIBEJtfJpwEEGWTzdHebq8 6iePlGypEi+M0Gp65tY4C304M6DU7rtIr0z59c/MBds51uVO8QPW1byoNsUCuvdcTKBm I/XA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si2987297ply.258.2019.03.29.15.38.02; Fri, 29 Mar 2019 15:38:17 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730481AbfC2Wf5 (ORCPT + 99 others); Fri, 29 Mar 2019 18:35:57 -0400 Received: from mga06.intel.com ([134.134.136.31]:51806 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730137AbfC2Wf5 (ORCPT ); Fri, 29 Mar 2019 18:35:57 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 15:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,286,1549958400"; d="scan'208";a="129890618" Received: from lparisol-mobl1.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.252.46.120]) by orsmga008.jf.intel.com with ESMTP; 29 Mar 2019 15:35:54 -0700 Received: by kekkonen.fi.intel.com (Postfix, from userid 1000) id 7A1E821E50; Sat, 30 Mar 2019 00:35:50 +0200 (EET) Date: Sat, 30 Mar 2019 00:35:50 +0200 From: Sakari Ailus To: Janusz Krzysztofik Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] media: ov6650: Register with asynchronous subdevice framework Message-ID: <20190329223549.7lbmcwqvubcmw4zs@kekkonen.localdomain> References: <20190325003501.14687-1-jmkrzyszt@gmail.com> <20190329202903.5622-1-jmkrzyszt@gmail.com> <20190329202903.5622-3-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329202903.5622-3-jmkrzyszt@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz, On Fri, Mar 29, 2019 at 09:29:03PM +0100, Janusz Krzysztofik wrote: > Register V4L2 subdevice implemented by the driver to the V4L2 > asynchronous subdevice framework. > > Signed-off-by: Janusz Krzysztofik > --- > drivers/media/i2c/ov6650.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c > index de7d9790f054..50e60da73036 100644 > --- a/drivers/media/i2c/ov6650.c > +++ b/drivers/media/i2c/ov6650.c > @@ -804,8 +804,9 @@ static int ov6650_prog_dflt(struct i2c_client *client) > return ret; > } > > -static int ov6650_video_probe(struct i2c_client *client) > +static int ov6650_video_probe(struct v4l2_subdev *sd) > { > + struct i2c_client *client = v4l2_get_subdevdata(sd); > struct ov6650 *priv = to_ov6650(client); > u8 pidh, pidl, midh, midl; > int ret; > @@ -817,7 +818,7 @@ static int ov6650_video_probe(struct i2c_client *client) > return ret; > } > > - ret = ov6650_s_power(&priv->subdev, 1); > + ret = ov6650_s_power(sd, 1); > if (ret < 0) > goto eclkput; > > @@ -855,7 +856,7 @@ static int ov6650_video_probe(struct i2c_client *client) > ret = v4l2_ctrl_handler_setup(&priv->hdl); > > done: > - ov6650_s_power(&priv->subdev, 0); > + ov6650_s_power(sd, 0); > if (!ret) > return 0; > eclkput: > @@ -943,6 +944,10 @@ static const struct v4l2_subdev_ops ov6650_subdev_ops = { > .pad = &ov6650_pad_ops, > }; > > +static const struct v4l2_subdev_internal_ops ov6650_internal_ops = { > + .registered = ov6650_video_probe, > +}; > + > /* > * i2c_driver function > */ > @@ -1003,7 +1008,12 @@ static int ov6650_probe(struct i2c_client *client, > priv->code = MEDIA_BUS_FMT_YUYV8_2X8; > priv->colorspace = V4L2_COLORSPACE_JPEG; > > - ret = ov6650_video_probe(client); > + priv->subdev.internal_ops = &ov6650_internal_ops; > + priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + snprintf(priv->subdev.name, sizeof(priv->subdev.name), "%s %d-%04x", > + did->name, i2c_adapter_id(client->adapter), client->addr); Could you use v4l2_i2c_subdev_set_name()? > + > + ret = v4l2_async_register_subdev(&priv->subdev); > if (ret) > v4l2_ctrl_handler_free(&priv->hdl); > > @@ -1015,7 +1025,7 @@ static int ov6650_remove(struct i2c_client *client) > struct ov6650 *priv = to_ov6650(client); > > v4l2_clk_put(priv->clk); > - v4l2_device_unregister_subdev(&priv->subdev); > + v4l2_async_unregister_subdev(&priv->subdev); > v4l2_ctrl_handler_free(&priv->hdl); > return 0; > } > -- > 2.19.2 > -- Sakari Ailus sakari.ailus@linux.intel.com