提交 5f9e711b 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

media: smiapp: Support the "rotation" property

Use the "rotation" property to tell that the sensor is mounted upside
down. This reverses the behaviour of the VFLIP and HFLIP controls as well
as the pixel order.
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 691faafa
...@@ -2764,6 +2764,7 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) ...@@ -2764,6 +2764,7 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
struct v4l2_fwnode_endpoint *bus_cfg; struct v4l2_fwnode_endpoint *bus_cfg;
struct fwnode_handle *ep; struct fwnode_handle *ep;
struct fwnode_handle *fwnode = dev_fwnode(dev); struct fwnode_handle *fwnode = dev_fwnode(dev);
u32 rotation;
int i; int i;
int rval; int rval;
...@@ -2800,6 +2801,21 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) ...@@ -2800,6 +2801,21 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
dev_dbg(dev, "lanes %u\n", hwcfg->lanes); dev_dbg(dev, "lanes %u\n", hwcfg->lanes);
rval = fwnode_property_read_u32(fwnode, "rotation", &rotation);
if (!rval) {
switch (rotation) {
case 180:
hwcfg->module_board_orient =
SMIAPP_MODULE_BOARD_ORIENT_180;
/* Fall through */
case 0:
break;
default:
dev_err(dev, "invalid rotation %u\n", rotation);
goto out_err;
}
}
/* NVM size is not mandatory */ /* NVM size is not mandatory */
fwnode_property_read_u32(fwnode, "nokia,nvm-size", &hwcfg->nvm_size); fwnode_property_read_u32(fwnode, "nokia,nvm-size", &hwcfg->nvm_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册