From nobody Sun Apr 12 09:39:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7E1B1DD0EF; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913193; cv=none; b=CAOrNU3FniZ3L+hEcesU7qPv51zMvl9zXX4fJ+xtFI+eHaZ2r41X8Jy9vTYj6I11s+fosMxKJBGSlleFBkxVVprsQUvEWA8NJCYJ4XfRXKULfVoDgn69V7lWZcBAfBEguR/pmL/xtJmJ65mZtA9IuLybKCzA3bgGlCLhnee1084= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913193; c=relaxed/simple; bh=2ENfBnHpWpi0r3ZLXmWmDjqJ8aRPN1NeTlp9MkMlkUg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d3SJW3d5S3Lf7F/oizpJmRVZAjtx9I9l6V7hp8hWjdhzsbILs6k9RUEd7zD/IOB1+LwUWYOzDYJnJwfFDGAE9YbSgNeUMurazMJJOOKSHryLLbrEJzQUOoGu1zutrRwTDFPtaDyAQCDOwQ+V1HC1wDZkztd6s05kyVYM4TFA5sw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mafzj2Xf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mafzj2Xf" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9717EC2BC9E; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775913193; bh=2ENfBnHpWpi0r3ZLXmWmDjqJ8aRPN1NeTlp9MkMlkUg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Mafzj2Xfxs1JswfQVghhSTG7/vfIawzdxdpuzCz4ntD0WJ8prFosYBci+9yLHI2WD SqTO/amraJOW0852zWyDReSZ4XW44Ktup8R+lsiG0b24ob0tzpkvV8rsBv0PtTvtOW +AhpkkkoWCTE9LLiWfkfaq20u7E8c049R4pc0dAIe/XqPfhvQfeD5QC8NB9oXDUwxc iP41/kerJi2TkIBtmMbSLf5ZNrV8b9pU31SuUv+/qOogrDZOGpwL7sVfB9Z+TOSWgP VfO8w8F1bctthbNuj5du7C368mVNOsRX1oat6gclGI+EvN44dvlNbHwZmsM9BXt4Za jmRGsCCBWBtLw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E84F3ED4F; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) From: Vasiliy Doylov via B4 Relay Date: Sat, 11 Apr 2026 16:13:08 +0300 Subject: [PATCH v5 1/3] media: dt-bindings: Add LC898217XC documentation 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: <20260411-media-i2c-lc898217xc-initial-driver-v5-1-c71ddcf40bad@mainlining.org> References: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> In-Reply-To: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , david@ixit.cz Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, Vitalii Skorkin , Antonio Rische , Vasiliy Doylov , Krzysztof Kozlowski X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2204; i=nekocwd@mainlining.org; h=from:subject:message-id; bh=s4FrTZ3Fx26kAj8zMlKs4iZ3umFcszpWLs1SXRZOPZs=; b=owGbwMvMwCVmXFbadLHr1XTG02pJDJm3PF5wrD+dsuxJwrHOXN5pVp3vJ/WGifmICd7dc91/m kTSzKagjlIWBjEuBlkxRZbu94fvPZjHy1qq/okXZg4rE8gQBi5OAZjIRztGhicvMiVOs00WmPd+ z/t+o6xTIhE2r569D5ObckAqdOkrYV6G/6mm2ydWs4jGWk08o7JiZ/vKU9KtP12fxAucdJ/Ju6m 3nA0A X-Developer-Key: i=nekocwd@mainlining.org; a=openpgp; fpr=8BEFC3DEE09E0D057527F20D33767582D18AEA97 X-Endpoint-Received: by B4 Relay for nekocwd@mainlining.org/default with auth_id=692 X-Original-From: Vasiliy Doylov Reply-To: nekocwd@mainlining.org From: Vasiliy Doylov Add device tree bindings documentation for ON Semiconductor LC898217XC voice coil motor. Signed-off-by: Vasiliy Doylov Reviewed-by: Krzysztof Kozlowski --- .../bindings/media/i2c/onnn,lc898217xc.yaml | 59 ++++++++++++++++++= ++++ 1 file changed, 59 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/onnn,lc898217xc.ya= ml b/Documentation/devicetree/bindings/media/i2c/onnn,lc898217xc.yaml new file mode 100644 index 000000000000..3dd137d4c67c --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/onnn,lc898217xc.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright 2025 Vasiliy Doylov +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/onnn,lc898217xc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ON Semiconductor LC898217XC Voice Coil Motor (VCM) Lens + +maintainers: + - Vasiliy Doylov + +description: + The LC898217XC is a 11-bit digital-to-analog (DAC) converter. + VCM current is controlled with a linear mode driver.The DAC is controlled + via a 2-wire (I2C-compatible) serial interface that operates at clock + rates up to 1MHz. This chip integrates Advanced Actuator Control (AAC) + technology and is intended for driving voice coil lenses in camera modul= es. + +properties: + compatible: + enum: + - onnn,lc898217xc + + reg: + maxItems: 1 + + vana-supply: + description: + Definition of the regulator used as motor voltage supply. + + vdd-supply: + description: + Definition of the regulator used as digital core voltage supply. + +required: + - compatible + - reg + - vana-supply + - vdd-supply + +additionalProperties: false + +examples: + - | + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + camera-lens@74 { + compatible =3D "onnn,lc898217xc"; + reg =3D <0x74>; + + vana-supply =3D <&mt6358_vaf_reg>; + vdd-supply =3D <&mt6358_vcamio_reg>; + }; + }; + +... --=20 2.50.1 From nobody Sun Apr 12 09:39:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7DB42F851; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913193; cv=none; b=qBus0IfqcvJdEghST07MiRhbbcw4Kl/hFQbJw9VqOjFYT9FXnnLkMVLiFrsZVurJizdA7XmJX8/1dffdeUEDam5aOxINCCeO1VzX3ylnMNzhOWetycVwesi8LrTDt3aAnKAO3H2cjxy5pV1XcHbgoq8pehGPFZE7vgo2I3kh5n0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913193; c=relaxed/simple; bh=NPbaH7Mb+r/zpV26RDSQgYlKwVA7SmYmCbAKpHFrDCg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ViH/ojLwrdiSjHLigsxE8g1tr/7VvXp5E7fzGjUK9tu/pEVNiDOtzIyqPa5WO63wQQbGJlX455FaD5eMsKO4EdSpH7BTwx+Q30BABjOJbH4Fcgj2IS17sJOGS1od8+6OgRlWjz3rKg1EPhbJH8WPirmioQkxlDm7pQ1ZPLhGn+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CK3mf4XT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CK3mf4XT" Received: by smtp.kernel.org (Postfix) with ESMTPS id A9573C2BCB1; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775913193; bh=NPbaH7Mb+r/zpV26RDSQgYlKwVA7SmYmCbAKpHFrDCg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=CK3mf4XTf5WexYh0kgphv4HmWbfah3rA8LoSQJM+OiJ0A0vSNikcYn+CwQhpIDE+E 4NfLuTjK/L65jdStYXJQNL7i6J4pZowvy4fnhoODGbSsAJh71+qiZRLxuUo3aOjaBO LvMVR3LQO8b4ASUtwUdZA3dYFHGa14IbPJtqHVTM7us9YjxKnr9zJ9I2VnTE4AxBKC Kl6w3vO5VMlDm2jgXgBRX30VnmWuaHclMw3TVOO1BrswXkxXuz/EXdl8PjxiI0oEn7 id/cM4pZNGWHuN6rJhPTBq+FIpCnxXYrwJvhIFUc1Fy5x7SoabonA/yRMA75FkdKcs bSpa78P4tXpwQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AF09F3ED51; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) From: Vasiliy Doylov via B4 Relay Date: Sat, 11 Apr 2026 16:13:09 +0300 Subject: [PATCH v5 2/3] media: i2c: Add driver for LC898217XC VCM 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: <20260411-media-i2c-lc898217xc-initial-driver-v5-2-c71ddcf40bad@mainlining.org> References: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> In-Reply-To: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , david@ixit.cz Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, Vitalii Skorkin , Antonio Rische , Vasiliy Doylov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=10078; i=nekocwd@mainlining.org; h=from:subject:message-id; bh=w1xMhHNxEs24H0rzdzEcBr0nZ8bjdNTC98l7g7zZsq4=; b=owGbwMvMwCVmXFbadLHr1XTG02pJDJm3PF6oRpqafHtg/fJww+29cbb7NLaofvvY9mF1OMNGV uWfgjuFOkpZGMS4GGTFFFm63x++92AeL2up+idemDmsTCBDGLg4BWAiBwwYGb4tP9sXNuch/zLN zYqFSw5efJCS73n6nLFrwqSFZRqnTwkxMvSEbq5N29ikuN/oxRebXa5rt5ldfMmc5VuvKsBj7en ykxMA X-Developer-Key: i=nekocwd@mainlining.org; a=openpgp; fpr=8BEFC3DEE09E0D057527F20D33767582D18AEA97 X-Endpoint-Received: by B4 Relay for nekocwd@mainlining.org/default with auth_id=692 X-Original-From: Vasiliy Doylov Reply-To: nekocwd@mainlining.org From: Vasiliy Doylov LC898217XC is a 11 bit DAC, designed for linear control of voice coil motor. This driver creates a V4L2 subdevice and provides control to set the desired focus. Tested on Oneplus 6 (oneplus-enchilada) Signed-off-by: Vasiliy Doylov --- drivers/media/i2c/Kconfig | 9 ++ drivers/media/i2c/Makefile | 1 + drivers/media/i2c/lc898217xc.c | 289 +++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 299 insertions(+) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 8f2ba4121586..346dd4a14105 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -926,6 +926,15 @@ config VIDEO_DW9807_VCM capability. This is designed for linear control of voice coil motors, controlled via I2C serial interface. =20 +config VIDEO_LC898217XC + tristate "LC898217XC lens voice coil support" + select V4L2_CCI_I2C + help + This is a driver for the LC898217XC camera lens voice coil. + LC898217XC is a 11 bit DAC with 110mA output current sink + capability. This is designed for linear control of + voice coil motors, controlled via I2C serial interface. + endif =20 menu "Flash devices" diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile index 90b276a7417a..f55c44feca53 100644 --- a/drivers/media/i2c/Makefile +++ b/drivers/media/i2c/Makefile @@ -64,6 +64,7 @@ obj-$(CONFIG_VIDEO_IMX415) +=3D imx415.o obj-$(CONFIG_VIDEO_IR_I2C) +=3D ir-kbd-i2c.o obj-$(CONFIG_VIDEO_ISL7998X) +=3D isl7998x.o obj-$(CONFIG_VIDEO_KS0127) +=3D ks0127.o +obj-$(CONFIG_VIDEO_LC898217XC) +=3D lc898217xc.o obj-$(CONFIG_VIDEO_LM3560) +=3D lm3560.o obj-$(CONFIG_VIDEO_LM3646) +=3D lm3646.o obj-$(CONFIG_VIDEO_LT6911UXE) +=3D lt6911uxe.o diff --git a/drivers/media/i2c/lc898217xc.c b/drivers/media/i2c/lc898217xc.c new file mode 100644 index 000000000000..cfac7e7ce3d6 --- /dev/null +++ b/drivers/media/i2c/lc898217xc.c @@ -0,0 +1,289 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright (c) 2025 Vasiliy Doylov + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LC898217XC_NAME "lc898217xc" +/* Actuator has 11 bit resolution */ +#define LC898217XC_MAX_FOCUS_POS (2048 - 1) +#define LC898217XC_MIN_FOCUS_POS 0 +#define LC898217XC_FOCUS_STEPS 1 +#define LC898217XC_DAC_ADDR CCI_REG16(0x84) + +static const char *const lc898217xc_supply_names[] =3D { + "vdd", + "vana", +}; + +struct lc898217xc { + struct regulator_bulk_data supplies[ARRAY_SIZE(lc898217xc_supply_names)]; + struct v4l2_ctrl_handler ctrls; + struct v4l2_subdev sd; + struct regmap *regmap; +}; + +static inline struct lc898217xc *sd_to_lc898217xc(struct v4l2_subdev *subd= ev) +{ + return container_of(subdev, struct lc898217xc, sd); +} + +static int lc898217xc_set_dac(struct lc898217xc *lc898217xc, u16 val) +{ + struct i2c_client *client =3D v4l2_get_subdevdata(&lc898217xc->sd); + int ret; + + ret =3D cci_write(lc898217xc->regmap, LC898217XC_DAC_ADDR, val, NULL); + if (ret) + dev_err(&client->dev, "failed to set DAC: %d\n", ret); + + return ret; +} + +static int lc898217xc_power_on(struct lc898217xc *lc898217xc) +{ + int ret; + + ret =3D regulator_bulk_enable(ARRAY_SIZE(lc898217xc_supply_names), + lc898217xc->supplies); + if (ret < 0) + return ret; + + usleep_range(8000, 10000); + return 0; +} + +static int lc898217xc_power_off(struct lc898217xc *lc898217xc) +{ + regulator_bulk_disable(ARRAY_SIZE(lc898217xc_supply_names), + lc898217xc->supplies); + return 0; +} + +static int __maybe_unused lc898217xc_runtime_suspend(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct lc898217xc *lc898217xc =3D sd_to_lc898217xc(sd); + + lc898217xc_power_off(lc898217xc); + return 0; +} + +static int __maybe_unused lc898217xc_runtime_resume(struct device *dev) +{ + struct v4l2_subdev *sd =3D dev_get_drvdata(dev); + struct lc898217xc *lc898217xc =3D sd_to_lc898217xc(sd); + int ret; + + ret =3D lc898217xc_power_on(lc898217xc); + if (ret < 0) { + dev_err(dev, "failed to enable regulators\n"); + return ret; + } + + __v4l2_ctrl_handler_setup(&lc898217xc->ctrls); + + return ret; +} + +static int lc898217xc_set_ctrl(struct v4l2_ctrl *ctrl) +{ + struct lc898217xc *lc898217xc =3D container_of(ctrl->handler, + struct lc898217xc, ctrls); + + if (ctrl->id =3D=3D V4L2_CID_FOCUS_ABSOLUTE) + return lc898217xc_set_dac(lc898217xc, ctrl->val); + + return 0; +} + +static const struct v4l2_ctrl_ops lc898217xc_ctrl_ops =3D { + .s_ctrl =3D lc898217xc_set_ctrl, +}; + +static int lc898217xc_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *= fh) +{ + return pm_runtime_resume_and_get(sd->dev); +} + +static int lc898217xc_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh = *fh) +{ + pm_runtime_put_autosuspend(sd->dev); + + return 0; +} + +static const struct v4l2_subdev_internal_ops lc898217xc_int_ops =3D { + .open =3D lc898217xc_open, + .close =3D lc898217xc_close, +}; + +static const struct v4l2_subdev_core_ops lc898217xc_core_ops =3D { + .log_status =3D v4l2_ctrl_subdev_log_status, +}; + +static const struct v4l2_subdev_ops lc898217xc_ops =3D { + .core =3D &lc898217xc_core_ops, +}; + +static int lc898217xc_init_controls(struct lc898217xc *lc898217xc) +{ + struct v4l2_ctrl_handler *hdl =3D &lc898217xc->ctrls; + const struct v4l2_ctrl_ops *ops =3D &lc898217xc_ctrl_ops; + + v4l2_ctrl_handler_init(hdl, 1); + + v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE, + LC898217XC_MIN_FOCUS_POS, + LC898217XC_MAX_FOCUS_POS, + LC898217XC_FOCUS_STEPS, 0); + + if (hdl->error) + return hdl->error; + + lc898217xc->sd.ctrl_handler =3D hdl; + + return 0; +} + +static int lc898217xc_probe(struct i2c_client *client) +{ + struct device *dev =3D &client->dev; + struct lc898217xc *lc898217xc; + unsigned int i; + int ret; + + lc898217xc =3D devm_kzalloc(dev, sizeof(*lc898217xc), GFP_KERNEL); + if (!lc898217xc) + return -ENOMEM; + + lc898217xc->regmap =3D devm_cci_regmap_init_i2c(client, 8); + if (IS_ERR(lc898217xc->regmap)) + return dev_err_probe(dev, PTR_ERR(lc898217xc->regmap), + "failed to initialize CCI\n"); + + /* Initialize subdev */ + v4l2_i2c_subdev_init(&lc898217xc->sd, client, &lc898217xc_ops); + + for (i =3D 0; i < ARRAY_SIZE(lc898217xc_supply_names); i++) + lc898217xc->supplies[i].supply =3D lc898217xc_supply_names[i]; + + ret =3D devm_regulator_bulk_get(dev, ARRAY_SIZE(lc898217xc_supply_names), + lc898217xc->supplies); + if (ret) + return dev_err_probe(dev, ret, "failed to get regulators\n"); + + ret =3D lc898217xc_power_on(lc898217xc); + if (ret) + return dev_err_probe(dev, ret, "failed to enable regulators\n"); + + ret =3D lc898217xc_init_controls(lc898217xc); + if (ret) { + dev_err_probe(dev, ret, "failed to init v4l2 controls\n"); + goto err_power_off; + } + + /* Initialize subdev */ + lc898217xc->sd.flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE; + lc898217xc->sd.internal_ops =3D &lc898217xc_int_ops; + + ret =3D media_entity_pads_init(&lc898217xc->sd.entity, 0, NULL); + if (ret < 0) { + dev_err_probe(dev, ret, "failed to init media entity pads"); + goto err_free_handler; + } + + lc898217xc->sd.entity.function =3D MEDIA_ENT_F_LENS; + + /* + * Enable runtime PM. As the device has been powered manually, mark it + * as active, and increase the usage count without resuming the device. + */ + pm_runtime_set_active(dev); + pm_runtime_get_noresume(dev); + pm_runtime_enable(dev); + + ret =3D v4l2_async_register_subdev(&lc898217xc->sd); + if (ret < 0) { + dev_err_probe(dev, ret, "failed to register V4L2 subdev\n"); + goto err_pm; + } + + /* + * Finally, enable autosuspend and decrease the usage count. The device + * will get suspended after the autosuspend delay, turning the power + * off. + */ + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); + pm_runtime_put_autosuspend(dev); + + return 0; + +err_pm: + pm_runtime_disable(dev); + pm_runtime_put_noidle(dev); + media_entity_cleanup(&lc898217xc->sd.entity); +err_free_handler: + v4l2_ctrl_handler_free(&lc898217xc->ctrls); +err_power_off: + lc898217xc_power_off(lc898217xc); + return ret; +} + +static void lc898217xc_remove(struct i2c_client *client) +{ + struct v4l2_subdev *sd =3D i2c_get_clientdata(client); + struct lc898217xc *lc898217xc =3D sd_to_lc898217xc(sd); + struct device *dev =3D &client->dev; + + v4l2_async_unregister_subdev(&lc898217xc->sd); + v4l2_ctrl_handler_free(&lc898217xc->ctrls); + media_entity_cleanup(&lc898217xc->sd.entity); + + /* + * Disable runtime PM. In case runtime PM is disabled in the kernel, + * make sure to turn power off manually. + */ + pm_runtime_disable(dev); + if (!pm_runtime_status_suspended(dev)) + lc898217xc_power_off(lc898217xc); + pm_runtime_set_suspended(dev); +} + +static const struct of_device_id lc898217xc_of_table[] =3D { + { .compatible =3D "onnn,lc898217xc" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, lc898217xc_of_table); + +static const struct dev_pm_ops lc898217xc_pm_ops =3D { + SET_RUNTIME_PM_OPS(lc898217xc_runtime_suspend, + lc898217xc_runtime_resume, NULL) +}; + +static struct i2c_driver lc898217xc_i2c_driver =3D { + .driver =3D { + .name =3D LC898217XC_NAME, + .pm =3D &lc898217xc_pm_ops, + .of_match_table =3D lc898217xc_of_table, + }, + .probe =3D lc898217xc_probe, + .remove =3D lc898217xc_remove, +}; +module_i2c_driver(lc898217xc_i2c_driver); + +MODULE_AUTHOR("Vasiliy Doylov "); +MODULE_DESCRIPTION("Onsemi LC898217XC VCM driver"); +MODULE_LICENSE("GPL"); --=20 2.50.1 From nobody Sun Apr 12 09:39:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF641212548; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913194; cv=none; b=mDtKjRWZK9fc0tVNU+AF/sR4/y0t7GW8fmvTB+nw7J8S2TUbmukDyutYFZFOBFjC3pFT7rrjVx57KMdjNqoZvxG45eY0DIRmTQp19/FXSlEf9E5Q10I18qn81YnoaKucpSeLdzypUSOmaARH+OYres/48bqMPEt+MdA2hsCmNq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775913194; c=relaxed/simple; bh=gYvw5ZKRCl0RH8BgUOu5V3anD1d0+Iic81fLL49D928=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KaSxdJi2bbpvb5MBC6ULe9fmKNtuNanZ/3mHVt52rFymTwz2gflRO+Ldyvu0svn+r7f+8jh3zfdRBiV/jjJ5cZUsTOv/ubOsg+70qYXA0NW/A2cD1YRiGWFYCTZV1UJWHbA1JVLQWzTlOvkY4fvcBQYIhgbcUrfJkay74kEgU3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nunJRZKv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nunJRZKv" Received: by smtp.kernel.org (Postfix) with ESMTPS id B5625C2BCB3; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775913193; bh=gYvw5ZKRCl0RH8BgUOu5V3anD1d0+Iic81fLL49D928=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nunJRZKv+bX5GutT7y2MU+Ql+3/2vb2vEHZFTNhhznSFU/QtmH/XsHFZymosX4azG O/fLz0c/cNm1PXrDEe5xEU0BLDLjJCFVSpT5GZ+cVebstRPN0tyB43vZ2LhRjQLyqa XBJdK/gYB7MkQRJ8N78xEIey8nrs6u/cnv82lysG5F3ZEEdLp1EWrCAlSuxPLyiq5T tOucuHkFMYaVjrL8B7vqfaChpKGqKNC4IEBdGmCOu0HAUYEimfxh/fRlJnnljJ/DHo zCcDGKDptulKUTjhWZBV4HSTRLPrE+ZL4DEB4p6OxKCn9x/hNbWDqjbcpa1MAwgf+h vwJ1JtsHL2JMg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABE32F3ED53; Sat, 11 Apr 2026 13:13:13 +0000 (UTC) From: Vasiliy Doylov via B4 Relay Date: Sat, 11 Apr 2026 16:13:10 +0300 Subject: [PATCH v5 3/3] MAINTAINERS: Add entry for Onsemi LC898217XC lens voice coil 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: <20260411-media-i2c-lc898217xc-initial-driver-v5-3-c71ddcf40bad@mainlining.org> References: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> In-Reply-To: <20260411-media-i2c-lc898217xc-initial-driver-v5-0-c71ddcf40bad@mainlining.org> To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , david@ixit.cz Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, Vitalii Skorkin , Antonio Rische , Vasiliy Doylov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=790; i=nekocwd@mainlining.org; h=from:subject:message-id; bh=47zPYZVQfTlmz5yR21UDZYEArwVIUE2fjhcCknakC2A=; b=owGbwMvMwCVmXFbadLHr1XTG02pJDJm3PF7oOn+d/NHi/3RJ+9A9a9JL/c280jTeRNv+Ph/a5 3Yt8XlSRykLgxgXg6yYIkv3+8P3HszjZS1V/8QLM4eVCWQIAxenAEzkmRjDP6scCb98vyzG8vR1 KWvLc+dx3kzbqsf9/e7S3EednySXejD8d5rBWuY5jT/2h2DlscC7d+J+M6slPRfd0xUyQ8328qH P/AA= X-Developer-Key: i=nekocwd@mainlining.org; a=openpgp; fpr=8BEFC3DEE09E0D057527F20D33767582D18AEA97 X-Endpoint-Received: by B4 Relay for nekocwd@mainlining.org/default with auth_id=692 X-Original-From: Vasiliy Doylov Reply-To: nekocwd@mainlining.org From: Vasiliy Doylov Add entry for Onsemi LC898217XC lens voice coil driver Signed-off-by: Vasiliy Doylov --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d4b396dccfe9..a87c03ad740b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19938,6 +19938,13 @@ S: Supported W: http://www.onsemi.com F: drivers/net/phy/ncn* =20 +ONSEMI LC898217XC LENS VOICE COIL DRIVER +M: Vasiliy Doylov +L: linux-media@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/media/i2c/onnn,lc898217xc.yaml +F: drivers/media/i2c/lc898217xc.c + OP-TEE DRIVER M: Jens Wiklander L: op-tee@lists.trustedfirmware.org (moderated for non-subscribers) --=20 2.50.1