aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/imx258.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-05-23 05:33:32 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-06-27 09:49:11 -0400
commit17121d12a5c1089bdfce429bc6f7ae2c25d9d25d (patch)
treee9df50769474980c8700f418bca631a7cf5573cf /drivers/media/i2c/imx258.c
parentLinux 4.18-rc2 (diff)
downloadlinux-dev-17121d12a5c1089bdfce429bc6f7ae2c25d9d25d.tar.xz
linux-dev-17121d12a5c1089bdfce429bc6f7ae2c25d9d25d.zip
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: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: "Lai, Jim" <jim.lai@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c/imx258.c')
-rw-r--r--drivers/media/i2c/imx258.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
index f3b124723aa0..31a1e2294843 100644
--- a/drivers/media/i2c/imx258.c
+++ b/drivers/media/i2c/imx258.c
@@ -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;