Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drivers/media/i2c/ov5693.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = -1;

struct ov5693_device {
struct device *dev;
struct regmap *regmap;
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -1127,6 +1130,12 @@ static int ov5693_init_controls(struct ov5693_device *ov5693)
OV5693_DIGITAL_GAIN_STEP,
OV5693_DIGITAL_GAIN_DEF);

/* Set rotation if explicitly set via param */
if (!(sensor_default_rotation % 90) && sensor_default_rotation <= 270) {
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);
Expand Down Expand Up @@ -1418,6 +1427,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");