All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add a property to tell camera sensor orientation, support it in smiapp
@ 2018-05-02 21:31 Sakari Ailus
  2018-05-02 21:31 ` [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation Sakari Ailus
  2018-05-02 21:31 ` [PATCH 2/2] smiapp: Support the "upside-down" property Sakari Ailus
  0 siblings, 2 replies; 5+ messages in thread
From: Sakari Ailus @ 2018-05-02 21:31 UTC (permalink / raw)
  To: linux-media; +Cc: devicetree, andy.yeh

Hi,

The two patches add an "upside-down" property to the video bindings and
support for the property in the smiapp driver.

Sakari Ailus (2):
  dt-bindings: media: Add "upside-down" property to tell sensor
    orientation
  smiapp: Support the "upside-down" property

 Documentation/devicetree/bindings/media/i2c/nokia,smia.txt   | 2 ++
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 drivers/media/i2c/smiapp/smiapp-core.c                       | 3 +++
 3 files changed, 8 insertions(+)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation
  2018-05-02 21:31 [PATCH 0/2] Add a property to tell camera sensor orientation, support it in smiapp Sakari Ailus
@ 2018-05-02 21:31 ` Sakari Ailus
  2018-05-03 15:26   ` Sebastian Reichel
  2018-05-02 21:31 ` [PATCH 2/2] smiapp: Support the "upside-down" property Sakari Ailus
  1 sibling, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2018-05-02 21:31 UTC (permalink / raw)
  To: linux-media; +Cc: devicetree, andy.yeh

Camera sensors are occasionally mounted upside down. In order to use such
a sensor without having to turn every image upside down separately, most
camera sensors support reversing the readout order by setting both
horizontal and vertical flipping.

This patch adds a boolean property to tell a sensor is mounted upside
down.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index 258b8dfddf48..2a3e4ec4ea27 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -85,6 +85,9 @@ Optional properties
 
 - lens-focus: A phandle to the node of the focus lens controller.
 
+- upside-down: The device, typically an image sensor, is mounted upside
+  down in the system.
+
 
 Optional endpoint properties
 ----------------------------
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] smiapp: Support the "upside-down" property
  2018-05-02 21:31 [PATCH 0/2] Add a property to tell camera sensor orientation, support it in smiapp Sakari Ailus
  2018-05-02 21:31 ` [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation Sakari Ailus
@ 2018-05-02 21:31 ` Sakari Ailus
  1 sibling, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2018-05-02 21:31 UTC (permalink / raw)
  To: linux-media; +Cc: devicetree, andy.yeh

Use the "upside-down" 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: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/devicetree/bindings/media/i2c/nokia,smia.txt | 2 ++
 drivers/media/i2c/smiapp/smiapp-core.c                     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/i2c/nokia,smia.txt b/Documentation/devicetree/bindings/media/i2c/nokia,smia.txt
index 33f10a94c381..c824cd7025b3 100644
--- a/Documentation/devicetree/bindings/media/i2c/nokia,smia.txt
+++ b/Documentation/devicetree/bindings/media/i2c/nokia,smia.txt
@@ -29,6 +29,8 @@ Optional properties
 - reset-gpios: XSHUTDOWN GPIO
 - flash-leds: See ../video-interfaces.txt
 - lens-focus: See ../video-interfaces.txt
+- upside-down: A boolean property. Tells that the sensor is mounted upside
+  down.
 
 
 Endpoint node mandatory properties
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 3b7ace395ee6..5bc91b5a5998 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2801,6 +2801,9 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
 
 	dev_dbg(dev, "lanes %u\n", hwcfg->lanes);
 
+	if (fwnode_property_read_bool(fwnode, "upside-down"))
+		hwcfg->module_board_orient = SMIAPP_MODULE_BOARD_ORIENT_180;
+
 	/* NVM size is not mandatory */
 	fwnode_property_read_u32(fwnode, "nokia,nvm-size", &hwcfg->nvm_size);
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation
  2018-05-02 21:31 ` [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation Sakari Ailus
@ 2018-05-03 15:26   ` Sebastian Reichel
  2018-05-03 15:35     ` Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Reichel @ 2018-05-03 15:26 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, devicetree, andy.yeh

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hi,

On Thu, May 03, 2018 at 12:31:14AM +0300, Sakari Ailus wrote:
> Camera sensors are occasionally mounted upside down. In order to use such
> a sensor without having to turn every image upside down separately, most
> camera sensors support reversing the readout order by setting both
> horizontal and vertical flipping.
> 
> This patch adds a boolean property to tell a sensor is mounted upside
> down.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

I think the DT binding should use a rotation property instead,
similar to the panel bindings:

Documentation/devicetree/bindings/display/panel/panel.txt

-- Sebastian

> ---
>  Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> index 258b8dfddf48..2a3e4ec4ea27 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -85,6 +85,9 @@ Optional properties
>  
>  - lens-focus: A phandle to the node of the focus lens controller.
>  
> +- upside-down: The device, typically an image sensor, is mounted upside
> +  down in the system.
> +
>  
>  Optional endpoint properties
>  ----------------------------
> -- 
> 2.11.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation
  2018-05-03 15:26   ` Sebastian Reichel
@ 2018-05-03 15:35     ` Sakari Ailus
  0 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2018-05-03 15:35 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-media, devicetree, andy.yeh

Hi Sebastian,

On Thu, May 03, 2018 at 05:26:59PM +0200, Sebastian Reichel wrote:
> Hi,
> 
> On Thu, May 03, 2018 at 12:31:14AM +0300, Sakari Ailus wrote:
> > Camera sensors are occasionally mounted upside down. In order to use such
> > a sensor without having to turn every image upside down separately, most
> > camera sensors support reversing the readout order by setting both
> > horizontal and vertical flipping.
> > 
> > This patch adds a boolean property to tell a sensor is mounted upside
> > down.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> I think the DT binding should use a rotation property instead,
> similar to the panel bindings:
> 
> Documentation/devicetree/bindings/display/panel/panel.txt

Good point. I was trying to find something relevant relating to e.g.
orientation but this one escaped me.

So... I'll abandon this patch, and use the "rotation" property instead.
I'll send v2 of the smiapp patch. I think I'll actually split that into
two, DT and driver changes.

-- 
Kind regards,

Sakari Ailus
sakari.ailus@linux.intel.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-03 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 21:31 [PATCH 0/2] Add a property to tell camera sensor orientation, support it in smiapp Sakari Ailus
2018-05-02 21:31 ` [PATCH 1/2] dt-bindings: media: Add "upside-down" property to tell sensor orientation Sakari Ailus
2018-05-03 15:26   ` Sebastian Reichel
2018-05-03 15:35     ` Sakari Ailus
2018-05-02 21:31 ` [PATCH 2/2] smiapp: Support the "upside-down" property Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.