From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 87A5F101FF for ; Mon, 17 Mar 2025 00:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171984; cv=none; b=Dn/oX9cPNBJD3jTQSs/yWo1N5iMpHQXAp5hStmVmfXfsK5pTNwdzQ3ELpkjVsQoWJ5vP2goPzbRkw13RZW1paXSVQaJ/xUefWWKgjBnjTuxer5qf7qUubBYECrd4Pml6uE89NqadbmfEtSDTs4NbStgc10E4e/PVeQu0P/+n+pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171984; c=relaxed/simple; bh=LNaAkzEltZLxOUbOqbFu9FNibqscZviTnVjPzj8sR4E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b5Ri0mV0YVXS29rrie89GOHyEwfUYOO9K+eQQdcgmRSP2OzIaPF3SC6rxU+vFVrJ6JI0j0GfNsGvcRyX85Ux0s7dwj7sg6VB3xX31O3mmfp4mOgEWigRDy2FmWJ9AI47MZcacXJ+PJ2lAdHVSqWh0QpEaHSPRHZSsF85UMxFUf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LODKKn6K; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LODKKn6K" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-aaf0f1adef8so207293666b.3 for ; Sun, 16 Mar 2025 17:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171980; x=1742776780; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ihwPD3UMc4J97W1CrIubuAYVRcrzaarmeWo517AInDE=; b=LODKKn6K9eCuglMQv1zVVvHBz1znx+2ySLJgzhEdD+toCGbmg6Sfx4zU+GBUBe9GEm XiXQxg8Tk3oAbmWU5S0/g1dkL6R9hjCa041byrzeeoPUEaXXHtBAR6Zx4Od0x+8KgGgN FlubSkqMfI5Rd3rvCNF8uXSeS8DZlW6nc3iUPIJHqwzI6Rs+E5+CUGCyKpJpOwoH9Ko4 lxkQK/+HMZfFWNuZp0pBuDGbNzupmX0xLpPAJkMJRtW/sLXfr6vlHR9jub3UsYBo4Q2Q wvKGWek/6m9X0qdbXkeVP+ltlbqezTKDuy5WoN/zssAf8axgHnph/0y4W5FAs6mOS22H IAJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171980; x=1742776780; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ihwPD3UMc4J97W1CrIubuAYVRcrzaarmeWo517AInDE=; b=eoeRwH5beADEo5jRJFJdurl1f8W+O21lC+Emsyz862wEpkqrdXnMbp2ETFNTCSsM7T QmqMOcuqjBdEqvnpJFhdUwuFOT8WdQGZDo5ozJ94597AHyY3P30cHn7+FWmYz5m4CnPg MG9B/8sPYLV/NysTcVO40gIuwllyJqYCwloTHzyNdMY8KZDnpzuYIPtTQlurLRPNzAVs avWlEQpr6BZf+ZVFWl+luAj4FXwZ1yJ6oASlIAeD9RsuYz4DKMwT4fHnpiOGQ/LE+l64 2ArOGaZZCdyPzEodwJMxxUvT6Ny0knAUXy9GfT7z//NiEM6AUOvHRKjKU+qXJttvK4C4 jSuA== X-Forwarded-Encrypted: i=1; AJvYcCU0MvRSGj808gLMsK3/QLxQ6NY8liizpeHxnk5vz/g3tDuNa1mmGKT8jLh15ME6tXl2UQ5maVHTNbIIxtE=@vger.kernel.org X-Gm-Message-State: AOJu0YzvQwlQ192MC6bXMET43WOR7OI3AOzv2e1XgJrcLza6uj/LwYZg 0/QuXgseLEoVMmzEhofLQgflxCjF1oaPgCMmVKpKzJ0kE8BctuaMXQE7N9hy4/w= X-Gm-Gg: ASbGncu14Ewh8Gbt9rmTclaQCAyM0Lp1hS2aGLjXhUWWwVKYboD4Zuq5KzYfrHORgqL UtMiSffeBm00/N0whA6Iw550zmkFMFrJRMZruasfYk2C+eUN0rDWFqyPCR21f8Q4zz5RNHcFbj7 +4z8xmxXveyxGFErWdjeXIxI9aFrQxpyn/xjzMdMGrJAPcxE0b1rDJEjivIhZboMvv/m9ggYpZ6 QPHW7vDnhGNos2JdvcuhCjseyleoDEG4Tf9KnO8XBEdGlFYJC0kHc6NRGFptE9433hbSRvjQ0XL P7ArOUeF3sa7v79R8qf/GPBt2MJHxq9PUoYMYXP4Fd85BfiYK3Vc5X9alGmGJyTz8lsA6zEL0ge 9chX8PLGJ8sbD1+d+4by5iY2J6ZBAqepYh8SD8FCr7KEk4tkOvkJshXg0XGMYk/oNkWiL X-Google-Smtp-Source: AGHT+IE0OpVCIFv22B4bWrLXG3KIuV47aR4P9f6EwKgo1+B4sxrYAEkQVg1rvg7xp/ohDKUmIE9O2g== X-Received: by 2002:a17:907:2d89:b0:ac2:fa32:f3 with SMTP id a640c23a62f3a-ac330506270mr1224633366b.52.1742171979711; Sun, 16 Mar 2025 17:39:39 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:38 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:33 +0000 Subject: [PATCH 1/8] media: i2c: add OV02E10 image sensor driver 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-1-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 From: Jingjing Xiong Add in the ov02e10 driver from the Intel IPU6 repository. Signed-off-by: Jingjing Xiong Co-developed-by: Hao Yao Signed-off-by: Hao Yao Co-developed-by: Jim Lai Signed-off-by: Jim Lai Co-developed-by: You-Sheng Yang Signed-off-by: You-Sheng Yang Co-developed-by: Alan Stern Signed-off-by: Alan Stern Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/ov02e10.c | 975 ++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 986 insertions(+) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index e576b213084d232e90b7e556a7a855a3bb95544c..7b8af1c87a0e40c19ef8ddb9a86= 03a1962877163 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -356,6 +356,16 @@ config VIDEO_OV02A10 To compile this driver as a module, choose M here: the module will be called ov02a10. =20 +config VIDEO_OV02E10 + tristate "OmniVision OV02E10 sensor support" + select V4L2_CCI_I2C + help + This is a Video4Linux2 sensor driver for the OmniVision + OV02E10 camera. + + To compile this driver as a module, choose M here: the + module will be called ov02e10. + config VIDEO_OV08D10 tristate "OmniVision OV08D10 sensor support" help diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile index 6c23a4463527cf762032df663bbfe26be29018c8..ed5e62fd6199d8c0ab0d3104fd3= 53243021a11be 100644 --- a/drivers/media/i2c/Makefile +++ b/drivers/media/i2c/Makefile @@ -83,6 +83,7 @@ obj-$(CONFIG_VIDEO_MT9V111) +=3D mt9v111.o obj-$(CONFIG_VIDEO_OG01A1B) +=3D og01a1b.o obj-$(CONFIG_VIDEO_OV01A10) +=3D ov01a10.o obj-$(CONFIG_VIDEO_OV02A10) +=3D ov02a10.o +obj-$(CONFIG_VIDEO_OV02E10) +=3D ov02e10.o obj-$(CONFIG_VIDEO_OV08D10) +=3D ov08d10.o obj-$(CONFIG_VIDEO_OV08X40) +=3D ov08x40.o obj-$(CONFIG_VIDEO_OV13858) +=3D ov13858.o diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c new file mode 100644 index 0000000000000000000000000000000000000000..8c4455b3643307be5b1e8110979= 740a7e843c146 --- /dev/null +++ b/drivers/media/i2c/ov02e10.c @@ -0,0 +1,975 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2023 Intel Corporation. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OV02E10_LINK_FREQ_360MHZ 360000000ULL +#define OV02E10_SCLK 36000000LL +#define OV02E10_MCLK 19200000 +#define OV02E10_DATA_LANES 2 +#define OV02E10_RGB_DEPTH 10 + +#define OV02E10_REG_PAGE_FLAG CCI_REG8(0xfd) +#define OV02E10_PAGE_0 0x0 +#define OV02E10_PAGE_1 0x1 +#define OV02E10_PAGE_2 0x2 +#define OV02E10_PAGE_3 0x3 +#define OV02E10_PAGE_5 0x4 +#define OV02E10_PAGE_7 0x5 +#define OV02E10_PAGE_8 0x6 +#define OV02E10_PAGE_9 0xF +#define OV02E10_PAGE_D 0x8 +#define OV02E10_PAGE_E 0x9 +#define OV02E10_PAGE_F 0xA + +#define OV02E10_REG_CHIP_ID CCI_REG32(0x00) +#define OV02E10_CHIP_ID 0x45025610 + +/* vertical-timings from sensor */ +#define OV02E10_REG_VTS CCI_REG16(0x35) +#define OV02E10_VTS_DEF 2244 +#define OV02E10_VTS_MIN 2244 +#define OV02E10_VTS_MAX 0x7fff + +/* horizontal-timings from sensor */ +#define OV02E10_REG_HTS CCI_REG16(0x37) + +/* Exposure controls from sensor */ +#define OV02E10_REG_EXPOSURE CCI_REG16(0x03) +#define OV02E10_EXPOSURE_MIN 1 +#define OV02E10_EXPOSURE_MAX_MARGIN 2 +#define OV02E10_EXPOSURE_STEP 1 + +/* Analog gain controls from sensor */ +#define OV02E10_REG_ANALOG_GAIN CCI_REG8(0x24) +#define OV02E10_ANAL_GAIN_MIN 0x10 +#define OV02E10_ANAL_GAIN_MAX 0xf8 +#define OV02E10_ANAL_GAIN_STEP 1 + +/* Digital gain controls from sensor */ +#define OV02E10_REG_DIGITAL_GAIN CCI_REG16(0x21) +#define OV02E10_DGTL_GAIN_MIN 256 +#define OV02E10_DGTL_GAIN_MAX 1020 +#define OV02E10_DGTL_GAIN_STEP 1 +#define OV02E10_DGTL_GAIN_DEFAULT 256 + +/* Register update control */ +#define OV02E10_REG_COMMAND_UPDATE CCI_REG8(0xE7) +#define OV02E10_COMMAND_UPDATE 0x00 +#define OV02E10_COMMAND_HOLD 0x01 + +/* Test Pattern Control */ +#define OV02E10_REG_TEST_PATTERN CCI_REG8(0x12) +#define OV02E10_TEST_PATTERN_ENABLE BIT(0) +#define OV02E10_TEST_PATTERN_BAR_SHIFT 1 + +enum { + OV02E10_LINK_FREQ_360MHZ_INDEX, +}; + +struct reg_sequence_list { + u32 num_regs; + const struct reg_sequence *regs; +}; + +struct ov02e10_mode { + /* Frame width in pixels */ + u32 width; + + /* Frame height in pixels */ + u32 height; + + /* Horizontal timining size */ + u32 hts; + + /* Default vertical timining size */ + u32 vts_def; + + /* Min vertical timining size */ + u32 vts_min; + + /* Link frequency needed for this resolution */ + u32 link_freq_index; + + /* Sensor register settings for this resolution */ + const struct reg_sequence_list reg_list; +}; + +static const struct reg_sequence mode_1928x1088_30fps_2lane[] =3D { + { 0xfd, 0x00 }, + { 0x20, 0x00 }, + { 0x20, 0x0b }, + { 0x21, 0x02 }, + { 0x10, 0x23 }, + { 0xc5, 0x04 }, + { 0x21, 0x00 }, + { 0x14, 0x96 }, + { 0x17, 0x01 }, + { 0xfd, 0x01 }, + { 0x03, 0x00 }, + { 0x04, 0x04 }, + { 0x05, 0x04 }, + { 0x06, 0x62 }, + { 0x07, 0x01 }, + { 0x22, 0x80 }, + { 0x24, 0xff }, + { 0x40, 0xc6 }, + { 0x41, 0x18 }, + { 0x45, 0x3f }, + { 0x48, 0x0c }, + { 0x4c, 0x08 }, + { 0x51, 0x12 }, + { 0x52, 0x10 }, + { 0x57, 0x98 }, + { 0x59, 0x06 }, + { 0x5a, 0x04 }, + { 0x5c, 0x38 }, + { 0x5e, 0x10 }, + { 0x67, 0x11 }, + { 0x7b, 0x04 }, + { 0x81, 0x12 }, + { 0x90, 0x51 }, + { 0x91, 0x09 }, + { 0x92, 0x21 }, + { 0x93, 0x28 }, + { 0x95, 0x54 }, + { 0x9d, 0x20 }, + { 0x9e, 0x04 }, + { 0xb1, 0x9a }, + { 0xb2, 0x86 }, + { 0xb6, 0x3f }, + { 0xb9, 0x30 }, + { 0xc1, 0x01 }, + { 0xc5, 0xa0 }, + { 0xc6, 0x73 }, + { 0xc7, 0x04 }, + { 0xc8, 0x25 }, + { 0xc9, 0x05 }, + { 0xca, 0x28 }, + { 0xcb, 0x00 }, + { 0xcf, 0x16 }, + { 0xd2, 0xd0 }, + { 0xd7, 0x3f }, + { 0xd8, 0x40 }, + { 0xd9, 0x40 }, + { 0xda, 0x44 }, + { 0xdb, 0x3d }, + { 0xdc, 0x3d }, + { 0xdd, 0x3d }, + { 0xde, 0x3d }, + { 0xdf, 0xf0 }, + { 0xea, 0x0f }, + { 0xeb, 0x04 }, + { 0xec, 0x29 }, + { 0xee, 0x47 }, + { 0xfd, 0x01 }, + { 0x31, 0x01 }, + { 0x27, 0x00 }, + { 0x2f, 0x41 }, + { 0xfd, 0x02 }, + { 0xa1, 0x01 }, + { 0xfd, 0x02 }, + { 0x9a, 0x03 }, + { 0xfd, 0x03 }, + { 0x9d, 0x0f }, + { 0xfd, 0x07 }, + { 0x42, 0x00 }, + { 0x43, 0xad }, + { 0x44, 0x00 }, + { 0x45, 0xa8 }, + { 0x46, 0x00 }, + { 0x47, 0xa8 }, + { 0x48, 0x00 }, + { 0x49, 0xad }, + { 0xfd, 0x00 }, + { 0xc4, 0x01 }, + { 0xfd, 0x01 }, + { 0x33, 0x03 }, + { 0xfd, 0x00 }, + { 0x20, 0x1f }, +}; + +static const char *const ov02e10_test_pattern_menu[] =3D { + "Disabled", + "Color Bar", +}; + +static const s64 link_freq_menu_items[] =3D { + OV02E10_LINK_FREQ_360MHZ, +}; + +static const struct ov02e10_mode supported_modes[] =3D { + { + .width =3D 1928, + .height =3D 1088, + .hts =3D 534, + .vts_def =3D 2244, + .vts_min =3D 2244, + .reg_list =3D { + .num_regs =3D ARRAY_SIZE(mode_1928x1088_30fps_2lane), + .regs =3D mode_1928x1088_30fps_2lane, + }, + + .link_freq_index =3D OV02E10_LINK_FREQ_360MHZ_INDEX, + }, +}; + +struct ov02e10 { + struct regmap *regmap; + struct v4l2_subdev sd; + struct media_pad pad; + struct v4l2_ctrl_handler ctrl_handler; + + /* V4L2 Controls */ + struct v4l2_ctrl *link_freq; + struct v4l2_ctrl *pixel_rate; + struct v4l2_ctrl *vblank; + struct v4l2_ctrl *hblank; + struct v4l2_ctrl *exposure; + + struct clk *img_clk; + struct regulator *avdd; + struct gpio_desc *reset; + struct gpio_desc *handshake; + + /* Current mode */ + const struct ov02e10_mode *cur_mode; + + /* To serialize asynchronus callbacks */ + struct mutex mutex; + + /* Streaming on/off */ + bool streaming; +}; + +static inline struct ov02e10 *to_ov02e10(struct v4l2_subdev *subdev) +{ + return container_of(subdev, struct ov02e10, sd); +} + +static u64 to_pixel_rate(u32 f_index) +{ + u64 pixel_rate =3D link_freq_menu_items[f_index] * 2 * OV02E10_DATA_LANES; + + do_div(pixel_rate, OV02E10_RGB_DEPTH); + + return pixel_rate; +} + +static u64 to_pixels_per_line(u32 hts, u32 f_index) +{ + u64 ppl =3D hts * to_pixel_rate(f_index); + + do_div(ppl, OV02E10_SCLK); + + return ppl; +} + +static void ov02e10_test_pattern(struct ov02e10 *ov02e10, u32 pattern, int= *pret) +{ + if (pattern) + pattern =3D pattern << OV02E10_TEST_PATTERN_BAR_SHIFT | + OV02E10_TEST_PATTERN_ENABLE; + + cci_write(ov02e10->regmap, OV02E10_REG_TEST_PATTERN, pattern, pret); +} + +static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) +{ + struct ov02e10 *ov02e10 =3D container_of(ctrl->handler, + struct ov02e10, ctrl_handler); + struct i2c_client *client =3D v4l2_get_subdevdata(&ov02e10->sd); + s64 exposure_max; + int ret; + + /* Propagate change of current control to all related controls */ + if (ctrl->id =3D=3D V4L2_CID_VBLANK) { + /* Update max exposure while meeting expected vblanking */ + exposure_max =3D ov02e10->cur_mode->height + ctrl->val - + OV02E10_EXPOSURE_MAX_MARGIN; + __v4l2_ctrl_modify_range(ov02e10->exposure, + ov02e10->exposure->minimum, + exposure_max, ov02e10->exposure->step, + exposure_max); + } + + /* V4L2 controls values will be applied only when power is already up */ + if (!pm_runtime_get_if_in_use(&client->dev)) + return 0; + ret =3D cci_write(ov02e10->regmap, OV02E10_REG_COMMAND_UPDATE, + OV02E10_COMMAND_HOLD, NULL); + + switch (ctrl->id) { + case V4L2_CID_ANALOGUE_GAIN: + dev_dbg(&client->dev, "set analog gain\n"); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_1, &ret); + cci_write(ov02e10->regmap, OV02E10_REG_ANALOG_GAIN, + ctrl->val, &ret); + break; + + case V4L2_CID_DIGITAL_GAIN: + dev_dbg(&client->dev, "set digital gain\n"); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_1, &ret); + cci_write(ov02e10->regmap, OV02E10_REG_DIGITAL_GAIN, + ctrl->val, &ret); + break; + + case V4L2_CID_EXPOSURE: + dev_dbg(&client->dev, "set exposure\n"); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_1, &ret); + cci_write(ov02e10->regmap, OV02E10_REG_EXPOSURE, + ctrl->val, &ret); + break; + + case V4L2_CID_VBLANK: + dev_dbg(&client->dev, "set vblank\n"); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_1, &ret); + cci_write(ov02e10->regmap, OV02E10_REG_VTS, + ov02e10->cur_mode->height + ctrl->val, &ret); + break; + + case V4L2_CID_TEST_PATTERN: + dev_dbg(&client->dev, "set test pattern\n"); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_1, &ret); + ov02e10_test_pattern(ov02e10, ctrl->val, &ret); + break; + + default: + ret =3D -EINVAL; + break; + } + dev_dbg(&client->dev, "will update cmd\n"); + cci_write(ov02e10->regmap, OV02E10_REG_COMMAND_UPDATE, + OV02E10_COMMAND_UPDATE, &ret); + + pm_runtime_put(&client->dev); + + return ret; +} + +static const struct v4l2_ctrl_ops ov02e10_ctrl_ops =3D { + .s_ctrl =3D ov02e10_set_ctrl, +}; + +static int ov02e10_init_controls(struct ov02e10 *ov02e10) +{ + struct v4l2_ctrl_handler *ctrl_hdlr; + const struct ov02e10_mode *cur_mode; + s64 exposure_max, h_blank, pixel_rate; + u32 vblank_min, vblank_max, vblank_default; + int size; + int ret; + + ctrl_hdlr =3D &ov02e10->ctrl_handler; + ret =3D v4l2_ctrl_handler_init(ctrl_hdlr, 8); + + if (ret) + return ret; + + ctrl_hdlr->lock =3D &ov02e10->mutex; + cur_mode =3D ov02e10->cur_mode; + size =3D ARRAY_SIZE(link_freq_menu_items); + + ov02e10->link_freq =3D + v4l2_ctrl_new_int_menu(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_LINK_FREQ, size - 1, 0, + link_freq_menu_items); + if (ov02e10->link_freq) + ov02e10->link_freq->flags |=3D V4L2_CTRL_FLAG_READ_ONLY; + + pixel_rate =3D to_pixel_rate(OV02E10_LINK_FREQ_360MHZ_INDEX); + ov02e10->pixel_rate =3D v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_PIXEL_RATE, 0, + pixel_rate, 1, pixel_rate); + + vblank_min =3D cur_mode->vts_min - cur_mode->height; + vblank_max =3D OV02E10_VTS_MAX - cur_mode->height; + vblank_default =3D cur_mode->vts_def - cur_mode->height; + ov02e10->vblank =3D v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_VBLANK, vblank_min, + vblank_max, 1, vblank_default); + + h_blank =3D to_pixels_per_line(cur_mode->hts, cur_mode->link_freq_index); + h_blank -=3D cur_mode->width; + ov02e10->hblank =3D v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_HBLANK, h_blank, h_blank, + 1, h_blank); + if (ov02e10->hblank) + ov02e10->hblank->flags |=3D V4L2_CTRL_FLAG_READ_ONLY; + + v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, V4L2_CID_ANALOGUE_GAIN, + OV02E10_ANAL_GAIN_MIN, OV02E10_ANAL_GAIN_MAX, + OV02E10_ANAL_GAIN_STEP, OV02E10_ANAL_GAIN_MIN); + v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, V4L2_CID_DIGITAL_GAIN, + OV02E10_DGTL_GAIN_MIN, OV02E10_DGTL_GAIN_MAX, + OV02E10_DGTL_GAIN_STEP, OV02E10_DGTL_GAIN_DEFAULT); + exposure_max =3D cur_mode->vts_def - OV02E10_EXPOSURE_MAX_MARGIN; + ov02e10->exposure =3D v4l2_ctrl_new_std(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_EXPOSURE, + OV02E10_EXPOSURE_MIN, + exposure_max, + OV02E10_EXPOSURE_STEP, + exposure_max); + v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02e10_ctrl_ops, + V4L2_CID_TEST_PATTERN, + ARRAY_SIZE(ov02e10_test_pattern_menu) - 1, + 0, 0, ov02e10_test_pattern_menu); + if (ctrl_hdlr->error) + return ctrl_hdlr->error; + + ov02e10->sd.ctrl_handler =3D ctrl_hdlr; + + return 0; +} + +static void ov02e10_update_pad_format(const struct ov02e10_mode *mode, + struct v4l2_mbus_framefmt *fmt) +{ + fmt->width =3D mode->width; + fmt->height =3D mode->height; + fmt->code =3D MEDIA_BUS_FMT_SGRBG10_1X10; + fmt->field =3D V4L2_FIELD_NONE; +} + +static int ov02e10_set_stream_mode(struct ov02e10 *ov02e10, u8 val) +{ + int ret =3D 0; + + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_0, &ret); + cci_write(ov02e10->regmap, CCI_REG8(0xa0), val, &ret); + cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); + cci_write(ov02e10->regmap, CCI_REG8(0x01), 0x02, &ret); + + return ret; +} + +static int ov02e10_start_streaming(struct ov02e10 *ov02e10) +{ + struct i2c_client *client =3D v4l2_get_subdevdata(&ov02e10->sd); + const struct reg_sequence_list *reg_list; + int ret; + + reg_list =3D &ov02e10->cur_mode->reg_list; + ret =3D regmap_multi_reg_write(ov02e10->regmap, reg_list->regs, + reg_list->num_regs); + if (ret) { + dev_err(&client->dev, "failed to set mode\n"); + return ret; + } + ret =3D __v4l2_ctrl_handler_setup(ov02e10->sd.ctrl_handler); + if (ret) { + dev_err(&client->dev, "setup V4L2 ctrl handler fail\n"); + return ret; + } + + return ov02e10_set_stream_mode(ov02e10, 1); +} + +static inline void ov02e10_stop_streaming(struct ov02e10 *ov02e10) +{ + ov02e10_set_stream_mode(ov02e10, 0); +} + +static int ov02e10_set_stream(struct v4l2_subdev *sd, int enable) +{ + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + struct i2c_client *client =3D v4l2_get_subdevdata(sd); + int ret =3D 0; + + if (ov02e10->streaming =3D=3D enable) + return 0; + + mutex_lock(&ov02e10->mutex); + if (enable) { + ret =3D pm_runtime_get_sync(&client->dev); + if (ret < 0) { + pm_runtime_put_noidle(&client->dev); + mutex_unlock(&ov02e10->mutex); + return ret; + } + + ret =3D ov02e10_start_streaming(ov02e10); + if (ret) { + dev_dbg(&client->dev, "start streaming failed\n"); + enable =3D 0; + ov02e10_stop_streaming(ov02e10); + pm_runtime_put(&client->dev); + } + } else { + ov02e10_stop_streaming(ov02e10); + pm_runtime_put(&client->dev); + } + + ov02e10->streaming =3D enable; + mutex_unlock(&ov02e10->mutex); + + return ret; +} + +/* This function tries to get power control resources */ +static int ov02e10_get_pm_resources(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + int ret; + + ov02e10->reset =3D devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(ov02e10->reset)) + return dev_err_probe(dev, PTR_ERR(ov02e10->reset), + "failed to get reset gpio\n"); + + ov02e10->handshake =3D devm_gpiod_get_optional(dev, "handshake", + GPIOD_OUT_LOW); + if (IS_ERR(ov02e10->handshake)) + return dev_err_probe(dev, PTR_ERR(ov02e10->handshake), + "failed to get handshake gpio\n"); + + ov02e10->img_clk =3D devm_clk_get_optional(dev, NULL); + if (IS_ERR(ov02e10->img_clk)) + return dev_err_probe(dev, PTR_ERR(ov02e10->img_clk), + "failed to get imaging clock\n"); + + ov02e10->avdd =3D devm_regulator_get_optional(dev, "avdd"); + if (IS_ERR(ov02e10->avdd)) { + ret =3D PTR_ERR(ov02e10->avdd); + ov02e10->avdd =3D NULL; + if (ret !=3D -ENODEV) + return dev_err_probe(dev, ret, + "failed to get avdd regulator\n"); + } + + return 0; +} + +static int ov02e10_power_off(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + int ret =3D 0; + + gpiod_set_value_cansleep(ov02e10->reset, 1); + gpiod_set_value_cansleep(ov02e10->handshake, 0); + + if (ov02e10->avdd) + ret =3D regulator_disable(ov02e10->avdd); + + clk_disable_unprepare(ov02e10->img_clk); + + return ret; +} + +static int ov02e10_power_on(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + int ret; + + ret =3D clk_prepare_enable(ov02e10->img_clk); + if (ret < 0) { + dev_err(dev, "failed to enable imaging clock: %d\n", ret); + return ret; + } + + if (ov02e10->avdd) { + ret =3D regulator_enable(ov02e10->avdd); + if (ret < 0) { + dev_err(dev, "failed to enable avdd: %d\n", ret); + clk_disable_unprepare(ov02e10->img_clk); + return ret; + } + } + gpiod_set_value_cansleep(ov02e10->handshake, 1); + gpiod_set_value_cansleep(ov02e10->reset, 0); + + /* Lattice MIPI aggregator with some version FW needs longer delay + after handshake triggered. We set 25ms as a safe value and wait + for a stable version FW. */ + msleep_interruptible(25); + + return ret; +} + +static int __maybe_unused ov02e10_suspend(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + + mutex_lock(&ov02e10->mutex); + if (ov02e10->streaming) + ov02e10_stop_streaming(ov02e10); + + mutex_unlock(&ov02e10->mutex); + + return 0; +} + +static int __maybe_unused ov02e10_resume(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + int ret =3D 0; + + mutex_lock(&ov02e10->mutex); + if (!ov02e10->streaming) + goto exit; + + ret =3D ov02e10_start_streaming(ov02e10); + if (ret) { + ov02e10->streaming =3D false; + ov02e10_stop_streaming(ov02e10); + } + +exit: + mutex_unlock(&ov02e10->mutex); + return ret; +} + +static int ov02e10_set_format(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_format *fmt) +{ + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + const struct ov02e10_mode *mode; + s32 vblank_def, h_blank; + + mode =3D v4l2_find_nearest_size(supported_modes, + ARRAY_SIZE(supported_modes), + width, height, fmt->format.width, + fmt->format.height); + + mutex_lock(&ov02e10->mutex); + ov02e10_update_pad_format(mode, &fmt->format); + if (fmt->which =3D=3D V4L2_SUBDEV_FORMAT_TRY) { + *v4l2_subdev_state_get_format(sd_state, fmt->pad) =3D + fmt->format; + } else { + ov02e10->cur_mode =3D mode; + __v4l2_ctrl_s_ctrl(ov02e10->link_freq, mode->link_freq_index); + __v4l2_ctrl_s_ctrl_int64(ov02e10->pixel_rate, + to_pixel_rate(mode->link_freq_index)); + + /* Update limits and set FPS to default */ + vblank_def =3D mode->vts_def - mode->height; + __v4l2_ctrl_modify_range(ov02e10->vblank, + mode->vts_min - mode->height, + OV02E10_VTS_MAX - mode->height, 1, + vblank_def); + __v4l2_ctrl_s_ctrl(ov02e10->vblank, vblank_def); + h_blank =3D to_pixels_per_line(mode->hts, mode->link_freq_index) - + mode->width; + __v4l2_ctrl_modify_range(ov02e10->hblank, h_blank, h_blank, 1, + h_blank); + } + mutex_unlock(&ov02e10->mutex); + + return 0; +} + +static int ov02e10_get_format(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_format *fmt) +{ + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + + mutex_lock(&ov02e10->mutex); + if (fmt->which =3D=3D V4L2_SUBDEV_FORMAT_TRY) + fmt->format =3D *v4l2_subdev_state_get_format(sd_state, fmt->pad); + else + ov02e10_update_pad_format(ov02e10->cur_mode, &fmt->format); + + mutex_unlock(&ov02e10->mutex); + + return 0; +} + +static int ov02e10_enum_mbus_code(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_mbus_code_enum *code) +{ + if (code->index > 0) + return -EINVAL; + + code->code =3D MEDIA_BUS_FMT_SGRBG10_1X10; + + return 0; +} + +static int ov02e10_enum_frame_size(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_frame_size_enum *fse) +{ + if (fse->index >=3D ARRAY_SIZE(supported_modes)) + return -EINVAL; + + if (fse->code !=3D MEDIA_BUS_FMT_SGRBG10_1X10) + return -EINVAL; + + fse->min_width =3D supported_modes[fse->index].width; + fse->max_width =3D fse->min_width; + fse->min_height =3D supported_modes[fse->index].height; + fse->max_height =3D fse->min_height; + + return 0; +} + +static int ov02e10_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) +{ + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + + mutex_lock(&ov02e10->mutex); + ov02e10_update_pad_format(&supported_modes[0], + v4l2_subdev_state_get_format(fh->state, 0)); + mutex_unlock(&ov02e10->mutex); + + return 0; +} + +static const struct v4l2_subdev_video_ops ov02e10_video_ops =3D { + .s_stream =3D ov02e10_set_stream, +}; + +static const struct v4l2_subdev_pad_ops ov02e10_pad_ops =3D { + .set_fmt =3D ov02e10_set_format, + .get_fmt =3D ov02e10_get_format, + .enum_mbus_code =3D ov02e10_enum_mbus_code, + .enum_frame_size =3D ov02e10_enum_frame_size, +}; + +static const struct v4l2_subdev_ops ov02e10_subdev_ops =3D { + .video =3D &ov02e10_video_ops, + .pad =3D &ov02e10_pad_ops, +}; + +static const struct media_entity_operations ov02e10_subdev_entity_ops =3D { + .link_validate =3D v4l2_subdev_link_validate, +}; + +static const struct v4l2_subdev_internal_ops ov02e10_internal_ops =3D { + .open =3D ov02e10_open, +}; + +static int ov02e10_identify_module(struct ov02e10 *ov02e10) +{ + struct i2c_client *client =3D v4l2_get_subdevdata(&ov02e10->sd); + int ret; + u64 val; + + ret =3D cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, + OV02E10_PAGE_0, NULL); + cci_read(ov02e10->regmap, OV02E10_REG_CHIP_ID, &val, &ret); + if (ret) + return ret; + + if (val !=3D OV02E10_CHIP_ID) { + dev_err(&client->dev, "chip id mismatch: %x!=3D%x\n", + OV02E10_CHIP_ID, (u32) val); + return -ENXIO; + } + + return 0; +} + +static int ov02e10_check_hwcfg(struct device *dev) +{ + struct v4l2_fwnode_endpoint bus_cfg =3D { + .bus_type =3D V4L2_MBUS_CSI2_DPHY + }; + struct fwnode_handle *ep; + struct fwnode_handle *fwnode =3D dev_fwnode(dev); + unsigned int i, j; + int ret; + u32 ext_clk; + + ep =3D fwnode_graph_get_next_endpoint(fwnode, NULL); + if (!ep) + return dev_err_probe(dev, -EPROBE_DEFER, + "waiting for fwnode graph endpoint\n"); + + ret =3D v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); + fwnode_handle_put(ep); + if (ret) + return dev_err_probe(dev, ret, "parsing endpoint failed\n"); + + ret =3D fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency", + &ext_clk); + if (ret) { + dev_err(dev, "can't get clock frequency\n"); + goto out_err; + } + + if (bus_cfg.bus.mipi_csi2.num_data_lanes !=3D OV02E10_DATA_LANES) { + dev_err(dev, "number of CSI2 data lanes %d is not supported\n", + bus_cfg.bus.mipi_csi2.num_data_lanes); + ret =3D -EINVAL; + goto out_err; + } + + if (!bus_cfg.nr_of_link_frequencies) { + dev_err(dev, "no link frequencies defined\n"); + ret =3D -EINVAL; + goto out_err; + } + + for (i =3D 0; i < ARRAY_SIZE(link_freq_menu_items); i++) { + for (j =3D 0; j < bus_cfg.nr_of_link_frequencies; j++) { + if (link_freq_menu_items[i] =3D=3D + bus_cfg.link_frequencies[j]) + break; + } + + if (j =3D=3D bus_cfg.nr_of_link_frequencies) { + dev_err(dev, "no link frequency %lld supported\n", + link_freq_menu_items[i]); + ret =3D -EINVAL; + goto out_err; + } + } + +out_err: + v4l2_fwnode_endpoint_free(&bus_cfg); + + return ret; +} + +static void ov02e10_remove(struct i2c_client *client) +{ + struct v4l2_subdev *sd =3D i2c_get_clientdata(client); + struct ov02e10 *ov02e10 =3D to_ov02e10(sd); + + v4l2_async_unregister_subdev(sd); + media_entity_cleanup(&sd->entity); + v4l2_ctrl_handler_free(sd->ctrl_handler); + pm_runtime_disable(&client->dev); + mutex_destroy(&ov02e10->mutex); +} + +static int ov02e10_probe(struct i2c_client *client) +{ + struct ov02e10 *ov02e; + int ret; + + /* Check HW config */ + ret =3D ov02e10_check_hwcfg(&client->dev); + if (ret) + return ret; + + ov02e =3D devm_kzalloc(&client->dev, sizeof(*ov02e), GFP_KERNEL); + if (!ov02e) + return -ENOMEM; + + /* Initialize subdev */ + ov02e->regmap =3D devm_cci_regmap_init_i2c(client, 8); + if (IS_ERR(ov02e->regmap)) + return PTR_ERR(ov02e->regmap); + + v4l2_i2c_subdev_init(&ov02e->sd, client, &ov02e10_subdev_ops); + ov02e10_get_pm_resources(&client->dev); + + ret =3D ov02e10_power_on(&client->dev); + if (ret) { + dev_err_probe(&client->dev, ret, "failed to power on\n"); + goto error_power_off; + } + + /* Check module identity */ + ret =3D ov02e10_identify_module(ov02e); + if (ret) { + dev_err(&client->dev, "failed to find sensor: %d\n", ret); + goto error_power_off; + } + + /* Set default mode to max resolution */ + ov02e->cur_mode =3D &supported_modes[0]; + + dev_dbg(&client->dev, "will Init controls\n"); + ret =3D ov02e10_init_controls(ov02e); + if (ret) + return ret; + + /* Initialize subdev */ + ov02e->sd.internal_ops =3D &ov02e10_internal_ops; + ov02e->sd.flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE; + ov02e->sd.entity.ops =3D &ov02e10_subdev_entity_ops; + ov02e->sd.entity.function =3D MEDIA_ENT_F_CAM_SENSOR; + + /* Initialize source pad */ + ov02e->pad.flags =3D MEDIA_PAD_FL_SOURCE; + ret =3D media_entity_pads_init(&ov02e->sd.entity, 1, &ov02e->pad); + if (ret) { + dev_err(&client->dev, "%s failed:%d\n", __func__, ret); + goto error_handler_free; + } + + ret =3D v4l2_async_register_subdev_sensor(&ov02e->sd); + if (ret < 0) { + dev_err(&client->dev, "async reg subdev error\n"); + goto error_media_entity; + } + + /* + * Device is already turned on by i2c-core with ACPI domain PM. + * Enable runtime PM and turn off the device. + */ + pm_runtime_set_active(&client->dev); + pm_runtime_enable(&client->dev); + pm_runtime_idle(&client->dev); + + return 0; + +error_media_entity: + media_entity_cleanup(&ov02e->sd.entity); + +error_handler_free: + v4l2_ctrl_handler_free(ov02e->sd.ctrl_handler); + mutex_destroy(&ov02e->mutex); + dev_err(&client->dev, "%s failed:%d\n", __func__, ret); +error_power_off: + ov02e10_power_off(&client->dev); + + dev_dbg(&client->dev, "probe done\n"); + return ret; +} + +static const struct dev_pm_ops ov02e10_pm_ops =3D { + SET_SYSTEM_SLEEP_PM_OPS(ov02e10_suspend, ov02e10_resume) + SET_RUNTIME_PM_OPS(ov02e10_power_off, ov02e10_power_on, NULL) +}; + +static const struct acpi_device_id ov02e10_acpi_ids[] =3D { + { "OVTI02E1" }, + { } +}; + +MODULE_DEVICE_TABLE(acpi, ov02e10_acpi_ids); + +static struct i2c_driver ov02e10_i2c_driver =3D { + .driver =3D { + .name =3D "ov02e10", + .pm =3D &ov02e10_pm_ops, + .acpi_match_table =3D ov02e10_acpi_ids, + }, + .probe =3D ov02e10_probe, + .remove =3D ov02e10_remove, +}; + +module_i2c_driver(ov02e10_i2c_driver); + +MODULE_AUTHOR("Jingjing Xiong "); +MODULE_DESCRIPTION("OmniVision OV02E10 sensor driver"); +MODULE_LICENSE("GPL v2"); --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 9278138DF9 for ; Mon, 17 Mar 2025 00:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171985; cv=none; b=UQuqR4usWtnKSx3nQTRy4/ujG/t/CQ5mijHyc4rDofgB/hyPk1al+u7luU13t3o1+/vYF9jVDK990jcuJaOVWa12lcPaoAOzuhUwustTuCKz3hqU49i6rtSGQFUe0dwLYoFySh+ewS+7+sD1o2Dc6Yw5v+4GGYzuV5o2ihLMeRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171985; c=relaxed/simple; bh=3QrEKdTshQRi2xw4f5hCGvoDJjZMloAagBZBYMjysZ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a/7IJDAU/C171d+dYt6ME+TlKZYQ314f7m9vk919oTuHN3fI+qHaZGjDGTbpElahPDgxsRrQTw0nnPxKrQd6U9+RqS9tIEBt1/PrxVd9ysVy1HAMZ6iBm1TWckGdMl7jj4ZBlxJudmRvZ/CIVp9G7zsHj32zVvRsTPr1UFuKQd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Zb+n8QMq; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Zb+n8QMq" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5e5b572e45cso7254171a12.0 for ; Sun, 16 Mar 2025 17:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171982; x=1742776782; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NjMvwquUu5HvTpeV8tRi1qdeKCAJgZcm3OhYAciYMmY=; b=Zb+n8QMqtAJfUrnUn2Hf6aLcRH0Ofw2ocoAxBxX4OKkb9LnnkTPgYXLHTy2xSlpTun T9S4wXGOttRuHGWC6Mnh1CT9OtCn/hZxdSQ9wyvdJuiR9m2HsJzce/uDecBG+16jiFUf cE1DoBQe/a4xUgC2spdjUHJQHyJ5UjMFXtY7omNQ9XrTiBkMaaKoWg5T0uT07ysF4t1w s84pPNMTcbX2Dxz+nOxzGyEKoMaOCyf7e02ch4owRIJfBRxUntL37RI9dh85tqBJpBx7 TKJXw1Y8hZ9IrHt2xvkyWXFXjjd0o8TWhX3WvnyGgFHBTc8sp10sjFRXznhc7CyAOZbw rlJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171982; x=1742776782; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NjMvwquUu5HvTpeV8tRi1qdeKCAJgZcm3OhYAciYMmY=; b=EFuQB1KLHQJD2j3A4kM57OovSV/l1cAvuMiz8hJersfq4pKZG+nbfNjsIgWg7YDx/S emBr9MrRu8GfVeMnTy45kp5+6AkOD3U39kWHK/K3xXmOfDeOPr182Qs21z0hEkSutQkf vfePi/nWl/TQvwPPG0VYgJ+X5fYW/cC5o4pGggUOSbKNy9JO4wtAkj1BKR5p/SOflMrZ oV4tUyNbgihfaOkyCVwe3Di0u3cxVcXlkdl7kzRrWFJYzdrj2r6GM+lydMynaBxU0pZe cVBV1OTlhsuW/vBZOC2DEWeoit3R6GIOcR+HdNjtqpIYHxna5k8E/dDN0edzUstCwoqA 8OrA== X-Forwarded-Encrypted: i=1; AJvYcCVsKfiEwPMWoXbSBxYTLyH9Uud08LYx5habyZZVarRy32YPcrsqYNpxBFIPfXmZGqF0/byHVAxkCIZ+wx0=@vger.kernel.org X-Gm-Message-State: AOJu0YxT0IdMgdDp7EIJIv0mjHqNvauzff1cGmrQn8xd88m/SKHHasCD UzGoynywuvcHDOoTAc0Be9EIlZu+RiEXF4/3fnZf6GNXydxnr/fhBtrAy3JNVpI= X-Gm-Gg: ASbGncu+kJPmeWrCLdQEf9USSxTUkpyJQk+FWyjOYPplwE8tlAE8Q7qnaqPX5o20OxI gqWoMefNu6xlpsSi6uSZjU/Js5Id+dFOYC7mbogHk8UkHg0jReMlbFFncdJr9D1Ee6ZVImD9bea b+UxI2uBZpJ1bCvBoRo0+5/afWCq2ZkwBXrInTSn2X9YocDPt7RlN6xiCrJlExpzl4MwaFwncYp sEcyWjVF0eWoVNb8fKee2sHxBkfzMwr/atpJ7Vp+92kzQ5LvjEyFD7AnsEGi44fwShCM4ykuqPu oiZB645PYdXufGYjg77JFtX9pzRengEsqRgvL0w2NEnCyiK/Ot/+NbLfh2WPivk8ttw3xUo/CBL yUsLDnykBS5OyA9ZlbZ/jSI2elXQ25ukBeTtcJ3jmPXbelqIii3KVD9pzbw2P51qD2Yxt X-Google-Smtp-Source: AGHT+IG2MA1VjloGr2GNffV2SfFhbl1kHIYBhP5Cte6pgnARhrLj1e4TxqCjo29diAEMPEL/GmQdjw== X-Received: by 2002:a17:907:1ca3:b0:ac2:d1bd:3293 with SMTP id a640c23a62f3a-ac3301e34c8mr955902066b.19.1742171981897; Sun, 16 Mar 2025 17:39:41 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:40 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:34 +0000 Subject: [PATCH 2/8] media: i2c: ov02e10: Fix initial indentation and spacing 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-2-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 8c4455b3643307be5b1e8110979740a7e843c146..db27d8c9f3f0b8dd6df6f9757cc= 674075e419075 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -220,7 +220,6 @@ static const struct ov02e10_mode supported_modes[] =3D { .num_regs =3D ARRAY_SIZE(mode_1928x1088_30fps_2lane), .regs =3D mode_1928x1088_30fps_2lane, }, - .link_freq_index =3D OV02E10_LINK_FREQ_360MHZ_INDEX, }, }; @@ -771,14 +770,14 @@ static int ov02e10_identify_module(struct ov02e10 *ov= 02e10) u64 val; =20 ret =3D cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, - OV02E10_PAGE_0, NULL); + OV02E10_PAGE_0, NULL); cci_read(ov02e10->regmap, OV02E10_REG_CHIP_ID, &val, &ret); if (ret) return ret; =20 if (val !=3D OV02E10_CHIP_ID) { dev_err(&client->dev, "chip id mismatch: %x!=3D%x\n", - OV02E10_CHIP_ID, (u32) val); + OV02E10_CHIP_ID, (u32)val); return -ENXIO; } =20 @@ -948,7 +947,7 @@ static int ov02e10_probe(struct i2c_client *client) =20 static const struct dev_pm_ops ov02e10_pm_ops =3D { SET_SYSTEM_SLEEP_PM_OPS(ov02e10_suspend, ov02e10_resume) - SET_RUNTIME_PM_OPS(ov02e10_power_off, ov02e10_power_on, NULL) + SET_RUNTIME_PM_OPS(ov02e10_power_off, ov02e10_power_on, NULL) }; =20 static const struct acpi_device_id ov02e10_acpi_ids[] =3D { @@ -960,10 +959,10 @@ MODULE_DEVICE_TABLE(acpi, ov02e10_acpi_ids); =20 static struct i2c_driver ov02e10_i2c_driver =3D { .driver =3D { - .name =3D "ov02e10", - .pm =3D &ov02e10_pm_ops, - .acpi_match_table =3D ov02e10_acpi_ids, - }, + .name =3D "ov02e10", + .pm =3D &ov02e10_pm_ops, + .acpi_match_table =3D ov02e10_acpi_ids, + }, .probe =3D ov02e10_probe, .remove =3D ov02e10_remove, }; --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 C66CC60DCF for ; Mon, 17 Mar 2025 00:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171987; cv=none; b=e0ko5RaIH1qnA/zb55zPhyy1eO/a7OmrCEEXalPuz249ZVRFDeZd4p26sBzNzfpLrEjL16s5HVRXF3y0ePkRCilEDuocajeGV+Hf5Wdb+1fGLNxZfQvdfraGWEn4Z+r9ufOaAF/Y/22WIGP8v1ChkNyz/ka3HUo/n+Qlis/TudQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171987; c=relaxed/simple; bh=KIg73JLaVi8hOvqu+RYn7ANzfZBohIjnh0HTlx/y0GI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IQIvjTrzwK7gtVTg5oSm+Aw8fYZsY5TTaUgPvj8G6o4nHcotL0SloOnj+/kf09duHiY6Bydjv3nq+qhUqdz5Ezhl0CdqxkwC2Y9R8U+bfZqmSNQzrTneXbpeLGaljpqDjszJ04eO4b3WtsEOkzxtsTL+jJ3NugVLHXF7zGVfGY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TILKBI8J; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TILKBI8J" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ac2aeada833so759653666b.0 for ; Sun, 16 Mar 2025 17:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171984; x=1742776784; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IoT6hEWGo8s9UTjENCcvZ5oqOOzIvji9QYyI5V3xbzI=; b=TILKBI8JYvFHYyPEcM0klEATbTiKZJN2oWNOJhIb9jPT22HtmrhqL5uUrPb67zBh+Q sdAsCj48CiFAuZA2CYKmAvAUjc9HEk2ngotbAyPOvUcY6o0ra3wOtTjHVeLJdFL76RNL jhJFE5J2lH2bkkH2TZapF3ucSA+WLnffOClFCVIYvuwc/yQAyMJb2ZfBGEZ1TQzA8fBS FPFPnWmR7GdYHG2E1N2H/111M59ewzK9Lnd75V1tKPb1sIS2Qz85JmMxRKWAaWRRqe3M UW6FXLl27sxT6Ui1XMSpefxz/4g3vIEu+cqcRh1/nR+XzA4og8kGuCtNuK9Xa3ItSq9d WOoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171984; x=1742776784; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IoT6hEWGo8s9UTjENCcvZ5oqOOzIvji9QYyI5V3xbzI=; b=WJOsLAsT4ZXOwWPmtCKjDEz0vqnRXuJak8iZKeRm0FSGHU38XnR4sCci02b3HcFwnf 9TsHiYfY0D1TwyaTUkAHmngylvuHWa99Uu/r52nD2fpaPDFrO+kHJHUF1GLx0jA38fQL +CY0VlsQ6ia/tP2OCkhGcsZ6f4vOjzjPdCUWXTCBGC/PByE7358A+GR2wNqvuFehh5RU QVZ+n/psrcZprsDmA7vxqRfSqqXKCAaRejpWoi7E4ZtLipKkTd+CDlLBi1/vbJJFx03j EWLuoqSacpyWyyXCxuwvOpul0PdJ9s9DoaZR9kb2mjvu7d35ylvrY4iHtMZPTQH8J8Oa 639g== X-Forwarded-Encrypted: i=1; AJvYcCVGn6gThWoL1N9gZIdA5ZFVDCBtCs+0rlFMNBt+u/MC3aFygSkLeMP78VSO3RUFx62LEdD+my/03ODua+0=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6h06DvvGG3TpENHiJaarb3JZ07eXVdany77SNtXa0X+F2utNM M7AY1PuobIM5zqhsGR80ZQ2dHK0Pvo4/fURLmG8w7QY41DSt5P8ZF3HOuxf71CY= X-Gm-Gg: ASbGncutGN8RVi20qeuvmkc/WkLhbou50kKK/sEEfGkdOAQgp7otBY7Qd5YtNOoGdWk vo7TIpaI+oDJYNVeMkXhrlGOLcfSjrVYGyVx3BG8k7wpFm2gsqvDJWx7vxwPTa73EWzGiZ2eOp/ FScPSBsiFORXqNtEY8l2/hToaMt2ILH9YlNJ/yLrpG1G6cOV0cmGMtMNDYUFzi+nhMJKMfayU/E SW1frmr461jIQ1JsRzzCxN0sJHXY2RLybFuMHaAmvppjk6IVItvjEGTcT51wqb910yfqrK67+bx FM/32gwzqyXmP+U4xjcckxH5CK7AtCQO03EmUBivg32KCiOFg5tg26+Ot54WmqrNmOgDuGSR8wa It+KMkz3w2V1URmnqXtknvm6m3ukVlYCfcQ8UODP5pTUNE9tPnqal02Qgs28VhG9nh9sp X-Google-Smtp-Source: AGHT+IGxj3hD3Zl/SHYK+Ro/Yq/QeM0EbgWKhYdvYO1QgDwVz72yJECHm1FociRYklXqmpJxEGwR4A== X-Received: by 2002:a17:906:730b:b0:ac2:f24e:1fa3 with SMTP id a640c23a62f3a-ac3314f59eamr858256366b.20.1742171984107; Sun, 16 Mar 2025 17:39:44 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:43 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:35 +0000 Subject: [PATCH 3/8] media: i2c: ov02e10: Drop IPU6 FPGA specific handshake GPIO 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-3-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 The IPU6 handshake GPIO signals to the FPGA on IPU6/IPU7 laptops and as such is not a sensor signal. Hans has a proposal for handling those GPIOs below. Dropf from the incoming sensor driver. link: https://lore.kernel.org/linux-media/4b87a956-a767-48dc-b98b-f80d9a44a= dc8@redhat.com Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index db27d8c9f3f0b8dd6df6f9757cc674075e419075..29f9eec927b4660f941fa8e3224= 9b321d25b7735 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -240,7 +240,6 @@ struct ov02e10 { struct clk *img_clk; struct regulator *avdd; struct gpio_desc *reset; - struct gpio_desc *handshake; =20 /* Current mode */ const struct ov02e10_mode *cur_mode; @@ -533,12 +532,6 @@ static int ov02e10_get_pm_resources(struct device *dev) return dev_err_probe(dev, PTR_ERR(ov02e10->reset), "failed to get reset gpio\n"); =20 - ov02e10->handshake =3D devm_gpiod_get_optional(dev, "handshake", - GPIOD_OUT_LOW); - if (IS_ERR(ov02e10->handshake)) - return dev_err_probe(dev, PTR_ERR(ov02e10->handshake), - "failed to get handshake gpio\n"); - ov02e10->img_clk =3D devm_clk_get_optional(dev, NULL); if (IS_ERR(ov02e10->img_clk)) return dev_err_probe(dev, PTR_ERR(ov02e10->img_clk), @@ -563,7 +556,6 @@ static int ov02e10_power_off(struct device *dev) int ret =3D 0; =20 gpiod_set_value_cansleep(ov02e10->reset, 1); - gpiod_set_value_cansleep(ov02e10->handshake, 0); =20 if (ov02e10->avdd) ret =3D regulator_disable(ov02e10->avdd); @@ -593,14 +585,8 @@ static int ov02e10_power_on(struct device *dev) return ret; } } - gpiod_set_value_cansleep(ov02e10->handshake, 1); gpiod_set_value_cansleep(ov02e10->reset, 0); =20 - /* Lattice MIPI aggregator with some version FW needs longer delay - after handshake triggered. We set 25ms as a safe value and wait - for a stable version FW. */ - msleep_interruptible(25); - return ret; } =20 --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 6753E12CDA5 for ; Mon, 17 Mar 2025 00:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171989; cv=none; b=VQkl+0LXvRCMzKye991/T5ZjdsDk0Wp1Xym1aIyLOO4jyqhpAzBECLP6jTtb+Eyg6XcxH2r09/xNUIpJ1goWShJRUJUjVppYEcl7AznnURQV3mpTmhS9toTEdWnkbju0O7EYmYBshNxiS5XiwX+lo+OynHXApW6sjGw6QjdlPwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171989; c=relaxed/simple; bh=eRL0pzRV5KcpM/Epzs62OHbODj4sT3wl0WJ5nHoAiS4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WCHz6BKiOjdhIOUuTqsUq+2bdyX6YARKN+qaL1keu8P/dafCsvVZB7l729MwkxVZyYKSKnrteBr/wp9ZF/FIzmbN0Limecbwj3/EMyB6JPmUrSzwoT+Ae6qSgBF3HP5yXWCwXyxBzqEFPaUBAd2VcDHlHxwA+8oYoBu/vbsz8os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ynz5jpJz; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ynz5jpJz" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aaecf50578eso699163266b.2 for ; Sun, 16 Mar 2025 17:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171986; x=1742776786; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n082EhybKfMTlm5jNgC5EZa5zxrxPioIfsLFHDtNktM=; b=Ynz5jpJzvKjK/QzLn6GZ6emyWWiNmi00f+YlMX2vGGUqG1eJ2lY4FCDB4R22Wr5xfj v+ON+0pUAWxzLMvBX4imbe1513utnqjqIHlUbUL67RhlY2Ht44IREKpjumP45S8+Ftak h/4HutK4cr/sSmiv7rMSvtQQz7+ACYdimDFK6YYEDTtyAi8nK2f5BlJ5V6bs70zT/iqt dGhxpjH86H3NsaoFh9GlHujmTdDbDtFkB7do8jb84nxZ7kmfZc6VR5/oM5a7IJlgx1DG lZmckWu1BKgVA/4A+OVHRfOxmmeHF7gSw6N8aE534zbHAX07RCgxMN7XW0XbyI4we5TX IE7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171986; x=1742776786; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n082EhybKfMTlm5jNgC5EZa5zxrxPioIfsLFHDtNktM=; b=U/PpO58sNY3NMvTpIZpUXx8PcMAoL+ZWPZAVhQm+3adxSwp/VFUmHl/F72g3v7tHTt UCsXg8+veYWgrQip1avRPbsB3xlTbFFwdTAp/phfDQkZR9ozj943fhJer3CSSTUXUBFr XJlunzGmyVYEF8Nfqjkv2qVMi5upJyh6NmdfqLm1ID5YYXMnTTht8Okdg7bgM8H9YICu F0A4z2M6+wu3l2IpiClsMzqtK7ImQXKYG0PDj8TbOV3LHyOg8mEXZTVXehpEUjrGU4hd HAE6yPwJzpxdFGZZtk2o0P6d6KiYJIPBdzSDzIQp571NJeOW7q1OOKvQklAu2Hq7YgWn H5Vw== X-Forwarded-Encrypted: i=1; AJvYcCXpZIZwzdPR5aFyPmTp06f0zPtFkDFMWUrJPnMUU3/ZdPG4Rcd8TpLJ5km9dAx/Lt3lhy/nLqC6SH/Gttk=@vger.kernel.org X-Gm-Message-State: AOJu0YwMmHj7RkwfOkbfPcHs1Yfefi5iA1S2YZBIua8lCYqrz7Ej6OlS TS8kOdJMtX2WV1vI2AY4i6B5W+VZguOKHe7Nk1jwTARGWNGGfom1YWfvmo2HdXM= X-Gm-Gg: ASbGncvigCNLzUKEAvCh9cIu54BNI5dIuVQtYTdbE9yn9hlRGM/vQ6cZMo0nmpR15G+ ZOHOrJurlrU6pyUdJjJF5B0l8PLlwFcqHCYX4Q1nKoYkTRumJggiGpJ/jKQKg0Gmqo4Np3ie4hr 7IpTh0kXv2aiTQzg2Ayfne+NKRqyWYm8UXg02c91X8rBScBe1P/EU6zlR+UxLtJ7SnTwTHDRifF BG8bs3t7vjO9zdg8zx9us4AHlR+yQqdG5vNrN30vpGlR4TpzC7MmQZHQxl13E/3ratthiOss3ce 09g6qu3rtrBKw8Cq4A3S9P+wR6LXCqQDiJB1J9yUQc8tYjrVDIdI9l+EooZyaRuS6wiZrO55Aoe 06E6OaLCrGI3VftNUryL2PyYjmm47Da/rRwWucd4t2jYkFX0B0asN8wwiR2zyeZhFouPvJKyf/y oaa88= X-Google-Smtp-Source: AGHT+IF0LQVRgCzkI7Nuvq266Wk5lgf/Th1urxfb6eFhn7BdMEj7xPDiCeLXnIeLYP+vZb6jZV9IdQ== X-Received: by 2002:a17:907:2cc4:b0:abf:75ba:c99f with SMTP id a640c23a62f3a-ac330404688mr1052267966b.46.1742171985688; Sun, 16 Mar 2025 17:39:45 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:45 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:36 +0000 Subject: [PATCH 4/8] media: i2c: ov02e10: Convert to regulator_bulk API 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-4-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 Change to regulator_bulk API to capture the full range of rails to the o02e10 sensor. This will work for ACPI systems which only have the avdd rail available as missing rails won't fail the regulator_bulk_* function calls. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 48 ++++++++++++++++++++++++-----------------= ---- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 29f9eec927b4660f941fa8e32249b321d25b7735..0a016cb23cbe98d8af371c6a35d= b2f1d8c699d68 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -224,6 +224,12 @@ static const struct ov02e10_mode supported_modes[] =3D= { }, }; =20 +static const char * const ov02e10_supply_names[] =3D { + "dovdd", /* Digital I/O power */ + "avdd", /* Analog power */ + "dvdd", /* Digital core power */ +}; + struct ov02e10 { struct regmap *regmap; struct v4l2_subdev sd; @@ -238,7 +244,7 @@ struct ov02e10 { struct v4l2_ctrl *exposure; =20 struct clk *img_clk; - struct regulator *avdd; + struct regulator_bulk_data supplies[ARRAY_SIZE(ov02e10_supply_names)]; struct gpio_desc *reset; =20 /* Current mode */ @@ -525,7 +531,7 @@ static int ov02e10_get_pm_resources(struct device *dev) { struct v4l2_subdev *sd =3D dev_get_drvdata(dev); struct ov02e10 *ov02e10 =3D to_ov02e10(sd); - int ret; + int i; =20 ov02e10->reset =3D devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ov02e10->reset)) @@ -537,32 +543,26 @@ static int ov02e10_get_pm_resources(struct device *de= v) return dev_err_probe(dev, PTR_ERR(ov02e10->img_clk), "failed to get imaging clock\n"); =20 - ov02e10->avdd =3D devm_regulator_get_optional(dev, "avdd"); - if (IS_ERR(ov02e10->avdd)) { - ret =3D PTR_ERR(ov02e10->avdd); - ov02e10->avdd =3D NULL; - if (ret !=3D -ENODEV) - return dev_err_probe(dev, ret, - "failed to get avdd regulator\n"); - } + for (i =3D 0; i < ARRAY_SIZE(ov02e10_supply_names); i++) + ov02e10->supplies[i].supply =3D ov02e10_supply_names[i]; =20 - return 0; + return devm_regulator_bulk_get(dev, ARRAY_SIZE(ov02e10_supply_names), + ov02e10->supplies); } =20 static int ov02e10_power_off(struct device *dev) { struct v4l2_subdev *sd =3D dev_get_drvdata(dev); struct ov02e10 *ov02e10 =3D to_ov02e10(sd); - int ret =3D 0; =20 gpiod_set_value_cansleep(ov02e10->reset, 1); =20 - if (ov02e10->avdd) - ret =3D regulator_disable(ov02e10->avdd); + regulator_bulk_disable(ARRAY_SIZE(ov02e10_supply_names), + ov02e10->supplies); =20 clk_disable_unprepare(ov02e10->img_clk); =20 - return ret; + return 0; } =20 static int ov02e10_power_on(struct device *dev) @@ -577,16 +577,20 @@ static int ov02e10_power_on(struct device *dev) return ret; } =20 - if (ov02e10->avdd) { - ret =3D regulator_enable(ov02e10->avdd); - if (ret < 0) { - dev_err(dev, "failed to enable avdd: %d\n", ret); - clk_disable_unprepare(ov02e10->img_clk); - return ret; - } + ret =3D regulator_bulk_enable(ARRAY_SIZE(ov02e10_supply_names), + ov02e10->supplies); + if (ret < 0) { + dev_err(dev, "failed to enable regulators\n"); + goto disable_clk; } + gpiod_set_value_cansleep(ov02e10->reset, 0); =20 + return 0; + +disable_clk: + clk_disable_unprepare(ov02e10->img_clk); + return ret; } =20 --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 0BFA438DF9 for ; Mon, 17 Mar 2025 00:39:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171990; cv=none; b=HauWNNFKHb8TYV636vsRLrVdXTi52vOG0ezrjFXoglEYecyfAbvpLr9jEcuawinGFyk6ZkVITe7HuqlqO6ntLDhaOPxiUkI3UEjuIFIY62aJJxbCi9aKPQXYFl3ITLELZtyLPS6WkXaLRI7ZKtWJ/58/1GBuGRzhzqcD9jIXhA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171990; c=relaxed/simple; bh=R9gQe3qP710QBxP5kvOsE7wmBexZNkhKVtIyauDUWSk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R0pSrZyctOf2LfwXek1WPMAU8djDyQXLj1P/1u0f6+WSLNpsVoYiosTGEwNPp4U4o0bDXEq4KFy/8ou1tWTwA+vdflzj+WIpGSNSoUVA34fYgS/TXh5dqrTYGWWRg8519J4bR3X/2UoKUpveLfKbUfYcxyeGap4rIngNMNk7J2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SEPwx1IQ; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SEPwx1IQ" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5e5e0caa151so6690230a12.0 for ; Sun, 16 Mar 2025 17:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171987; x=1742776787; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Fa0+XG41AnTpCxI6rUtKEupAlgua8QfZ9lbTB2DppLg=; b=SEPwx1IQrSNh92hFzyoF5ugg/rFJjO5/LcvTcvLrdNeJ+C8jktKA3qESRRmhIiTaOS KkmtSfIM1FXE9tZvnk3dv+JtZ7II5acrZfS86f4rQaIj3YPGyZFIHbvF0IhWzJ3LIzsj TbdAHmcEQxT4EWb3jl5xEDEuKQTh3N1J18JVXcYEqniI35X9ftpMKOmWJa3X9gbOefQd 4BGq6+aYpbxjvKzN5bejZ+b00+cT4AFWImikmpimD341JsXmALAK8Uj7G6a3tcmjRMIL sieH3k4rFNIyq4aLaaoTRgVFm8c+hpUSpg+gH+qZLVN39L6D39rvmwf40h1jv4/vWGb6 btWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171987; x=1742776787; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fa0+XG41AnTpCxI6rUtKEupAlgua8QfZ9lbTB2DppLg=; b=G/RKbCONcj5cNx8erIgpsjun1hvoa42HinldLTY4XhGbAXMKwuzEIPVzuLkSowsoPL 83dIIHz87PsW8NMnady046T8TGRqfklHVXZj1XaxvxufyJFbySM5573b0bvkeZNmQ9fq M9fW4Oxil9M3fFYVSruIqGUFEKqaSbgITtkrTVnObIkRMSJXSAfmhqsTcXyuJl6okYXU U3+DD72wIYdJ2zYUZyMzXGQehG658cYMzHXKud/nviHRlKOrZgPENPP6fa2+754voie0 ZE/3r6T81jNbLbveGZbrkRNnz7260VG0NaQBHHFH8KT+36i12zFWSIhelC9e8S5jxCnA 94CQ== X-Forwarded-Encrypted: i=1; AJvYcCWUe38bpXwmx/QUZ19dbRUtAUOUq2TipAaKYEtrGBrFCmQBKbVKhpilAD7FA/C9+RTxaGRoH5Zc3BDnz7k=@vger.kernel.org X-Gm-Message-State: AOJu0YxGlFZu7N89nodHf8VW4nS6U6sSc5gwl5U/a8YJkgZuZ+/DIJZI EvSNbVg6wXrBqs+5Rac6b9D4CXN0iydLobKkTRoIWK8P71oP/geYzhdnN9ue2c4= X-Gm-Gg: ASbGncudlYUW5ud+em+j7CZM+EIEjkW+INRx6KyVCJq7tBba4nAZe61VOGuOomIiViw VvEnPOESUvkWgzXRTTp+HbGzPtGjtxbBKLjZ4Cgz7YRhQuhHxw1B6cZMpiIpfkZr2hmN7QzuHkY Fxx5Dw2SBs1KEtrHYIndqY8GegzccZ5VFNmXGh1y3t/B7no525Pwm90Sdd7ZAbScEy4G6t5lA51 3kjMhGlvA2nIYGtVNFNqrD6Oh8AjD4eakt0upayvoMQmcsODruNssfS050qcdB8z4WejZ2c7XLI f+/XMBsvcD06q1P48v4ro0sJROawkihNOizy1/Eo3qu+z1u1AfSWNeKdZdGPim0q8E5UVKCdos7 oeJC/gIR18Xgyb27ZqfpvqLL908mp/ZttDnwAhDC0U069xsXbJxX/lmCd9z64qXzOmUd3 X-Google-Smtp-Source: AGHT+IFGB/6ELCetEqsulbq9XYDj362qmt+yhgOiXelWC2RLXXmy8I2ZSYJBdVHdEvtB3cFlQPysAQ== X-Received: by 2002:a17:907:6ea9:b0:abf:52e1:2615 with SMTP id a640c23a62f3a-ac3301db85emr1179198966b.7.1742171987230; Sun, 16 Mar 2025 17:39:47 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:46 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:37 +0000 Subject: [PATCH 5/8] media: i2c: ov02e10: Rework MCLK clock get logic to facilitate OF 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-5-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 Move the MCLK validation logic to check_hwcfg() and move check_hwcfg() to after devm_kzalloc() so that we can pass a struct ov02e pointer to check_hwcfg() to begin to enumerate that structure. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 43 ++++++++++++++++++++++++++++-------------= -- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 0a016cb23cbe98d8af371c6a35db2f1d8c699d68..9ad70671a718ea0aaf80ad3adcc= 5738ee57a7ff6 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -538,11 +538,6 @@ static int ov02e10_get_pm_resources(struct device *dev) return dev_err_probe(dev, PTR_ERR(ov02e10->reset), "failed to get reset gpio\n"); =20 - ov02e10->img_clk =3D devm_clk_get_optional(dev, NULL); - if (IS_ERR(ov02e10->img_clk)) - return dev_err_probe(dev, PTR_ERR(ov02e10->img_clk), - "failed to get imaging clock\n"); - for (i =3D 0; i < ARRAY_SIZE(ov02e10_supply_names); i++) ov02e10->supplies[i].supply =3D ov02e10_supply_names[i]; =20 @@ -774,7 +769,7 @@ static int ov02e10_identify_module(struct ov02e10 *ov02= e10) return 0; } =20 -static int ov02e10_check_hwcfg(struct device *dev) +static int ov02e10_check_hwcfg(struct device *dev, struct ov02e10 *ov02e10) { struct v4l2_fwnode_endpoint bus_cfg =3D { .bus_type =3D V4L2_MBUS_CSI2_DPHY @@ -795,10 +790,28 @@ static int ov02e10_check_hwcfg(struct device *dev) if (ret) return dev_err_probe(dev, ret, "parsing endpoint failed\n"); =20 - ret =3D fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency", - &ext_clk); - if (ret) { - dev_err(dev, "can't get clock frequency\n"); + ov02e10->img_clk =3D devm_clk_get_optional(dev, NULL); + if (IS_ERR(ov02e10->img_clk)) { + ret =3D dev_err_probe(dev, PTR_ERR(ov02e10->img_clk), + "failed to get imaging clock\n"); + goto out_err; + } + + if (ov02e10->img_clk) { + ext_clk =3D clk_get_rate(ov02e10->img_clk); + } else { + ret =3D fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency", + &ext_clk); + if (ret) { + dev_err(dev, "can't get clock frequency\n"); + goto out_err; + } + } + + if (ext_clk !=3D OV02E10_MCLK) { + dev_err(dev, "external clock %d is not supported\n", + ext_clk); + ret =3D -EINVAL; goto out_err; } =20 @@ -853,15 +866,15 @@ static int ov02e10_probe(struct i2c_client *client) struct ov02e10 *ov02e; int ret; =20 - /* Check HW config */ - ret =3D ov02e10_check_hwcfg(&client->dev); - if (ret) - return ret; - ov02e =3D devm_kzalloc(&client->dev, sizeof(*ov02e), GFP_KERNEL); if (!ov02e) return -ENOMEM; =20 + /* Check HW config */ + ret =3D ov02e10_check_hwcfg(&client->dev, ov02e); + if (ret) + return ret; + /* Initialize subdev */ ov02e->regmap =3D devm_cci_regmap_init_i2c(client, 8); if (IS_ERR(ov02e->regmap)) --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 7AB9E14AD02 for ; Mon, 17 Mar 2025 00:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171992; cv=none; b=nd+o1TsEBmwKNpP8EE783Mh2rTdMxymZ+fBS324spnN035/+RD4/x7TOg4NbKwwXNUEFMG0F7zQyp442cSskyz7ZgbWZAWmktd0xVGSUd4SKkvRfYQDyX9eQuZ09jTKBiHG0cRo4IUl8FFqWBkCpLAhpPNyY8G5384PXzmhtogg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171992; c=relaxed/simple; bh=xI8NEGU+/vOVowktJFplHlwmCPwO6Su0nn2Dpzy9ADE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ippUg/2IdYGPG17Ew5v7yY0UhL2WdjyQt7zRZZS75pLWpFOAhXrku+mWP1CbAYkfeF8w484+TBJrY4c2nKHpbDUjW8C4l9PbNEC3kctYmx2+geWfaUorauTxr4KXX42xeXtx6DDnnRuRfttsuqVJImn//Vq1Fegh/IrmYw031SM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dwgW4dxD; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dwgW4dxD" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5e8be1bdb7bso2941987a12.0 for ; Sun, 16 Mar 2025 17:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171989; x=1742776789; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LTwjuKAVPDFwywDGvwuXvBGY8agm/8D4s3lYkbuf/68=; b=dwgW4dxDF+giCyGeXOSUDreZyh24J1wwO4BvjZifUPRO9VDJLse7s4ombFqDgswKgb 8cKLPBvEohcHc9dui1TKnX7wgmHyqkOISp27ts87Ph5JeNBluC7RRWJ477Ty3+romS3G L4NMLXkDsTgT4FThjCQdgafoz/zdiEquVycZgNAq2ZI2JRMSRRv7+CeIge+cJSAiOCQ2 bCSb74Mxulpf5kRVA2xVYxaqshgCGhyGrNHxpV7ZLzLsNZmY79DExvOKv2ot8oBnKc8B O18FSpej0eu5UZcNf6KKOlV0jnkdt805dF6bs6gr8YK0eK+hb/24E6TFxfcSnsFyF20E DQZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171989; x=1742776789; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LTwjuKAVPDFwywDGvwuXvBGY8agm/8D4s3lYkbuf/68=; b=s7d80MAfagiqm4FP2GmYSqjTjuKJRxtFMSGO2wqkeveXXcL7qS0GNX5slm+aLOxCHf YzDU8puZ4NjUvet0j8acHt847IkuonTXCtTCYTRz/PApKfXWOQ5NMM36EpsXS0hSim9R 2voI0fY1xAV2wU2HPNtigIiTohQ+Vcrpl47vkNu9ai1A8+GyJswTgrHQ1/sj5xBaxjFD aK3vme+t/gjM74alizVDy5M69L3cQcRjlOwH8DMRt59cx6Z3uGUjCxQccPI5NI1BDZ+S ty2IXgkfs3qKtI9KV+0nYaEZGh6ZNNXy8bGz4kGbk1dszXFq2MV/1P9nh0sDqh8mlKjw PcOA== X-Forwarded-Encrypted: i=1; AJvYcCVFJt7uaFUcqCkh08v1jOUA/LvplF/CnyLeisnu8C9vxfcUnTvC7HmPhkSwMRVVvKwktJr28nqau8goUD0=@vger.kernel.org X-Gm-Message-State: AOJu0YwNKUF1STi2tKzNp6CnuF3KxsepnqAXtxX1osesXIG815GeBz2U wCbO0HCgcy74DqooQVUTwUe/BfvcllSNsRv9Jd18OxudRb4Q97+Kd2Q3uj4aT9g= X-Gm-Gg: ASbGncv7O9uEdXrkUScdmIRlAtsOWkmp3XOeEfg4qsu6aVfRdw/nWNTWHJipTXCXl8d Zfwb19/HDV3OvIEYDO5g4FR9rPktMWi2KZKQ5m2MtCV7DKstT24bxTDDHhT5zHA8qBvS2hMaMW5 SQ7rlFOf6ZQWP2h23uPZYFYNMYvl7eWDFYq4eydPDtbtQwYpY6+9sCPbaVXI76qD7i7saSIgaNH c9a4QBs39tzgGx2VXXW7AW68FPAll/8ctEdfRK5MEClnz94F52zirBsI9o6Vmnp2cPURJS8qZsj b0LkgjvRAtCVPCLpJBhswA8/KrT80/mUAxim9aR90MLdmVgiUL41sg7hMWj6c3K7STI9RL7supf IM4Y5LqBXUXnQLzyVU2u/tP9+fkWq/BPGC3ny14xLjzRDJuYvoJvtOD2mgpFQozeEM6+J X-Google-Smtp-Source: AGHT+IHuPF9RmLSS+cmRMvKhsL6P3ptFy8EeFpnvckAhRdDHOi6nF7p0bB4TaCKF/ZRiT1JFMASrhA== X-Received: by 2002:a17:907:960f:b0:ac3:1b00:e17d with SMTP id a640c23a62f3a-ac3303dc6dcmr1028421966b.54.1742171988774; Sun, 16 Mar 2025 17:39:48 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:47 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:38 +0000 Subject: [PATCH 6/8] media: i2c: ov02e10: Implement specification t3 and t5 delays on power-up 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-6-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 The ov02e10 specification says for power-on: t3 =3D the time between dvdd stable and XSHUTDOWN deassert t5 =3D the time between XSHUTDOWN deassert and SCCB ready The power-off path in the spec shows no required delays between XSHUTDONW and power-rail shut off so power-off is left alone. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 9ad70671a718ea0aaf80ad3adcc5738ee57a7ff6..40c4d3ee36e3e2a0bb8be3ff10d= 016e2bb9bbc9d 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -579,7 +579,11 @@ static int ov02e10_power_on(struct device *dev) goto disable_clk; } =20 - gpiod_set_value_cansleep(ov02e10->reset, 0); + if (ov02e10->reset) { + usleep_range(5000, 5100); + gpiod_set_value_cansleep(ov02e10->reset, 0); + usleep_range(8000, 8100); + } =20 return 0; =20 --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 E366B155316 for ; Mon, 17 Mar 2025 00:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171993; cv=none; b=hkq+ro1dUflcW4jAZTsdeVemGRnzkcQwfJGcWEvTQ6HcODbqr99kGp8mYKfp7xCWRIa4jN5xu02SQZEE80Pwit4MFVn0laOooYTpzqI2kRsZwHMBSMAGl7UUeyTkX/VrAdLAQojnpcj5iMcUouO5MmVhnyNMbyrud1uX8ME/qWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171993; c=relaxed/simple; bh=BseOSyrWbC7XsN7Ir+jFiDNzEQWe5FkrG+nPfKJhH3o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+DTvs28dlrpqwN+lSer79XSKa4gSg6sJWKuj/fqgVfkjaKqTjTtA5xx34BNTj3vsxdjnb420Kd5unQDIlLeExJci0oVupOKB7/ojbusnd2cQ8Osg6Bmcej61qZV1hdvYSnL8mobmIuijM909MhfYUGLy2M45TS3oe7LcmKq0p0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eOyyBbPI; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eOyyBbPI" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso739088066b.3 for ; Sun, 16 Mar 2025 17:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171990; x=1742776790; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9CgiISetOnuxy15HQS3MAPprAz1pVNJBASTHqb0R23I=; b=eOyyBbPIbg+Fi+qJ0SIKD7AmsuvhuHBn3AktJ6Qkn2l317ppI9xtuSvfjam+RN7l+D wZF/a1iqAx4lbHBoFypAN4w5puZbRA5LrIpOsfKKv33CKONov3yRqIAwgaABvoyLuhQT FsGUmlYXooLEfuBFrWEWN1Z0NgCdJVfHEJ3SpSqQIXOnaxh6cr6rL1n+MmXbDZycOnPI rdtYxkYvWvVei0iPyc0dxQXYIIRw7FGbCYUGm/R9eeymG8hA8SsRfP1ejl4rVMjpqvhA 9JzHQ19zmJgFdhXcy+JAdy7VkRvI/AOahksdboq+cHPZ0OHzZA4AwhXZ9s9ItwA2YKwm ImiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171990; x=1742776790; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9CgiISetOnuxy15HQS3MAPprAz1pVNJBASTHqb0R23I=; b=t84X+Bebozp69LgaAMXK2S9MBqS3sQ18f6ZYW5SjcmBpIAStORSG/bhWm3j1IfuoA9 v7pbJAiO772RX36WTBIHtHMBNnM1qdZ1zPLvhJ/nQeh9DeNfVerpirIn3stQ+2+rcvq4 iouEXBZe4//bb9Rg9jmwxWT2LkkEMilKhWAVM80h92/sHa3hQ1XOatYgEL2umLh55Dit sal6Zu0F+a/t54upn+IxWnLrGBfbQz5EvEbaRS0prmwrBgX/PmvgSwFb15pWssUy42PV MRfqJFBspRDRc/Q/xlDEDhFtm5Q+a/ul0jMEugxePKo0QXyChCSRERUEOvZ0KrkzTPAA wChQ== X-Forwarded-Encrypted: i=1; AJvYcCXYfrQ5wJKqvkCaF9VnhDNWrs4YpdQKDKI+Ueh2yaIy71qZLMmLIPJT3A1k/IFnbRC6gW/0cCb0QiYSKSY=@vger.kernel.org X-Gm-Message-State: AOJu0YzedkmAwqXRAcV8G3geJ6uXaspvmO6Z3CeMsJhWX+ZrDjp7ydUO Pn+ZrQEQrDsvuEfgSsjgcj8Ez8iup44i0xqxLXOtRX0O2jQ/Z8pNaI3GFYdR74s= X-Gm-Gg: ASbGncstMoZnOnRx47yq6mpuD8sHz+tLX1t9TROrUTS8Ex/tLODz+MoajHeWsn5u+rt uD+N+GRsHrtTUVy2LScl50668Snj3IJ0nO9MLOIPkRKULeo191SKhMx405EReHiWH9pXo3BCzXQ k4u2tYYGSaYUobhCKwj1d9O9oTZ27w5u2yQTiKUiAsBe7QRe3pBtXUzGtWZdBAxtG6AqGq4I+tz aLSQjlkZ0KD1x/P50xgBBCsK4/pV1qHy57USUfKYhOyhwMPQmlrXgXVfWdTyqUKRzVBTFRTa6me 3m+EjsaQTR+66T+zFylv2mMIKAwDFL+SV/w9eoRHWX71/CkypssAAmz7zDqXvjwMMbCkPmjtmzE PT+/8NasV1RRW9/+hJddhUUdvhDcTcmVz/k1OrTzqJRXHMnIOEN9NBAC6NbIMSvUtP0Ec X-Google-Smtp-Source: AGHT+IHN6MpPoVaqeceUTiJ12TLHptJq+aSorclyfov0XAOk0vnOAfc+Ft0TUVap5T6G00OSbPu+0A== X-Received: by 2002:a17:907:7d87:b0:ac3:26fb:f420 with SMTP id a640c23a62f3a-ac3303715c9mr1205541966b.42.1742171990333; Sun, 16 Mar 2025 17:39:50 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:49 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:39 +0000 Subject: [PATCH 7/8] media: i2c: ov02e10: Remove redundant dev_dbg() and some extra dev_err() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-7-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 40c4d3ee36e3e2a0bb8be3ff10d016e2bb9bbc9d..2c15df8ca733aa4f37e125ac3bf= b51a319e34c6e 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -316,7 +316,6 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) =20 switch (ctrl->id) { case V4L2_CID_ANALOGUE_GAIN: - dev_dbg(&client->dev, "set analog gain\n"); cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); cci_write(ov02e10->regmap, OV02E10_REG_ANALOG_GAIN, @@ -324,7 +323,6 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) break; =20 case V4L2_CID_DIGITAL_GAIN: - dev_dbg(&client->dev, "set digital gain\n"); cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); cci_write(ov02e10->regmap, OV02E10_REG_DIGITAL_GAIN, @@ -332,7 +330,6 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) break; =20 case V4L2_CID_EXPOSURE: - dev_dbg(&client->dev, "set exposure\n"); cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); cci_write(ov02e10->regmap, OV02E10_REG_EXPOSURE, @@ -340,7 +337,6 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) break; =20 case V4L2_CID_VBLANK: - dev_dbg(&client->dev, "set vblank\n"); cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); cci_write(ov02e10->regmap, OV02E10_REG_VTS, @@ -348,7 +344,6 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) break; =20 case V4L2_CID_TEST_PATTERN: - dev_dbg(&client->dev, "set test pattern\n"); cci_write(ov02e10->regmap, OV02E10_REG_PAGE_FLAG, OV02E10_PAGE_1, &ret); ov02e10_test_pattern(ov02e10, ctrl->val, &ret); @@ -358,7 +353,7 @@ static int ov02e10_set_ctrl(struct v4l2_ctrl *ctrl) ret =3D -EINVAL; break; } - dev_dbg(&client->dev, "will update cmd\n"); + cci_write(ov02e10->regmap, OV02E10_REG_COMMAND_UPDATE, OV02E10_COMMAND_UPDATE, &ret); =20 @@ -510,7 +505,6 @@ static int ov02e10_set_stream(struct v4l2_subdev *sd, i= nt enable) =20 ret =3D ov02e10_start_streaming(ov02e10); if (ret) { - dev_dbg(&client->dev, "start streaming failed\n"); enable =3D 0; ov02e10_stop_streaming(ov02e10); pm_runtime_put(&client->dev); @@ -903,7 +897,6 @@ static int ov02e10_probe(struct i2c_client *client) /* Set default mode to max resolution */ ov02e->cur_mode =3D &supported_modes[0]; =20 - dev_dbg(&client->dev, "will Init controls\n"); ret =3D ov02e10_init_controls(ov02e); if (ret) return ret; @@ -917,10 +910,8 @@ static int ov02e10_probe(struct i2c_client *client) /* Initialize source pad */ ov02e->pad.flags =3D MEDIA_PAD_FL_SOURCE; ret =3D media_entity_pads_init(&ov02e->sd.entity, 1, &ov02e->pad); - if (ret) { - dev_err(&client->dev, "%s failed:%d\n", __func__, ret); + if (ret) goto error_handler_free; - } =20 ret =3D v4l2_async_register_subdev_sensor(&ov02e->sd); if (ret < 0) { @@ -944,11 +935,10 @@ static int ov02e10_probe(struct i2c_client *client) error_handler_free: v4l2_ctrl_handler_free(ov02e->sd.ctrl_handler); mutex_destroy(&ov02e->mutex); - dev_err(&client->dev, "%s failed:%d\n", __func__, ret); + error_power_off: ov02e10_power_off(&client->dev); =20 - dev_dbg(&client->dev, "probe done\n"); return ret; } =20 --=20 2.48.1 From nobody Fri Dec 19 19:18:52 2025 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 7527B171092 for ; Mon, 17 Mar 2025 00:39:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171996; cv=none; b=otaH+l6E29Jns+TvfVY+gU9E8vwinfC0fK7Xuqv5bnaVtB0+2kZa6nnaCpNcIbG5fyrTptEui3JdYr76w4uzrvTvgRMdbFAIHycP/SqmAcz4dtYvRxO0uWF4HbIfFk8jwSOkYOeQQF6giMR/e4xpNIMj2dMwB4tR7ujUL7bWULE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742171996; c=relaxed/simple; bh=EC9j2bIq4ciGt5bTfsPpCKAcRq1j/C87MvJJDh4ON1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h89+8iJRG4hDmWYELrWp7qbG23wG9EDyduT2bsueYaQA2ATHUmoJTNGr04bzNdO/udHxKwz/sp6SaqxD/JmQZaVEDwUqZ+iR7dtVkvuOSQ74SRrN9/pI6KiJwm0K3TJj47jRS4RRTUJ9T5Ffzrmz7XFLXY7srV7urb3ITFN1NdQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=oX3pM9Ip; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oX3pM9Ip" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-ac345bd8e13so235422166b.0 for ; Sun, 16 Mar 2025 17:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742171992; x=1742776792; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3oIaC4JSPq4Hxx0BCotHyy3fEpNhxbu3GVa44qnjARE=; b=oX3pM9IpCKJ5eXZxBEMA5VP2Zh4cZLsOAJFCJdsAaZooEFe1ZRqeduJAZlQnU8GCTI Eq/+HRAQ7zxmOT1EIFenukb960BHGeO4GzEdCwGKNWE0mpUgeVDk1BWbE6GQ+Icpf3zK 2fD8hj38v/8gR8TAGZG6Y/nYZti26HjX3c5WXoypF30mJRNFg11fs1xEalA1bBCHNv8D /KyLZ7N1+Muz8YeYGyY2sjKeI/DYgr5FVYT12B5SOqG9BNNloRzP5s0vQaVKlzo9AJqG FhzzMMzNC5faCCBMhJifEvggxqBkINSjCt7GDZcig/yWqgnRDiyCdErOHlGGA6NcNg0A Gl3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742171992; x=1742776792; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3oIaC4JSPq4Hxx0BCotHyy3fEpNhxbu3GVa44qnjARE=; b=hlRty2Dql+//CYyGP89cdwEvy/peM5fe0cYB5uIETH5+AUqTeiVegGa7N4Ro4QkV8m xUsKVOLhxDnE7a00ak48SYjQtkNQ46+QBbxfd4xtpddElDXHfM/5xi2RWYiWaXztXgaq YaD+hZLSvhNaKgajhpQrSrIG4VHMGbuTCvRLbDqVtG8Y0ch8b4wZfSz/w7Si2q9CS7IB pgyHvMH7cBx7wNmFbO3GYu2L6QrytXyJFhvIFWx+xmI0Rj9qIM/fOV+9wY+ueLN9ICAn oyGRd1+UZVDuyTrePJwYw6DSeTXcXFUl43WO+shBLRwT+zc/F+x/zdB2Ru5r3RvRr/KX TB2Q== X-Forwarded-Encrypted: i=1; AJvYcCUEzikEuhLfdBfc0+1vJtQCFc4ligConjveqAOgheKSSRiVvMZShqGfvJEYvf8yzHEqgJ4LBgyZy2koT90=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/ZLxkJ1bKs2ujlpL6Dtf09MQaNHMeOyXOFA9Hn9VxTxaCuAF6 vNsa8Txlj9jiKirj3dYwMZXRY91Lq2btuHjM2DZYzEFnMegg6yYaqvXbc3FvPHA= X-Gm-Gg: ASbGncvOA8p3dfREhz8PTMweqROjzRxxMxlFcCR13T/+QHteIfi82JX/Miue0Knk/5F +K0X6HySaw96aGaRp0H788LLKzfIfidRE7vL6uBBQ47d8+qKtxdAqiLJIiUmuRT7GEcT4ESej7K wIBxc7gZIQCfX3mDpZVQMS2zDxjIV7LtXrcZ9AbyPT43xMv2u6WZvgxTrewueXopGX74r7TpX14 1jEvwRWC5BMOso0IKIVjB369oeeFn0FwU28Gag0du+5xY/Ara+33/xrJsJcH/74IjzoEnIzsnaD HLyFoSy206nWvv22pkfzpHCXF0qmUOnuJUv6LwPaVBZeTRbQeWufCCIIg5FXKE82hec3rED2sqw PonA2917TiO0m0aG+S4TbDNufNBUFAdzWFAEngmuot8xilhhJhYikRAMpjowYgOlTJ6TB X-Google-Smtp-Source: AGHT+IGw5bWEY5CU0ToSapKWjZkga24fSjvSj722h9dS/H4k7EkMFeAOLRKF/irP9dBdAZwFIVLVfQ== X-Received: by 2002:a17:907:7e8d:b0:ac2:29cf:643d with SMTP id a640c23a62f3a-ac3301e4c55mr1021762166b.25.1742171991816; Sun, 16 Mar 2025 17:39:51 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aefadsm562407166b.8.2025.03.16.17.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 17:39:51 -0700 (PDT) From: Bryan O'Donoghue Date: Mon, 17 Mar 2025 00:39:40 +0000 Subject: [PATCH 8/8] media: i2c: ov02e10: Add OF probe support 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-8-bd924634b889@linaro.org> References: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> In-Reply-To: <20250317-b4-media-comitters-next-25-03-13-ov02e10-v1-0-bd924634b889@linaro.org> To: Mauro Carvalho Chehab , Sakari Ailus , Liam Girdwood , Mark Brown Cc: Jingjing Xiong , Hao Yao , Jim Lai , You-Sheng Yang , Alan Stern , Hans de Goede , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.2 Supply OF probe matching table and enumeration structure hook. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/ov02e10.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 2c15df8ca733aa4f37e125ac3bfb51a319e34c6e..10cac199b23f14ed79f4fb7e84d= 2c685c6d70399 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -954,11 +954,18 @@ static const struct acpi_device_id ov02e10_acpi_ids[]= =3D { =20 MODULE_DEVICE_TABLE(acpi, ov02e10_acpi_ids); =20 +static const struct of_device_id ov02e10_of_match[] =3D { + { .compatible =3D "ovti,ov02e10" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ov02e10_of_match); + static struct i2c_driver ov02e10_i2c_driver =3D { .driver =3D { .name =3D "ov02e10", .pm =3D &ov02e10_pm_ops, .acpi_match_table =3D ov02e10_acpi_ids, + .of_match_table =3D ov02e10_of_match, }, .probe =3D ov02e10_probe, .remove =3D ov02e10_remove, --=20 2.48.1