Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1588621 > unrolled thread
| Started by | Martin Kaiser <martin@kaiser.cx> |
|---|---|
| First post | 2017-02-27 12:40 +0100 |
| Last post | 2017-02-28 22:40 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] video: fbdev: imxfb: support AUS mode Martin Kaiser <martin@kaiser.cx> - 2017-02-27 12:40 +0100
Re: [PATCH 1/2] video: fbdev: imxfb: support AUS mode Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2017-02-27 23:40 +0100
Re: [PATCH 1/2] video: fbdev: imxfb: support AUS mode Martin Kaiser <martin@kaiser.cx> - 2017-02-28 00:10 +0100
Re: [PATCH 1/2] video: fbdev: imxfb: support AUS mode Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-02-28 13:30 +0100
[PATCH v2] video: fbdev: imxfb: support AUS mode Martin Kaiser <martin@kaiser.cx> - 2017-02-28 22:40 +0100
| From | Martin Kaiser <martin@kaiser.cx> |
|---|---|
| Date | 2017-02-27 12:40 +0100 |
| Subject | [PATCH 1/2] video: fbdev: imxfb: support AUS mode |
| Message-ID | <tfrc6-4pq-5@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 Control Register's value depends on
the display mode.
Allow setting this register from the device tree. Make the device tree
node optional to keep the DT ABI stable. This register is available only
on imx21 and compatible chipsets.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/video/fbdev/imxfb.c | 19 +++++++++++++++++++
include/linux/platform_data/video-imxfb.h | 1 +
2 files changed, 20 insertions(+)
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 1b0faad..a05cad4 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -117,6 +117,8 @@
#define IMXFB_LSCR1_DEFAULT 0x00120300
+#define LCDC_LAUSCR 0x80
+
/* Used fb-mode. Can be set on kernel command line, therefore file-static. */
static const char *fb_mode;
@@ -158,6 +160,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 +425,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))
+ fbi->lauscr = imxfb_mode->lauscr;
/*
* Copy the RGB parameters for this display
@@ -638,6 +646,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;
}
@@ -707,6 +718,7 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
struct fb_videomode *of_mode = &imxfb_mode->mode;
u32 bpp;
u32 pcr;
+ u32 lauscr;
ret = of_property_read_string(np, "model", &of_mode->name);
if (ret)
@@ -734,6 +746,13 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
imxfb_mode->bpp = bpp;
imxfb_mode->pcr = pcr;
+ /*
+ * fsl,lauscr is optional
+ */
+ ret = of_property_read_u32(np, "fsl,lauscr", &lauscr);
+ if (ret == 0)
+ imxfb_mode->lauscr = lauscr;
+
return 0;
}
diff --git a/include/linux/platform_data/video-imxfb.h b/include/linux/platform_data/video-imxfb.h
index a5c0a71..fdd2d4c 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;
+ u32 lauscr;
unsigned char bpp;
};
--
2.1.4
[toc] | [next] | [standalone]
| From | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
|---|---|
| Date | 2017-02-27 23:40 +0100 |
| Message-ID | <tfC7w-3G2-21@gated-at.bofh.it> |
| In reply to | #1588621 |
Hello, given fbdev is orphaned (http://git.kernel.org/linus/238600783d7470bec19350b0ee79e01825d3c84f) I think it would be nice to move the imxfb driver over to drm. I don't know much about drm, so I cannot say if that is easy or not, but long term I think this is more robust than fbdev. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
[toc] | [prev] | [next] | [standalone]
| From | Martin Kaiser <martin@kaiser.cx> |
|---|---|
| Date | 2017-02-28 00:10 +0100 |
| Message-ID | <tfCAy-47Y-13@gated-at.bofh.it> |
| In reply to | #1589004 |
Hello Uwe, Thus wrote Uwe Kleine-König (u.kleine-koenig@pengutronix.de): > given fbdev is orphaned > (http://git.kernel.org/linus/238600783d7470bec19350b0ee79e01825d3c84f) fbdev is no longer orphaned, Bartlomiej is the new maintainer. > I think it would be nice to move the imxfb driver over to drm. > I don't know much about drm, so I cannot say if that is easy or not, but > long term I think this is more robust than fbdev. I am aware that fbdev is in maintenance mode. However, I hope that small modifications like the one I submitted are still possible. In the long run, I agree that we should move imxfb to drm. Best regards, Martin
[toc] | [prev] | [next] | [standalone]
| From | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> |
|---|---|
| Date | 2017-02-28 13:30 +0100 |
| Message-ID | <tfP4J-4lm-1@gated-at.bofh.it> |
| In reply to | #1589037 |
Hi, On Monday, February 27, 2017 11:33:36 PM Martin Kaiser wrote: > Hello Uwe, > > Thus wrote Uwe Kleine-König (u.kleine-koenig@pengutronix.de): > > > given fbdev is orphaned > > (http://git.kernel.org/linus/238600783d7470bec19350b0ee79e01825d3c84f) > > fbdev is no longer orphaned, Bartlomiej is the new maintainer. > > > I think it would be nice to move the imxfb driver over to drm. > > I don't know much about drm, so I cannot say if that is easy or not, but > > long term I think this is more robust than fbdev. > > I am aware that fbdev is in maintenance mode. However, I hope that small > modifications like the one I submitted are still possible. Yes, such changes are fine. BTW Please merge both patches into one or at least make Cc: list complete so people can see the whole context easily (i.e. I didn't get patch #2 in my patches folder and Rob didn't get patch #1). > In the long run, I agree that we should move imxfb to drm. > > Best regards, > Martin Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics
[toc] | [prev] | [next] | [standalone]
| From | Martin Kaiser <martin@kaiser.cx> |
|---|---|
| Date | 2017-02-28 22:40 +0100 |
| Subject | [PATCH v2] video: fbdev: imxfb: support AUS mode |
| Message-ID | <tfXF0-1ys-15@gated-at.bofh.it> |
| In reply to | #1588621 |
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 Control Register's value depends on
the display mode.
Allow setting this register from the device tree. Make the device tree
node optional to keep the DT ABI stable. This register is available only
on imx21 and compatible chipsets. Update the device tree bindings with
this info.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
re-sending DT bindings and code changes as one patch
.../devicetree/bindings/display/imx/fsl,imx-fb.txt | 2 ++
drivers/video/fbdev/imxfb.c | 19 +++++++++++++++++++
include/linux/platform_data/video-imxfb.h | 1 +
3 files changed, 22 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..bd5077f 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,lauscr: LCDC AUS Mode Control Register value (only for imx21)
Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 1b0faad..a05cad4 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -117,6 +117,8 @@
#define IMXFB_LSCR1_DEFAULT 0x00120300
+#define LCDC_LAUSCR 0x80
+
/* Used fb-mode. Can be set on kernel command line, therefore file-static. */
static const char *fb_mode;
@@ -158,6 +160,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 +425,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))
+ fbi->lauscr = imxfb_mode->lauscr;
/*
* Copy the RGB parameters for this display
@@ -638,6 +646,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;
}
@@ -707,6 +718,7 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
struct fb_videomode *of_mode = &imxfb_mode->mode;
u32 bpp;
u32 pcr;
+ u32 lauscr;
ret = of_property_read_string(np, "model", &of_mode->name);
if (ret)
@@ -734,6 +746,13 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
imxfb_mode->bpp = bpp;
imxfb_mode->pcr = pcr;
+ /*
+ * fsl,lauscr is optional
+ */
+ ret = of_property_read_u32(np, "fsl,lauscr", &lauscr);
+ if (ret == 0)
+ imxfb_mode->lauscr = lauscr;
+
return 0;
}
diff --git a/include/linux/platform_data/video-imxfb.h b/include/linux/platform_data/video-imxfb.h
index a5c0a71..fdd2d4c 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;
+ u32 lauscr;
unsigned char bpp;
};
--
2.1.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web