diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 46bc6c5b7758..fbf9188151db 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -132,6 +132,8 @@ static const char * const ov5693_supply_names[] = { #define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names) +static int sensor_default_rotation; + struct ov5693_device { struct device *dev; struct regmap *regmap; @@ -169,6 +171,7 @@ struct ov5693_device { struct v4l2_ctrl *hblank; struct v4l2_ctrl *vblank; struct v4l2_ctrl *test_pattern; + struct v4l2_ctrl *rotation; } ctrls; }; @@ -1126,7 +1129,9 @@ static int ov5693_init_controls(struct ov5693_device *ov5693) OV5693_DIGITAL_GAIN_MAX, OV5693_DIGITAL_GAIN_STEP, OV5693_DIGITAL_GAIN_DEF); - + /* Rotation */ + ctrls->rotation = v4l2_ctrl_new_std(&ctrls->handler, ops, + V4L2_CID_CAMERA_SENSOR_ROTATION, 0, 270, 90, sensor_default_rotation); /* Flip */ ctrls->hflip = v4l2_ctrl_new_std(&ctrls->handler, ops, V4L2_CID_HFLIP, 0, 1, 1, 0); @@ -1418,6 +1423,8 @@ static struct i2c_driver ov5693_driver = { .remove = ov5693_remove, }; module_i2c_driver(ov5693_driver); +module_param(sensor_default_rotation, int, 0644); +MODULE_PARM_DESC(sensor_default_rotation, "Sensor default rotation in degrees (0, 90, 180, 270)"); MODULE_DESCRIPTION("A low-level driver for OmniVision 5693 sensors"); MODULE_LICENSE("GPL");