mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
media: ccs: Align flipping behaviour with other drivers
No longer mirror flipping controls if the sensor is mounted upside down. This way the behaviour of the flipping controls and rotation of the sensor are aligned with the rest of the drivers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
23c3b904b1
commit
6b3980e045
2 changed files with 0 additions and 54 deletions
|
@ -569,8 +569,6 @@ static u32 ccs_pixel_order(struct ccs_sensor *sensor)
|
||||||
flip |= CCS_IMAGE_ORIENTATION_VERTICAL_FLIP;
|
flip |= CCS_IMAGE_ORIENTATION_VERTICAL_FLIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
flip ^= sensor->hvflip_inv_mask;
|
|
||||||
|
|
||||||
dev_dbg(&client->dev, "flip %u\n", flip);
|
dev_dbg(&client->dev, "flip %u\n", flip);
|
||||||
return sensor->default_pixel_order ^ flip;
|
return sensor->default_pixel_order ^ flip;
|
||||||
}
|
}
|
||||||
|
@ -632,8 +630,6 @@ static int ccs_set_ctrl(struct v4l2_ctrl *ctrl)
|
||||||
if (sensor->vflip->val)
|
if (sensor->vflip->val)
|
||||||
orient |= CCS_IMAGE_ORIENTATION_VERTICAL_FLIP;
|
orient |= CCS_IMAGE_ORIENTATION_VERTICAL_FLIP;
|
||||||
|
|
||||||
orient ^= sensor->hvflip_inv_mask;
|
|
||||||
|
|
||||||
ccs_update_mbus_formats(sensor);
|
ccs_update_mbus_formats(sensor);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -3185,7 +3181,6 @@ static int ccs_get_hwconfig(struct ccs_sensor *sensor, struct device *dev)
|
||||||
struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = V4L2_MBUS_UNKNOWN };
|
struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = V4L2_MBUS_UNKNOWN };
|
||||||
struct fwnode_handle *ep;
|
struct fwnode_handle *ep;
|
||||||
struct fwnode_handle *fwnode = dev_fwnode(dev);
|
struct fwnode_handle *fwnode = dev_fwnode(dev);
|
||||||
u32 rotation;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int rval;
|
int rval;
|
||||||
|
|
||||||
|
@ -3224,22 +3219,6 @@ static int ccs_get_hwconfig(struct ccs_sensor *sensor, struct device *dev)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
rval = fwnode_property_read_u32(fwnode, "rotation", &rotation);
|
|
||||||
if (!rval) {
|
|
||||||
switch (rotation) {
|
|
||||||
case 180:
|
|
||||||
hwcfg->module_board_orient =
|
|
||||||
CCS_MODULE_BOARD_ORIENT_180;
|
|
||||||
fallthrough;
|
|
||||||
case 0:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dev_err(dev, "invalid rotation %u\n", rotation);
|
|
||||||
rval = -EINVAL;
|
|
||||||
goto out_err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rval = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
|
rval = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
|
||||||
&hwcfg->ext_clk);
|
&hwcfg->ext_clk);
|
||||||
if (rval)
|
if (rval)
|
||||||
|
@ -3437,25 +3416,6 @@ static int ccs_probe(struct i2c_client *client)
|
||||||
if (rval < 0)
|
if (rval < 0)
|
||||||
goto out_free_ccs_limits;
|
goto out_free_ccs_limits;
|
||||||
|
|
||||||
/*
|
|
||||||
* Handle Sensor Module orientation on the board.
|
|
||||||
*
|
|
||||||
* The application of H-FLIP and V-FLIP on the sensor is modified by
|
|
||||||
* the sensor orientation on the board.
|
|
||||||
*
|
|
||||||
* For CCS_BOARD_SENSOR_ORIENT_180 the default behaviour is to set
|
|
||||||
* both H-FLIP and V-FLIP for normal operation which also implies
|
|
||||||
* that a set/unset operation for user space HFLIP and VFLIP v4l2
|
|
||||||
* controls will need to be internally inverted.
|
|
||||||
*
|
|
||||||
* Rotation also changes the bayer pattern.
|
|
||||||
*/
|
|
||||||
if (sensor->hwcfg.module_board_orient ==
|
|
||||||
CCS_MODULE_BOARD_ORIENT_180)
|
|
||||||
sensor->hvflip_inv_mask =
|
|
||||||
CCS_IMAGE_ORIENTATION_HORIZONTAL_MIRROR |
|
|
||||||
CCS_IMAGE_ORIENTATION_VERTICAL_FLIP;
|
|
||||||
|
|
||||||
rval = ccs_call_quirk(sensor, limits);
|
rval = ccs_call_quirk(sensor, limits);
|
||||||
if (rval) {
|
if (rval) {
|
||||||
dev_err(&client->dev, "limits quirks failed\n");
|
dev_err(&client->dev, "limits quirks failed\n");
|
||||||
|
|
|
@ -57,17 +57,6 @@
|
||||||
#define CCS_LIM_AT(sensor, limit, offset) \
|
#define CCS_LIM_AT(sensor, limit, offset) \
|
||||||
ccs_get_limit(sensor, CCS_L_##limit, CCS_L_##limit##_OFFSET(offset))
|
ccs_get_limit(sensor, CCS_L_##limit, CCS_L_##limit##_OFFSET(offset))
|
||||||
|
|
||||||
/*
|
|
||||||
* Sometimes due to board layout considerations the camera module can be
|
|
||||||
* mounted rotated. The typical rotation used is 180 degrees which can be
|
|
||||||
* corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
|
|
||||||
* FIXME: rotation also changes the bayer pattern.
|
|
||||||
*/
|
|
||||||
enum ccs_module_board_orient {
|
|
||||||
CCS_MODULE_BOARD_ORIENT_0 = 0,
|
|
||||||
CCS_MODULE_BOARD_ORIENT_180,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ccs_flash_strobe_parms {
|
struct ccs_flash_strobe_parms {
|
||||||
u8 mode;
|
u8 mode;
|
||||||
u32 strobe_width_high_us;
|
u32 strobe_width_high_us;
|
||||||
|
@ -90,8 +79,6 @@ struct ccs_hwconfig {
|
||||||
u32 csi_signalling_mode; /* CCS_CSI_SIGNALLING_MODE_* */
|
u32 csi_signalling_mode; /* CCS_CSI_SIGNALLING_MODE_* */
|
||||||
u64 *op_sys_clock;
|
u64 *op_sys_clock;
|
||||||
|
|
||||||
enum ccs_module_board_orient module_board_orient;
|
|
||||||
|
|
||||||
struct ccs_flash_strobe_parms *strobe_setup;
|
struct ccs_flash_strobe_parms *strobe_setup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -243,7 +230,6 @@ struct ccs_sensor {
|
||||||
u8 scale_m;
|
u8 scale_m;
|
||||||
u8 scaling_mode;
|
u8 scaling_mode;
|
||||||
|
|
||||||
u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */
|
|
||||||
u8 frame_skip;
|
u8 frame_skip;
|
||||||
u16 embedded_start; /* embedded data start line */
|
u16 embedded_start; /* embedded data start line */
|
||||||
u16 embedded_end;
|
u16 embedded_end;
|
||||||
|
|
Loading…
Reference in a new issue