* [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver
@ 2013-07-31 1:38 Hyungwon Hwang
2013-07-31 6:03 ` Heiko Schocher
0 siblings, 1 reply; 5+ messages in thread
From: Hyungwon Hwang @ 2013-07-31 1:38 UTC (permalink / raw)
To: u-boot
This is u-boot driver for L5F31188 panel.
I've tested it in the board based on MIPI DSI with EXYNOS4 series, and it worked well.
Thanks,
Hyungwon Hwang
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Donghwa Lee <dw09.lee@samsung.com>
---
drivers/video/Makefile | 1 +
drivers/video/l5f31188.c | 201 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 202 insertions(+)
create mode 100644 drivers/video/l5f31188.c
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 68ff34b..997d041 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
COBJS-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o
COBJS-$(CONFIG_PXA_LCD) += pxa_lcd.o
COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
+COBJS-$(CONFIG_L5F31188) += l5f31188.o
COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
COBJS-$(CONFIG_LD9040) += ld9040.o
COBJS-$(CONFIG_SED156X) += sed156x.o
diff --git a/drivers/video/l5f31188.c b/drivers/video/l5f31188.c
new file mode 100644
index 0000000..a13be0b
--- /dev/null
+++ b/drivers/video/l5f31188.c
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ * Hyungwon Hwang <human.hwang@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <asm/arch/mipi_dsim.h>
+
+#define SCAN_FROM_LEFT_TO_RIGHT 0
+#define SCAN_FROM_RIGHT_TO_LEFT 1
+#define SCAN_FROM_TOP_TO_BOTTOM 0
+#define SCAN_FROM_BOTTOM_TO_TOP 1
+
+static void l5f31188_sleep_in(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE, 0x10, 0x00);
+}
+
+static void l5f31188_sleep_out(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE, 0x11, 0x00);
+}
+
+static void l5f31188_set_gamma(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE, 0x26, 0x00);
+}
+
+static void l5f31188_display_off(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE, 0x28, 0x00);
+}
+
+static void l5f31188_display_on(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE, 0x29, 0x00);
+}
+
+static void l5f31188_ctl_memory_access(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops,
+ int h_direction, int v_direction)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x36,
+ (((h_direction & 0x1) << 1) | (v_direction & 0x1)));
+}
+
+static void l5f31188_set_pixel_format(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x3A, 0x70);
+}
+
+static void l5f31188_write_disbv(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops, unsigned int brightness)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x51, brightness);
+}
+
+static void l5f31188_write_ctrld(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x53, 0x2C);
+}
+
+static void l5f31188_write_cabc(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops,
+ unsigned int wm_mode)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x55, wm_mode);
+}
+
+static void l5f31188_write_cabcmb(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops, unsigned int min_brightness)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0x5E,
+ min_brightness);
+}
+
+static void l5f31188_set_extension(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ const unsigned char data_to_send[] = {
+ 0xB9, 0xFF, 0x83, 0x94
+ };
+
+ ops->cmd_write(dev, MIPI_DSI_DCS_LONG_WRITE,
+ (unsigned int)data_to_send, ARRAY_SIZE(data_to_send));
+}
+
+static void l5f31188_set_dgc_lut(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ const unsigned char data_to_send[] = {
+ 0xC1, 0x01, 0x00, 0x04, 0x0E, 0x18, 0x1E, 0x26,
+ 0x2F, 0x36, 0x3E, 0x47, 0x4E, 0x56, 0x5D, 0x65,
+ 0x6D, 0x75, 0x7D, 0x84, 0x8C, 0x94, 0x9C, 0xA4,
+ 0xAD, 0xB5, 0xBD, 0xC5, 0xCC, 0xD4, 0xDE, 0xE5,
+ 0xEE, 0xF7, 0xFF, 0x3F, 0x9A, 0xCE, 0xD4, 0x21,
+ 0xA1, 0x26, 0x54, 0x00, 0x00, 0x04, 0x0E, 0x19,
+ 0x1F, 0x27, 0x30, 0x37, 0x40, 0x48, 0x50, 0x58,
+ 0x60, 0x67, 0x6F, 0x77, 0x7F, 0x87, 0x8F, 0x97,
+ 0x9F, 0xA7, 0xB0, 0xB8, 0xC0, 0xC8, 0xCE, 0xD8,
+ 0xE0, 0xE7, 0xF0, 0xF7, 0xFF, 0x3C, 0xEB, 0xFD,
+ 0x2F, 0x66, 0xA8, 0x2C, 0x46, 0x00, 0x00, 0x04,
+ 0x0E, 0x18, 0x1E, 0x26, 0x30, 0x38, 0x41, 0x4A,
+ 0x52, 0x5A, 0x62, 0x6B, 0x73, 0x7B, 0x83, 0x8C,
+ 0x94, 0x9C, 0xA5, 0xAD, 0xB6, 0xBD, 0xC5, 0xCC,
+ 0xD4, 0xDD, 0xE3, 0xEB, 0xF2, 0xF9, 0xFF, 0x3F,
+ 0xA4, 0x8A, 0x8F, 0xC7, 0x33, 0xF5, 0xE9, 0x00
+ };
+ ops->cmd_write(dev, MIPI_DSI_DCS_LONG_WRITE,
+ (unsigned int)data_to_send, ARRAY_SIZE(data_to_send));
+}
+
+static void l5f31188_set_tcon(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ const unsigned char data_to_send[] = {
+ 0xC7, 0x00, 0x20
+ };
+ ops->cmd_write(dev, MIPI_DSI_DCS_LONG_WRITE,
+ (unsigned int)data_to_send, ARRAY_SIZE(data_to_send));
+}
+
+static void l5f31188_set_ptba(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ const unsigned char data_to_send[] = {
+ 0xBF, 0x06, 0x10
+ };
+ ops->cmd_write(dev, MIPI_DSI_DCS_LONG_WRITE,
+ (unsigned int)data_to_send, ARRAY_SIZE(data_to_send));
+}
+
+static void l5f31188_set_eco(struct mipi_dsim_device *dev,
+ struct mipi_dsim_master_ops *ops)
+{
+ ops->cmd_write(dev, MIPI_DSI_DCS_SHORT_WRITE_PARAM, 0xC6, 0x0C);
+}
+
+static int l5f31188_panel_init(struct mipi_dsim_device *dev)
+{
+ struct mipi_dsim_master_ops *ops = dev->master_ops;
+
+ l5f31188_set_extension(dev, ops);
+ l5f31188_set_dgc_lut(dev, ops);
+
+ l5f31188_set_eco(dev, ops);
+ l5f31188_set_tcon(dev, ops);
+ l5f31188_set_ptba(dev, ops);
+ l5f31188_set_gamma(dev, ops);
+ l5f31188_ctl_memory_access(dev, ops,
+ SCAN_FROM_LEFT_TO_RIGHT, SCAN_FROM_TOP_TO_BOTTOM);
+ l5f31188_set_pixel_format(dev, ops);
+ l5f31188_write_disbv(dev, ops, 0xFF);
+ l5f31188_write_ctrld(dev, ops);
+ l5f31188_write_cabc(dev, ops, 0x0);
+ l5f31188_write_cabcmb(dev, ops, 0x0);
+
+ l5f31188_sleep_out(dev, ops);
+
+ /* 120 msec */
+ udelay(120 * 1000);
+
+ return 0;
+}
+
+static void l5f31188_display_enable(struct mipi_dsim_device *dev)
+{
+ struct mipi_dsim_master_ops *ops = dev->master_ops;
+ l5f31188_display_on(dev, ops);
+}
+
+static struct mipi_dsim_lcd_driver l5f31188_dsim_ddi_driver = {
+ .name = "l5f31188",
+ .id = -1,
+
+ .mipi_panel_init = l5f31188_panel_init,
+ .mipi_display_on = l5f31188_display_enable,
+};
+
+void l5f31188_init(void)
+{
+ exynos_mipi_dsi_register_lcd_driver(&l5f31188_dsim_ddi_driver);
+}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver
2013-07-31 1:38 [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver Hyungwon Hwang
@ 2013-07-31 6:03 ` Heiko Schocher
2013-07-31 8:25 ` Hyungwon Hwang
0 siblings, 1 reply; 5+ messages in thread
From: Heiko Schocher @ 2013-07-31 6:03 UTC (permalink / raw)
To: u-boot
Hello Hyungwon
Am 31.07.2013 03:38, schrieb Hyungwon Hwang:
> This is u-boot driver for L5F31188 panel.
>
> I've tested it in the board based on MIPI DSI with EXYNOS4 series, and it worked well.
>
> Thanks,
> Hyungwon Hwang
>
> Signed-off-by: Hyungwon Hwang<human.hwang@samsung.com>
> Signed-off-by: Donghwa Lee<dw09.lee@samsung.com>
> ---
> drivers/video/Makefile | 1 +
> drivers/video/l5f31188.c | 201 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 202 insertions(+)
> create mode 100644 drivers/video/l5f31188.c
>
> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> index 68ff34b..997d041 100644
> --- a/drivers/video/Makefile
> +++ b/drivers/video/Makefile
> @@ -38,6 +38,7 @@ COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
> COBJS-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o
> COBJS-$(CONFIG_PXA_LCD) += pxa_lcd.o
> COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
> +COBJS-$(CONFIG_L5F31188) += l5f31188.o
> COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
> COBJS-$(CONFIG_LD9040) += ld9040.o
> COBJS-$(CONFIG_SED156X) += sed156x.o
> diff --git a/drivers/video/l5f31188.c b/drivers/video/l5f31188.c
> new file mode 100644
> index 0000000..a13be0b
> --- /dev/null
> +++ b/drivers/video/l5f31188.c
> @@ -0,0 +1,201 @@
> +/*
> + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
> + * Hyungwon Hwang<human.hwang@samsung.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
Please use for new files SPDX-License-Identifier, thanks.
> + *
> + */
> +
> +#include<common.h>
> +#include<asm/arch/mipi_dsim.h>
> +
> +#define SCAN_FROM_LEFT_TO_RIGHT 0
> +#define SCAN_FROM_RIGHT_TO_LEFT 1
> +#define SCAN_FROM_TOP_TO_BOTTOM 0
> +#define SCAN_FROM_BOTTOM_TO_TOP 1
[...]
> +static void l5f31188_display_enable(struct mipi_dsim_device *dev)
> +{
> + struct mipi_dsim_master_ops *ops = dev->master_ops;
> + l5f31188_display_on(dev, ops);
> +}
empty function?
> +
> +static struct mipi_dsim_lcd_driver l5f31188_dsim_ddi_driver = {
> + .name = "l5f31188",
> + .id = -1,
> +
> + .mipi_panel_init = l5f31188_panel_init,
> + .mipi_display_on = l5f31188_display_enable,
> +};
> +
> +void l5f31188_init(void)
> +{
> + exynos_mipi_dsi_register_lcd_driver(&l5f31188_dsim_ddi_driver);
> +}
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver
2013-07-31 6:03 ` Heiko Schocher
@ 2013-07-31 8:25 ` Hyungwon Hwang
2013-07-31 10:26 ` Minkyu Kang
0 siblings, 1 reply; 5+ messages in thread
From: Hyungwon Hwang @ 2013-07-31 8:25 UTC (permalink / raw)
To: u-boot
Hello, Heiko.
I think that function l5f31188_display_enable() is needed to wrap up function l5f31188_display_on().
Function l5f31188_display_enable() is used as an interface to external side, especially to MIPI DSI driver. But function l5f31188_display_on() is used as an internal function in this driver.
Moreover, because they have different input argument types, it cannot be simply replacable.
Thank you for your reply.
Best regards,
Hyungwon Hwang
On Wed, 31 Jul 2013 08:03:28 +0200
Heiko Schocher <hs@denx.de> wrote:
> Hello Hyungwon
>
> Am 31.07.2013 03:38, schrieb Hyungwon Hwang:
> > This is u-boot driver for L5F31188 panel.
> >
> > I've tested it in the board based on MIPI DSI with EXYNOS4 series,
> > and it worked well.
> >
> > Thanks,
> > Hyungwon Hwang
> >
> > Signed-off-by: Hyungwon Hwang<human.hwang@samsung.com>
> > Signed-off-by: Donghwa Lee<dw09.lee@samsung.com>
> > ---
> > drivers/video/Makefile | 1 +
> > drivers/video/l5f31188.c | 201
> > ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 202
> > insertions(+) create mode 100644 drivers/video/l5f31188.c
> >
> > diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> > index 68ff34b..997d041 100644
> > --- a/drivers/video/Makefile
> > +++ b/drivers/video/Makefile
> > @@ -38,6 +38,7 @@ COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o
> > videomodes.o COBJS-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o
> > COBJS-$(CONFIG_PXA_LCD) += pxa_lcd.o
> > COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
> > +COBJS-$(CONFIG_L5F31188) += l5f31188.o
> > COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
> > COBJS-$(CONFIG_LD9040) += ld9040.o
> > COBJS-$(CONFIG_SED156X) += sed156x.o
> > diff --git a/drivers/video/l5f31188.c b/drivers/video/l5f31188.c
> > new file mode 100644
> > index 0000000..a13be0b
> > --- /dev/null
> > +++ b/drivers/video/l5f31188.c
> > @@ -0,0 +1,201 @@
> > +/*
> > + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights
> > reserved.
> > + * Hyungwon Hwang<human.hwang@samsung.com>
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
>
> Please use for new files SPDX-License-Identifier, thanks.
>
> > + *
> > + */
> > +
> > +#include<common.h>
> > +#include<asm/arch/mipi_dsim.h>
> > +
> > +#define SCAN_FROM_LEFT_TO_RIGHT 0
> > +#define SCAN_FROM_RIGHT_TO_LEFT 1
> > +#define SCAN_FROM_TOP_TO_BOTTOM 0
> > +#define SCAN_FROM_BOTTOM_TO_TOP 1
> [...]
> > +static void l5f31188_display_enable(struct mipi_dsim_device *dev)
> > +{
> > + struct mipi_dsim_master_ops *ops = dev->master_ops;
> > + l5f31188_display_on(dev, ops);
> > +}
>
> empty function?
>
> > +
> > +static struct mipi_dsim_lcd_driver l5f31188_dsim_ddi_driver = {
> > + .name = "l5f31188",
> > + .id = -1,
> > +
> > + .mipi_panel_init = l5f31188_panel_init,
> > + .mipi_display_on = l5f31188_display_enable,
> > +};
> > +
> > +void l5f31188_init(void)
> > +{
> > +
> > exynos_mipi_dsi_register_lcd_driver(&l5f31188_dsim_ddi_driver); +}
>
> bye,
> Heiko
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver
2013-07-31 8:25 ` Hyungwon Hwang
@ 2013-07-31 10:26 ` Minkyu Kang
2013-08-01 1:45 ` Hyungwon Hwang
0 siblings, 1 reply; 5+ messages in thread
From: Minkyu Kang @ 2013-07-31 10:26 UTC (permalink / raw)
To: u-boot
Dear Hyungwon Hwang.
On 31/07/13 17:25, Hyungwon Hwang wrote:
> Hello, Heiko.
>
> I think that function l5f31188_display_enable() is needed to wrap up function l5f31188_display_on().
>
> Function l5f31188_display_enable() is used as an interface to external side, especially to MIPI DSI driver. But function l5f31188_display_on() is used as an internal function in this driver.
>
> Moreover, because they have different input argument types, it cannot be simply replacable.
>
> Thank you for your reply.
please don't top posting.
I think you need this link.
(http://www.denx.de/wiki/U-Boot/Patches)
please read it carefully.
welcome to join us.
Thanks,
Minkyu Kang.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver
2013-07-31 10:26 ` Minkyu Kang
@ 2013-08-01 1:45 ` Hyungwon Hwang
0 siblings, 0 replies; 5+ messages in thread
From: Hyungwon Hwang @ 2013-08-01 1:45 UTC (permalink / raw)
To: u-boot
To heiko and minkyu,
I'm very sorry. It was my first time to contribute my code to open-source community, and it was my mistake not to be familiar with the convention in this community. I read the article in the link which minkyu sent me. It was very helpful. Thank you.
I'll be more careful next time. I wanna say thank you for our replies from all of you, again.
Sincerely,
Hyungwon Hwang
On Wed, 31 Jul 2013 19:26:04 +0900
Minkyu Kang <mk7.kang@samsung.com> wrote:
> Dear Hyungwon Hwang.
>
> On 31/07/13 17:25, Hyungwon Hwang wrote:
> > Hello, Heiko.
> >
> > I think that function l5f31188_display_enable() is needed to wrap
> > up function l5f31188_display_on().
> >
> > Function l5f31188_display_enable() is used as an interface to
> > external side, especially to MIPI DSI driver. But function
> > l5f31188_display_on() is used as an internal function in this
> > driver.
> >
> > Moreover, because they have different input argument types, it
> > cannot be simply replacable.
> >
> > Thank you for your reply.
>
> please don't top posting.
> I think you need this link.
> (http://www.denx.de/wiki/U-Boot/Patches)
> please read it carefully.
>
> welcome to join us.
>
> Thanks,
> Minkyu Kang.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-01 1:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 1:38 [U-Boot] [PATCH] video: add L5F31188 TFT-LCD panel driver Hyungwon Hwang
2013-07-31 6:03 ` Heiko Schocher
2013-07-31 8:25 ` Hyungwon Hwang
2013-07-31 10:26 ` Minkyu Kang
2013-08-01 1:45 ` Hyungwon Hwang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox