Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17121d12 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

media: imx258: Check the rotation property has a value of 180



The driver only supports streaming images flipped horizontally and
vertically. In order to ensure that all current users will be fine if or
when support for upright streaming is added, require the presence of the
"rotation" control now.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: default avatar"Lai, Jim" <jim.lai@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 7daf201d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1221,6 +1221,14 @@ static int imx258_probe(struct i2c_client *client)
	if (val != 19200000)
		return -EINVAL;

	/*
	 * Check that the device is mounted upside down. The driver only
	 * supports a single pixel order right now.
	 */
	ret = device_property_read_u32(&client->dev, "rotation", &val);
	if (ret || val != 180)
		return -EINVAL;

	imx258 = devm_kzalloc(&client->dev, sizeof(*imx258), GFP_KERNEL);
	if (!imx258)
		return -ENOMEM;