From patchwork Wed Jan 25 17:37:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 646884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5526AC27C76 for ; Wed, 25 Jan 2023 17:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235844AbjAYRhf (ORCPT ); Wed, 25 Jan 2023 12:37:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236068AbjAYRhe (ORCPT ); Wed, 25 Jan 2023 12:37:34 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D19D818B1D for ; Wed, 25 Jan 2023 09:37:31 -0800 (PST) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9CA3298C; Wed, 25 Jan 2023 18:37:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674668250; bh=eKUzX7f3ssB6e+vxGYoRVT1XBerfqzqH0bftzPhm45I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pm+MixEI3LSfL67v9em9zQVkTfppXBg3e4GUPEoKjSotjKpFjIl78yku9VjxKWnOL 7uRTyFnaOzkM3KFBCbrUIvaUZ+9EeXu1V0R6kQdo6+S7c36TO1Uem8qqgrCWg2WFFy KBAQia60pjNFI+hQEjuj1g4U8Q2BUMykHl8f0EcA= From: Jacopo Mondi To: Chiranjeevi Rapolu , Luca Weiss Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:OMNIVISION OV5670 SENSOR DRIVER) Subject: [PATCH v4 1/8] media: dt-bindings: Add OV5670 Date: Wed, 25 Jan 2023 18:37:00 +0100 Message-Id: <20230125173707.127687-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> References: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add the bindings documentation for Omnivision OV5670 image sensor. Signed-off-by: Jacopo Mondi --- .../bindings/media/i2c/ovti,ov5670.yaml | 92 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov5670.yaml diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov5670.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov5670.yaml new file mode 100644 index 000000000000..fa264255b5eb --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov5670.yaml @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/ovti,ov5670.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Omnivision OV5670 5 Megapixels raw image sensor + +maintainers: + - Jacopo Mondi + +description: |- + The OV5670 is a 5 Megapixels raw image sensor which provides images in 10-bits + RAW BGGR Bayer format on a 2 data lanes MIPI CSI-2 serial interface and is + controlled through an I2C compatible control bus. + +properties: + compatible: + const: ovti,ov5670 + + reg: + maxItems: 1 + + clocks: + description: System clock. From 6 to 27 MHz. + maxItems: 1 + + powerdown-gpios: + description: Reference to the GPIO connected to the PWDNB pin. Active low. + + reset-gpios: + description: Reference to the GPIO connected to the XSHUTDOWN pin. Active low. + maxItems: 1 + + avdd-supply: + description: Analog circuit power. Typically 2.8V. + + dvdd-supply: + description: Digital circuit power. Typically 1.2V. + + dovdd-supply: + description: Digital I/O circuit power. Typically 2.8V or 1.8V. + + port: + $ref: /schemas/graph.yaml#/$defs/port-base + additionalProperties: false + + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 2 + items: + enum: [1, 2] + + clock-noncontinuous: true + +required: + - compatible + - reg + - clocks + - port + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ov5670: sensor@36 { + compatible = "ovti,ov5670"; + reg = <0x36>; + + clocks = <&sensor_xclk>; + + port { + ov5670_ep: endpoint { + remote-endpoint = <&csi_ep>; + data-lanes = <1 2>; + clock-noncontinuous; + }; + }; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index f61eb221415b..38d8d1d5d536 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15468,6 +15468,7 @@ M: Chiranjeevi Rapolu L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git +F: Documentation/devicetree/bindings/media/i2c/ovti,ov5670.yaml F: drivers/media/i2c/ov5670.c OMNIVISION OV5675 SENSOR DRIVER From patchwork Wed Jan 25 17:37:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 646883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B601C54EED for ; Wed, 25 Jan 2023 17:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236137AbjAYRhj (ORCPT ); Wed, 25 Jan 2023 12:37:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236113AbjAYRhi (ORCPT ); Wed, 25 Jan 2023 12:37:38 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F22C45A360 for ; Wed, 25 Jan 2023 09:37:35 -0800 (PST) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 346D2188E; Wed, 25 Jan 2023 18:37:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674668251; bh=8JU7sJ2ljljJsNbMiSjJN5c8kK/fxi4OzT+BXQnCE0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ogG6TImT7fNLB1N2GUeXBll96dpa8Ac/TAFPxH5fxITZHfXDC39QWro3+nq5JvZqG v8frXZ1tv5T32X4e9I8hvPeYoOz1+HmL6sS8nx43BbvqksXvbImGezoZfkTiE8nWp8 UWourEJNqLRUilLbLNpbzWIjo7vIybArwMRTvS8k= From: Jacopo Mondi To: Chiranjeevi Rapolu , Luca Weiss Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:OMNIVISION OV5670 SENSOR DRIVER) Subject: [PATCH v4 3/8] media: i2c: ov5670: Probe clocks with OF Date: Wed, 25 Jan 2023 18:37:02 +0100 Message-Id: <20230125173707.127687-4-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> References: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add support for probing the main system clock using the common clock framework and its OF bindings. Maintain ACPI compatibility by falling back to parse 'clock-frequency'. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/ov5670.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 07a396c8ab68..c8beb2bc3d0f 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2,6 +2,7 @@ // Copyright (c) 2017 Intel Corporation. #include +#include #include #include #include @@ -2475,13 +2476,10 @@ static int ov5670_probe(struct i2c_client *client) struct ov5670 *ov5670; const char *err_msg; u32 input_clk = 0; + struct clk *clk; bool full_power; int ret; - device_property_read_u32(&client->dev, "clock-frequency", &input_clk); - if (input_clk != 19200000) - return -EINVAL; - ov5670 = devm_kzalloc(&client->dev, sizeof(*ov5670), GFP_KERNEL); if (!ov5670) { ret = -ENOMEM; @@ -2489,6 +2487,25 @@ static int ov5670_probe(struct i2c_client *client) goto error_print; } + /* OF uses the common clock framework, ACPI uses "clock-frequency". */ + if (is_of_node(dev_fwnode(&client->dev))) { + clk = devm_clk_get(&client->dev, NULL); + if (IS_ERR(clk)) + return dev_err_probe(&client->dev, PTR_ERR(clk), + "error getting clock\n"); + + input_clk = clk_get_rate(clk); + } else { + device_property_read_u32(&client->dev, "clock-frequency", + &input_clk); + } + + if (input_clk != 19200000) { + dev_err(&client->dev, + "Unsupported clock frequency %u\n", input_clk); + return -EINVAL; + } + /* Initialize subdev */ v4l2_i2c_subdev_init(&ov5670->sd, client, &ov5670_subdev_ops); From patchwork Wed Jan 25 17:37:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 646882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 524F8C61D97 for ; Wed, 25 Jan 2023 17:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236141AbjAYRhl (ORCPT ); Wed, 25 Jan 2023 12:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236117AbjAYRhk (ORCPT ); Wed, 25 Jan 2023 12:37:40 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EE7577EA for ; Wed, 25 Jan 2023 09:37:39 -0800 (PST) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C74DB1935; Wed, 25 Jan 2023 18:37:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674668252; bh=7Ur6WazrHGmAkomdY6iX3LBpNO0v+G+W0eprodEVILQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dVs0I570KxvaTH8hT3KQDm4VSn/ahKdyX2Ou5U6IX9NLTMFV+bVOzc5A5hai6VY3r 9O6gD/875umiGwevKH+sZyLktdWN/pYoiYYBLrkSCJAODooi3l3U8dg86T6e9LVc/W MjJ8ofr5biQc9dBOnU9D90ueJKA7DmpzZHnLup14= From: Jacopo Mondi To: Chiranjeevi Rapolu , Luca Weiss Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:OMNIVISION OV5670 SENSOR DRIVER) Subject: [PATCH v4 4/8] media: i2c: ov5670: Probe regulators Date: Wed, 25 Jan 2023 18:37:03 +0100 Message-Id: <20230125173707.127687-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> References: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The OV5670 has three power supplies (AVDD, DOVDD and DVDD). Probe them in the driver to prepare controlling with runtime_pm operations. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ov5670.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index c8beb2bc3d0f..95bdbf628556 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,14 @@ struct ov5670_link_freq_config { const struct ov5670_reg_list reg_list; }; +static const char * const ov5670_supply_names[] = { + "avdd", /* Analog power */ + "dvdd", /* Digital power */ + "dovdd", /* Digital output power */ +}; + +#define OV5670_NUM_SUPPLIES ARRAY_SIZE(ov5670_supply_names) + struct ov5670_mode { /* Frame width in pixels */ u32 width; @@ -1831,6 +1840,9 @@ struct ov5670 { /* Current mode */ const struct ov5670_mode *cur_mode; + /* Regulators */ + struct regulator_bulk_data supplies[OV5670_NUM_SUPPLIES]; + /* To serialize asynchronus callbacks */ struct mutex mutex; @@ -2471,6 +2483,18 @@ static const struct v4l2_subdev_internal_ops ov5670_internal_ops = { .open = ov5670_open, }; +static int ov5670_regulators_probe(struct ov5670 *ov5670) +{ + struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd); + unsigned int i; + + for (i = 0; i < OV5670_NUM_SUPPLIES; i++) + ov5670->supplies[i].supply = ov5670_supply_names[i]; + + return devm_regulator_bulk_get(&client->dev, OV5670_NUM_SUPPLIES, + ov5670->supplies); +} + static int ov5670_probe(struct i2c_client *client) { struct ov5670 *ov5670; @@ -2509,6 +2533,12 @@ static int ov5670_probe(struct i2c_client *client) /* Initialize subdev */ v4l2_i2c_subdev_init(&ov5670->sd, client, &ov5670_subdev_ops); + ret = ov5670_regulators_probe(ov5670); + if (ret) { + err_msg = "Regulators probe failed"; + goto error_print; + } + full_power = acpi_dev_state_d0(&client->dev); if (full_power) { /* Check module identity */ From patchwork Wed Jan 25 17:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 646881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D843AC54E94 for ; Wed, 25 Jan 2023 17:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236176AbjAYRhq (ORCPT ); Wed, 25 Jan 2023 12:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236190AbjAYRhp (ORCPT ); Wed, 25 Jan 2023 12:37:45 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94AD35867A for ; Wed, 25 Jan 2023 09:37:41 -0800 (PST) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 985B02731; Wed, 25 Jan 2023 18:37:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674668254; bh=vcRT+SjdZCUXl5wyF/UY3elIxusJX0vFOFyDjJDcgP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qh0VqsT3XY6yHQUAUBFv+x4lGySpV5cUCWwUnzLldzHFTCxFsz4+1SrRn3hd6qRIy Z9+gwzs2T2kPnHhxU4St+nvfnGd3UKyyG3Io4xEmra/P5m2aqCfHKx5x03w37TqToq jj+KamgTXd3UR7dLDyWoZTDdiI5WzM4gwdpSNdvY= From: Jacopo Mondi To: Chiranjeevi Rapolu , Luca Weiss Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:OMNIVISION OV5670 SENSOR DRIVER) Subject: [PATCH v4 7/8] media: i2c: ov5670: Implement init_cfg Date: Wed, 25 Jan 2023 18:37:06 +0100 Message-Id: <20230125173707.127687-8-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> References: <20230125173707.127687-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Implement the .init_cfg() pad operation and initialize the default format with the default full resolution mode 2592x1944. With .init_cfg() pad operation implemented the deprecated .open() internal operation can now be dropped. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/ov5670.c | 46 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 0a530b9edd3c..a79582b48a74 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -1960,27 +1960,6 @@ static int ov5670_write_reg_list(struct ov5670 *ov5670, return ov5670_write_regs(ov5670, r_list->regs, r_list->num_of_regs); } -/* Open sub-device */ -static int ov5670_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) -{ - struct ov5670 *ov5670 = to_ov5670(sd); - struct v4l2_mbus_framefmt *try_fmt = - v4l2_subdev_get_try_format(sd, fh->state, 0); - - mutex_lock(&ov5670->mutex); - - /* Initialize try_fmt */ - try_fmt->width = ov5670->cur_mode->width; - try_fmt->height = ov5670->cur_mode->height; - try_fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; - try_fmt->field = V4L2_FIELD_NONE; - - /* No crop or compose */ - mutex_unlock(&ov5670->mutex); - - return 0; -} - static int ov5670_update_digital_gain(struct ov5670 *ov5670, u32 d_gain) { int ret; @@ -2180,6 +2159,25 @@ static int ov5670_init_controls(struct ov5670 *ov5670) return ret; } +static int ov5670_init_cfg(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state) +{ + struct v4l2_mbus_framefmt *fmt = + v4l2_subdev_get_try_format(sd, state, 0); + const struct ov5670_mode *default_mode = &supported_modes[0]; + + fmt->width = default_mode->width; + fmt->height = default_mode->height; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; + fmt->field = V4L2_FIELD_NONE; + fmt->colorspace = V4L2_COLORSPACE_SRGB; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(V4L2_COLORSPACE_SRGB); + fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE; + fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(V4L2_COLORSPACE_SRGB); + + return 0; +} + static int ov5670_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -2503,6 +2501,7 @@ static const struct v4l2_subdev_video_ops ov5670_video_ops = { }; static const struct v4l2_subdev_pad_ops ov5670_pad_ops = { + .init_cfg = ov5670_init_cfg, .enum_mbus_code = ov5670_enum_mbus_code, .get_fmt = ov5670_get_pad_format, .set_fmt = ov5670_set_pad_format, @@ -2524,10 +2523,6 @@ static const struct media_entity_operations ov5670_subdev_entity_ops = { .link_validate = v4l2_subdev_link_validate, }; -static const struct v4l2_subdev_internal_ops ov5670_internal_ops = { - .open = ov5670_open, -}; - static int ov5670_regulators_probe(struct ov5670 *ov5670) { struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd); @@ -2637,7 +2632,6 @@ static int ov5670_probe(struct i2c_client *client) goto error_mutex_destroy; } - ov5670->sd.internal_ops = &ov5670_internal_ops; ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; ov5670->sd.entity.ops = &ov5670_subdev_entity_ops;