Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.21 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292894; b=vw4YDWMroAVoI7VQzrq9JQ8axonIcitL0E8ZM8oS5Vd1B6pxDrnxzb+1N6BkoRU47aMo pA3d0x4vSIhcr6EsBBvAp6thV5c5fMrYrE32Lf8VkNLK6en+oRgWXO1DpuzNh9yCBDiTQ gZwM5PDDI9su8a1QANvLoar7WRf3iEmGXvKFoKXhUCcqKz/oNlLv0Rf/bRp/JfCvCXJDh 46sOpdEfHp/zVWZJfxmtYcBVF/E6ZxCvt/u0S2sRpIkXgtV71uvQnnlJD78V81n8oxcmo CiNoUEJtG5RZHw/wp+QBfe5RIHIfXzM4y16Q+oa1CVQdBQSZ1uTeVKH3U54CgOiK8oQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292894; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date: Organization:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=1dI1qZ7quJ/sax26v1VLZCu5xEkUVLQjoTi0crAS1P4=; b=i9ohEr+TEi8FOazY3zYnR4QZWv8YZ520Q0XH1QRs9bMhwp5AzN6ylisNsp+wtdxe1E48 4Ti8lhPND3xQS+pv050JZYB5bCrnB2+zePxpM4ouDDLgJHJCNHWO/i+9tUJD/vij+/uVT G6Aof7FjP1nFFX0YkAaDrFu4+yhlh+jjciWKrT6wYbYJ+ac1BAbR5L9/ZFZ11pWEAJt3g iYdbNG96S3cKrXyoYukkykz5HARYmlZsssvy2DLggR+KhhyCsk7bgfx/5wNTMyh3jSXik ov8Uhx3xZLEFLR6BHpHTrvVZtMmw+D7JUprfgG88pw2G/18GMosNqtyI5p6HN8w85Ww== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UfqhtNCo; arc=none smtp.remote-ip=198.175.65.21 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B3CD606A32D for ; Thu, 3 Dec 2026 10:14:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B3CD606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UfqhtNCo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796292894; x=1827828894; h=date:from:to:cc:subject:message-id:mime-version: in-reply-to; bh=1dI1qZ7quJ/sax26v1VLZCu5xEkUVLQjoTi0crAS1P4=; b=UfqhtNCoyRAu7broX7B0DBuDKZlr2dB8cxPqMTxYF9rHEtnrlKwi333S +PW8ErttBt0eQIZ9H1ss/EMDOXJNWn5iuCRl+BJm0DZdixYwniMntRAEo JKtfbLhtYXZ5bIxFJwG3d/UTQnlaqIA0FwxxeQy3If3aDwkH7FV3jpoR6 NGEw5c8C8Z9tnCutQffeyfzuVYHT7DadyGeBweXV7/FNcjww71NAOMZ5n jCmxzQDn19Y+DAJWDqXYpTAY4mdmVVzc0HehXQ5e+Jvlb8pfPQ7mijiPe 05ENs81v9KqLdC1JrCtX6ZPI4FryPVEfARlr88C887b435/LtUGK7Knyg A==; X-CSE-ConnectionGUID: YbJU0fSFTgCLb/PKwcm13g== X-CSE-MsgGUID: 2dlNF+EvQUKwCDQUkI9ZUQ== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5352190" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5352190" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:14:53 -0800 X-CSE-ConnectionGUID: B3MRT/HBS5aXgMkT7ailXQ== X-CSE-MsgGUID: kiEpruQxTAGAUg7YS60iVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="14331914" Received: from mkosciow-mobl1.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.74]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:14:51 -0800 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 8006F1225B3; Thu, 03 Dec 2026 12:14:48 +0200 (EET) Date: Thu, 3 Dec 2026 12:14:48 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: vunny.sodhi@intel.com Cc: linux-media@vger.kernel.org, dave.stevenson@raspberrypi.com Subject: Re: [PATCH v5 2/2] media: i2c: add isx031 sensor driver Message-ID: X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203052944.1059314-3-vunny.sodhi@intel.com> Hi Vunny, A few more comments below... On Thu, Dec 03, 2026 at 01:29:44PM +0800, vunny.sodhi@intel.com wrote: > From: "Yew, Chang Ching" > > Add a V4L2 sub-device driver for the Sony ISX031 YUV422 image sensor. > The sensor is controlled over I2C with the CCI helpers and outputs > MIPI CSI-2. > > Supported modes: > - 1920x1536 at 30 fps > - 1920x1080 at 30 fps > - 1280x720 at 30 fps > > The frame rate is selected according to the configured CSI-2 lane > count. The driver supports runtime PM, auto/manual exposure controls > and an optional external frame-sync input (fsin GPIO). > > The driver is ACPI-only: it binds through the INTC113C HID and relies > on the IPU bridge for the endpoint (lane count) and device properties. > > Co-developed-by: Hao Yao > Signed-off-by: Hao Yao > Co-developed-by: Jonathan Lui > Signed-off-by: Jonathan Lui > Co-developed-by: Wei Khang, Goh > Signed-off-by: Wei Khang, Goh > Signed-off-by: Yew, Chang Ching > Reviewed-by: Kris Pan > Signed-off-by: Sodhi, Vunny > --- > MAINTAINERS | 7 + > drivers/media/i2c/Kconfig | 11 + > drivers/media/i2c/Makefile | 1 + > drivers/media/i2c/isx031.c | 953 +++++++++++++++++++++++++++++++++++++ > 4 files changed, 972 insertions(+) > create mode 100644 drivers/media/i2c/isx031.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index ccbcdc0799b9..ccb3a1e077e9 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -26266,6 +26266,12 @@ S: Maintained > F: Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml > F: drivers/media/i2c/imx678.c > > +SONY ISX031 SENSOR DRIVER > +M: Yew, Chang Ching > +L: linux-media@vger.kernel.org > +S: Maintained > +F: drivers/media/i2c/isx031.c > + > SONY MEMORYSTICK SUBSYSTEM > M: Maxim Levitsky > M: Alex Dubov > @@ -29374,6 +29380,7 @@ F: drivers/media/i2c/ar* > F: drivers/media/i2c/gc* > F: drivers/media/i2c/hi* > F: drivers/media/i2c/imx* > +F: drivers/media/i2c/isx* > F: drivers/media/i2c/mt* > F: drivers/media/i2c/og* > F: drivers/media/i2c/ov* > diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig > index 11c30252540e..cdca5c8fcf53 100644 > --- a/drivers/media/i2c/Kconfig > +++ b/drivers/media/i2c/Kconfig > @@ -300,6 +300,17 @@ config VIDEO_IMX415 > To compile this driver as a module, choose M here: the > module will be called imx415. > > +config VIDEO_ISX031 > + tristate "ISX031 sensor support" > + depends on ACPI || COMPILE_TEST > + select V4L2_CCI_I2C > + help > + This is a Video4Linux2 sensor-level driver for the > + Sony ISX031 camera. > + > + To compile this driver as a module, choose M here: the > + module will be called isx031. > + > config VIDEO_IMX471 > tristate "Sony IMX471 sensor support" > select V4L2_CCI_I2C > diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile > index 59e31af457cd..53449ed01969 100644 > --- a/drivers/media/i2c/Makefile > +++ b/drivers/media/i2c/Makefile > @@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_IMX576) += imx576.o > obj-$(CONFIG_VIDEO_IMX678) += imx678.o > obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o > obj-$(CONFIG_VIDEO_ISL7998X) += isl7998x.o > +obj-$(CONFIG_VIDEO_ISX031) += isx031.o > obj-$(CONFIG_VIDEO_IT6625) += it6625.o > obj-$(CONFIG_VIDEO_KS0127) += ks0127.o > obj-$(CONFIG_VIDEO_LM3560) += lm3560.o > diff --git a/drivers/media/i2c/isx031.c b/drivers/media/i2c/isx031.c > new file mode 100644 > index 000000000000..1d5fef203486 > --- /dev/null > +++ b/drivers/media/i2c/isx031.c > @@ -0,0 +1,953 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2022-2026 Intel Corporation. > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +#define to_isx031(_sd) container_of(_sd, struct isx031, sd) > + > +#define ISX031_OTP_TYPE_NAME CCI_REG16_LE(0x7E8A) > +#define ISX031_OTP_TYPE_NAME_MASK 0x0FFF > +#define ISX031_OTP_MODULE_ID_L 0x031 > + > +#define ISX031_REG_MODE_SET_F CCI_REG8(0x8A01) > +#define ISX031_MODE_STANDBY 0x00 > +#define ISX031_MODE_STREAMING 0x80 > + > +#define ISX031_REG_SENSOR_STATE CCI_REG8(0x6005) > +#define ISX031_STATE_STREAMING 0x05 > +#define ISX031_STATE_STARTUP 0x02 > + > +#define ISX031_REG_MODE_SET_F_LOCK CCI_REG8(0xBEF0) > +#define ISX031_MODE_UNLOCK 0x53 > + > +#define ISX031_REG_MODE_SELECT CCI_REG8(0x8A00) > +#define ISX031_MODE_4LANES_30FPS 0x17 > + > +#define ISX031_NUM_LANES 4 > + > +#define ISX031_PIXEL_ARRAY_WIDTH 1920 > +#define ISX031_PIXEL_ARRAY_HEIGHT 1536 > +#define ISX031_MIN_WIDTH 64 > +#define ISX031_MIN_HEIGHT 64 > + > +#define ISX031_MBUS_CODE MEDIA_BUS_FMT_UYVY8_1X16 > +#define ISX031_FPS 30 > + > +/* Crop sizes and offsets must be multiples of two */ > +#define ISX031_REG_DCROP_ON CCI_REG8(0x8AA8) > +#define ISX031_REG_DCROP_HSIZE CCI_REG16_LE(0x8AAA) > +#define ISX031_REG_DCROP_HOFFSET CCI_REG16_LE(0x8AAC) > +#define ISX031_REG_DCROP_VSIZE CCI_REG16_LE(0x8AAE) > +#define ISX031_REG_DCROP_VOFFSET CCI_REG16_LE(0x8AB0) > +#define ISX031_REG_DCROP_DATA_SEL CCI_REG8(0x8ADA) > +#define ISX031_DCROP_DATA_SEL 0x03 > + > +/* Compared against the DCROP_* registers by the Application Lock function */ > +#define ISX031_REG_DCROP_ON_APL CCI_REG8(0xBF04) > +#define ISX031_REG_DCROP_HSIZE_APL CCI_REG16_LE(0xBF06) > +#define ISX031_REG_DCROP_HOFFSET_APL CCI_REG16_LE(0xBF08) > +#define ISX031_REG_DCROP_VSIZE_APL CCI_REG16_LE(0xBF0A) > +#define ISX031_REG_DCROP_VOFFSET_APL CCI_REG16_LE(0xBF0C) > + > +#define ISX031_REG_AEMODE CCI_REG8(0xABC0) > +#define ISX031_AEMODE_AUTO 0x00 > +#define ISX031_AEMODE_FULL_ME 0x03 > +#define ISX031_REG_FME_SHTVAL CCI_REG32_LE(0xABEC) > +#define ISX031_REG_FME_SHTVAL_UNIT CCI_REG8(0xABF0) > +#define ISX031_REG_FME_SHTVAL_S1 CCI_REG32_LE(0xABF4) > +#define ISX031_REG_FME_SHTVAL_S1_UNIT CCI_REG8(0xABF8) > +#define ISX031_FME_SHTVAL_UNIT_USEC 0x03 > + > +/* Exposure time applied by the sensor in either AE mode, in 100 us units */ > +#define ISX031_REG_SHT_TIME_SP1 CCI_REG16_LE(0x61A2) > +#define ISX031_SHT_TIME_SP1_UNIT_USEC 100 > + > +#define ISX031_INCK_FREQ (24 * HZ_PER_MHZ) > + > +#define ISX031_READ_REG_RETRY_TIMEOUT 50 > +#define ISX031_REG_SLEEP_50MS 50 > + > +/* > + * Exposure is in microseconds. Full manual exposure (Full ME, AEMODE=3) is > + * limited to one frame period so it does not lower the frame rate. > + */ > +#define ISX031_EXPOSURE_MIN 1200 > +#define ISX031_EXPOSURE_MAX (USEC_PER_SEC / ISX031_FPS) > +#define ISX031_EXPOSURE_STEP 1 > +#define ISX031_EXPOSURE_DEF ISX031_EXPOSURE_MIN > + > +struct isx031 { > + struct v4l2_subdev sd; > + struct v4l2_ctrl_handler ctrls; > + struct v4l2_ctrl *ctrl_exposure_auto; > + struct v4l2_ctrl *ctrl_exposure; > + > + struct device *dev; > + struct regmap *regmap; > + > + struct gpio_desc *reset_gpio; > + struct gpio_desc *fsin_gpio; > + struct media_pad pad; > +}; > + > +static const s64 isx031_link_frequencies[] = { > + 288 * HZ_PER_MHZ, /* 576 Mbps/lane DDR */ > +}; > + > +static const struct cci_reg_sequence isx031_init_reg[] = { > + {CCI_REG8(0xFFFF), 0x00}, /* Select mode */ > + {CCI_REG8(0x0171), 0x00}, /* Close F_EBD */ > + {CCI_REG8(0x0172), 0x00}, /* Close R_EBD */ > + {CCI_REG8(0xBF14), 0x00}, /* SG_MODE_APL */ > + {CCI_REG8(0x8AF0), 0x00}, /* Internal sync */ > +}; > + > +static int isx031_set_crop(struct isx031 *isx031, const struct v4l2_rect *crop) > +{ > + struct regmap *regmap = isx031->regmap; > + int ret = 0; > + > + cci_write(regmap, ISX031_REG_DCROP_ON, 1, &ret); > + cci_write(regmap, ISX031_REG_DCROP_HSIZE, crop->width, &ret); > + cci_write(regmap, ISX031_REG_DCROP_HOFFSET, crop->left, &ret); > + cci_write(regmap, ISX031_REG_DCROP_VSIZE, crop->height, &ret); > + cci_write(regmap, ISX031_REG_DCROP_VOFFSET, crop->top, &ret); > + cci_write(regmap, ISX031_REG_DCROP_DATA_SEL, ISX031_DCROP_DATA_SEL, > + &ret); > + cci_write(regmap, ISX031_REG_DCROP_ON_APL, 1, &ret); > + cci_write(regmap, ISX031_REG_DCROP_HSIZE_APL, crop->width, &ret); > + cci_write(regmap, ISX031_REG_DCROP_HOFFSET_APL, crop->left, &ret); > + cci_write(regmap, ISX031_REG_DCROP_VSIZE_APL, crop->height, &ret); > + cci_write(regmap, ISX031_REG_DCROP_VOFFSET_APL, crop->top, &ret); > + > + return ret; > +} > + > +static int isx031_wait_state(struct isx031 *isx031, u32 state) > +{ > + u64 val = 0; > + int read_ret; > + int ret; > + > + /* > + * read_poll_timeout() retries the read itself; the register value has > + * to be checked here so that a refused transition is reported. > + */ > + ret = read_poll_timeout(cci_read, read_ret, > + !read_ret && val == state, > + 10 * USEC_PER_MSEC, > + ISX031_READ_REG_RETRY_TIMEOUT * 10 * USEC_PER_MSEC, > + false, isx031->regmap, > + ISX031_REG_SENSOR_STATE, &val, NULL); > + /* The state register can lag the actual transition, so only warn */ > + if (ret) > + dev_warn(isx031->dev, > + "Sensor state 0x%02llx, expected 0x%02x, continuing\n", > + val, state); > + > + return 0; > +} > + > +static int isx031_mode_transit(struct isx031 *isx031, int state) > +{ > + struct device *dev = isx031->dev; > + int ret; > + u32 mode; > + > + if (state == ISX031_STATE_STARTUP) > + mode = ISX031_MODE_STANDBY; > + else if (state == ISX031_STATE_STREAMING) > + mode = ISX031_MODE_STREAMING; > + else > + return -EINVAL; > + > + ret = cci_write(isx031->regmap, ISX031_REG_MODE_SELECT, > + ISX031_MODE_4LANES_30FPS, NULL); > + if (ret) { > + dev_err(dev, "Failed to set drive mode\n"); > + return ret; > + } > + > + ret = cci_write(isx031->regmap, ISX031_REG_MODE_SET_F_LOCK, > + ISX031_MODE_UNLOCK, NULL); > + if (ret) { > + dev_err(dev, "Failed to unlock mode\n"); > + return ret; > + } > + > + ret = cci_write(isx031->regmap, ISX031_REG_MODE_SET_F, mode, NULL); > + if (ret) { > + dev_err(dev, "Failed to set mode 0x%x\n", mode); > + return ret; > + } > + > + return isx031_wait_state(isx031, state); > +} > + > +static int isx031_identify_module(struct isx031 *isx031) > +{ > + struct device *dev = isx031->dev; > + u64 name = 0; > + int read_ret; > + int ret; > + > + /* After reset the sensor first NAKs, then reads 0xffff until OTP is loaded */ > + ret = read_poll_timeout(cci_read, read_ret, > + !read_ret && (name & ISX031_OTP_TYPE_NAME_MASK) == > + ISX031_OTP_MODULE_ID_L, > + 10 * USEC_PER_MSEC, > + ISX031_READ_REG_RETRY_TIMEOUT * 10 * USEC_PER_MSEC, > + false, isx031->regmap, ISX031_OTP_TYPE_NAME, > + &name, NULL); > + if (read_ret) { > + dev_err(dev, "Failed to read OTP type name register\n"); > + return read_ret; > + } > + if (ret) { > + dev_err(dev, > + "Invalid module ID: expected 0x%04x, got 0x%04llx\n", > + ISX031_OTP_MODULE_ID_L, > + name & ISX031_OTP_TYPE_NAME_MASK); > + return -ENODEV; > + } > + > + return 0; > +} > + > +static void isx031_update_pad_format(struct v4l2_mbus_framefmt *fmt, > + u32 width, u32 height) > +{ > + fmt->width = width; > + fmt->height = height; > + fmt->code = ISX031_MBUS_CODE; > + fmt->field = V4L2_FIELD_NONE; > + fmt->colorspace = V4L2_COLORSPACE_SRGB; > + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(V4L2_COLORSPACE_SRGB); > + fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE; > + fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(V4L2_COLORSPACE_SRGB); > +} > + > +static int isx031_parse_endpoint(struct device *dev) > +{ > + struct fwnode_handle *endpoint; > + struct v4l2_fwnode_endpoint bus_cfg = { > + .bus_type = V4L2_MBUS_CSI2_DPHY, > + }; > + unsigned long link_freq_bitmap; > + int ret; > + > + endpoint = > + fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), > + 0, 0, > + FWNODE_GRAPH_ENDPOINT_NEXT); > + if (!endpoint) > + return dev_err_probe(dev, -EPROBE_DEFER, > + "waiting for fwnode graph endpoint\n"); Please remove this check, it's redundant. > + > + ret = v4l2_fwnode_endpoint_alloc_parse(endpoint, &bus_cfg); > + fwnode_handle_put(endpoint); > + if (ret) > + return dev_err_probe(dev, ret, > + "Failed to parse endpoint node\n"); > + > + if (bus_cfg.bus.mipi_csi2.num_data_lanes != ISX031_NUM_LANES) { > + dev_err(dev, "Only %u data lanes are supported\n", > + ISX031_NUM_LANES); > + ret = -EINVAL; > + goto out_err; > + } > + > + ret = v4l2_link_freq_to_bitmap(dev, bus_cfg.link_frequencies, > + bus_cfg.nr_of_link_frequencies, > + isx031_link_frequencies, > + ARRAY_SIZE(isx031_link_frequencies), > + &link_freq_bitmap); > + > +out_err: > + v4l2_fwnode_endpoint_free(&bus_cfg); > + return ret; > +} > + > +static int isx031_enable_streams(struct v4l2_subdev *subdev, > + struct v4l2_subdev_state *state, > + u32 pad, u64 streams_mask) > +{ > + struct isx031 *isx031 = to_isx031(subdev); > + struct device *dev = isx031->dev; > + const struct v4l2_rect *crop = v4l2_subdev_state_get_crop(state, 0); > + int ret; > + > + ret = pm_runtime_resume_and_get(dev); > + if (ret < 0) > + return ret; > + > + /* Mode registers must be reprogrammed in standby */ > + cci_write(isx031->regmap, ISX031_REG_MODE_SET_F_LOCK, > + ISX031_MODE_UNLOCK, &ret); > + cci_write(isx031->regmap, ISX031_REG_MODE_SET_F, > + ISX031_MODE_STANDBY, &ret); > + if (ret) { > + dev_err(dev, "Failed to enter standby: %d\n", ret); > + goto err_put; > + } > + msleep(ISX031_REG_SLEEP_50MS); > + > + ret = isx031_set_crop(isx031, crop); > + if (ret) { > + dev_err(dev, "Failed to set crop: %d\n", ret); > + goto err_put; > + } > + > + ret = isx031_mode_transit(isx031, ISX031_STATE_STREAMING); > + if (ret) { > + dev_err(dev, "Failed to start streaming: %d\n", ret); > + goto err_stop; > + } > + > + cci_write(isx031->regmap, ISX031_REG_FME_SHTVAL_UNIT, > + ISX031_FME_SHTVAL_UNIT_USEC, &ret); > + cci_write(isx031->regmap, ISX031_REG_FME_SHTVAL_S1_UNIT, > + ISX031_FME_SHTVAL_UNIT_USEC, &ret); > + if (ret) { > + dev_err(dev, "Failed to set exposure unit: %d\n", ret); > + goto err_stop; > + } > + > + /* > + * The STREAMING transition resets the AE registers, so re-apply the > + * cached control values once the sensor runs. This runs with the state > + * lock held, which v4l2_subdev_enable_streams() also uses as the > + * control handler lock, as required by __v4l2_ctrl_handler_setup(). > + */ > + ret = __v4l2_ctrl_handler_setup(&isx031->ctrls); > + if (ret) { > + dev_err(dev, "Failed to apply controls, stopping stream: %d\n", > + ret); > + goto err_stop; > + } > + > + /* AEMODE must not be changed while streaming */ > + __v4l2_ctrl_grab(isx031->ctrl_exposure_auto, true); > + > + return 0; > + > +err_stop: > + isx031_mode_transit(isx031, ISX031_STATE_STARTUP); > +err_put: > + pm_runtime_put_autosuspend(dev); > + > + return ret; > +} > + > +static int isx031_disable_streams(struct v4l2_subdev *subdev, > + struct v4l2_subdev_state *state, > + u32 pad, u64 streams_mask) > +{ > + struct isx031 *isx031 = to_isx031(subdev); > + int ret; > + > + __v4l2_ctrl_grab(isx031->ctrl_exposure_auto, false); > + > + ret = isx031_mode_transit(isx031, ISX031_STATE_STARTUP); > + if (ret) > + dev_err(isx031->dev, "Failed to stop streaming: %d\n", ret); > + > + pm_runtime_put_autosuspend(isx031->dev); > + > + return 0; > +} > + > +static void isx031_power_off(struct isx031 *isx031) > +{ > + /* Without a reset line, standby is the only way to stop the sensor */ > + if (!isx031->reset_gpio) > + isx031_mode_transit(isx031, ISX031_STATE_STARTUP); > + > + /* Active low gpio reset, set 1 to power off sensor */ > + gpiod_set_value_cansleep(isx031->reset_gpio, 1); > +} > + > +static int isx031_power_on(struct isx031 *isx031) > +{ > + u64 val = 0; > + int read_ret; > + int ret; > + > + /* Active low gpio reset */ > + gpiod_set_value_cansleep(isx031->reset_gpio, 0); > + > + /* S4 clears the GPIO bias/config, so re-set fsin direction and level */ > + gpiod_direction_output(isx031->fsin_gpio, 0); > + > + /* Without a reset line the sensor was never reset, so has nothing to boot */ > + if (!isx031->reset_gpio) > + return 0; > + > + /* After reset the sensor first NAKs, then reads 0xffff until OTP is loaded */ > + ret = read_poll_timeout(cci_read, read_ret, > + !read_ret && val != 0xffff, > + 10 * USEC_PER_MSEC, > + ISX031_READ_REG_RETRY_TIMEOUT * 10 * USEC_PER_MSEC, > + false, isx031->regmap, > + ISX031_OTP_TYPE_NAME, &val, NULL); > + if (ret) > + dev_err(isx031->dev, "Sensor did not boot: OTP 0x%04llx\n", val); > + > + return ret; > +} > + > +static int isx031_suspend(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + > + isx031_power_off(to_isx031(sd)); Please refactor this so you have a single set of suspend / resume callbacks. > + > + return 0; > +} > + > +static int isx031_resume(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + struct isx031 *isx031 = to_isx031(sd); > + int ret; > + > + ret = isx031_power_on(isx031); > + if (ret) > + return ret; > + > + return cci_multi_reg_write(isx031->regmap, isx031_init_reg, > + ARRAY_SIZE(isx031_init_reg), NULL); Are there cases where the init register sequence doesn't need to be written to the sensor? > +} > + > +static int isx031_get_frame_desc(struct v4l2_subdev *sd, > + unsigned int pad, > + struct v4l2_mbus_frame_desc *desc) > +{ > + desc->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2; > + desc->num_entries = 1; > + desc->entry[0].pixelcode = ISX031_MBUS_CODE; > + desc->entry[0].stream = 0; > + desc->entry[0].bus.csi2.vc = 0; > + desc->entry[0].bus.csi2.dt = MIPI_CSI2_DT_YUV422_8B; > + return 0; > +} > + > +/* The output is the crop rectangle unscaled; the sensor has no scaler */ > +static void isx031_update_crop(struct v4l2_subdev_state *sd_state, u32 pad, > + const struct v4l2_rect *crop) > +{ > + *v4l2_subdev_state_get_crop(sd_state, pad) = *crop; > + isx031_update_pad_format(v4l2_subdev_state_get_format(sd_state, pad), > + crop->width, crop->height); > +} > + > +static int isx031_set_format(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_format *fmt) > +{ > + struct v4l2_rect crop; > + > + /* The sensor keeps the old crop until the next stream start. */ > + if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE && > + media_entity_is_streaming(&sd->entity)) > + return -EBUSY; > + > + crop.width = clamp_t(u32, round_down(fmt->format.width, 2), > + ISX031_MIN_WIDTH, ISX031_PIXEL_ARRAY_WIDTH); > + crop.height = clamp_t(u32, round_down(fmt->format.height, 2), > + ISX031_MIN_HEIGHT, ISX031_PIXEL_ARRAY_HEIGHT); > + crop.left = round_down((ISX031_PIXEL_ARRAY_WIDTH - crop.width) / 2, 2); > + crop.top = round_down((ISX031_PIXEL_ARRAY_HEIGHT - crop.height) / 2, 2); > + > + isx031_update_crop(sd_state, fmt->pad, &crop); > + fmt->format = *v4l2_subdev_state_get_format(sd_state, fmt->pad); > + > + return 0; > +} > + > +static int isx031_get_selection(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_selection *sel) > +{ > + switch (sel->target) { > + case V4L2_SEL_TGT_CROP: > + sel->r = *v4l2_subdev_state_get_crop(sd_state, sel->pad); > + return 0; > + case V4L2_SEL_TGT_NATIVE_SIZE: > + case V4L2_SEL_TGT_CROP_BOUNDS: > + case V4L2_SEL_TGT_CROP_DEFAULT: > + sel->r.left = 0; > + sel->r.top = 0; > + sel->r.width = ISX031_PIXEL_ARRAY_WIDTH; > + sel->r.height = ISX031_PIXEL_ARRAY_HEIGHT; > + return 0; > + default: > + return -EINVAL; > + } > +} > + > +static int isx031_set_selection(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_selection *sel) > +{ > + struct v4l2_rect crop; > + > + if (sel->target != V4L2_SEL_TGT_CROP) > + return -EINVAL; > + > + if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE && > + media_entity_is_streaming(&sd->entity)) > + return -EBUSY; > + > + crop.width = clamp_t(u32, round_down(sel->r.width, 2), > + ISX031_MIN_WIDTH, ISX031_PIXEL_ARRAY_WIDTH); > + crop.height = clamp_t(u32, round_down(sel->r.height, 2), > + ISX031_MIN_HEIGHT, ISX031_PIXEL_ARRAY_HEIGHT); > + crop.left = clamp_t(s32, round_down(sel->r.left, 2), 0, > + ISX031_PIXEL_ARRAY_WIDTH - crop.width); > + crop.top = clamp_t(s32, round_down(sel->r.top, 2), 0, > + ISX031_PIXEL_ARRAY_HEIGHT - crop.height); > + > + isx031_update_crop(sd_state, sel->pad, &crop); > + sel->r = crop; > + > + return 0; > +} > + > +static int isx031_init_state(struct v4l2_subdev *sd, > + struct v4l2_subdev_state *sd_state) > +{ > + struct v4l2_fract *interval = v4l2_subdev_state_get_interval(sd_state, 0); > + const struct v4l2_rect crop = { > + .width = ISX031_PIXEL_ARRAY_WIDTH, > + .height = ISX031_PIXEL_ARRAY_HEIGHT, > + }; > + > + isx031_update_crop(sd_state, 0, &crop); > + interval->numerator = 1; > + interval->denominator = ISX031_FPS; > + > + return 0; > +} > + > +static int isx031_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 = ISX031_MBUS_CODE; > + > + return 0; > +} > + > +static int isx031_enum_frame_size(struct v4l2_subdev *sd, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_frame_size_enum *fse) > +{ > + if (fse->index > 0 || fse->code != ISX031_MBUS_CODE) > + return -EINVAL; > + > + fse->min_width = ISX031_MIN_WIDTH; > + fse->max_width = ISX031_PIXEL_ARRAY_WIDTH; > + fse->min_height = ISX031_MIN_HEIGHT; > + fse->max_height = ISX031_PIXEL_ARRAY_HEIGHT; > + > + return 0; > +} > + > +static int isx031_enum_frame_interval(struct v4l2_subdev *sd, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_frame_interval_enum *fie) > +{ > + if (fie->index > 0 || fie->code != ISX031_MBUS_CODE || > + fie->width < ISX031_MIN_WIDTH || > + fie->width > ISX031_PIXEL_ARRAY_WIDTH || > + fie->height < ISX031_MIN_HEIGHT || > + fie->height > ISX031_PIXEL_ARRAY_HEIGHT) > + return -EINVAL; > + > + fie->interval.numerator = 1; > + fie->interval.denominator = ISX031_FPS; > + > + return 0; > +} > + > +/* The frame rate is fixed regardless of the crop */ > +static int isx031_set_frame_interval(struct v4l2_subdev *sd, > + struct v4l2_subdev_state *sd_state, > + struct v4l2_subdev_frame_interval *fi) > +{ > + fi->interval = *v4l2_subdev_state_get_interval(sd_state, fi->pad); > + > + return 0; > +} > + > +static const struct v4l2_subdev_video_ops isx031_video_ops = { > + .s_stream = v4l2_subdev_s_stream_helper, > +}; > + > +static const struct v4l2_subdev_pad_ops isx031_pad_ops = { > + .set_fmt = isx031_set_format, > + .get_fmt = v4l2_subdev_get_fmt, > + .get_selection = isx031_get_selection, > + .set_selection = isx031_set_selection, > + .get_frame_desc = isx031_get_frame_desc, > + .enable_streams = isx031_enable_streams, > + .disable_streams = isx031_disable_streams, > + .enum_mbus_code = isx031_enum_mbus_code, > + .enum_frame_size = isx031_enum_frame_size, > + .enum_frame_interval = isx031_enum_frame_interval, > + .get_frame_interval = v4l2_subdev_get_frame_interval, > + .set_frame_interval = isx031_set_frame_interval, > +}; > + > +static const struct v4l2_subdev_ops isx031_subdev_ops = { > + .video = &isx031_video_ops, > + .pad = &isx031_pad_ops, > +}; > + > +static const struct v4l2_subdev_internal_ops isx031_internal_ops = { > + .init_state = isx031_init_state, > +}; > + > +static int isx031_set_exposure_value(struct isx031 *isx031, u32 val) > +{ > + int ret = 0; > + > + cci_write(isx031->regmap, ISX031_REG_FME_SHTVAL, val, &ret); > + cci_write(isx031->regmap, ISX031_REG_FME_SHTVAL_S1, val, &ret); > + > + return ret; > +} > + > +static int isx031_apply_ctrls(struct isx031 *isx031) > +{ > + struct device *dev = isx031->dev; > + bool manual = isx031->ctrl_exposure_auto->val == V4L2_EXPOSURE_MANUAL; > + u32 val; > + int ret = 0; > + > + val = manual ? ISX031_AEMODE_FULL_ME : ISX031_AEMODE_AUTO; > + > + cci_write(isx031->regmap, ISX031_REG_AEMODE, val, &ret); > + if (ret) { > + dev_err(dev, "Failed to write AEMODE=0x%02x: %d\n", val, ret); > + return ret; > + } > + > + if (manual) > + return isx031_set_exposure_value(isx031, > + isx031->ctrl_exposure->val); > + > + return 0; > +} > + > +static int isx031_set_ctrl(struct v4l2_ctrl *ctrl) > +{ > + struct isx031 *isx031 = container_of(ctrl->handler, > + struct isx031, ctrls); > + struct device *dev = isx031->dev; > + int ret; > + > + /* Cached values are applied by __v4l2_ctrl_handler_setup() at stream start */ I'd say this comment is redundant. > + ret = pm_runtime_get_if_in_use(dev); > + if (ret <= 0) > + return 0; > + > + ret = isx031_apply_ctrls(isx031); Can you move the code from apply_ctrls() above here and do the writes based on the ctrl->id here, as other drivers do? > + > + pm_runtime_put_autosuspend(dev); > + > + return ret; > +} > + > +static int isx031_get_ctrl(struct v4l2_ctrl *ctrl) > +{ > + struct isx031 *isx031 = container_of(ctrl->handler, > + struct isx031, ctrls); > + struct device *dev = isx031->dev; > + struct v4l2_ctrl *exposure; > + u64 val; > + int ret; > + > + /* If not powered up, the framework falls back to cur.val */ > + ret = pm_runtime_get_if_in_use(dev); > + if (ret <= 0) > + return 0; > + > + /* > + * FME_SHTVAL only applies in Full ME mode and keeps the last manual > + * value under AE, so report the exposure the sensor actually applies. > + * This is called on the cluster master, so update the exposure control. > + */ > + ret = cci_read(isx031->regmap, ISX031_REG_SHT_TIME_SP1, &val, NULL); > + if (ret) { > + dev_err(dev, "Failed to read SHT_TIME_SP1: %d\n", ret); > + goto out; > + } > + exposure = isx031->ctrl_exposure; > + exposure->val = clamp_t(s64, val * ISX031_SHT_TIME_SP1_UNIT_USEC, ctrl->id is presumably exposure already. Worth checking perhaps still? > + exposure->minimum, exposure->maximum); > + > +out: > + pm_runtime_put_autosuspend(dev); > + > + return ret; > +} > + > +static const struct v4l2_ctrl_ops isx031_ctrl_ops = { > + .s_ctrl = isx031_set_ctrl, > + .g_volatile_ctrl = isx031_get_ctrl, > +}; > + > +static int isx031_ctrls_init(struct isx031 *sensor) > +{ > + struct v4l2_fwnode_device_properties props; > + struct v4l2_ctrl *link_freq; > + struct v4l2_ctrl_handler *hdl = &sensor->ctrls; > + int ret; > + > + ret = v4l2_fwnode_device_parse(sensor->dev, &props); > + if (ret) > + return ret; > + > + v4l2_ctrl_handler_init(hdl, 5); > + > + /* There's a need to set the link frequency because IPU6 dictates it. */ > + link_freq = v4l2_ctrl_new_int_menu(hdl, &isx031_ctrl_ops, > + V4L2_CID_LINK_FREQ, > + ARRAY_SIZE(isx031_link_frequencies) - 1, 0, > + isx031_link_frequencies); > + > + sensor->ctrl_exposure_auto = > + v4l2_ctrl_new_std_menu(hdl, &isx031_ctrl_ops, > + V4L2_CID_EXPOSURE_AUTO, > + V4L2_EXPOSURE_MANUAL, 0, > + V4L2_EXPOSURE_AUTO); > + > + sensor->ctrl_exposure = > + v4l2_ctrl_new_std(hdl, &isx031_ctrl_ops, V4L2_CID_EXPOSURE, > + ISX031_EXPOSURE_MIN, > + ISX031_EXPOSURE_MAX, > + ISX031_EXPOSURE_STEP, ISX031_EXPOSURE_DEF); > + > + /* Expose the orientation/rotation properties of the module. */ > + v4l2_ctrl_new_fwnode_properties(hdl, &isx031_ctrl_ops, &props); > + if (hdl->error) { > + ret = hdl->error; > + v4l2_ctrl_handler_free(hdl); > + return ret; I'm afraid this was better in v3. > + } > + > + link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY; > + sensor->ctrl_exposure_auto->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; > + sensor->ctrl_exposure->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; > + > + /* > + * Exposure is read back from the sensor in auto mode, so it has to be > + * part of an auto cluster: that makes the core mark it volatile (and > + * inactive) while auto exposure is selected. > + */ > + v4l2_ctrl_auto_cluster(2, &sensor->ctrl_exposure_auto, > + V4L2_EXPOSURE_MANUAL, true); > + > + sensor->sd.ctrl_handler = hdl; > + > + return 0; > +} > + > +static void isx031_remove(struct i2c_client *client) > +{ > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + struct isx031 *isx031 = to_isx031(sd); > + > + v4l2_async_unregister_subdev(sd); > + v4l2_subdev_cleanup(sd); > + media_entity_cleanup(&sd->entity); > + v4l2_ctrl_handler_free(&isx031->ctrls); > + > + pm_runtime_disable(&client->dev); > + pm_runtime_dont_use_autosuspend(&client->dev); You can drop this actually. The autosuspend is re-initialised now before probe. > + if (!pm_runtime_status_suspended(&client->dev)) { > + isx031_power_off(isx031); > + pm_runtime_set_suspended(&client->dev); > + } > +} > + > +static int isx031_probe(struct i2c_client *client) > +{ > + struct device *dev = &client->dev; > + struct v4l2_subdev *sd; > + struct isx031 *isx031; > + unsigned long freq; > + struct clk *clk; > + int ret; > + > + isx031 = devm_kzalloc_obj(dev, *isx031); > + if (!isx031) > + return -ENOMEM; > + > + isx031->dev = dev; > + > + ret = isx031_parse_endpoint(dev); > + if (ret) > + return ret; > + > + clk = devm_v4l2_sensor_clk_get(dev, NULL); > + if (IS_ERR(clk)) > + return dev_err_probe(dev, PTR_ERR(clk), "Failed to get clock\n"); > + > + freq = clk_get_rate(clk); > + if (freq != ISX031_INCK_FREQ) > + return dev_err_probe(dev, -EINVAL, > + "External clock %lu Hz not supported\n", > + freq); > + > + isx031->reset_gpio = devm_gpiod_get_optional(dev, "reset", > + GPIOD_OUT_HIGH); > + if (IS_ERR(isx031->reset_gpio)) > + return dev_err_probe(dev, PTR_ERR(isx031->reset_gpio), > + "Failed to get reset gpio\n"); > + > + isx031->fsin_gpio = devm_gpiod_get_optional(dev, "fsin", GPIOD_OUT_LOW); > + if (IS_ERR(isx031->fsin_gpio)) > + return dev_err_probe(dev, PTR_ERR(isx031->fsin_gpio), > + "Failed to get fsin gpio\n"); Can you drop all references to the fsin gpio? The driver now sets it output at low level but does nothing else with it. > + > + isx031->regmap = devm_cci_regmap_init_i2c(client, 16); > + if (IS_ERR(isx031->regmap)) > + return dev_err_probe(dev, PTR_ERR(isx031->regmap), > + "Failed to init regmap\n"); > + > + /* Initialize subdevice */ > + sd = &isx031->sd; I'd just use &isx031->sd where you need it. If you prefer to keep sd shorthand, then use it consistently. > + v4l2_i2c_subdev_init(sd, client, &isx031_subdev_ops); > + > + /* The sensor may not be in reset at this point, so reset it explicitly */ The reset GPIO is already set high and presumably the sensor isn't streaming. If you want to support operation without reset GPIO, then I'd be looking at software reset. Probably DT support will be added at some point so it'd be good to keep these calls balanced, too. > + isx031_power_off(isx031); > + if (isx031->reset_gpio) > + msleep(ISX031_REG_SLEEP_50MS); > + > + ret = isx031_power_on(isx031); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to power on sensor\n"); > + goto err_power_off; > + } > + > + ret = isx031_identify_module(isx031); > + if (ret) > + goto err_power_off; > + > + ret = cci_multi_reg_write(isx031->regmap, isx031_init_reg, > + ARRAY_SIZE(isx031_init_reg), NULL); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to initialize sensor\n"); > + goto err_power_off; > + } > + > + ret = isx031_ctrls_init(isx031); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to init sensor ctrls\n"); > + goto err_power_off; > + } > + > + sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + sd->internal_ops = &isx031_internal_ops; > + sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; > + > + /* Initialize subdev media pad */ > + isx031->pad.flags = MEDIA_PAD_FL_SOURCE; > + ret = media_entity_pads_init(&sd->entity, 1, &isx031->pad); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to init entity pads\n"); > + goto err_ctrl_free; > + } > + > + isx031->sd.state_lock = isx031->sd.ctrl_handler->lock; > + ret = v4l2_subdev_init_finalize(&isx031->sd); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to finalize V4L2 subdev\n"); > + goto err_media_cleanup; > + } > + > + pm_runtime_set_active(dev); > + pm_runtime_enable(dev); > + /* Booting the sensor out of reset is slow, so avoid it between streams */ > + pm_runtime_set_autosuspend_delay(dev, 1000); > + pm_runtime_use_autosuspend(dev); > + > + ret = v4l2_async_register_subdev_sensor(&isx031->sd); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to register V4L2 subdev\n"); > + goto err_pm_disable; > + } > + > + pm_runtime_idle(dev); > + > + return 0; > + > +err_pm_disable: > + pm_runtime_disable(dev); > + pm_runtime_dont_use_autosuspend(dev); > + pm_runtime_set_suspended(dev); > + v4l2_subdev_cleanup(&isx031->sd); > +err_media_cleanup: > + media_entity_cleanup(&isx031->sd.entity); > +err_ctrl_free: > + v4l2_ctrl_handler_free(&isx031->ctrls); > +err_power_off: > + isx031_power_off(isx031); > + > + return ret; > +} > + > +static DEFINE_RUNTIME_DEV_PM_OPS(isx031_pm_ops, isx031_suspend, > + isx031_resume, NULL); > + > +static const struct acpi_device_id isx031_acpi_ids[] = { > + { "INTC113C" }, > + {} > +}; > + > +MODULE_DEVICE_TABLE(acpi, isx031_acpi_ids); > + > +static struct i2c_driver isx031_i2c_driver = { > + .driver = { > + .name = "isx031", > + .acpi_match_table = isx031_acpi_ids, > + .pm = pm_sleep_ptr(&isx031_pm_ops), > + }, > + .probe = isx031_probe, > + .remove = isx031_remove, > +}; > + > +module_i2c_driver(isx031_i2c_driver); > + > +MODULE_DESCRIPTION("isx031 sensor driver"); > +MODULE_AUTHOR("Hao Yao "); > +MODULE_AUTHOR("Jonathan Lui "); > +MODULE_AUTHOR("Wei Khang, Goh "); > +MODULE_AUTHOR("Yew Chang Ching "); > +MODULE_LICENSE("GPL"); -- Regards, Sakari Ailus