* [PATCH v3 0/8] media: Sony IMX335 improvements
@ 2023-12-08 15:07 Umang Jain
2023-12-08 15:07 ` [PATCH v3 1/8] media: dt-bindings: media: imx335: Add supply bindings Umang Jain
` (7 more replies)
0 siblings, 8 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Umang Jain
The Sony IMX335 is not yet compatible with libcamera, as it is missing
the get selection API call.
It also misses a way to describe how to power on the sensor.
Now that I've got this camera functioning on Debix-SOM and Pi5, I expect
to be able to do quite a bit more cleanup to the code here. But these
patches should already be valid for consideration.
The series provides the bindings required to reference the power
supplies, and then performs some initial clean up to the driver for
error reporting before adding the regulator enablement, implementing the
get_selection api (as well as set selection, which returns the static
configuration) and restricts the hblanking to match the configuration.
v3:
- Remove #define and use ARRAY_SIZE(imx335_supply_name) directly in 4/8
- Add two new patches for 10-bit mode(7/8) and multiple link frequency
support(8/8)
v2:
- Supplies are no longer 'required'
- media: i2c: imx335: Fix logging line endings - New patch
- line endings are fixed
- error paths are handled for the regulator in imx335_power_on
- set_selection is defined alongside get_selection
Kieran Bingham (6):
media: dt-bindings: media: imx335: Add supply bindings
media: i2c: imx335: Fix logging line endings
media: i2c: imx335: Improve configuration error reporting
media: i2c: imx335: Enable regulator supplies
media: i2c: imx335: Implement get selection API
media: i2c: imx335: Fix hblank min/max values
Umang Jain (2):
media: i2c: imx335: Support 2592x1940 10-bit mode
media: i2c: imx335: Support multiple link frequency
.../bindings/media/i2c/sony,imx335.yaml | 13 +
drivers/media/i2c/imx335.c | 297 ++++++++++++++----
2 files changed, 257 insertions(+), 53 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/8] media: dt-bindings: media: imx335: Add supply bindings
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 2/8] media: i2c: imx335: Fix logging line endings Umang Jain
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, Umang Jain, Marco Felsch,
Conor Dooley, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, Bartosz Golaszewski, Sebastian Reichel,
Mark Brown,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Add the bindings for the supply references used on the IMX335.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
.../devicetree/bindings/media/i2c/sony,imx335.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml
index a167dcdb3a32..106c36ee966d 100644
--- a/Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml
@@ -32,6 +32,15 @@ properties:
description: Clock frequency from 6 to 27 MHz, 37.125MHz, 74.25MHz
maxItems: 1
+ avdd-supply:
+ description: Analog power supply (2.9V)
+
+ ovdd-supply:
+ description: Interface power supply (1.8V)
+
+ dvdd-supply:
+ description: Digital power supply (1.2V)
+
reset-gpios:
description: Reference to the GPIO connected to the XCLR pin, if any.
maxItems: 1
@@ -79,6 +88,10 @@ examples:
assigned-clock-parents = <&imx335_clk_parent>;
assigned-clock-rates = <24000000>;
+ avdd-supply = <&camera_vdda_2v9>;
+ ovdd-supply = <&camera_vddo_1v8>;
+ dvdd-supply = <&camera_vddd_1v2>;
+
port {
imx335: endpoint {
remote-endpoint = <&cam>;
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 2/8] media: i2c: imx335: Fix logging line endings
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
2023-12-08 15:07 ` [PATCH v3 1/8] media: dt-bindings: media: imx335: Add supply bindings Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 3/8] media: i2c: imx335: Improve configuration error reporting Umang Jain
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
The use of \n as a line ending throughout the driver is inconsistent.
While it is possible for logging messages to automatically have newlines
added by the kernel printk mechanisms, this is specifically to support
continued lines with PR_CONT and the lack of a new line character
indicates that the text is a fragment of a continuation line.
As each of these lines are whole and not fragments, explicitly define the
newline for consistency.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 42 +++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index ec729126274b..cbabef968e21 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -396,7 +396,7 @@ static int imx335_update_exp_gain(struct imx335 *imx335, u32 exposure, u32 gain)
lpfr = imx335->vblank + imx335->cur_mode->height;
shutter = lpfr - exposure;
- dev_dbg(imx335->dev, "Set exp %u, analog gain %u, shutter %u, lpfr %u",
+ dev_dbg(imx335->dev, "Set exp %u, analog gain %u, shutter %u, lpfr %u\n",
exposure, gain, shutter, lpfr);
ret = imx335_write_reg(imx335, IMX335_REG_HOLD, 1, 1);
@@ -443,7 +443,7 @@ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_VBLANK:
imx335->vblank = imx335->vblank_ctrl->val;
- dev_dbg(imx335->dev, "Received vblank %u, new lpfr %u",
+ dev_dbg(imx335->dev, "Received vblank %u, new lpfr %u\n",
imx335->vblank,
imx335->vblank + imx335->cur_mode->height);
@@ -462,7 +462,7 @@ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl)
exposure = ctrl->val;
analog_gain = imx335->again_ctrl->val;
- dev_dbg(imx335->dev, "Received exp %u, analog gain %u",
+ dev_dbg(imx335->dev, "Received exp %u, analog gain %u\n",
exposure, analog_gain);
ret = imx335_update_exp_gain(imx335, exposure, analog_gain);
@@ -471,7 +471,7 @@ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl)
break;
default:
- dev_err(imx335->dev, "Invalid control %d", ctrl->id);
+ dev_err(imx335->dev, "Invalid control %d\n", ctrl->id);
ret = -EINVAL;
}
@@ -652,14 +652,14 @@ static int imx335_start_streaming(struct imx335 *imx335)
ret = imx335_write_regs(imx335, reg_list->regs,
reg_list->num_of_regs);
if (ret) {
- dev_err(imx335->dev, "fail to write initial registers");
+ dev_err(imx335->dev, "fail to write initial registers\n");
return ret;
}
/* Setup handler will write actual exposure and gain */
ret = __v4l2_ctrl_handler_setup(imx335->sd.ctrl_handler);
if (ret) {
- dev_err(imx335->dev, "fail to setup handler");
+ dev_err(imx335->dev, "fail to setup handler\n");
return ret;
}
@@ -667,7 +667,7 @@ static int imx335_start_streaming(struct imx335 *imx335)
ret = imx335_write_reg(imx335, IMX335_REG_MODE_SELECT,
1, IMX335_MODE_STREAMING);
if (ret) {
- dev_err(imx335->dev, "fail to start streaming");
+ dev_err(imx335->dev, "fail to start streaming\n");
return ret;
}
@@ -744,7 +744,7 @@ static int imx335_detect(struct imx335 *imx335)
return ret;
if (val != IMX335_ID) {
- dev_err(imx335->dev, "chip id mismatch: %x!=%x",
+ dev_err(imx335->dev, "chip id mismatch: %x!=%x\n",
IMX335_ID, val);
return -ENXIO;
}
@@ -776,7 +776,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(imx335->reset_gpio)) {
- dev_err(imx335->dev, "failed to get reset gpio %ld",
+ dev_err(imx335->dev, "failed to get reset gpio %ld\n",
PTR_ERR(imx335->reset_gpio));
return PTR_ERR(imx335->reset_gpio);
}
@@ -784,13 +784,13 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
/* Get sensor input clock */
imx335->inclk = devm_clk_get(imx335->dev, NULL);
if (IS_ERR(imx335->inclk)) {
- dev_err(imx335->dev, "could not get inclk");
+ dev_err(imx335->dev, "could not get inclk\n");
return PTR_ERR(imx335->inclk);
}
rate = clk_get_rate(imx335->inclk);
if (rate != IMX335_INCLK_RATE) {
- dev_err(imx335->dev, "inclk frequency mismatch");
+ dev_err(imx335->dev, "inclk frequency mismatch\n");
return -EINVAL;
}
@@ -805,14 +805,14 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
if (bus_cfg.bus.mipi_csi2.num_data_lanes != IMX335_NUM_DATA_LANES) {
dev_err(imx335->dev,
- "number of CSI2 data lanes %d is not supported",
+ "number of CSI2 data lanes %d is not supported\n",
bus_cfg.bus.mipi_csi2.num_data_lanes);
ret = -EINVAL;
goto done_endpoint_free;
}
if (!bus_cfg.nr_of_link_frequencies) {
- dev_err(imx335->dev, "no link frequencies defined");
+ dev_err(imx335->dev, "no link frequencies defined\n");
ret = -EINVAL;
goto done_endpoint_free;
}
@@ -863,7 +863,7 @@ static int imx335_power_on(struct device *dev)
ret = clk_prepare_enable(imx335->inclk);
if (ret) {
- dev_err(imx335->dev, "fail to enable inclk");
+ dev_err(imx335->dev, "fail to enable inclk\n");
goto error_reset;
}
@@ -969,7 +969,7 @@ static int imx335_init_controls(struct imx335 *imx335)
imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
if (ctrl_hdlr->error) {
- dev_err(imx335->dev, "control init failed: %d",
+ dev_err(imx335->dev, "control init failed: %d\n",
ctrl_hdlr->error);
v4l2_ctrl_handler_free(ctrl_hdlr);
return ctrl_hdlr->error;
@@ -1002,7 +1002,7 @@ static int imx335_probe(struct i2c_client *client)
ret = imx335_parse_hw_config(imx335);
if (ret) {
- dev_err(imx335->dev, "HW configuration is not supported");
+ dev_err(imx335->dev, "HW configuration is not supported\n");
return ret;
}
@@ -1010,14 +1010,14 @@ static int imx335_probe(struct i2c_client *client)
ret = imx335_power_on(imx335->dev);
if (ret) {
- dev_err(imx335->dev, "failed to power-on the sensor");
+ dev_err(imx335->dev, "failed to power-on the sensor\n");
goto error_mutex_destroy;
}
/* Check module identity */
ret = imx335_detect(imx335);
if (ret) {
- dev_err(imx335->dev, "failed to find sensor: %d", ret);
+ dev_err(imx335->dev, "failed to find sensor: %d\n", ret);
goto error_power_off;
}
@@ -1027,7 +1027,7 @@ static int imx335_probe(struct i2c_client *client)
ret = imx335_init_controls(imx335);
if (ret) {
- dev_err(imx335->dev, "failed to init controls: %d", ret);
+ dev_err(imx335->dev, "failed to init controls: %d\n", ret);
goto error_power_off;
}
@@ -1039,14 +1039,14 @@ static int imx335_probe(struct i2c_client *client)
imx335->pad.flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_pads_init(&imx335->sd.entity, 1, &imx335->pad);
if (ret) {
- dev_err(imx335->dev, "failed to init entity pads: %d", ret);
+ dev_err(imx335->dev, "failed to init entity pads: %d\n", ret);
goto error_handler_free;
}
ret = v4l2_async_register_subdev_sensor(&imx335->sd);
if (ret < 0) {
dev_err(imx335->dev,
- "failed to register async subdev: %d", ret);
+ "failed to register async subdev: %d\n", ret);
goto error_media_entity;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 3/8] media: i2c: imx335: Improve configuration error reporting
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
2023-12-08 15:07 ` [PATCH v3 1/8] media: dt-bindings: media: imx335: Add supply bindings Umang Jain
2023-12-08 15:07 ` [PATCH v3 2/8] media: i2c: imx335: Fix logging line endings Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 4/8] media: i2c: imx335: Enable regulator supplies Umang Jain
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, Umang Jain, open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
The existing imx335_parse_hw_config function has two paths
that can be taken without reporting to the user the reason
for failing to accept the hardware configuration.
Extend the error reporting paths to identify failures when
probing the device.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index cbabef968e21..31c612c6bdd8 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -795,8 +795,10 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
}
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
- if (!ep)
+ if (!ep) {
+ dev_err(imx335->dev, "Failed to get next endpoint\n");
return -ENXIO;
+ }
ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
fwnode_handle_put(ep);
@@ -821,6 +823,8 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
if (bus_cfg.link_frequencies[i] == IMX335_LINK_FREQ)
goto done_endpoint_free;
+ dev_err(imx335->dev, "no compatible link frequencies found\n");
+
ret = -EINVAL;
done_endpoint_free:
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 4/8] media: i2c: imx335: Enable regulator supplies
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
` (2 preceding siblings ...)
2023-12-08 15:07 ` [PATCH v3 3/8] media: i2c: imx335: Improve configuration error reporting Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 5/8] media: i2c: imx335: Implement get selection API Umang Jain
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, Umang Jain, open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Provide support for enabling and disabling regulator supplies to control
power to the camera sensor.
While updating the power on function, document that a sleep is
represented as 'T4' in the datasheet power on sequence.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index 31c612c6bdd8..b25216b3350e 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -75,6 +75,12 @@ struct imx335_reg_list {
const struct imx335_reg *regs;
};
+static const char * const imx335_supply_name[] = {
+ "avdd", /* Analog (2.9V) supply */
+ "ovdd", /* Digital I/O (1.8V) supply */
+ "dvdd", /* Digital Core (1.2V) supply */
+};
+
/**
* struct imx335_mode - imx335 sensor mode structure
* @width: Frame width
@@ -108,6 +114,7 @@ struct imx335_mode {
* @sd: V4L2 sub-device
* @pad: Media pad. Only one pad supported
* @reset_gpio: Sensor reset gpio
+ * @supplies: Regulator supplies to handle power control
* @inclk: Sensor input clock
* @ctrl_handler: V4L2 control handler
* @link_freq_ctrl: Pointer to link frequency control
@@ -126,6 +133,8 @@ struct imx335 {
struct v4l2_subdev sd;
struct media_pad pad;
struct gpio_desc *reset_gpio;
+ struct regulator_bulk_data supplies[ARRAY_SIZE(imx335_supply_name)];
+
struct clk *inclk;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *link_freq_ctrl;
@@ -781,6 +790,17 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
return PTR_ERR(imx335->reset_gpio);
}
+ for (i = 0; i < ARRAY_SIZE(imx335_supply_name); i++)
+ imx335->supplies[i].supply = imx335_supply_name[i];
+
+ ret = devm_regulator_bulk_get(imx335->dev,
+ ARRAY_SIZE(imx335_supply_name),
+ imx335->supplies);
+ if (ret) {
+ dev_err(imx335->dev, "Failed to get regulators\n");
+ return ret;
+ }
+
/* Get sensor input clock */
imx335->inclk = devm_clk_get(imx335->dev, NULL);
if (IS_ERR(imx335->inclk)) {
@@ -863,6 +883,17 @@ static int imx335_power_on(struct device *dev)
struct imx335 *imx335 = to_imx335(sd);
int ret;
+ ret = regulator_bulk_enable(ARRAY_SIZE(imx335_supply_name),
+ imx335->supplies);
+ if (ret) {
+ dev_err(dev, "%s: failed to enable regulators\n",
+ __func__);
+ return ret;
+ }
+
+ usleep_range(500, 550); /* Tlow */
+
+ /* Set XCLR */
gpiod_set_value_cansleep(imx335->reset_gpio, 1);
ret = clk_prepare_enable(imx335->inclk);
@@ -871,12 +902,13 @@ static int imx335_power_on(struct device *dev)
goto error_reset;
}
- usleep_range(20, 22);
+ usleep_range(20, 22); /* T4 */
return 0;
error_reset:
gpiod_set_value_cansleep(imx335->reset_gpio, 0);
+ regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);
return ret;
}
@@ -893,8 +925,8 @@ static int imx335_power_off(struct device *dev)
struct imx335 *imx335 = to_imx335(sd);
gpiod_set_value_cansleep(imx335->reset_gpio, 0);
-
clk_disable_unprepare(imx335->inclk);
+ regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);
return 0;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 5/8] media: i2c: imx335: Implement get selection API
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
` (3 preceding siblings ...)
2023-12-08 15:07 ` [PATCH v3 4/8] media: i2c: imx335: Enable regulator supplies Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 6/8] media: i2c: imx335: Fix hblank min/max values Umang Jain
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, Umang Jain, open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Support reporting of the Sensor Native and Active pixel array areas
through the Selection API.
The implementation reports a single target crop only for the mode that
is presently exposed by the driver.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 45 ++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index b25216b3350e..a924b7222ca3 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -55,6 +55,14 @@
#define IMX335_REG_MIN 0x00
#define IMX335_REG_MAX 0xfffff
+/* IMX335 native and active pixel array size. */
+#define IMX335_NATIVE_WIDTH 2616U
+#define IMX335_NATIVE_HEIGHT 1964U
+#define IMX335_PIXEL_ARRAY_LEFT 12U
+#define IMX335_PIXEL_ARRAY_TOP 12U
+#define IMX335_PIXEL_ARRAY_WIDTH 2592U
+#define IMX335_PIXEL_ARRAY_HEIGHT 1944U
+
/**
* struct imx335_reg - imx335 sensor register
* @address: Register address
@@ -645,6 +653,41 @@ static int imx335_init_pad_cfg(struct v4l2_subdev *sd,
return imx335_set_pad_format(sd, sd_state, &fmt);
}
+/**
+ * imx335_get_selection() - Selection API
+ * @sd: pointer to imx335 V4L2 sub-device structure
+ * @sd_state: V4L2 sub-device configuration
+ * @sel: V4L2 selection info
+ *
+ * Return: 0 if successful, error code otherwise.
+ */
+static int imx335_get_selection(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *sd_state,
+ struct v4l2_subdev_selection *sel)
+{
+ switch (sel->target) {
+ case V4L2_SEL_TGT_NATIVE_SIZE:
+ sel->r.top = 0;
+ sel->r.left = 0;
+ sel->r.width = IMX335_NATIVE_WIDTH;
+ sel->r.height = IMX335_NATIVE_HEIGHT;
+
+ return 0;
+
+ case V4L2_SEL_TGT_CROP:
+ case V4L2_SEL_TGT_CROP_DEFAULT:
+ case V4L2_SEL_TGT_CROP_BOUNDS:
+ sel->r.top = IMX335_PIXEL_ARRAY_TOP;
+ sel->r.left = IMX335_PIXEL_ARRAY_LEFT;
+ sel->r.width = IMX335_PIXEL_ARRAY_WIDTH;
+ sel->r.height = IMX335_PIXEL_ARRAY_HEIGHT;
+
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
/**
* imx335_start_streaming() - Start sensor stream
* @imx335: pointer to imx335 device
@@ -862,6 +905,8 @@ static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
.init_cfg = imx335_init_pad_cfg,
.enum_mbus_code = imx335_enum_mbus_code,
.enum_frame_size = imx335_enum_frame_size,
+ .get_selection = imx335_get_selection,
+ .set_selection = imx335_get_selection,
.get_fmt = imx335_get_pad_format,
.set_fmt = imx335_set_pad_format,
};
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 6/8] media: i2c: imx335: Fix hblank min/max values
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
` (4 preceding siblings ...)
2023-12-08 15:07 ` [PATCH v3 5/8] media: i2c: imx335: Implement get selection API Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-08 15:07 ` [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode Umang Jain
2023-12-08 15:07 ` [PATCH v3 8/8] media: i2c: imx335: Support multiple link frequency Umang Jain
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Kieran Bingham, Umang Jain, open list
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
The V4L2_CID_HBLANK control is marked as readonly and can only be a
single value.
Set the minimum and maximum value to match the mode value.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index a924b7222ca3..f353647a0d4e 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -1043,8 +1043,8 @@ static int imx335_init_controls(struct imx335 *imx335)
imx335->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
&imx335_ctrl_ops,
V4L2_CID_HBLANK,
- IMX335_REG_MIN,
- IMX335_REG_MAX,
+ mode->hblank,
+ mode->hblank,
1, mode->hblank);
if (imx335->hblank_ctrl)
imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
` (5 preceding siblings ...)
2023-12-08 15:07 ` [PATCH v3 6/8] media: i2c: imx335: Fix hblank min/max values Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
2023-12-09 0:50 ` kernel test robot
2023-12-08 15:07 ` [PATCH v3 8/8] media: i2c: imx335: Support multiple link frequency Umang Jain
7 siblings, 1 reply; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Umang Jain, open list
In addition to the existing 2592x1940 12-bit mode, introduce support
for 2592x1940 10-bit mode.
Following are the register set which control the 10/12 bit mode setting:
MDBIT 0x319d
ADBIT 0x3050
ADBIT1 0x341c
0x341d
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 77 ++++++++++++++++++++++++++++++++++----
1 file changed, 70 insertions(+), 7 deletions(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index f353647a0d4e..76a05624ca94 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -156,6 +156,7 @@ struct imx335 {
u32 vblank;
const struct imx335_mode *cur_mode;
struct mutex mutex;
+ u32 cur_mbus_code;
};
static const s64 link_freq[] = {
@@ -250,6 +251,25 @@ static const struct imx335_reg mode_2592x1940_regs[] = {
{0x3a00, 0x01},
};
+static const struct imx335_reg raw10_framefmt_regs[] = {
+ {0x3050, 0x00},
+ {0x319d, 0x00},
+ {0x341c, 0xff},
+ {0x341d, 0x01},
+};
+
+static const struct imx335_reg raw12_framefmt_regs[] = {
+ {0x3050, 0x01},
+ {0x319d, 0x01},
+ {0x341c, 0x47},
+ {0x341d, 0x00},
+};
+
+static const u32 imx335_mbus_codes[] = {
+ MEDIA_BUS_FMT_SRGGB12_1X12,
+ MEDIA_BUS_FMT_SRGGB10_1X10,
+};
+
/* Supported sensor mode configurations */
static const struct imx335_mode supported_mode = {
.width = 2592,
@@ -260,7 +280,6 @@ static const struct imx335_mode supported_mode = {
.vblank_max = 133060,
.pclk = 396000000,
.link_freq_idx = 0,
- .code = MEDIA_BUS_FMT_SRGGB12_1X12,
.reg_list = {
.num_of_regs = ARRAY_SIZE(mode_2592x1940_regs),
.regs = mode_2592x1940_regs,
@@ -500,6 +519,18 @@ static const struct v4l2_ctrl_ops imx335_ctrl_ops = {
.s_ctrl = imx335_set_ctrl,
};
+static int imx335_get_format_code(struct imx335 *imx335, u32 code)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(imx335_mbus_codes); i++) {
+ if (imx335_mbus_codes[i] == code)
+ return imx335_mbus_codes[i];
+ }
+
+ return imx335_mbus_codes[0];
+}
+
/**
* imx335_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes
* @sd: pointer to imx335 V4L2 sub-device structure
@@ -512,10 +543,10 @@ static int imx335_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
- if (code->index > 0)
+ if (code->index >= ARRAY_SIZE(imx335_mbus_codes))
return -EINVAL;
- code->code = supported_mode.code;
+ code->code = imx335_mbus_codes[code->index];
return 0;
}
@@ -532,10 +563,14 @@ static int imx335_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fsize)
{
- if (fsize->index > 0)
+ struct imx335 *imx335 = to_imx335(sd);
+ u32 code;
+
+ if (fsize->index > ARRAY_SIZE(imx335_mbus_codes))
return -EINVAL;
- if (fsize->code != supported_mode.code)
+ code = imx335_get_format_code(imx335, fsize->code);
+ if (fsize->code != code)
return -EINVAL;
fsize->min_width = supported_mode.width;
@@ -559,7 +594,7 @@ static void imx335_fill_pad_format(struct imx335 *imx335,
{
fmt->format.width = mode->width;
fmt->format.height = mode->height;
- fmt->format.code = mode->code;
+ fmt->format.code = imx335->cur_mbus_code;
fmt->format.field = V4L2_FIELD_NONE;
fmt->format.colorspace = V4L2_COLORSPACE_RAW;
fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
@@ -611,11 +646,16 @@ static int imx335_set_pad_format(struct v4l2_subdev *sd,
{
struct imx335 *imx335 = to_imx335(sd);
const struct imx335_mode *mode;
- int ret = 0;
+ int i, ret = 0;
mutex_lock(&imx335->mutex);
mode = &supported_mode;
+ for (i = 0; i < ARRAY_SIZE(imx335_mbus_codes); i++) {
+ if (imx335_mbus_codes[i] == fmt->format.code)
+ imx335->cur_mbus_code = imx335_mbus_codes[i];
+ }
+
imx335_fill_pad_format(imx335, mode, fmt);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
@@ -688,6 +728,21 @@ static int imx335_get_selection(struct v4l2_subdev *sd,
return -EINVAL;
}
+static int imx335_set_framefmt(struct imx335 *imx335)
+{
+ switch (imx335->cur_mbus_code) {
+ case MEDIA_BUS_FMT_SRGGB10_1X10:
+ return imx335_write_regs(imx335, raw10_framefmt_regs,
+ ARRAY_SIZE(raw10_framefmt_regs));
+
+ case MEDIA_BUS_FMT_SRGGB12_1X12:
+ return imx335_write_regs(imx335, raw12_framefmt_regs,
+ ARRAY_SIZE(raw12_framefmt_regs));
+ }
+
+ return -EINVAL;
+}
+
/**
* imx335_start_streaming() - Start sensor stream
* @imx335: pointer to imx335 device
@@ -708,6 +763,13 @@ static int imx335_start_streaming(struct imx335 *imx335)
return ret;
}
+ ret = imx335_set_framefmt(imx335);
+ if (ret) {
+ dev_err(imx335->dev, "%s failed to set frame format: %d\n",
+ __func__, ret);
+ return ret;
+ }
+
/* Setup handler will write actual exposure and gain */
ret = __v4l2_ctrl_handler_setup(imx335->sd.ctrl_handler);
if (ret) {
@@ -1104,6 +1166,7 @@ static int imx335_probe(struct i2c_client *client)
/* Set default mode to max resolution */
imx335->cur_mode = &supported_mode;
+ imx335->cur_mbus_code = imx335_mbus_codes[0];
imx335->vblank = imx335->cur_mode->vblank;
ret = imx335_init_controls(imx335);
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 8/8] media: i2c: imx335: Support multiple link frequency
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
` (6 preceding siblings ...)
2023-12-08 15:07 ` [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode Umang Jain
@ 2023-12-08 15:07 ` Umang Jain
7 siblings, 0 replies; 10+ messages in thread
From: Umang Jain @ 2023-12-08 15:07 UTC (permalink / raw)
To: devicetree, linux-media
Cc: Paul J . Murphy, Daniele Alessandrelli, Sakari Ailus,
Mauro Carvalho Chehab, Umang Jain, open list
Support link frequency of 445MHz in addition to 594MHz.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
drivers/media/i2c/imx335.c | 89 +++++++++++++++++++++++++++++---------
1 file changed, 68 insertions(+), 21 deletions(-)
diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index 76a05624ca94..1d6dc38e3e6b 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -49,7 +49,8 @@
#define IMX335_INCLK_RATE 24000000
/* CSI2 HW configuration */
-#define IMX335_LINK_FREQ 594000000
+#define IMX335_LINK_FREQ_594MHz 594000000
+#define IMX335_LINK_FREQ_445MHz 445500000
#define IMX335_NUM_DATA_LANES 4
#define IMX335_REG_MIN 0x00
@@ -99,7 +100,6 @@ static const char * const imx335_supply_name[] = {
* @vblank_min: Minimum vertical blanking in lines
* @vblank_max: Maximum vertical blanking in lines
* @pclk: Sensor pixel clock
- * @link_freq_idx: Link frequency index
* @reg_list: Register list for sensor mode
*/
struct imx335_mode {
@@ -111,7 +111,6 @@ struct imx335_mode {
u32 vblank_min;
u32 vblank_max;
u64 pclk;
- u32 link_freq_idx;
struct imx335_reg_list reg_list;
};
@@ -133,6 +132,7 @@ struct imx335_mode {
* @again_ctrl: Pointer to analog gain control
* @vblank: Vertical blanking in lines
* @cur_mode: Pointer to current selected sensor mode
+ * @link_freq_idx: Selected link frequency index
* @mutex: Mutex for serializing sensor controls
*/
struct imx335 {
@@ -155,20 +155,16 @@ struct imx335 {
};
u32 vblank;
const struct imx335_mode *cur_mode;
+ u32 link_freq_idx;
struct mutex mutex;
u32 cur_mbus_code;
};
-static const s64 link_freq[] = {
- IMX335_LINK_FREQ,
-};
/* Sensor mode registers */
static const struct imx335_reg mode_2592x1940_regs[] = {
{0x3000, 0x01},
{0x3002, 0x00},
- {0x300c, 0x3b},
- {0x300d, 0x2a},
{0x3018, 0x04},
{0x302c, 0x3c},
{0x302e, 0x20},
@@ -176,10 +172,6 @@ static const struct imx335_reg mode_2592x1940_regs[] = {
{0x3074, 0xc8},
{0x3076, 0x28},
{0x304c, 0x00},
- {0x314c, 0xc6},
- {0x315a, 0x02},
- {0x3168, 0xa0},
- {0x316a, 0x7e},
{0x31a1, 0x00},
{0x3288, 0x21},
{0x328a, 0x02},
@@ -265,6 +257,46 @@ static const struct imx335_reg raw12_framefmt_regs[] = {
{0x341d, 0x00},
};
+static const struct imx335_reg mipi_data_rate_1188Mbps[] = {
+ {0x300c, 0x3b},
+ {0x300d, 0x2a},
+ {0x314c, 0xc6},
+ {0x314d, 0x00},
+ {0x315a, 0x02},
+ {0x3168, 0xa0},
+ {0x316a, 0x7e},
+ {0x319e, 0x01},
+};
+
+static const struct imx335_reg mipi_data_rate_891Mbps[] = {
+ {0x300c, 0x3b},
+ {0x300d, 0x2a},
+ {0x314c, 0x29},
+ {0x314d, 0x01},
+ {0x315a, 0x06},
+ {0x3168, 0xa0},
+ {0x316a, 0x7e},
+ {0x319e, 0x02},
+};
+
+static const s64 link_freq[] = {
+ /* Corresponds to 1188Mbps data lane rate */
+ IMX335_LINK_FREQ_594MHz,
+ /* Corresponds to 891Mbps data lane rate */
+ IMX335_LINK_FREQ_445MHz,
+};
+
+static const struct imx335_reg_list link_freq_reglist[] = {
+ {
+ .num_of_regs = ARRAY_SIZE(mipi_data_rate_1188Mbps),
+ .regs = mipi_data_rate_1188Mbps,
+ },
+ {
+ .num_of_regs = ARRAY_SIZE(mipi_data_rate_891Mbps),
+ .regs = mipi_data_rate_891Mbps,
+ },
+};
+
static const u32 imx335_mbus_codes[] = {
MEDIA_BUS_FMT_SRGGB12_1X12,
MEDIA_BUS_FMT_SRGGB10_1X10,
@@ -279,7 +311,6 @@ static const struct imx335_mode supported_mode = {
.vblank_min = 2560,
.vblank_max = 133060,
.pclk = 396000000,
- .link_freq_idx = 0,
.reg_list = {
.num_of_regs = ARRAY_SIZE(mode_2592x1940_regs),
.regs = mode_2592x1940_regs,
@@ -404,7 +435,7 @@ static int imx335_update_controls(struct imx335 *imx335,
{
int ret;
- ret = __v4l2_ctrl_s_ctrl(imx335->link_freq_ctrl, mode->link_freq_idx);
+ ret = __v4l2_ctrl_s_ctrl(imx335->link_freq_ctrl, imx335->link_freq_idx);
if (ret)
return ret;
@@ -754,6 +785,14 @@ static int imx335_start_streaming(struct imx335 *imx335)
const struct imx335_reg_list *reg_list;
int ret;
+ /* Setup PLL */
+ reg_list = &link_freq_reglist[imx335->link_freq_idx];
+ ret = imx335_write_regs(imx335, reg_list->regs, reg_list->num_of_regs);
+ if (ret) {
+ dev_err(imx335->dev, "%s failed to set plls\n", __func__);
+ return ret;
+ }
+
/* Write sensor mode registers */
reg_list = &imx335->cur_mode->reg_list;
ret = imx335_write_regs(imx335, reg_list->regs,
@@ -880,7 +919,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
};
struct fwnode_handle *ep;
unsigned long rate;
- unsigned int i;
+ unsigned int i, j;
int ret;
if (!fwnode)
@@ -944,13 +983,21 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
goto done_endpoint_free;
}
- for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++)
- if (bus_cfg.link_frequencies[i] == IMX335_LINK_FREQ)
- goto done_endpoint_free;
- dev_err(imx335->dev, "no compatible link frequencies found\n");
+ for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) {
+ for (j = 0; j < ARRAY_SIZE(link_freq); j++) {
+ if (bus_cfg.link_frequencies[i] == link_freq[j]) {
+ imx335->link_freq_idx = j;
+ break;
+ }
+ }
- ret = -EINVAL;
+ if (j == ARRAY_SIZE(link_freq)) {
+ ret = dev_err_probe(imx335->dev, -EINVAL,
+ "no supported link freq found\n");
+ goto done_endpoint_free;
+ }
+ }
done_endpoint_free:
v4l2_fwnode_endpoint_free(&bus_cfg);
@@ -1097,7 +1144,7 @@ static int imx335_init_controls(struct imx335 *imx335)
V4L2_CID_LINK_FREQ,
ARRAY_SIZE(link_freq) -
1,
- mode->link_freq_idx,
+ imx335->link_freq_idx,
link_freq);
if (imx335->link_freq_ctrl)
imx335->link_freq_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode
2023-12-08 15:07 ` [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode Umang Jain
@ 2023-12-09 0:50 ` kernel test robot
0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-12-09 0:50 UTC (permalink / raw)
To: Umang Jain, devicetree, linux-media
Cc: oe-kbuild-all, Paul J . Murphy, Daniele Alessandrelli,
Sakari Ailus, Mauro Carvalho Chehab, Umang Jain, linux-kernel
Hi Umang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on v6.7-rc4]
[also build test WARNING on linus/master next-20231208]
[cannot apply to media-tree/master linuxtv-media-stage/master sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Umang-Jain/media-dt-bindings-media-imx335-Add-supply-bindings/20231208-230953
base: v6.7-rc4
patch link: https://lore.kernel.org/r/20231208150756.124720-8-umang.jain%40ideasonboard.com
patch subject: [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20231209/202312090803.2jM0Kj0d-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/202312090803.2jM0Kj0d-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312090803.2jM0Kj0d-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/imx335.c:160: warning: Function parameter or member 'cur_mbus_code' not described in 'imx335'
vim +160 drivers/media/i2c/imx335.c
45d19b5fb9aeab Martina Krasteva 2021-05-27 117
45d19b5fb9aeab Martina Krasteva 2021-05-27 118 /**
45d19b5fb9aeab Martina Krasteva 2021-05-27 119 * struct imx335 - imx335 sensor device structure
45d19b5fb9aeab Martina Krasteva 2021-05-27 120 * @dev: Pointer to generic device
45d19b5fb9aeab Martina Krasteva 2021-05-27 121 * @client: Pointer to i2c client
45d19b5fb9aeab Martina Krasteva 2021-05-27 122 * @sd: V4L2 sub-device
45d19b5fb9aeab Martina Krasteva 2021-05-27 123 * @pad: Media pad. Only one pad supported
45d19b5fb9aeab Martina Krasteva 2021-05-27 124 * @reset_gpio: Sensor reset gpio
84a97de1949593 Kieran Bingham 2023-12-08 125 * @supplies: Regulator supplies to handle power control
45d19b5fb9aeab Martina Krasteva 2021-05-27 126 * @inclk: Sensor input clock
45d19b5fb9aeab Martina Krasteva 2021-05-27 127 * @ctrl_handler: V4L2 control handler
45d19b5fb9aeab Martina Krasteva 2021-05-27 128 * @link_freq_ctrl: Pointer to link frequency control
45d19b5fb9aeab Martina Krasteva 2021-05-27 129 * @pclk_ctrl: Pointer to pixel clock control
45d19b5fb9aeab Martina Krasteva 2021-05-27 130 * @hblank_ctrl: Pointer to horizontal blanking control
45d19b5fb9aeab Martina Krasteva 2021-05-27 131 * @vblank_ctrl: Pointer to vertical blanking control
45d19b5fb9aeab Martina Krasteva 2021-05-27 132 * @exp_ctrl: Pointer to exposure control
45d19b5fb9aeab Martina Krasteva 2021-05-27 133 * @again_ctrl: Pointer to analog gain control
45d19b5fb9aeab Martina Krasteva 2021-05-27 134 * @vblank: Vertical blanking in lines
45d19b5fb9aeab Martina Krasteva 2021-05-27 135 * @cur_mode: Pointer to current selected sensor mode
45d19b5fb9aeab Martina Krasteva 2021-05-27 136 * @mutex: Mutex for serializing sensor controls
45d19b5fb9aeab Martina Krasteva 2021-05-27 137 */
45d19b5fb9aeab Martina Krasteva 2021-05-27 138 struct imx335 {
45d19b5fb9aeab Martina Krasteva 2021-05-27 139 struct device *dev;
45d19b5fb9aeab Martina Krasteva 2021-05-27 140 struct i2c_client *client;
45d19b5fb9aeab Martina Krasteva 2021-05-27 141 struct v4l2_subdev sd;
45d19b5fb9aeab Martina Krasteva 2021-05-27 142 struct media_pad pad;
45d19b5fb9aeab Martina Krasteva 2021-05-27 143 struct gpio_desc *reset_gpio;
84a97de1949593 Kieran Bingham 2023-12-08 144 struct regulator_bulk_data supplies[ARRAY_SIZE(imx335_supply_name)];
84a97de1949593 Kieran Bingham 2023-12-08 145
45d19b5fb9aeab Martina Krasteva 2021-05-27 146 struct clk *inclk;
45d19b5fb9aeab Martina Krasteva 2021-05-27 147 struct v4l2_ctrl_handler ctrl_handler;
45d19b5fb9aeab Martina Krasteva 2021-05-27 148 struct v4l2_ctrl *link_freq_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 149 struct v4l2_ctrl *pclk_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 150 struct v4l2_ctrl *hblank_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 151 struct v4l2_ctrl *vblank_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 152 struct {
45d19b5fb9aeab Martina Krasteva 2021-05-27 153 struct v4l2_ctrl *exp_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 154 struct v4l2_ctrl *again_ctrl;
45d19b5fb9aeab Martina Krasteva 2021-05-27 155 };
45d19b5fb9aeab Martina Krasteva 2021-05-27 156 u32 vblank;
45d19b5fb9aeab Martina Krasteva 2021-05-27 157 const struct imx335_mode *cur_mode;
45d19b5fb9aeab Martina Krasteva 2021-05-27 158 struct mutex mutex;
b843d1b4daf24e Umang Jain 2023-12-08 159 u32 cur_mbus_code;
45d19b5fb9aeab Martina Krasteva 2021-05-27 @160 };
45d19b5fb9aeab Martina Krasteva 2021-05-27 161
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-12-09 0:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 15:07 [PATCH v3 0/8] media: Sony IMX335 improvements Umang Jain
2023-12-08 15:07 ` [PATCH v3 1/8] media: dt-bindings: media: imx335: Add supply bindings Umang Jain
2023-12-08 15:07 ` [PATCH v3 2/8] media: i2c: imx335: Fix logging line endings Umang Jain
2023-12-08 15:07 ` [PATCH v3 3/8] media: i2c: imx335: Improve configuration error reporting Umang Jain
2023-12-08 15:07 ` [PATCH v3 4/8] media: i2c: imx335: Enable regulator supplies Umang Jain
2023-12-08 15:07 ` [PATCH v3 5/8] media: i2c: imx335: Implement get selection API Umang Jain
2023-12-08 15:07 ` [PATCH v3 6/8] media: i2c: imx335: Fix hblank min/max values Umang Jain
2023-12-08 15:07 ` [PATCH v3 7/8] media: i2c: imx335: Support 2592x1940 10-bit mode Umang Jain
2023-12-09 0:50 ` kernel test robot
2023-12-08 15:07 ` [PATCH v3 8/8] media: i2c: imx335: Support multiple link frequency Umang Jain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox