Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628118 > unrolled thread

[PATCH 1/2 v4] video: fbdev: imxfb: support AUS mode

Started byMartin Kaiser <martin@kaiser.cx>
First post2017-04-21 12:40 +0200
Last post2017-04-21 17:30 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2 v4] video: fbdev: imxfb: support AUS mode Martin Kaiser <martin@kaiser.cx> - 2017-04-21 12:40 +0200
    [PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode Martin Kaiser <martin@kaiser.cx> - 2017-04-21 14:40 +0200
      Re: [PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-04-21 20:30 +0200
    Re: [PATCH 1/2 v4] video: fbdev: imxfb: support AUS mode Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-04-21 17:30 +0200

#1628118 — [PATCH 1/2 v4] video: fbdev: imxfb: support AUS mode

FromMartin Kaiser <martin@kaiser.cx>
Date2017-04-21 12:40 +0200
Subject[PATCH 1/2 v4] video: fbdev: imxfb: support AUS mode
Message-ID<tyE8N-4Ha-13@gated-at.bofh.it>
Some displays require setting AUS mode in the LDCD AUS Mode Control
Register to work with the imxfb driver. Like the value of the Panel
Configuration Register, the AUS mode setting depends on the display
mode.

Allow setting AUS mode from the device tree by adding a boolean
property. Make this property optional to keep the DT ABI stable.
AUS mode can be set only on imx21 and compatible chipsets.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v4:
   rename the DT property to fsl,aus-mode

v3:
   use a boolean DT property instead of the register value
   separate patches for DT binding and code changes

v2:
   re-sending DT bindings and code changes as one patch

 drivers/video/fbdev/imxfb.c               | 17 +++++++++++++++++
 include/linux/platform_data/video-imxfb.h |  1 +
 2 files changed, 18 insertions(+)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 1b0faad..c166e07 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -117,6 +117,9 @@
 
 #define IMXFB_LSCR1_DEFAULT 0x00120300
 
+#define LCDC_LAUSCR	0x80
+#define LAUSCR_AUS_MODE	(1<<31)
+
 /* Used fb-mode. Can be set on kernel command line, therefore file-static. */
 static const char *fb_mode;
 
@@ -158,6 +161,7 @@ struct imxfb_info {
 	dma_addr_t		dbar2;
 
 	u_int			pcr;
+	u_int			lauscr;
 	u_int			pwmr;
 	u_int			lscr1;
 	u_int			dmacr;
@@ -422,6 +426,11 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 	pcr |= imxfb_mode->pcr & ~(0x3f | (7 << 25));
 
 	fbi->pcr = pcr;
+	/*
+	 * The LCDC AUS Mode Control Register does not exist on imx1.
+	 */
+	if (!is_imx1_fb(fbi) && imxfb_mode->aus_mode)
+		fbi->lauscr = LAUSCR_AUS_MODE;
 
 	/*
 	 * Copy the RGB parameters for this display
@@ -638,6 +647,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
 	if (fbi->dmacr)
 		writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
 
+	if (fbi->lauscr)
+		writel(fbi->lauscr, fbi->regs + LCDC_LAUSCR);
+
 	return 0;
 }
 
@@ -734,6 +746,11 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
 	imxfb_mode->bpp = bpp;
 	imxfb_mode->pcr = pcr;
 
+	/*
+	 * fsl,aus-mode is optional
+	 */
+	imxfb_mode->aus_mode = of_property_read_bool(np, "fsl,aus-mode");
+
 	return 0;
 }
 
diff --git a/include/linux/platform_data/video-imxfb.h b/include/linux/platform_data/video-imxfb.h
index a5c0a71..cf9348b 100644
--- a/include/linux/platform_data/video-imxfb.h
+++ b/include/linux/platform_data/video-imxfb.h
@@ -50,6 +50,7 @@
 struct imx_fb_videomode {
 	struct fb_videomode mode;
 	u32 pcr;
+	bool aus_mode;
 	unsigned char	bpp;
 };
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1628205 — [PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode

FromMartin Kaiser <martin@kaiser.cx>
Date2017-04-21 14:40 +0200
Subject[PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode
Message-ID<tyG0V-5O5-5@gated-at.bofh.it>
In reply to#1628118
Allow setting AUS mode for a display from the device tree. Use an
optional boolean property. AUS mode can be set only on imx21 and
compatible chipsets.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Rob Herring <robh@kernel.org>
---
sending this again, I missed the v4 in the Subject line

v4:
   rename the DT property to fsl,aus-mode

v3:
   use a boolean DT property instead of the register value
   separate patches for DT binding and code changes

v2:
   re-sending DT bindings and code changes as one patch

 Documentation/devicetree/bindings/display/imx/fsl,imx-fb.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx-fb.txt b/Documentation/devicetree/bindings/display/imx/fsl,imx-fb.txt
index 7a5c0e2..e5a8b36 100644
--- a/Documentation/devicetree/bindings/display/imx/fsl,imx-fb.txt
+++ b/Documentation/devicetree/bindings/display/imx/fsl,imx-fb.txt
@@ -13,6 +13,8 @@ Required nodes:
 	Additional, the display node has to define properties:
 	- bits-per-pixel: Bits per pixel
 	- fsl,pcr: LCDC PCR value
+	A display node may optionally define
+	- fsl,aus-mode: boolean to enable AUS mode (only for imx21)
 
 Optional properties:
 - lcd-supply: Regulator for LCD supply voltage.
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1628448 — Re: [PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode

FromBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date2017-04-21 20:30 +0200
SubjectRe: [PATCH 2/2 v4] dt-bindings: display: imx: entry for AUS mode
Message-ID<tyLtG-Ix-61@gated-at.bofh.it>
In reply to#1628205
On Friday, April 21, 2017 02:29:50 PM Martin Kaiser wrote:
> Allow setting AUS mode for a display from the device tree. Use an
> optional boolean property. AUS mode can be set only on imx21 and
> compatible chipsets.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> Acked-by: Rob Herring <robh@kernel.org>

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

[toc] | [prev] | [next] | [standalone]


#1628360

FromBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date2017-04-21 17:30 +0200
Message-ID<tyIFt-7rg-27@gated-at.bofh.it>
In reply to#1628118
On Friday, April 21, 2017 12:29:08 PM Martin Kaiser wrote:
> Some displays require setting AUS mode in the LDCD AUS Mode Control
> Register to work with the imxfb driver. Like the value of the Panel
> Configuration Register, the AUS mode setting depends on the display
> mode.
> 
> Allow setting AUS mode from the device tree by adding a boolean
> property. Make this property optional to keep the DT ABI stable.
> AUS mode can be set only on imx21 and compatible chipsets.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web