* [PATCH V6 0/4] Generic PHY driver for the Exynos SoC DP PHY
From: Jingoo Han @ 2013-07-09 8:03 UTC (permalink / raw)
To: linux-arm-kernel
This patch series adds a simple driver for the Samsung Exynos SoC
series DP transmitter PHY, using the generic PHY framework [1].
Previously the DP PHY used an internal DT node to control the PHY
power enable bit.
These patches was tested on Exynos5250.
This PATCH v6 follows:
* PATCH v5, sent on July, 8th 2013
* PATCH v4, sent on July, 2nd 2013
* PATCH v3, sent on July, 1st 2013
* PATCH v2, sent on June, 28th 2013
* PATCH v1, sent on June, 28th 2013
Changes between v5 and v6:
* Re-based on git://gitorious.org/linuxphy/linuxphy.git
Changes between v4 and v5:
* Marked original bindings as deprecated in 'exynos_dp.txt'
* Fixed typo of commit message.
* Added Tomasz Figa's Reviewed-by.
Changes between v3 and v4:
* Added OF dependancy.
* Removed redundant local variable 'void __iomem *addr'.
* Removed unnecessary dev_set_drvdata().
* Added a patch that remove non-DT support for Exynos
Display Port driver.
* Removed unnecessary 'struct exynos_dp_platdata'.
* Kept supporting the original bindings for DT compatibility.
Changes between v2 and v3:
* Removed redundant spinlock
* Removed 'struct phy' from 'struct exynos_dp_video_phy'
* Updated 'samsung-phy.txt', instead of creating
'samsung,exynos5250-dp-video-phy.txt'.
* Removed unnecessary additional specifier from 'phys'
DT property.
* Added 'phys', 'phy-names' properties to 'exynos_dp.txt' file.
* Added Felipe Balbi's Acked-by.
Changes between v1 and v2:
* Replaced exynos_dp_video_phy_xlate() with of_phy_simple_xlate(),
as Kishon Vijay Abraham I guided.
* Set the value of phy-cells as 0, because the phy_provider implements
only one PHY.
* Removed unnecessary header include.
* Added '#ifdef CONFIG_OF' and of_match_ptr macro.
This series depends on the generic PHY framework [1]. These patches
refer to Sylwester Nawrocki's patches about Exynos MIPI [2].
[1] https://lkml.org/lkml/2013/6/26/259
[2] http://www.spinics.net/lists/linux-samsung-soc/msg20098.html
Jingoo Han (4):
ARM: dts: Add DP PHY node to exynos5250.dtsi
phy: Add driver for Exynos DP PHY
video: exynos_dp: remove non-DT support for Exynos Display Port
video: exynos_dp: Use the generic PHY driver
.../devicetree/bindings/phy/samsung-phy.txt | 8 ++
.../devicetree/bindings/video/exynos_dp.txt | 18 +++++++++---------
arch/arm/boot/dts/exynos5250.dtsi | 13 ++++++++-----
drivers/phy/Kconfig | 6 ++
drivers/phy/Makefile | 1 +
drivers/phy/phy-exynos-dp-video.c | 111 ++++++++++++++++++++
drivers/video/exynos/Kconfig | 2 +-
drivers/video/exynos/exynos_dp_core.c | 132 +++++++----------------------
drivers/video/exynos/exynos_dp_core.h | 110 +++++++++++++++++++++++++++
drivers/video/exynos/exynos_dp_reg.c | 2 -
include/video/exynos_dp.h | 131 ---------------------------------
11 files changed, 291 insertions(+), 243 deletions(-)
create mode 100644 drivers/phy/phy-exynos-dp-video.c
delete mode 100644 include/video/exynos_dp.h
--
1.7.10.4
^ permalink raw reply
* [PULL] fbdev changes for 3.11
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-08 8:52 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-fbdev, linux-kernel
Hi Linus,
Here is the first fbdev pull for 3.11
The following changes since commit 317ddd256b9c24b0d78fa8018f80f1e495481a10:
Linux 3.10-rc5 (2013-06-08 17:41:04 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/plagnioj/linux-fbdev.git tags/fbdev-for-3.11
for you to fetch changes up to 1b6c79361ba5ce30b40f0f7d6fc2421dc5fcbe0c:
video: imxfb: Add DT support (2013-07-08 16:36:49 +0800)
----------------------------------------------------------------
Various fbdev changes for 3.11
* xilinxfb updates
* Small cleanups and fixes to multiple drivers
* OMAP display subsystem bug updates
* imxfb dt support
----------------------------------------------------------------
Borislav Petkov (1):
uvesafb: Correct/simplify warning message
Dan Carpenter (1):
fbmem: return -EFAULT on copy_to_user() failure
Emil Goode (1):
OMAPDSS: Remove kfree for memory allocated with devm_kzalloc
Fabio Estevam (1):
video: of_display_timing.h: Declare 'display_timing'
Jean-Christophe PLAGNIOL-VILLARD (4):
Merge branch 'fbdev-3.11' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
Merge tag 'omapdss-for-3.11-1' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
Merge tag 'omapdss-for-3.11-2' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
Merge tag 'fbdev-3.11-2' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
Jing Xiang (2):
video: mmp: fix memcpy wrong size for mmp_addr issue
video: mmp: fix graphics/video layer enable/mask swap issue
Jingoo Han (2):
video: remove unnecessary platform_set_drvdata()
video: replace strict_strtoul() with kstrtoul()
Lars-Peter Clausen (1):
fbdev: bfin-lq035q1-fb: Use dev_pm_ops
Markus Pargmann (1):
video: imxfb: Add DT support
Maxime Ripard (4):
video: ssd1307fb: Add support for SSD1306 OLED controller
video: ssd1307fb: Rework the communication functions
video: ssd1307fb: Speed up the communication with the controller
video: ssd1307fb: Make use of horizontal addressing mode
Michal Simek (7):
video: xilinxfb: Fix OF probing on little-endian systems
video: xilinxfb: Do not name out_be32 in function name
video: xilinxfb: Rename PLB_ACCESS_FLAG to BUS_ACCESS_FLAG
video: xilinxfb: Use drvdata->regs_phys instead of physaddr
video: xilinxfb: Group bus initialization
video: xilinxfb: Add support for little endian accesses
video: xilinxfb: Use driver for Xilinx ARM Zynq
Randy Dunlap (2):
fb: fix atyfb build warning
fb: fix atyfb unused data warnings
Sachin Kamat (5):
video: smscufx: Use NULL instead of 0
video: udlfb: Use NULL instead of 0
video: udlfb: Make local symbol static
video: imxfb: Make local symbols static
video: i740fb: Make i740fb_init static
Sergey Kibrik (1):
OMAPDSS: gracefully disable overlay at error
Tomi Valkeinen (62):
videomode: don't allocate mem in of_get_display_timing()
videomode: implement public of_get_display_timing()
OMAPDSS: add pdata->default_display_name
OMAPDSS: only probe pdata if there's one
OMAPDSS: add omap_dss_find_output()
OMAPDSS: add omap_dss_find_output_by_node()
OMAPDSS: fix dss_get_ctx_loss_count for DT
OMAPDSS: clean up dss_[ovl|mgr]_get_device()
OMAPDSS: add helpers to get mgr or output from display
OMAPDSS: split overlay manager creation
OMAPDRM: fix overlay manager handling
OMAPDSS: Implement display (dis)connect support
OMAPDSS: CORE: use devm_regulator_get
OMAPDSS: DSI: cleanup regulator init
OMAPDSS: DPI: cleanup pll & regulator init
OMAPDSS: DPI: fix regulators for DT
OMAPDSS: HDMI: add hdmi_init_regulator
OMAPDSS: SDI: clean up regulator init
OMAPDSS: SDI: fix regulators for DT
OMAPDSS: VENC: clean up regulator init
OMAPDSS: add videomode conversion support
OMAPDSS: remove dssdev uses in trivial cases
OMAPDSS: add panel list
OMAPDSS: use the panel list in omap_dss_get_next_device
OMAPDSS: don't use dss bus in suspend/resume
OMAPDSS: implement display sysfs without dss bus
OMAPDSS: Add panel dev pointer to dssdev
OMAPDSS: remove omap_dss_start/stop_device()
OMAPDSS: combine omap_dss_output into omap_dss_device
OMAPDSS: omapdss.h: add owner field to omap_dss_device
OMAPDSS: add module_get/put to omap_dss_get/put_device()
OMAPDSS: add THIS_MODULE owner to DSS outputs
OMAPDSS: output: increase refcount in find_output funcs
OMAPFB: use EPROBE_DEFER if default display is not present
OMAPDSS: HDMI: clean up PHY power handling
OMAPDSS: HDMI clean up hpd_gpio
OMAPDSS: remove unused fields in omap_dss_device
OMAPDSS: remove dispc's dependency to VENC/HDMI
OMAPDSS: public omapdss_register_output()
OMAPDSS: modify get/find functions to go through the device chain
OMAPDSS: add OMAP_DISPLAY_TYPE_DVI
drm/omap: DVI connector fix
OMAPDSS: DPI: Add ops
OMAPDSS: SDI: Add ops
OMAPDSS: DVI: Add ops
OMAPDSS: AnalogTV: Add ops
OMAPDSS: HDMI: Add ops
OMAPDSS: DSI: Add ops
OMAPDSS: Add new TFP410 Encoder driver
OMAPDSS: Add new TPD12S015 Encoder driver
OMAPDSS: Add new DVI Connector driver
OMAPDSS: Add new HDMI Connector driver
OMAPDSS: Add new Analog TV Connector driver
OMAPDSS: Add new simple DPI panel driver
OMAPDSS: Add new DSI Command Mode panel driver
OMAPDSS: Add Sony ACX565AKM panel driver
OMAPDSS: Add LG.Philips LB035Q02 panel driver
OMAPDSS: Add Sharp LS037V7DW01 panel driver
OMAPDSS: Add TPO TD043MTEA1 panel driver
OMAPDSS: Add NEC NL8048HL11 panel driver
OMAPDSS: panels: add Kconfig comment
OMAPDSS: DPI: Fix wrong pixel clock limit
Vincent Stehlé (1):
fb: make fp_get_options name argument const
Wei Yongjun (1):
video: mxsfb: remove redundant dev_err call in mxsfb_probe()
Yijing Wang (2):
aty128fb: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
Documentation/devicetree/bindings/video/fsl,imx-fb.txt | 51 ++++++
Documentation/devicetree/bindings/video/ssd1307fb.txt | 10 +-
drivers/gpu/drm/omapdrm/omap_crtc.c | 46 +++++-
drivers/gpu/drm/omapdrm/omap_drv.c | 27 +++-
drivers/gpu/drm/omapdrm/omap_drv.h | 1 +
drivers/video/Kconfig | 4 +-
drivers/video/aty/aty128fb.c | 2 +-
drivers/video/aty/atyfb_base.c | 9 +-
drivers/video/aty/radeon_pm.c | 2 +-
drivers/video/au1100fb.c | 1 -
drivers/video/bf54x-lq043fb.c | 1 -
drivers/video/bfin-lq035q1-fb.c | 24 +--
drivers/video/bfin-t350mcqb-fb.c | 2 -
drivers/video/ep93xx-fb.c | 2 -
drivers/video/fbmem.c | 6 +-
drivers/video/fsl-diu-fb.c | 4 +-
drivers/video/i740fb.c | 2 +-
drivers/video/imxfb.c | 201 ++++++++++++++++++-----
drivers/video/jz4740_fb.c | 2 -
drivers/video/mmp/fb/mmpfb.c | 1 -
drivers/video/mmp/hw/mmp_ctrl.c | 9 +-
drivers/video/mxsfb.c | 3 -
drivers/video/nuc900fb.c | 1 -
drivers/video/of_display_timing.c | 55 +++++--
drivers/video/omap2/Kconfig | 1 +
drivers/video/omap2/Makefile | 1 +
drivers/video/omap2/displays-new/Kconfig | 73 +++++++++
drivers/video/omap2/displays-new/Makefile | 12 ++
drivers/video/omap2/displays-new/connector-analog-tv.c | 265 ++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/connector-dvi.c | 351 ++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/connector-hdmi.c | 375 ++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/encoder-tfp410.c | 267 ++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/encoder-tpd12s015.c | 395 +++++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-dpi.c | 270 +++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-dsi-cm.c | 1336 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-lgphilips-lb035q02.c | 358 ++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-nec-nl8048hl11.c | 394 ++++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-sharp-ls037v7dw01.c | 324 +++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 865 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays-new/panel-tpo-td043mtea1.c | 646 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/video/omap2/displays/Kconfig | 2 +-
drivers/video/omap2/displays/panel-acx565akm.c | 16 +-
drivers/video/omap2/displays/panel-generic-dpi.c | 26 +--
drivers/video/omap2/displays/panel-lgphilips-lb035q02.c | 10 +-
drivers/video/omap2/displays/panel-n8x0.c | 30 ++--
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c | 4 +-
drivers/video/omap2/displays/panel-picodlp.c | 34 ++--
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c | 10 +-
drivers/video/omap2/displays/panel-taal.c | 170 +++++++++----------
drivers/video/omap2/displays/panel-tfp410.c | 32 ++--
drivers/video/omap2/displays/panel-tpo-td043mtea1.c | 36 ++---
drivers/video/omap2/dss/Kconfig | 1 +
drivers/video/omap2/dss/apply.c | 59 ++++---
drivers/video/omap2/dss/core.c | 108 +++++++------
drivers/video/omap2/dss/dispc-compat.c | 3 +-
drivers/video/omap2/dss/dispc.c | 24 ++-
drivers/video/omap2/dss/display-sysfs.c | 154 ++++++++++--------
drivers/video/omap2/dss/display.c | 247 +++++++++++++++++++---------
drivers/video/omap2/dss/dpi.c | 209 ++++++++++++++++--------
drivers/video/omap2/dss/dsi.c | 232 ++++++++++++++++----------
drivers/video/omap2/dss/dss.c | 3 +-
drivers/video/omap2/dss/dss.h | 35 +---
drivers/video/omap2/dss/dss_features.c | 1 -
drivers/video/omap2/dss/hdmi.c | 345 ++++++++++++++++++++++++++++++++-------
drivers/video/omap2/dss/manager-sysfs.c | 47 ++++--
drivers/video/omap2/dss/manager.c | 29 +++-
drivers/video/omap2/dss/output.c | 87 +++++++++-
drivers/video/omap2/dss/rfbi.c | 43 +++--
drivers/video/omap2/dss/sdi.c | 143 ++++++++++++----
drivers/video/omap2/dss/ti_hdmi.h | 5 +-
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 87 +++++-----
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 1 +
drivers/video/omap2/dss/venc.c | 163 ++++++++++++-------
drivers/video/omap2/dss/venc_panel.c | 16 +-
drivers/video/omap2/omapfb/omapfb-ioctl.c | 9 +-
drivers/video/omap2/omapfb/omapfb-main.c | 27 ++--
drivers/video/pxa3xx-gcu.c | 2 -
drivers/video/pxafb.c | 1 -
drivers/video/s3c2410fb.c | 2 -
drivers/video/sa1100fb.c | 1 -
drivers/video/sh7760fb.c | 1 -
drivers/video/sh_mipi_dsi.c | 1 -
drivers/video/smscufx.c | 2 +-
drivers/video/ssd1307fb.c | 392 ++++++++++++++++++++++++++++++++------------
drivers/video/tmiofb.c | 3 -
drivers/video/udlfb.c | 12 +-
drivers/video/uvesafb.c | 4 +-
drivers/video/vga16fb.c | 1 -
drivers/video/vt8500lcdfb.c | 1 -
drivers/video/wm8505fb.c | 2 +-
drivers/video/xilinxfb.c | 135 ++++++++--------
include/linux/fb.h | 2 +-
include/video/of_display_timing.h | 3 +
include/video/omap-panel-data.h | 209 ++++++++++++++++++++++++
include/video/omapdss.h | 293 ++++++++++++++++++++++++++++-----
95 files changed, 8700 insertions(+), 1214 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/fsl,imx-fb.txt
create mode 100644 drivers/video/omap2/displays-new/Kconfig
create mode 100644 drivers/video/omap2/displays-new/Makefile
create mode 100644 drivers/video/omap2/displays-new/connector-analog-tv.c
create mode 100644 drivers/video/omap2/displays-new/connector-dvi.c
create mode 100644 drivers/video/omap2/displays-new/connector-hdmi.c
create mode 100644 drivers/video/omap2/displays-new/encoder-tfp410.c
create mode 100644 drivers/video/omap2/displays-new/encoder-tpd12s015.c
create mode 100644 drivers/video/omap2/displays-new/panel-dpi.c
create mode 100644 drivers/video/omap2/displays-new/panel-dsi-cm.c
create mode 100644 drivers/video/omap2/displays-new/panel-lgphilips-lb035q02.c
create mode 100644 drivers/video/omap2/displays-new/panel-nec-nl8048hl11.c
create mode 100644 drivers/video/omap2/displays-new/panel-sharp-ls037v7dw01.c
create mode 100644 drivers/video/omap2/displays-new/panel-sony-acx565akm.c
create mode 100644 drivers/video/omap2/displays-new/panel-tpo-td043mtea1.c
Best Regards,
J.
^ permalink raw reply
* Re: [ANNOUNCE] I'm just back
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-08 8:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20130703110644.GL305@game.jcrosoft.org>
On 10:22 Fri 05 Jul , Dave Airlie wrote:
> > I get sick for 2 weeks and just back to Shanghai
> >
> > I'm going through the ML the following days
> >
> > And will send the pull to Linus
>
> Have you a timeframe for the pull, the drm pull is blocked on that fb
> options const patch.
finishing it which one is the blocking
Best Regards,
J.
>
> Dave.
^ permalink raw reply
* [PATCH] drivers/video: remove unused parameter in Kconfig
From: Michael Opdenacker @ 2013-07-08 5:03 UTC (permalink / raw)
To: plagnioj, tomi.valkeinen; +Cc: linux-fbdev, linux-kernel, Michael Opdenacker
This patch proposes to remove the FB_NUC900_DEBUG kernel configuration
parameter defined in drivers/video/Kconfig, but used nowhere
in the makefiles and source code.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/video/Kconfig | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 2e937bd..a9c0964 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2098,13 +2098,6 @@ config GPM1040A0_320X240
bool "Giantplus Technology GPM1040A0 320x240 Color TFT LCD"
depends on FB_NUC900
-config FB_NUC900_DEBUG
- bool "NUC900 lcd debug messages"
- depends on FB_NUC900
- help
- Turn on debugging messages. Note that you can set/unset at run time
- through sysfs
-
config FB_SM501
tristate "Silicon Motion SM501 framebuffer support"
depends on FB && MFD_SM501
--
1.8.1.2
^ permalink raw reply related
* [PATCH V5 4/4] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-08 2:58 UTC (permalink / raw)
To: linux-arm-kernel
Use the generic PHY API to control the DP PHY.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
.../devicetree/bindings/video/exynos_dp.txt | 18 +++++++++---------
drivers/video/exynos/exynos_dp_core.c | 16 ++++++++++++----
drivers/video/exynos/exynos_dp_core.h | 1 +
3 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt
index 84f10c1..2f56376 100644
--- a/Documentation/devicetree/bindings/video/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -6,10 +6,10 @@ We use two nodes:
-dptx-phy node(defined inside dp-controller node)
For the DP-PHY initialization, we use the dptx-phy node.
-Required properties for dptx-phy:
- -reg:
+Required properties for dptx-phy: deprecated, use phys and phy-names
+ -reg: deprecated
Base address of DP PHY register.
- -samsung,enable-mask:
+ -samsung,enable-mask: deprecated
The bit-mask used to enable/disable DP PHY.
For the Panel initialization, we read data from dp-controller node.
@@ -25,6 +25,10 @@ Required properties for dp-controller:
from common clock binding: handle to dp clock.
-clock-names:
from common clock binding: Shall be "dp".
+ -phys:
+ from general PHY binding: the phandle for the PHY device.
+ -phy-names:
+ from general PHY binding: Should be "dp".
-interrupt-parent:
phandle to Interrupt combiner node.
-samsung,color-space:
@@ -67,12 +71,8 @@ SOC specific portion:
interrupt-parent = <&combiner>;
clocks = <&clock 342>;
clock-names = "dp";
-
- dptx-phy {
- reg = <0x10040720>;
- samsung,enable-mask = <1>;
- };
-
+ phys = <&dp_phy>;
+ phy-names = "dp";
};
Board Specific portion:
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 05fed7d..5e1a715 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -19,6 +19,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/of.h>
+#include <linux/phy/phy.h>
#include "exynos_dp_core.h"
@@ -960,8 +961,11 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy");
if (!dp_phy_node) {
- dev_err(dp->dev, "could not find dptx-phy node\n");
- return -ENODEV;
+ dp->phy = devm_phy_get(dp->dev, "dp");
+ if (IS_ERR(dp->phy))
+ return PTR_ERR(dp->phy);
+ else
+ return 0;
}
if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
@@ -992,7 +996,9 @@ err:
static void exynos_dp_phy_init(struct exynos_dp_device *dp)
{
- if (dp->phy_addr) {
+ if (dp->phy) {
+ phy_power_on(dp->phy);
+ } else if (dp->phy_addr) {
u32 reg;
reg = __raw_readl(dp->phy_addr);
@@ -1003,7 +1009,9 @@ static void exynos_dp_phy_init(struct exynos_dp_device *dp)
static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
{
- if (dp->phy_addr) {
+ if (dp->phy) {
+ phy_power_off(dp->phy);
+ } else if (dp->phy_addr) {
u32 reg;
reg = __raw_readl(dp->phy_addr);
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 56cfec8..607e36d 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -151,6 +151,7 @@ struct exynos_dp_device {
struct video_info *video_info;
struct link_train link_train;
struct work_struct hotplug_work;
+ struct phy *phy;
};
/* exynos_dp_reg.c */
--
1.7.10.4
^ permalink raw reply related
* [PATCH V5 3/4] video: exynos_dp: remove non-DT support for Exynos Display Port
From: Jingoo Han @ 2013-07-08 2:57 UTC (permalink / raw)
To: linux-arm-kernel
Exynos Display Port can be used only for Exynos SoCs. In addition,
non-DT for EXYNOS SoCs is not supported from v3.11; thus, there is
no need to support non-DT for Exynos Display Port.
The 'include/video/exynos_dp.h' file has been used for non-DT
support and the content of file include/video/exynos_dp.h is moved
to drivers/video/exynos/exynos_dp_core.h. Thus, the 'exynos_dp.h'
file is removed. Also, 'struct exynos_dp_platdata' is removed,
because it is not used any more.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
drivers/video/exynos/Kconfig | 2 +-
drivers/video/exynos/exynos_dp_core.c | 116 +++++++----------------------
drivers/video/exynos/exynos_dp_core.h | 109 +++++++++++++++++++++++++++
drivers/video/exynos/exynos_dp_reg.c | 2 -
include/video/exynos_dp.h | 131 ---------------------------------
5 files changed, 135 insertions(+), 225 deletions(-)
delete mode 100644 include/video/exynos_dp.h
diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
index 1b035b2..fab9019 100644
--- a/drivers/video/exynos/Kconfig
+++ b/drivers/video/exynos/Kconfig
@@ -29,7 +29,7 @@ config EXYNOS_LCD_S6E8AX0
config EXYNOS_DP
bool "EXYNOS DP driver support"
- depends on ARCH_EXYNOS
+ depends on OF && ARCH_EXYNOS
default n
help
This enables support for DP device.
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 12bbede..05fed7d 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -20,8 +20,6 @@
#include <linux/delay.h>
#include <linux/of.h>
-#include <video/exynos_dp.h>
-
#include "exynos_dp_core.h"
static int exynos_dp_init_dp(struct exynos_dp_device *dp)
@@ -894,26 +892,17 @@ static void exynos_dp_hotplug(struct work_struct *work)
dev_err(dp->dev, "unable to config video\n");
}
-#ifdef CONFIG_OF
-static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
+static struct video_info *exynos_dp_dt_parse_pdata(struct device *dev)
{
struct device_node *dp_node = dev->of_node;
- struct exynos_dp_platdata *pd;
struct video_info *dp_video_config;
- pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
- if (!pd) {
- dev_err(dev, "memory allocation for pdata failed\n");
- return ERR_PTR(-ENOMEM);
- }
dp_video_config = devm_kzalloc(dev,
sizeof(*dp_video_config), GFP_KERNEL);
-
if (!dp_video_config) {
dev_err(dev, "memory allocation for video config failed\n");
return ERR_PTR(-ENOMEM);
}
- pd->video_info = dp_video_config;
dp_video_config->h_sync_polarity of_property_read_bool(dp_node, "hsync-active-high");
@@ -960,7 +949,7 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
return ERR_PTR(-EINVAL);
}
- return pd;
+ return dp_video_config;
}
static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
@@ -1003,48 +992,30 @@ err:
static void exynos_dp_phy_init(struct exynos_dp_device *dp)
{
- u32 reg;
+ if (dp->phy_addr) {
+ u32 reg;
- reg = __raw_readl(dp->phy_addr);
- reg |= dp->enable_mask;
- __raw_writel(reg, dp->phy_addr);
+ reg = __raw_readl(dp->phy_addr);
+ reg |= dp->enable_mask;
+ __raw_writel(reg, dp->phy_addr);
+ }
}
static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
{
- u32 reg;
-
- reg = __raw_readl(dp->phy_addr);
- reg &= ~(dp->enable_mask);
- __raw_writel(reg, dp->phy_addr);
-}
-#else
-static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
-{
- return NULL;
-}
-
-static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
-{
- return -EINVAL;
-}
-
-static void exynos_dp_phy_init(struct exynos_dp_device *dp)
-{
- return;
-}
+ if (dp->phy_addr) {
+ u32 reg;
-static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
-{
- return;
+ reg = __raw_readl(dp->phy_addr);
+ reg &= ~(dp->enable_mask);
+ __raw_writel(reg, dp->phy_addr);
+ }
}
-#endif /* CONFIG_OF */
static int exynos_dp_probe(struct platform_device *pdev)
{
struct resource *res;
struct exynos_dp_device *dp;
- struct exynos_dp_platdata *pdata;
int ret = 0;
@@ -1057,21 +1028,13 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->dev = &pdev->dev;
- if (pdev->dev.of_node) {
- pdata = exynos_dp_dt_parse_pdata(&pdev->dev);
- if (IS_ERR(pdata))
- return PTR_ERR(pdata);
+ dp->video_info = exynos_dp_dt_parse_pdata(&pdev->dev);
+ if (IS_ERR(dp->video_info))
+ return PTR_ERR(dp->video_info);
- ret = exynos_dp_dt_parse_phydata(dp);
- if (ret)
- return ret;
- } else {
- pdata = pdev->dev.platform_data;
- if (!pdata) {
- dev_err(&pdev->dev, "no platform data\n");
- return -EINVAL;
- }
- }
+ ret = exynos_dp_dt_parse_phydata(dp);
+ if (ret)
+ return ret;
dp->clock = devm_clk_get(&pdev->dev, "dp");
if (IS_ERR(dp->clock)) {
@@ -1095,15 +1058,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
- dp->video_info = pdata->video_info;
-
- if (pdev->dev.of_node) {
- if (dp->phy_addr)
- exynos_dp_phy_init(dp);
- } else {
- if (pdata->phy_init)
- pdata->phy_init();
- }
+ exynos_dp_phy_init(dp);
exynos_dp_init_dp(dp);
@@ -1121,18 +1076,11 @@ static int exynos_dp_probe(struct platform_device *pdev)
static int exynos_dp_remove(struct platform_device *pdev)
{
- struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
struct exynos_dp_device *dp = platform_get_drvdata(pdev);
flush_work(&dp->hotplug_work);
- if (pdev->dev.of_node) {
- if (dp->phy_addr)
- exynos_dp_phy_exit(dp);
- } else {
- if (pdata->phy_exit)
- pdata->phy_exit();
- }
+ exynos_dp_phy_exit(dp);
clk_disable_unprepare(dp->clock);
@@ -1143,20 +1091,13 @@ static int exynos_dp_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int exynos_dp_suspend(struct device *dev)
{
- struct exynos_dp_platdata *pdata = dev->platform_data;
struct exynos_dp_device *dp = dev_get_drvdata(dev);
disable_irq(dp->irq);
flush_work(&dp->hotplug_work);
- if (dev->of_node) {
- if (dp->phy_addr)
- exynos_dp_phy_exit(dp);
- } else {
- if (pdata->phy_exit)
- pdata->phy_exit();
- }
+ exynos_dp_phy_exit(dp);
clk_disable_unprepare(dp->clock);
@@ -1165,16 +1106,9 @@ static int exynos_dp_suspend(struct device *dev)
static int exynos_dp_resume(struct device *dev)
{
- struct exynos_dp_platdata *pdata = dev->platform_data;
struct exynos_dp_device *dp = dev_get_drvdata(dev);
- if (dev->of_node) {
- if (dp->phy_addr)
- exynos_dp_phy_init(dp);
- } else {
- if (pdata->phy_init)
- pdata->phy_init();
- }
+ exynos_dp_phy_init(dp);
clk_prepare_enable(dp->clock);
@@ -1203,7 +1137,7 @@ static struct platform_driver exynos_dp_driver = {
.name = "exynos-dp",
.owner = THIS_MODULE,
.pm = &exynos_dp_pm_ops,
- .of_match_table = of_match_ptr(exynos_dp_match),
+ .of_match_table = exynos_dp_match,
},
};
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6c567bbf..56cfec8 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -13,6 +13,99 @@
#ifndef _EXYNOS_DP_CORE_H
#define _EXYNOS_DP_CORE_H
+#define DP_TIMEOUT_LOOP_COUNT 100
+#define MAX_CR_LOOP 5
+#define MAX_EQ_LOOP 5
+
+enum link_rate_type {
+ LINK_RATE_1_62GBPS = 0x06,
+ LINK_RATE_2_70GBPS = 0x0a
+};
+
+enum link_lane_count_type {
+ LANE_COUNT1 = 1,
+ LANE_COUNT2 = 2,
+ LANE_COUNT4 = 4
+};
+
+enum link_training_state {
+ START,
+ CLOCK_RECOVERY,
+ EQUALIZER_TRAINING,
+ FINISHED,
+ FAILED
+};
+
+enum voltage_swing_level {
+ VOLTAGE_LEVEL_0,
+ VOLTAGE_LEVEL_1,
+ VOLTAGE_LEVEL_2,
+ VOLTAGE_LEVEL_3,
+};
+
+enum pre_emphasis_level {
+ PRE_EMPHASIS_LEVEL_0,
+ PRE_EMPHASIS_LEVEL_1,
+ PRE_EMPHASIS_LEVEL_2,
+ PRE_EMPHASIS_LEVEL_3,
+};
+
+enum pattern_set {
+ PRBS7,
+ D10_2,
+ TRAINING_PTN1,
+ TRAINING_PTN2,
+ DP_NONE
+};
+
+enum color_space {
+ COLOR_RGB,
+ COLOR_YCBCR422,
+ COLOR_YCBCR444
+};
+
+enum color_depth {
+ COLOR_6,
+ COLOR_8,
+ COLOR_10,
+ COLOR_12
+};
+
+enum color_coefficient {
+ COLOR_YCBCR601,
+ COLOR_YCBCR709
+};
+
+enum dynamic_range {
+ VESA,
+ CEA
+};
+
+enum pll_status {
+ PLL_UNLOCKED,
+ PLL_LOCKED
+};
+
+enum clock_recovery_m_value_type {
+ CALCULATED_M,
+ REGISTER_M
+};
+
+enum video_timing_recognition_type {
+ VIDEO_TIMING_FROM_CAPTURE,
+ VIDEO_TIMING_FROM_REGISTER
+};
+
+enum analog_power_block {
+ AUX_BLOCK,
+ CH0_BLOCK,
+ CH1_BLOCK,
+ CH2_BLOCK,
+ CH3_BLOCK,
+ ANALOG_TOTAL,
+ POWER_ALL
+};
+
enum dp_irq_type {
DP_IRQ_TYPE_HP_CABLE_IN,
DP_IRQ_TYPE_HP_CABLE_OUT,
@@ -20,6 +113,22 @@ enum dp_irq_type {
DP_IRQ_TYPE_UNKNOWN,
};
+struct video_info {
+ char *name;
+
+ bool h_sync_polarity;
+ bool v_sync_polarity;
+ bool interlaced;
+
+ enum color_space color_space;
+ enum dynamic_range dynamic_range;
+ enum color_coefficient ycbcr_coeff;
+ enum color_depth color_depth;
+
+ enum link_rate_type link_rate;
+ enum link_lane_count_type lane_count;
+};
+
struct link_train {
int eq_loop;
int cr_loop[4];
diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
index 29d9d03..b70da50 100644
--- a/drivers/video/exynos/exynos_dp_reg.c
+++ b/drivers/video/exynos/exynos_dp_reg.c
@@ -14,8 +14,6 @@
#include <linux/io.h>
#include <linux/delay.h>
-#include <video/exynos_dp.h>
-
#include "exynos_dp_core.h"
#include "exynos_dp_reg.h"
diff --git a/include/video/exynos_dp.h b/include/video/exynos_dp.h
deleted file mode 100644
index bd8cabd..0000000
--- a/include/video/exynos_dp.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Samsung SoC DP device support
- *
- * Copyright (C) 2012 Samsung Electronics Co., Ltd.
- * Author: Jingoo Han <jg1.han@samsung.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _EXYNOS_DP_H
-#define _EXYNOS_DP_H
-
-#define DP_TIMEOUT_LOOP_COUNT 100
-#define MAX_CR_LOOP 5
-#define MAX_EQ_LOOP 5
-
-enum link_rate_type {
- LINK_RATE_1_62GBPS = 0x06,
- LINK_RATE_2_70GBPS = 0x0a
-};
-
-enum link_lane_count_type {
- LANE_COUNT1 = 1,
- LANE_COUNT2 = 2,
- LANE_COUNT4 = 4
-};
-
-enum link_training_state {
- START,
- CLOCK_RECOVERY,
- EQUALIZER_TRAINING,
- FINISHED,
- FAILED
-};
-
-enum voltage_swing_level {
- VOLTAGE_LEVEL_0,
- VOLTAGE_LEVEL_1,
- VOLTAGE_LEVEL_2,
- VOLTAGE_LEVEL_3,
-};
-
-enum pre_emphasis_level {
- PRE_EMPHASIS_LEVEL_0,
- PRE_EMPHASIS_LEVEL_1,
- PRE_EMPHASIS_LEVEL_2,
- PRE_EMPHASIS_LEVEL_3,
-};
-
-enum pattern_set {
- PRBS7,
- D10_2,
- TRAINING_PTN1,
- TRAINING_PTN2,
- DP_NONE
-};
-
-enum color_space {
- COLOR_RGB,
- COLOR_YCBCR422,
- COLOR_YCBCR444
-};
-
-enum color_depth {
- COLOR_6,
- COLOR_8,
- COLOR_10,
- COLOR_12
-};
-
-enum color_coefficient {
- COLOR_YCBCR601,
- COLOR_YCBCR709
-};
-
-enum dynamic_range {
- VESA,
- CEA
-};
-
-enum pll_status {
- PLL_UNLOCKED,
- PLL_LOCKED
-};
-
-enum clock_recovery_m_value_type {
- CALCULATED_M,
- REGISTER_M
-};
-
-enum video_timing_recognition_type {
- VIDEO_TIMING_FROM_CAPTURE,
- VIDEO_TIMING_FROM_REGISTER
-};
-
-enum analog_power_block {
- AUX_BLOCK,
- CH0_BLOCK,
- CH1_BLOCK,
- CH2_BLOCK,
- CH3_BLOCK,
- ANALOG_TOTAL,
- POWER_ALL
-};
-
-struct video_info {
- char *name;
-
- bool h_sync_polarity;
- bool v_sync_polarity;
- bool interlaced;
-
- enum color_space color_space;
- enum dynamic_range dynamic_range;
- enum color_coefficient ycbcr_coeff;
- enum color_depth color_depth;
-
- enum link_rate_type link_rate;
- enum link_lane_count_type lane_count;
-};
-
-struct exynos_dp_platdata {
- struct video_info *video_info;
-
- void (*phy_init)(void);
- void (*phy_exit)(void);
-};
-
-#endif /* _EXYNOS_DP_H */
--
1.7.10.4
^ permalink raw reply related
* [PATCH V5 2/4] phy: Add driver for Exynos DP PHY
From: Jingoo Han @ 2013-07-08 2:56 UTC (permalink / raw)
To: linux-arm-kernel
Add a PHY provider driver for the Samsung Exynos SoC Display Port PHY.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
---
.../devicetree/bindings/phy/samsung-phy.txt | 8 ++
drivers/phy/Kconfig | 6 ++
drivers/phy/Makefile | 1 +
drivers/phy/phy-exynos-dp-video.c | 111 ++++++++++++++++++++
4 files changed, 126 insertions(+)
create mode 100644 drivers/phy/phy-exynos-dp-video.c
diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
index 5ff208c..c0fccaa 100644
--- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -12,3 +12,11 @@ the PHY specifier identifies the PHY and its meaning is as follows:
1 - MIPI DSIM 0,
2 - MIPI CSIS 1,
3 - MIPI DSIM 1.
+
+Samsung EXYNOS SoC series Display Port PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the Display Port PHY register set;
+- #phy-cells : from the generic PHY bindings, must be 0;
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 6f446d0..ed0b1b8 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -19,4 +19,10 @@ config PHY_EXYNOS_MIPI_VIDEO
help
Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
S5P and EXYNOS SoCs.
+
+config PHY_EXYNOS_DP_VIDEO
+ tristate "EXYNOS SoC series Display Port PHY driver"
+ depends on OF
+ help
+ Support for Display Port PHY found on Samsung EXYNOS SoCs.
endif
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 71d8841..0fd1340 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -4,3 +4,4 @@
obj-$(CONFIG_GENERIC_PHY) += phy-core.o
obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c
new file mode 100644
index 0000000..3c8e247
--- /dev/null
+++ b/drivers/phy/phy-exynos-dp-video.c
@@ -0,0 +1,111 @@
+/*
+ * Samsung EXYNOS SoC series Display Port PHY driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han <jg1.han@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+
+/* DPTX_PHY_CONTROL register */
+#define EXYNOS_DPTX_PHY_ENABLE (1 << 0)
+
+struct exynos_dp_video_phy {
+ void __iomem *regs;
+};
+
+static int __set_phy_state(struct exynos_dp_video_phy *state, unsigned int on)
+{
+ u32 reg;
+
+ reg = readl(state->regs);
+ if (on)
+ reg |= EXYNOS_DPTX_PHY_ENABLE;
+ else
+ reg &= ~EXYNOS_DPTX_PHY_ENABLE;
+ writel(reg, state->regs);
+
+ return 0;
+}
+
+static int exynos_dp_video_phy_power_on(struct phy *phy)
+{
+ struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
+
+ return __set_phy_state(state, 1);
+}
+
+static int exynos_dp_video_phy_power_off(struct phy *phy)
+{
+ struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
+
+ return __set_phy_state(state, 0);
+}
+
+static struct phy_ops exynos_dp_video_phy_ops = {
+ .power_on = exynos_dp_video_phy_power_on,
+ .power_off = exynos_dp_video_phy_power_off,
+ .owner = THIS_MODULE,
+};
+
+static int exynos_dp_video_phy_probe(struct platform_device *pdev)
+{
+ struct exynos_dp_video_phy *state;
+ struct device *dev = &pdev->dev;
+ struct resource *res;
+ struct phy_provider *phy_provider;
+ struct phy *phy;
+
+ state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL);
+ if (!state)
+ return -ENOMEM;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+ state->regs = devm_ioremap_resource(dev, res);
+ if (IS_ERR(state->regs))
+ return PTR_ERR(state->regs);
+
+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+ if (IS_ERR(phy_provider))
+ return PTR_ERR(phy_provider);
+
+ phy = devm_phy_create(dev, 0, &exynos_dp_video_phy_ops, NULL);
+ if (IS_ERR(phy)) {
+ dev_err(dev, "failed to create Display Port PHY\n");
+ return PTR_ERR(phy);
+ }
+ phy_set_drvdata(phy, state);
+
+ return 0;
+}
+
+static const struct of_device_id exynos_dp_video_phy_of_match[] = {
+ { .compatible = "samsung,exynos5250-dp-video-phy" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match);
+
+static struct platform_driver exynos_dp_video_phy_driver = {
+ .probe = exynos_dp_video_phy_probe,
+ .driver = {
+ .name = "exynos-dp-video-phy",
+ .owner = THIS_MODULE,
+ .of_match_table = exynos_dp_video_phy_of_match,
+ }
+};
+module_platform_driver(exynos_dp_video_phy_driver);
+
+MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
+MODULE_DESCRIPTION("Samsung EXYNOS SoC DP PHY driver");
+MODULE_LICENSE("GPL v2");
--
1.7.10.4
^ permalink raw reply related
* [PATCH V5 1/4] ARM: dts: Add DP PHY node to exynos5250.dtsi
From: Jingoo Han @ 2013-07-08 2:55 UTC (permalink / raw)
To: linux-arm-kernel
Add PHY provider node for the DP PHY.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
---
arch/arm/boot/dts/exynos5250.dtsi | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index ef57277..2c1e73c 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -614,6 +614,12 @@
interrupts = <0 94 0>;
};
+ dp_phy: video-phy@10040720 {
+ compatible = "samsung,exynos5250-dp-video-phy";
+ reg = <0x10040720 4>;
+ #phy-cells = <0>;
+ };
+
dp-controller {
compatible = "samsung,exynos5-dp";
reg = <0x145b0000 0x1000>;
@@ -623,11 +629,8 @@
clock-names = "dp";
#address-cells = <1>;
#size-cells = <0>;
-
- dptx-phy {
- reg = <0x10040720>;
- samsung,enable-mask = <1>;
- };
+ phys = <&dp_phy>;
+ phy-names = "dp";
};
fimd {
--
1.7.10.4
^ permalink raw reply related
* [PATCH V5 0/4] Generic PHY driver for the Exynos SoC DP PHY
From: Jingoo Han @ 2013-07-08 2:54 UTC (permalink / raw)
To: linux-arm-kernel
This patch series adds a simple driver for the Samsung Exynos SoC
series DP transmitter PHY, using the generic PHY framework [1].
Previously the DP PHY used an internal DT node to control the PHY
power enable bit.
These patches was tested on Exynos5250.
This PATCH v5 follows:
* PATCH v4, sent on July, 2nd 2013
* PATCH v3, sent on July, 1st 2013
* PATCH v2, sent on June, 28th 2013
* PATCH v1, sent on June, 28th 2013
Changes between v4 and v5:
* Marked original bindings as deprecated in 'exynos_dp.txt'
* Fixed typo of commit message.
* Added Tomasz Figa's Reviewed-by.
Changes between v3 and v4:
* Added OF dependancy.
* Removed redundant local variable 'void __iomem *addr'.
* Removed unnecessary dev_set_drvdata().
* Added a patch that remove non-DT support for Exynos
Display Port driver.
* Removed unnecessary 'struct exynos_dp_platdata'.
* Kept supporting the original bindings for DT compatibility.
Changes between v2 and v3:
* Removed redundant spinlock
* Removed 'struct phy' from 'struct exynos_dp_video_phy'
* Updated 'samsung-phy.txt', instead of creating
'samsung,exynos5250-dp-video-phy.txt'.
* Removed unnecessary additional specifier from 'phys'
DT property.
* Added 'phys', 'phy-names' properties to 'exynos_dp.txt' file.
* Added Felipe Balbi's Acked-by.
Changes between v1 and v2:
* Replaced exynos_dp_video_phy_xlate() with of_phy_simple_xlate(),
as Kishon Vijay Abraham I guided.
* Set the value of phy-cells as 0, because the phy_provider implements
only one PHY.
* Removed unnecessary header include.
* Added '#ifdef CONFIG_OF' and of_match_ptr macro.
This series depends on the generic PHY framework [1]. These patches
refer to Sylwester Nawrocki's patches about Exynos MIPI [2].
[1] https://lkml.org/lkml/2013/6/26/259
[2] http://www.spinics.net/lists/linux-samsung-soc/msg20098.html
Jingoo Han (4):
ARM: dts: Add DP PHY node to exynos5250.dtsi
phy: Add driver for Exynos DP PHY
video: exynos_dp: remove non-DT support for Exynos Display Port
video: exynos_dp: Use the generic PHY driver
.../devicetree/bindings/phy/samsung-phy.txt | 8 ++
.../devicetree/bindings/video/exynos_dp.txt | 18 +++++++++---------
arch/arm/boot/dts/exynos5250.dtsi | 13 ++++++++-----
drivers/phy/Kconfig | 6 ++
drivers/phy/Makefile | 1 +
drivers/phy/phy-exynos-dp-video.c | 111 ++++++++++++++++++++
drivers/video/exynos/Kconfig | 2 +-
drivers/video/exynos/exynos_dp_core.c | 132 +++++++----------------------
drivers/video/exynos/exynos_dp_core.h | 110 +++++++++++++++++++++++++++
drivers/video/exynos/exynos_dp_reg.c | 2 -
include/video/exynos_dp.h | 131 ---------------------------------
11 files changed, 291 insertions(+), 243 deletions(-)
create mode 100644 drivers/phy/phy-exynos-dp-video.c
delete mode 100644 include/video/exynos_dp.h
--
1.7.10.4
^ permalink raw reply
* RE: [PATCH 4/4] fb: Add DCU framebuffer driver for Vybrid VF610 platform
From: Wang Huan-B18965 @ 2013-07-08 2:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130706060453.GE30164@S2101-09.ap.freescale.net>
Hi, Shawn,
> On Fri, Jul 05, 2013 at 03:51:42PM +0800, Alison Wang wrote:
> > The Display Controller Unit (DCU) module is a system master that
> > fetches graphics stored in internal or external memory and displays
> > them on a TFT LCD panel. A wide range of panel sizes is supported and
> > the timing of the interface signals is highly configurable.
> > Graphics are read directly from memory and then blended in real-time,
> > which allows for dynamic content creation with minimal CPU
> intervention.
> >
> > The features:
> >
> > (1) Full RGB888 output to TFT LCD panel.
> > (2) For the current LCD panel, WQVGA "480x272" is supported.
> > (3) Blending of each pixel using up to 4 source layers dependent on
> size of panel.
> > (4) Each graphic layer can be placed with one pixel resolution in
> either axis.
> > (5) Each graphic layer support RGB565 and RGB888 direct colors
> without
> > alpha channel and BGRA8888 direct colors with an alpha channel.
> > (6) Each graphic layer support alpha blending with 8-bit resolution.
> >
> > This driver has been tested on Vybrid VF610 TOWER board.
> >
> > Signed-off-by: Alison Wang <b18965@freescale.com>
> > ---
> > drivers/video/Kconfig | 9 +
> > drivers/video/Makefile | 1 +
> > drivers/video/fsl-dcu-fb.c | 1091
> > ++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 1101 insertions(+)
> > create mode 100644 drivers/video/fsl-dcu-fb.c
>
> You should have a document under Documentation/devicetree/bindings/fb/.
>
[Alison Wang] Ok, I will add a document in the next version. Thanks!
Best Regards,
Alison Wang
^ permalink raw reply
* Re: [PATCH V4 4/4] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-08 2:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1441230.DzaqAQ9HHT@flatron>
On Saturday, July 06, 2013 8:04 AM, Tomasz Figa wrote:
>
> Hi Jingoo,
>
> On Tuesday 02 of July 2013 17:42:49 Jingoo Han wrote:
> > Use the generic PHY API instead of the platform callback to control
> > the DP PHY.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> > .../devicetree/bindings/video/exynos_dp.txt | 23
> > +++++--------------- drivers/video/exynos/exynos_dp_core.c
> > | 16 ++++++++++---- drivers/video/exynos/exynos_dp_core.h
> > | 2 ++
> > 3 files changed, 20 insertions(+), 21 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt
> > b/Documentation/devicetree/bindings/video/exynos_dp.txt index
> > 84f10c1..022f4b6 100644
> > --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> > +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> > @@ -1,17 +1,6 @@
> > The Exynos display port interface should be configured based on
> > the type of panel connected to it.
> >
> > -We use two nodes:
> > - -dp-controller node
> > - -dptx-phy node(defined inside dp-controller node)
> > -
> > -For the DP-PHY initialization, we use the dptx-phy node.
> > -Required properties for dptx-phy:
> > - -reg:
> > - Base address of DP PHY register.
> > - -samsung,enable-mask:
> > - The bit-mask used to enable/disable DP PHY.
> > -
>
> I wonder if this part shouldn't stay here, just marked as deprecated,
> because compatibility with old dtbs must be preserved (and rest of the
> patch looks like it is).
I would like to remove these properties from Documentation.
But, I will mark it as deprecated as you suggested..
Best regards,
Jingoo Han
^ permalink raw reply
* Re: [PATCH 4/4] fb: Add DCU framebuffer driver for Vybrid VF610 platform
From: Shawn Guo @ 2013-07-06 6:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1373010702-9244-5-git-send-email-b18965@freescale.com>
On Fri, Jul 05, 2013 at 03:51:42PM +0800, Alison Wang wrote:
> The Display Controller Unit (DCU) module is a system master that
> fetches graphics stored in internal or external memory and displays
> them on a TFT LCD panel. A wide range of panel sizes is supported
> and the timing of the interface signals is highly configurable.
> Graphics are read directly from memory and then blended in real-time,
> which allows for dynamic content creation with minimal CPU intervention.
>
> The features:
>
> (1) Full RGB888 output to TFT LCD panel.
> (2) For the current LCD panel, WQVGA "480x272" is supported.
> (3) Blending of each pixel using up to 4 source layers dependent on size of panel.
> (4) Each graphic layer can be placed with one pixel resolution in either axis.
> (5) Each graphic layer support RGB565 and RGB888 direct colors without alpha channel
> and BGRA8888 direct colors with an alpha channel.
> (6) Each graphic layer support alpha blending with 8-bit resolution.
>
> This driver has been tested on Vybrid VF610 TOWER board.
>
> Signed-off-by: Alison Wang <b18965@freescale.com>
> ---
> drivers/video/Kconfig | 9 +
> drivers/video/Makefile | 1 +
> drivers/video/fsl-dcu-fb.c | 1091 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 1101 insertions(+)
> create mode 100644 drivers/video/fsl-dcu-fb.c
You should have a document under Documentation/devicetree/bindings/fb/.
Shawn
^ permalink raw reply
* Re: [PATCH V4 1/4] ARM: dts: Add DP PHY node to exynos5250.dtsi
From: Tomasz Figa @ 2013-07-05 23:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <000a01ce76ff$a02a7c40$e07f74c0$@samsung.com>
On Tuesday 02 of July 2013 17:39:11 Jingoo Han wrote:
> Add PHY provider node for the DP PHY.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> ---
> arch/arm/boot/dts/exynos5250.dtsi | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Best regards,
Tomasz
^ permalink raw reply
* Re: [PATCH V4 2/4] phy: Add driver for Exynos DP PHY
From: Tomasz Figa @ 2013-07-05 23:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <000b01ce76ff$cf9fd6a0$6edf83e0$@samsung.com>
On Tuesday 02 of July 2013 17:40:31 Jingoo Han wrote:
> Add a PHY provider driver for the Samsung Exynos SoC DP PHY.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> ---
> .../devicetree/bindings/phy/samsung-phy.txt | 8 ++
> drivers/phy/Kconfig | 6 ++
> drivers/phy/Makefile | 1 +
> drivers/phy/phy-exynos-dp-video.c | 111
> ++++++++++++++++++++ 4 files changed, 126 insertions(+)
> create mode 100644 drivers/phy/phy-exynos-dp-video.c
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Best regards,
Tomasz
^ permalink raw reply
* Re: [PATCH V4 3/4] video: exynos_dp: remove non-DT support for Exynos Display Port
From: Tomasz Figa @ 2013-07-05 23:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <000c01ce76ff$fffa39d0$ffeead70$@samsung.com>
Hi Jingoo,
On Tuesday 02 of July 2013 17:41:52 Jingoo Han wrote:
> Exynos Display Port can be used only for Exynos SoCs. In addition,
> non-DT for EXYNOS SoCs is be supported from v3.11; thus, there is
> no need to support non-DT for Exynos Display Port.
>
> The 'include/video/exynos_dp.h' file has been used for non-DT
> support and the content of file include/video/exynos_dp.h is moved
> to drivers/video/exynos/exynos_dp_core.h. Thus, the 'exynos_dp.h'
> file is removed. Also, 'struct exynos_dp_platdata' is removed,
> because it is not used any more.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
> drivers/video/exynos/Kconfig | 2 +-
> drivers/video/exynos/exynos_dp_core.c | 116
> +++++++---------------------- drivers/video/exynos/exynos_dp_core.h |
> 109 +++++++++++++++++++++++++++ drivers/video/exynos/exynos_dp_reg.c |
> 2 -
> include/video/exynos_dp.h | 131
> --------------------------------- 5 files changed, 135 insertions(+),
> 225 deletions(-)
> delete mode 100644 include/video/exynos_dp.h
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Best regards,
Tomasz
^ permalink raw reply
* Re: [PATCH V4 4/4] video: exynos_dp: Use the generic PHY driver
From: Tomasz Figa @ 2013-07-05 23:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <000d01ce7700$222a35a0$667ea0e0$@samsung.com>
Hi Jingoo,
On Tuesday 02 of July 2013 17:42:49 Jingoo Han wrote:
> Use the generic PHY API instead of the platform callback to control
> the DP PHY.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
> .../devicetree/bindings/video/exynos_dp.txt | 23
> +++++--------------- drivers/video/exynos/exynos_dp_core.c
> | 16 ++++++++++---- drivers/video/exynos/exynos_dp_core.h
> | 2 ++
> 3 files changed, 20 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt
> b/Documentation/devicetree/bindings/video/exynos_dp.txt index
> 84f10c1..022f4b6 100644
> --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> @@ -1,17 +1,6 @@
> The Exynos display port interface should be configured based on
> the type of panel connected to it.
>
> -We use two nodes:
> - -dp-controller node
> - -dptx-phy node(defined inside dp-controller node)
> -
> -For the DP-PHY initialization, we use the dptx-phy node.
> -Required properties for dptx-phy:
> - -reg:
> - Base address of DP PHY register.
> - -samsung,enable-mask:
> - The bit-mask used to enable/disable DP PHY.
> -
I wonder if this part shouldn't stay here, just marked as deprecated,
because compatibility with old dtbs must be preserved (and rest of the
patch looks like it is).
> For the Panel initialization, we read data from dp-controller node.
> Required properties for dp-controller:
> -compatible:
> @@ -25,6 +14,10 @@ Required properties for dp-controller:
> from common clock binding: handle to dp clock.
> -clock-names:
> from common clock binding: Shall be "dp".
> + -phys:
> + from general PHY binding: the phandle for the PHY device.
> + -phy-names:
> + from general PHY binding: Should be "dp".
> -interrupt-parent:
> phandle to Interrupt combiner node.
> -samsung,color-space:
> @@ -67,12 +60,8 @@ SOC specific portion:
> interrupt-parent = <&combiner>;
> clocks = <&clock 342>;
> clock-names = "dp";
> -
> - dptx-phy {
> - reg = <0x10040720>;
> - samsung,enable-mask = <1>;
> - };
> -
> + phys = <&dp_phy>;
> + phy-names = "dp";
> };
>
> Board Specific portion:
> diff --git a/drivers/video/exynos/exynos_dp_core.c
> b/drivers/video/exynos/exynos_dp_core.c index 05fed7d..5e1a715 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -19,6 +19,7 @@
> #include <linux/interrupt.h>
> #include <linux/delay.h>
> #include <linux/of.h>
> +#include <linux/phy/phy.h>
>
> #include "exynos_dp_core.h"
>
> @@ -960,8 +961,11 @@ static int exynos_dp_dt_parse_phydata(struct
> exynos_dp_device *dp)
>
> dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy");
> if (!dp_phy_node) {
> - dev_err(dp->dev, "could not find dptx-phy node\n");
> - return -ENODEV;
> + dp->phy = devm_phy_get(dp->dev, "dp");
> + if (IS_ERR(dp->phy))
> + return PTR_ERR(dp->phy);
> + else
> + return 0;
> }
>
> if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
> @@ -992,7 +996,9 @@ err:
>
> static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> {
> - if (dp->phy_addr) {
> + if (dp->phy) {
> + phy_power_on(dp->phy);
> + } else if (dp->phy_addr) {
> u32 reg;
>
> reg = __raw_readl(dp->phy_addr);
> @@ -1003,7 +1009,9 @@ static void exynos_dp_phy_init(struct
> exynos_dp_device *dp)
>
> static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> {
> - if (dp->phy_addr) {
> + if (dp->phy) {
> + phy_power_off(dp->phy);
> + } else if (dp->phy_addr) {
> u32 reg;
>
> reg = __raw_readl(dp->phy_addr);
> diff --git a/drivers/video/exynos/exynos_dp_core.h
> b/drivers/video/exynos/exynos_dp_core.h index 56cfec8..87804b6 100644
> --- a/drivers/video/exynos/exynos_dp_core.h
> +++ b/drivers/video/exynos/exynos_dp_core.h
> @@ -151,6 +151,8 @@ struct exynos_dp_device {
> struct video_info *video_info;
> struct link_train link_train;
> struct work_struct hotplug_work;
> +
nit: unnecessary blank line
> + struct phy *phy;
> };
>
> /* exynos_dp_reg.c */
Otherwise looks good.
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Best regards,
Tomasz
^ permalink raw reply
* Re: [PATCH v6] video: imxfb: Add DT support
From: Fabio Estevam @ 2013-07-05 12:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130528110927.GA23653@game.jcrosoft.org>
Hi Jean-Christophe,
On Tue, May 28, 2013 at 8:09 AM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 12:35 Sun 26 May , Markus Pargmann wrote:
>> Add devicetree support for imx framebuffer driver. It uses the generic
>> display bindings and helper functions.
>>
>> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
>> Cc: Fabio Estevam <festevam@gmail.com>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> Applied thanks
Still don't see this patch in linux-next. Could you please check?
^ permalink raw reply
* [PATCH 4/4] fb: Add DCU framebuffer driver for Vybrid VF610 platform
From: Alison Wang @ 2013-07-05 7:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1373010702-9244-1-git-send-email-b18965@freescale.com>
The Display Controller Unit (DCU) module is a system master that
fetches graphics stored in internal or external memory and displays
them on a TFT LCD panel. A wide range of panel sizes is supported
and the timing of the interface signals is highly configurable.
Graphics are read directly from memory and then blended in real-time,
which allows for dynamic content creation with minimal CPU intervention.
The features:
(1) Full RGB888 output to TFT LCD panel.
(2) For the current LCD panel, WQVGA "480x272" is supported.
(3) Blending of each pixel using up to 4 source layers dependent on size of panel.
(4) Each graphic layer can be placed with one pixel resolution in either axis.
(5) Each graphic layer support RGB565 and RGB888 direct colors without alpha channel
and BGRA8888 direct colors with an alpha channel.
(6) Each graphic layer support alpha blending with 8-bit resolution.
This driver has been tested on Vybrid VF610 TOWER board.
Signed-off-by: Alison Wang <b18965@freescale.com>
---
drivers/video/Kconfig | 9 +
drivers/video/Makefile | 1 +
drivers/video/fsl-dcu-fb.c | 1091 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 1101 insertions(+)
create mode 100644 drivers/video/fsl-dcu-fb.c
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 2c301f8..10af3a4 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1974,6 +1974,15 @@ config FB_FSL_DIU
---help---
Framebuffer driver for the Freescale SoC DIU
+config FB_FSL_DCU
+ tristate "Freescale DCU framebuffer support"
+ depends on FB
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+ ---help---
+ Framebuffer driver for the Freescale SoC DCU
+
config FB_W100
tristate "W100 frame buffer support"
depends on FB && ARCH_PXA
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index e8bae8d..3707a7d 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -129,6 +129,7 @@ obj-$(CONFIG_FB_IMX) += imxfb.o
obj-$(CONFIG_FB_S3C) += s3c-fb.o
obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o
obj-$(CONFIG_FB_FSL_DIU) += fsl-diu-fb.o
+obj-$(CONFIG_FB_FSL_DCU) += fsl-dcu-fb.o
obj-$(CONFIG_FB_COBALT) += cobalt_lcdfb.o
obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o
obj-$(CONFIG_FB_PS3) += ps3fb.o
diff --git a/drivers/video/fsl-dcu-fb.c b/drivers/video/fsl-dcu-fb.c
new file mode 100644
index 0000000..5571dde
--- /dev/null
+++ b/drivers/video/fsl-dcu-fb.c
@@ -0,0 +1,1091 @@
+/*
+ * Copyright 2012-2013 Freescale Semiconductor, Inc.
+ *
+ * Freescale DCU Frame Buffer device driver
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/dma-mapping.h>
+#include <linux/interrupt.h>
+#include <linux/fb.h>
+#include <linux/clk.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/uaccess.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+
+#define DRIVER_NAME "fsl-dcu-fb"
+
+#define DCU_DCU_MODE 0x0010
+#define DCU_MODE_BLEND_ITER(x) (x << 20)
+#define DCU_MODE_RASTER_EN (1 << 14)
+#define DCU_MODE_DCU_MODE(x) (x)
+#define DCU_MODE_DCU_MODE_MASK 0x03
+#define DCU_MODE_OFF 0
+#define DCU_MODE_NORMAL 1
+#define DCU_MODE_TEST 2
+#define DCU_MODE_COLORBAR 3
+
+#define DCU_BGND 0x0014
+#define DCU_BGND_R(x) (x << 16)
+#define DCU_BGND_G(x) (x << 8)
+#define DCU_BGND_B(x) (x)
+
+#define DCU_DISP_SIZE 0x0018
+#define DCU_DISP_SIZE_DELTA_Y(x) (x << 16)
+#define DCU_DISP_SIZE_DELTA_X(x) (x)
+
+#define DCU_HSYN_PARA 0x001c
+#define DCU_HSYN_PARA_BP(x) (x << 22)
+#define DCU_HSYN_PARA_PW(x) (x << 11)
+#define DCU_HSYN_PARA_FP(x) (x)
+
+#define DCU_VSYN_PARA 0x0020
+#define DCU_VSYN_PARA_BP(x) (x << 22)
+#define DCU_VSYN_PARA_PW(x) (x << 11)
+#define DCU_VSYN_PARA_FP(x) (x)
+
+#define DCU_SYN_POL 0x0024
+#define DCU_SYN_POL_INV_PXCK_FALL (0 << 6)
+#define DCU_SYN_POL_NEG_REMAIN (0 << 5)
+#define DCU_SYN_POL_INV_VS_LOW (1 << 1)
+#define DCU_SYN_POL_INV_HS_LOW (1)
+
+#define DCU_THRESHOLD 0x0028
+#define DCU_THRESHOLD_LS_BF_VS(x) (x << 16)
+#define DCU_THRESHOLD_OUT_BUF_HIGH(x) (x << 8)
+#define DCU_THRESHOLD_OUT_BUF_LOW(x) (x)
+
+#define DCU_INT_STATUS 0x002C
+#define DCU_INT_STATUS_UNDRUN (1 << 1)
+
+#define DCU_INT_MASK 0x0030
+#define DCU_INT_MASK_UNDRUN (1 << 1)
+
+#define DCU_DIV_RATIO 0x0054
+
+#define DCU_UPDATE_MODE 0x00cc
+#define DCU_UPDATE_MODE_MODE (1 << 31)
+#define DCU_UPDATE_MODE_READREG (1 << 30)
+
+#define DCU_CTRLDESCLN_1(x) (0x200 + (x) * 0x40)
+#define DCU_CTRLDESCLN_1_HEIGHT(x) (x << 16)
+#define DCU_CTRLDESCLN_1_WIDTH(x) (x)
+
+#define DCU_CTRLDESCLN_2(x) (0x204 + (x) * 0x40)
+#define DCU_CTRLDESCLN_2_POSY(x) (x << 16)
+#define DCU_CTRLDESCLN_2_POSX(x) (x)
+
+#define DCU_CTRLDESCLN_3(x) (0x208 + (x) * 0x40)
+
+#define DCU_CTRLDESCLN_4(x) (0x20c + (x) * 0x40)
+#define DCU_CTRLDESCLN_4_EN (1 << 31)
+#define DCU_CTRLDESCLN_4_TILE_EN (1 << 30)
+#define DCU_CTRLDESCLN_4_DATA_SEL_CLUT (1 << 29)
+#define DCU_CTRLDESCLN_4_SAFETY_EN (1 << 28)
+#define DCU_CTRLDESCLN_4_TRANS(x) (x << 20)
+#define DCU_CTRLDESCLN_4_BPP(x) (x << 16)
+#define DCU_CTRLDESCLN_4_RLE_EN (1 << 15)
+#define DCU_CTRLDESCLN_4_LUOFFS(x) (x << 4)
+#define DCU_CTRLDESCLN_4_BB_ON (1 << 2)
+#define DCU_CTRLDESCLN_4_AB(x) (x)
+
+#define DCU_CTRLDESCLN_5(x) (0x210 + (x) * 0x40)
+#define DCU_CTRLDESCLN_5_CKMAX_R(x) (x << 16)
+#define DCU_CTRLDESCLN_5_CKMAX_G(x) (x << 8)
+#define DCU_CTRLDESCLN_5_CKMAX_B(x) (x)
+
+#define DCU_CTRLDESCLN_6(x) (0x214 + (x) * 0x40)
+#define DCU_CTRLDESCLN_6_CKMIN_R(x) (x << 16)
+#define DCU_CTRLDESCLN_6_CKMIN_G(x) (x << 8)
+#define DCU_CTRLDESCLN_6_CKMIN_B(x) (x)
+
+#define DCU_CTRLDESCLN_7(x) (0x218 + (x) * 0x40)
+#define DCU_CTRLDESCLN_7_TILE_VER(x) (x << 16)
+#define DCU_CTRLDESCLN_7_TILE_HOR(x) (x)
+
+#define DCU_CTRLDESCLN_8(x) (0x21c + (x) * 0x40)
+#define DCU_CTRLDESCLN_8_FG_FCOLOR(x) (x)
+
+#define DCU_CTRLDESCLN_9(x) (0x220 + (x) * 0x40)
+#define DCU_CTRLDESCLN_9_BG_BCOLOR(x) (x)
+
+#define DCU_TOTAL_LAYER_NUM 64
+#define DCU_LAYER_NUM_MAX 6
+#define DCU_LAYER_NUM 4
+
+#define BPP_16_RGB565 4
+#define BPP_24_RGB888 5
+#define BPP_32_ARGB8888 6
+
+#define TCON_CTRL1 0x0000
+#define TCON_BYPASS_ENABLE (1 << 29)
+
+#define MFB_SET_ALPHA _IOW('M', 0, __u8)
+#define MFB_GET_ALPHA _IOR('M', 0, __u8)
+#define MFB_SET_LAYER _IOW('M', 4, struct layer_display_offset)
+#define MFB_GET_LAYER _IOR('M', 4, struct layer_display_offset)
+
+static char *fb_mode;
+static unsigned int default_bpp = 24;
+
+static struct fb_videomode dcu_mode_db[] = {
+ {
+ .name = "480x272",
+ .refresh = 75,
+ .xres = 480,
+ .yres = 272,
+ .pixclock = 91996,
+ .left_margin = 2,
+ .right_margin = 2,
+ .upper_margin = 1,
+ .lower_margin = 1,
+ .hsync_len = 41,
+ .vsync_len = 2,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+};
+
+/* DCU framebuffer data structure */
+struct dcu_fb_data {
+ struct fb_info *fsl_dcu_info[DCU_LAYER_NUM];
+ void __iomem *reg_base;
+ unsigned int irq;
+ struct clk *clk;
+};
+
+struct layer_display_offset {
+ int x_layer_d;
+ int y_layer_d;
+};
+
+struct mfb_info {
+ int index;
+ char *id;
+ unsigned long pseudo_palette[16];
+ unsigned char alpha;
+ unsigned char blend;
+ unsigned int count;
+ int x_layer_d; /* layer display x offset to physical screen */
+ int y_layer_d; /* layer display y offset to physical screen */
+ struct dcu_fb_data *parent;
+};
+
+enum mfb_index {
+ LAYER0 = 0,
+ LAYER1,
+ LAYER2,
+ LAYER3,
+};
+
+static struct mfb_info mfb_template[] = {
+ {
+ .index = LAYER0,
+ .id = "Layer0",
+ .alpha = 0xff,
+ .blend = 0,
+ .count = 0,
+ .x_layer_d = 0,
+ .y_layer_d = 0,
+ },
+ {
+ .index = LAYER1,
+ .id = "Layer1",
+ .alpha = 0xff,
+ .blend = 0,
+ .count = 0,
+ .x_layer_d = 50,
+ .y_layer_d = 50,
+ },
+ {
+ .index = LAYER2,
+ .id = "Layer2",
+ .alpha = 0xff,
+ .blend = 0,
+ .count = 0,
+ .x_layer_d = 100,
+ .y_layer_d = 100,
+ },
+ {
+ .index = LAYER3,
+ .id = "Layer3",
+ .alpha = 0xff,
+ .blend = 0,
+ .count = 0,
+ .x_layer_d = 150,
+ .y_layer_d = 150,
+ },
+};
+
+static int enable_panel(struct fb_info *info)
+{
+ struct fb_var_screeninfo *var = &info->var;
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+ unsigned int bpp;
+
+ writel(DCU_CTRLDESCLN_1_HEIGHT(var->yres) |
+ DCU_CTRLDESCLN_1_WIDTH(var->xres),
+ dcufb->reg_base + DCU_CTRLDESCLN_1(mfbi->index));
+ writel(DCU_CTRLDESCLN_2_POSY(mfbi->y_layer_d) |
+ DCU_CTRLDESCLN_2_POSX(mfbi->x_layer_d),
+ dcufb->reg_base + DCU_CTRLDESCLN_2(mfbi->index));
+
+ writel(info->fix.smem_start,
+ dcufb->reg_base + DCU_CTRLDESCLN_3(mfbi->index));
+
+ switch (var->bits_per_pixel) {
+ case 16:
+ bpp = BPP_16_RGB565;
+ break;
+ case 24:
+ bpp = BPP_24_RGB888;
+ break;
+ case 32:
+ bpp = BPP_32_ARGB8888;
+ break;
+ default:
+ printk(KERN_ERR "unsupported color depth: %u\n",
+ var->bits_per_pixel);
+ return -EINVAL;
+ }
+
+ writel(DCU_CTRLDESCLN_4_EN |
+ DCU_CTRLDESCLN_4_TRANS(mfbi->alpha) |
+ DCU_CTRLDESCLN_4_BPP(bpp) |
+ DCU_CTRLDESCLN_4_AB(mfbi->blend),
+ dcufb->reg_base + DCU_CTRLDESCLN_4(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_5_CKMAX_R(0xff) |
+ DCU_CTRLDESCLN_5_CKMAX_G(0xff) |
+ DCU_CTRLDESCLN_5_CKMAX_B(0xff),
+ dcufb->reg_base + DCU_CTRLDESCLN_5(mfbi->index));
+ writel(DCU_CTRLDESCLN_6_CKMIN_R(0) |
+ DCU_CTRLDESCLN_6_CKMIN_G(0) |
+ DCU_CTRLDESCLN_6_CKMIN_B(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_6(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_7_TILE_VER(0) | DCU_CTRLDESCLN_7_TILE_HOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_7(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_8_FG_FCOLOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_8(mfbi->index));
+ writel(DCU_CTRLDESCLN_9_BG_BCOLOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_9(mfbi->index));
+
+ writel(DCU_UPDATE_MODE_READREG, dcufb->reg_base + DCU_UPDATE_MODE);
+ return 0;
+}
+
+static int disable_panel(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+
+ writel(DCU_CTRLDESCLN_1_HEIGHT(0) |
+ DCU_CTRLDESCLN_1_WIDTH(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_1(mfbi->index));
+ writel(DCU_CTRLDESCLN_2_POSY(0) | DCU_CTRLDESCLN_2_POSX(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_2(mfbi->index));
+
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_3(mfbi->index));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_4(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_5_CKMAX_R(0) |
+ DCU_CTRLDESCLN_5_CKMAX_G(0) |
+ DCU_CTRLDESCLN_5_CKMAX_B(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_5(mfbi->index));
+ writel(DCU_CTRLDESCLN_6_CKMIN_R(0) |
+ DCU_CTRLDESCLN_6_CKMIN_G(0) |
+ DCU_CTRLDESCLN_6_CKMIN_B(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_6(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_7_TILE_VER(0) | DCU_CTRLDESCLN_7_TILE_HOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_7(mfbi->index));
+
+ writel(DCU_CTRLDESCLN_8_FG_FCOLOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_8(mfbi->index));
+ writel(DCU_CTRLDESCLN_9_BG_BCOLOR(0),
+ dcufb->reg_base + DCU_CTRLDESCLN_9(mfbi->index));
+
+ writel(DCU_UPDATE_MODE_READREG, dcufb->reg_base + DCU_UPDATE_MODE);
+ return 0;
+}
+
+static void enable_controller(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+ unsigned int dcu_mode;
+
+ dcu_mode = readl(dcufb->reg_base + DCU_DCU_MODE);
+ writel(dcu_mode | DCU_MODE_DCU_MODE(DCU_MODE_NORMAL),
+ dcufb->reg_base + DCU_DCU_MODE);
+}
+
+static void disable_controller(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+
+ writel(DCU_MODE_DCU_MODE(DCU_MODE_OFF),
+ dcufb->reg_base + DCU_DCU_MODE);
+}
+
+static int fsl_dcu_check_var(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ if (var->xres_virtual < var->xres)
+ var->xres_virtual = var->xres;
+ if (var->yres_virtual < var->yres)
+ var->yres_virtual = var->yres;
+
+ if (var->xoffset < 0)
+ var->xoffset = 0;
+
+ if (var->yoffset < 0)
+ var->yoffset = 0;
+
+ if (var->xoffset + info->var.xres > info->var.xres_virtual)
+ var->xoffset = info->var.xres_virtual - info->var.xres;
+
+ if (var->yoffset + info->var.yres > info->var.yres_virtual)
+ var->yoffset = info->var.yres_virtual - info->var.yres;
+
+ if ((var->bits_per_pixel != 32) && (var->bits_per_pixel != 24) &&
+ (var->bits_per_pixel != 16))
+ var->bits_per_pixel = default_bpp;
+
+ switch (var->bits_per_pixel) {
+ case 16:
+ var->red.length = 5;
+ var->red.offset = 11;
+ var->red.msb_right = 0;
+
+ var->green.length = 6;
+ var->green.offset = 5;
+ var->green.msb_right = 0;
+
+ var->blue.length = 5;
+ var->blue.offset = 0;
+ var->blue.msb_right = 0;
+
+ var->transp.length = 0;
+ var->transp.offset = 0;
+ var->transp.msb_right = 0;
+ break;
+ case 24:
+ var->red.length = 8;
+ var->red.offset = 16;
+ var->red.msb_right = 0;
+
+ var->green.length = 8;
+ var->green.offset = 8;
+ var->green.msb_right = 0;
+
+ var->blue.length = 8;
+ var->blue.offset = 0;
+ var->blue.msb_right = 0;
+
+ var->transp.length = 0;
+ var->transp.offset = 0;
+ var->transp.msb_right = 0;
+ break;
+ case 32:
+ var->red.length = 8;
+ var->red.offset = 16;
+ var->red.msb_right = 0;
+
+ var->green.length = 8;
+ var->green.offset = 8;
+ var->green.msb_right = 0;
+
+ var->blue.length = 8;
+ var->blue.offset = 0;
+ var->blue.msb_right = 0;
+
+ var->transp.length = 8;
+ var->transp.offset = 24;
+ var->transp.msb_right = 0;
+ break;
+ default:
+ printk(KERN_ERR "unsupported color depth: %u\n",
+ var->bits_per_pixel);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int calc_div_ratio(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+ unsigned long dcu_clk;
+ unsigned long long tmp;
+
+ dcu_clk = clk_get_rate(dcufb->clk);
+ tmp = info->var.pixclock * (unsigned long long)dcu_clk;
+
+ do_div(tmp, 1000000);
+
+ if (do_div(tmp, 1000000) > 500000)
+ tmp++;
+
+ tmp = tmp - 1;
+ return tmp;
+}
+
+static void update_controller(struct fb_info *info)
+{
+ struct fb_var_screeninfo *var = &info->var;
+ struct mfb_info *mfbi = info->par;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+ unsigned int ratio;
+
+ ratio = calc_div_ratio(info);
+ writel(ratio, dcufb->reg_base + DCU_DIV_RATIO);
+
+ writel(DCU_DISP_SIZE_DELTA_Y(var->yres) |
+ DCU_DISP_SIZE_DELTA_X(var->xres / 16),
+ dcufb->reg_base + DCU_DISP_SIZE);
+
+ /* Horizontal and vertical sync parameter */
+ writel(DCU_HSYN_PARA_BP(var->left_margin) |
+ DCU_HSYN_PARA_PW(var->hsync_len) |
+ DCU_HSYN_PARA_FP(var->right_margin),
+ dcufb->reg_base + DCU_HSYN_PARA);
+
+ writel(DCU_VSYN_PARA_BP(var->upper_margin) |
+ DCU_VSYN_PARA_PW(var->vsync_len) |
+ DCU_VSYN_PARA_FP(var->lower_margin),
+ dcufb->reg_base + DCU_VSYN_PARA);
+
+ writel(DCU_SYN_POL_INV_PXCK_FALL | DCU_SYN_POL_NEG_REMAIN |
+ DCU_SYN_POL_INV_VS_LOW | DCU_SYN_POL_INV_HS_LOW,
+ dcufb->reg_base + DCU_SYN_POL);
+
+ writel(DCU_BGND_R(0) | DCU_BGND_G(0) | DCU_BGND_B(0),
+ dcufb->reg_base + DCU_BGND);
+
+ writel(DCU_MODE_BLEND_ITER(DCU_LAYER_NUM_MAX) | DCU_MODE_RASTER_EN,
+ dcufb->reg_base + DCU_DCU_MODE);
+
+ writel(DCU_THRESHOLD_LS_BF_VS(0x3) | DCU_THRESHOLD_OUT_BUF_HIGH(0x78) |
+ DCU_THRESHOLD_OUT_BUF_LOW(0), dcufb->reg_base + DCU_THRESHOLD);
+
+ enable_controller(info);
+}
+
+static int map_video_memory(struct fb_info *info)
+{
+ u32 smem_len = info->fix.line_length * info->var.yres_virtual;
+
+ info->fix.smem_len = smem_len;
+
+ info->screen_base = dma_alloc_coherent(info->device, info->fix.smem_len,
+ (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL);
+ if (!info->screen_base) {
+ printk(KERN_ERR "unable to allocate fb memory\n");
+ return -ENOMEM;
+ }
+
+ memset(info->screen_base, 0, info->fix.smem_len);
+
+ return 0;
+}
+
+static void unmap_video_memory(struct fb_info *info)
+{
+ if (!info->screen_base)
+ return;
+
+ dma_free_coherent(info->device, info->fix.smem_len,
+ info->screen_base, info->fix.smem_start);
+
+ info->screen_base = NULL;
+ info->fix.smem_start = 0;
+ info->fix.smem_len = 0;
+}
+
+static int fsl_dcu_set_layer(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct fb_var_screeninfo *var = &info->var;
+ struct dcu_fb_data *dcufb = mfbi->parent;
+ int pixel_offset;
+ unsigned long addr;
+
+ pixel_offset = (var->yoffset * var->xres_virtual) + var->xoffset;
+ addr = info->fix.smem_start +
+ (pixel_offset * (var->bits_per_pixel >> 3));
+
+ writel(addr, dcufb->reg_base + DCU_CTRLDESCLN_3(mfbi->index));
+ writel(DCU_UPDATE_MODE_READREG, dcufb->reg_base + DCU_UPDATE_MODE);
+
+ return 0;
+}
+
+static int fsl_dcu_set_par(struct fb_info *info)
+{
+ unsigned long len;
+ struct fb_var_screeninfo *var = &info->var;
+ struct fb_fix_screeninfo *fix = &info->fix;
+ struct mfb_info *mfbi = info->par;
+
+ fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
+ fix->type = FB_TYPE_PACKED_PIXELS;
+ fix->accel = FB_ACCEL_NONE;
+ fix->visual = FB_VISUAL_TRUECOLOR;
+ fix->xpanstep = 1;
+ fix->ypanstep = 1;
+
+ len = info->var.yres_virtual * info->fix.line_length;
+ if (len != info->fix.smem_len) {
+ if (info->fix.smem_start)
+ unmap_video_memory(info);
+
+ if (map_video_memory(info)) {
+ printk(KERN_ERR "unable to allocate fb memory\n");
+ return -ENOMEM;
+ }
+ }
+
+ /* Only layer 0 could update LCD controller */
+ if (mfbi->index = LAYER0)
+ update_controller(info);
+
+ enable_panel(info);
+ return 0;
+}
+
+static inline __u32 CNVT_TOHW(__u32 val, __u32 width)
+{
+ return ((val<<width) + 0x7FFF - val) >> 16;
+}
+
+static int fsl_dcu_setcolreg(unsigned regno, unsigned red, unsigned green,
+ unsigned blue, unsigned transp, struct fb_info *info)
+{
+ unsigned int val;
+ int ret = -EINVAL;
+
+ /*
+ * If greyscale is true, then we convert the RGB value
+ * to greyscale no matter what visual we are using.
+ */
+ if (info->var.grayscale)
+ red = green = blue = (19595 * red + 38470 * green +
+ 7471 * blue) >> 16;
+ switch (info->fix.visual) {
+ case FB_VISUAL_TRUECOLOR:
+ /*
+ * 16-bit True Colour. We encode the RGB value
+ * according to the RGB bitfield information.
+ */
+ if (regno < 16) {
+ u32 *pal = info->pseudo_palette;
+
+ red = CNVT_TOHW(red, info->var.red.length);
+ green = CNVT_TOHW(green, info->var.green.length);
+ blue = CNVT_TOHW(blue, info->var.blue.length);
+ transp = CNVT_TOHW(transp, info->var.transp.length);
+
+ val = (red << info->var.red.offset) |
+ (green << info->var.green.offset) |
+ (blue << info->var.blue.offset) |
+ (transp << info->var.transp.offset);
+
+ pal[regno] = val;
+ ret = 0;
+ }
+ break;
+ case FB_VISUAL_STATIC_PSEUDOCOLOR:
+ case FB_VISUAL_PSEUDOCOLOR:
+ break;
+ }
+
+ return ret;
+}
+
+static int fsl_dcu_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ if ((info->var.xoffset = var->xoffset) &&
+ (info->var.yoffset = var->yoffset))
+ return 0;
+
+ if (var->xoffset < 0 || var->yoffset < 0
+ || var->xoffset + info->var.xres > info->var.xres_virtual
+ || var->yoffset + info->var.yres > info->var.yres_virtual)
+ return -EINVAL;
+
+ info->var.xoffset = var->xoffset;
+ info->var.yoffset = var->yoffset;
+
+ if (var->vmode & FB_VMODE_YWRAP)
+ info->var.vmode |= FB_VMODE_YWRAP;
+ else
+ info->var.vmode &= ~FB_VMODE_YWRAP;
+
+ fsl_dcu_set_layer(info);
+
+ return 0;
+}
+
+static int fsl_dcu_blank(int blank_mode, struct fb_info *info)
+{
+ switch (blank_mode) {
+ case FB_BLANK_VSYNC_SUSPEND:
+ case FB_BLANK_HSYNC_SUSPEND:
+ case FB_BLANK_NORMAL:
+ disable_panel(info);
+ break;
+ case FB_BLANK_POWERDOWN:
+ disable_controller(info);
+ break;
+ case FB_BLANK_UNBLANK:
+ enable_panel(info);
+ break;
+ }
+
+ return 0;
+}
+
+static int fsl_dcu_ioctl(struct fb_info *info, unsigned int cmd,
+ unsigned long arg)
+{
+ struct mfb_info *mfbi = info->par;
+ struct layer_display_offset layer_d;
+ void __user *buf = (void __user *)arg;
+ unsigned char alpha;
+
+ switch (cmd) {
+ case MFB_SET_LAYER:
+ if (copy_from_user(&layer_d, buf, sizeof(layer_d)))
+ return -EFAULT;
+ mfbi->x_layer_d = layer_d.x_layer_d;
+ mfbi->y_layer_d = layer_d.y_layer_d;
+ fsl_dcu_set_par(info);
+ break;
+ case MFB_GET_LAYER:
+ layer_d.x_layer_d = mfbi->x_layer_d;
+ layer_d.y_layer_d = mfbi->y_layer_d;
+ if (copy_to_user(buf, &layer_d, sizeof(layer_d)))
+ return -EFAULT;
+ break;
+ case MFB_GET_ALPHA:
+ alpha = mfbi->alpha;
+ if (copy_to_user(buf, &alpha, sizeof(alpha)))
+ return -EFAULT;
+ break;
+ case MFB_SET_ALPHA:
+ if (copy_from_user(&alpha, buf, sizeof(alpha)))
+ return -EFAULT;
+ mfbi->blend = 1;
+ mfbi->alpha = alpha;
+ fsl_dcu_set_par(info);
+ break;
+ default:
+ printk(KERN_ERR "unknown ioctl command (0x%08X)\n", cmd);
+ return -ENOIOCTLCMD;
+ }
+
+ return 0;
+}
+
+static void enable_interrupts(struct dcu_fb_data *dcufb)
+{
+ u32 int_mask = readl(dcufb->reg_base + DCU_INT_MASK);
+
+ writel(int_mask & ~DCU_INT_MASK_UNDRUN, dcufb->reg_base + DCU_INT_MASK);
+}
+
+static void reset_layers(struct dcu_fb_data *dcufb)
+{
+ int i;
+
+ for (i = 1; i < DCU_TOTAL_LAYER_NUM; i++) {
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_1(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_2(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_3(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_4(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_5(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_6(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_7(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_8(i));
+ writel(0, dcufb->reg_base + DCU_CTRLDESCLN_9(i));
+ }
+ writel(DCU_UPDATE_MODE_READREG, dcufb->reg_base + DCU_UPDATE_MODE);
+}
+
+static int fsl_dcu_open(struct fb_info *info, int user)
+{
+ struct mfb_info *mfbi = info->par;
+ int ret = 0;
+
+ mfbi->index = info->node;
+
+ mfbi->count++;
+ if (mfbi->count = 1) {
+ fsl_dcu_check_var(&info->var, info);
+ ret = fsl_dcu_set_par(info);
+ if (ret < 0)
+ mfbi->count--;
+ else
+ enable_interrupts(mfbi->parent);
+ }
+
+ return ret;
+}
+
+static int fsl_dcu_release(struct fb_info *info, int user)
+{
+ struct mfb_info *mfbi = info->par;
+ int ret = 0;
+
+ mfbi->count--;
+ if (mfbi->count = 0) {
+ ret = disable_panel(info);
+ if (ret < 0)
+ mfbi->count++;
+ }
+
+ return ret;
+}
+
+static struct fb_ops fsl_dcu_ops = {
+ .owner = THIS_MODULE,
+ .fb_check_var = fsl_dcu_check_var,
+ .fb_set_par = fsl_dcu_set_par,
+ .fb_setcolreg = fsl_dcu_setcolreg,
+ .fb_blank = fsl_dcu_blank,
+ .fb_pan_display = fsl_dcu_pan_display,
+ .fb_fillrect = cfb_fillrect,
+ .fb_copyarea = cfb_copyarea,
+ .fb_imageblit = cfb_imageblit,
+ .fb_ioctl = fsl_dcu_ioctl,
+ .fb_open = fsl_dcu_open,
+ .fb_release = fsl_dcu_release,
+};
+
+static int install_framebuffer(struct fb_info *info)
+{
+ struct mfb_info *mfbi = info->par;
+ struct fb_videomode *db = dcu_mode_db;
+ unsigned int dbsize = ARRAY_SIZE(dcu_mode_db);
+ int ret;
+
+ info->var.activate = FB_ACTIVATE_NOW;
+ info->fbops = &fsl_dcu_ops;
+ info->flags = FBINFO_FLAG_DEFAULT;
+ info->pseudo_palette = &mfbi->pseudo_palette;
+
+ fb_alloc_cmap(&info->cmap, 16, 0);
+
+ ret = fb_find_mode(&info->var, info, fb_mode, db, dbsize,
+ NULL, default_bpp);
+
+ if (fsl_dcu_check_var(&info->var, info)) {
+ ret = -EINVAL;
+ goto failed_checkvar;
+ }
+
+ if (register_framebuffer(info) < 0) {
+ ret = -EINVAL;
+ goto failed_register_framebuffer;
+ }
+
+ printk(KERN_INFO "fb%d: %s fb device registered successfully.\n",
+ info->node, info->fix.id);
+ return 0;
+
+failed_checkvar:
+ fb_dealloc_cmap(&info->cmap);
+failed_register_framebuffer:
+ unmap_video_memory(info);
+ fb_dealloc_cmap(&info->cmap);
+ return ret;
+}
+
+static void uninstall_framebuffer(struct fb_info *info)
+{
+ unregister_framebuffer(info);
+ unmap_video_memory(info);
+
+ if (&info->cmap)
+ fb_dealloc_cmap(&info->cmap);
+}
+
+static irqreturn_t fsl_dcu_irq(int irq, void *dev_id)
+{
+ struct dcu_fb_data *dcufb = dev_id;
+ unsigned int status = readl(dcufb->reg_base + DCU_INT_STATUS);
+ u32 dcu_mode;
+
+ if (status) {
+ if (status & DCU_INT_STATUS_UNDRUN) {
+ dcu_mode = readl(dcufb->reg_base + DCU_DCU_MODE);
+ dcu_mode &= ~DCU_MODE_DCU_MODE_MASK;
+ writel(dcu_mode | DCU_MODE_DCU_MODE(DCU_MODE_OFF),
+ dcufb->reg_base + DCU_DCU_MODE);
+ udelay(1);
+ writel(dcu_mode | DCU_MODE_DCU_MODE(DCU_MODE_NORMAL),
+ dcufb->reg_base + DCU_DCU_MODE);
+ }
+ writel(status, dcufb->reg_base + DCU_INT_STATUS);
+ return IRQ_HANDLED;
+ }
+ return IRQ_NONE;
+}
+
+#ifdef CONFIG_PM
+static int fsl_dcu_suspend(struct platform_device *pdev,
+ pm_message_t state)
+{
+ struct dcu_fb_data *dcufb = dev_get_drvdata(&pdev->dev);
+
+ clk_disable_unprepare(dcufb->clk);
+ return 0;
+}
+
+static int fsl_dcu_resume(struct platform_device *pdev)
+{
+ struct dcu_fb_data *dcufb = dev_get_drvdata(&pdev->dev);
+
+ clk_prepare_enable(dcufb->clk);
+ return 0;
+}
+#else
+#define fsl_dcu_suspend NULL
+#define fsl_dcu_resume NULL
+#endif
+
+static int bypass_tcon(struct device_node *np)
+{
+ struct device_node *tcon_np;
+ struct platform_device *tcon_pdev;
+ struct clk *tcon_clk;
+ void __iomem *tcon_reg;
+ int ret = 0;
+
+ tcon_np = of_parse_phandle(np, "tcon-controller", 0);
+ if (!tcon_np)
+ return -EINVAL;
+
+ tcon_pdev = of_find_device_by_node(tcon_np);
+ if (!tcon_pdev)
+ return -EINVAL;
+
+ tcon_clk = devm_clk_get(&tcon_pdev->dev, "tcon");
+ if (IS_ERR(tcon_clk)) {
+ ret = PTR_ERR(tcon_clk);
+ goto failed_getclock;
+ }
+ clk_prepare_enable(tcon_clk);
+
+ tcon_reg = of_iomap(tcon_np, 0);
+ if (!tcon_reg) {
+ ret = -ENOMEM;
+ goto failed_ioremap;
+ }
+ writel(TCON_BYPASS_ENABLE, tcon_reg + TCON_CTRL1);
+
+ return 0;
+
+failed_ioremap:
+ clk_disable_unprepare(tcon_clk);
+failed_getclock:
+ of_node_put(tcon_np);
+ return ret;
+}
+
+static int fsl_dcu_probe(struct platform_device *pdev)
+{
+ struct dcu_fb_data *dcufb;
+ struct mfb_info *mfbi;
+ struct resource *res;
+ int ret = 0;
+ int i;
+
+ dcufb = devm_kzalloc(&pdev->dev,
+ sizeof(struct dcu_fb_data), GFP_KERNEL);
+ if (!dcufb)
+ return -ENOMEM;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "could not get memory IO resource\n");
+ return -ENODEV;
+ }
+
+ dcufb->reg_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(dcufb->reg_base)) {
+ ret = PTR_ERR(dcufb->reg_base);
+ goto failed_ioremap;
+ }
+
+ dcufb->irq = platform_get_irq(pdev, 0);
+ if (!dcufb->irq) {
+ ret = -EINVAL;
+ goto failed_getirq;
+ }
+
+ ret = request_irq(dcufb->irq, fsl_dcu_irq, 0, DRIVER_NAME, dcufb);
+ if (ret) {
+ dev_err(&pdev->dev, "could not request irq\n");
+ goto failed_requestirq;
+ }
+
+ /* Put TCON in bypass mode, so the input signals from DCU are passed
+ * through TCON unchanged */
+ ret = bypass_tcon(pdev->dev.of_node);
+ if (ret) {
+ dev_err(&pdev->dev, "could not bypass TCON\n");
+ goto failed_bypasstcon;
+ }
+
+ dcufb->clk = devm_clk_get(&pdev->dev, "dcu");
+ if (IS_ERR(dcufb->clk)) {
+ dev_err(&pdev->dev, "could not get clock\n");
+ goto failed_getclock;
+ }
+ clk_prepare_enable(dcufb->clk);
+
+ for (i = 0; i < ARRAY_SIZE(dcufb->fsl_dcu_info); i++) {
+ dcufb->fsl_dcu_info[i] + framebuffer_alloc(sizeof(struct mfb_info), &pdev->dev);
+ if (!dcufb->fsl_dcu_info[i]) {
+ ret = ENOMEM;
+ goto failed_alloc_framebuffer;
+ }
+
+ dcufb->fsl_dcu_info[i]->fix.smem_start = 0;
+
+ mfbi = dcufb->fsl_dcu_info[i]->par;
+ memcpy(mfbi, &mfb_template[i], sizeof(struct mfb_info));
+ mfbi->parent = dcufb;
+
+ ret = install_framebuffer(dcufb->fsl_dcu_info[i]);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "could not register framebuffer %d\n", i);
+ goto failed_register_framebuffer;
+ }
+ }
+
+ reset_layers(mfbi->parent);
+
+ dev_set_drvdata(&pdev->dev, dcufb);
+ return 0;
+
+failed_register_framebuffer:
+ for (i = 0; i < ARRAY_SIZE(dcufb->fsl_dcu_info); i++) {
+ if (dcufb->fsl_dcu_info[i])
+ framebuffer_release(dcufb->fsl_dcu_info[i]);
+ }
+failed_alloc_framebuffer:
+failed_getclock:
+failed_bypasstcon:
+ free_irq(dcufb->irq, dcufb);
+failed_requestirq:
+failed_getirq:
+ iounmap(dcufb->reg_base);
+failed_ioremap:
+ kfree(dcufb);
+ return ret;
+}
+
+static int fsl_dcu_remove(struct platform_device *pdev)
+{
+ struct dcu_fb_data *dcufb = dev_get_drvdata(&pdev->dev);
+ int i;
+
+ disable_controller(dcufb->fsl_dcu_info[0]);
+
+ clk_disable_unprepare(dcufb->clk);
+ free_irq(dcufb->irq, dcufb);
+
+ for (i = 0; i < ARRAY_SIZE(dcufb->fsl_dcu_info); i++) {
+ uninstall_framebuffer(dcufb->fsl_dcu_info[i]);
+ framebuffer_release(dcufb->fsl_dcu_info[i]);
+ }
+
+ return 0;
+}
+
+static int fsl_dcu_setup(void)
+{
+#ifndef MODULE
+ char *opt, *options = NULL;
+ unsigned long val;
+
+ if (fb_get_options("fslfb", &options))
+ return -ENODEV;
+
+ if (!options || !*options)
+ return 0;
+
+ while ((opt = strsep(&options, ",")) != NULL) {
+ if (!*opt)
+ continue;
+ if (!strncmp(opt, "bpp=", 4)) {
+ if (!strict_strtoul(opt + 4, 10, &val))
+ default_bpp = val;
+ } else {
+ fb_mode = opt;
+ }
+ }
+#endif
+ return 0;
+}
+
+static struct of_device_id fsl_dcu_dt_ids[] = {
+ {
+ .compatible = "fsl,vf610-dcu",
+ },
+ {}
+};
+
+static struct platform_driver fsl_dcu_driver = {
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = fsl_dcu_dt_ids,
+ },
+ .probe = fsl_dcu_probe,
+ .remove = fsl_dcu_remove,
+ .suspend = fsl_dcu_suspend,
+ .resume = fsl_dcu_resume,
+};
+
+static int __init fsl_dcu_init(void)
+{
+ int ret = fsl_dcu_setup();
+
+ if (ret < 0)
+ return ret;
+
+ return platform_driver_register(&fsl_dcu_driver);
+}
+
+static void __exit fsl_dcu_exit(void)
+{
+ platform_driver_unregister(&fsl_dcu_driver);
+}
+
+module_init(fsl_dcu_init);
+module_exit(fsl_dcu_exit);
+
+MODULE_AUTHOR("Alison Wang");
+MODULE_DESCRIPTION("Freescale DCU framebuffer driver");
+MODULE_LICENSE("GPL v2");
--
1.8.0
^ permalink raw reply related
* [PATCH 3/4] ARM: clk: vf610: Add DCU and TCON clock support
From: Alison Wang @ 2013-07-05 7:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1373010702-9244-1-git-send-email-b18965@freescale.com>
This patch adds DCU and TCON clock support for Vybrid VF610 platform.
Signed-off-by: Alison Wang <b18965@freescale.com>
---
arch/arm/mach-imx/clk-vf610.c | 5 +++++
include/dt-bindings/clock/vf610-clock.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c
index d617c0b..c4dbe32 100644
--- a/arch/arm/mach-imx/clk-vf610.c
+++ b/arch/arm/mach-imx/clk-vf610.c
@@ -245,6 +245,8 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
clk[VF610_CLK_DCU1_DIV] = imx_clk_divider("dcu1_div", "dcu1_en", CCM_CSCDR3, 20, 3);
clk[VF610_CLK_DCU1] = imx_clk_gate2("dcu1", "dcu1_div", CCM_CCGR9, CCM_CCGRx_CGn(8));
+ clk[VF610_CLK_TCON0] = imx_clk_gate2("tcon0", "platform_bus", CCM_CCGR1, CCM_CCGRx_CGn(13));
+
clk[VF610_CLK_ESAI_SEL] = imx_clk_mux("esai_sel", CCM_CSCMR1, 20, 2, esai_sels, 4);
clk[VF610_CLK_ESAI_EN] = imx_clk_gate("esai_en", "esai_sel", CCM_CSCDR2, 30);
clk[VF610_CLK_ESAI_DIV] = imx_clk_divider("esai_div", "esai_en", CCM_CSCDR2, 24, 4);
@@ -311,6 +313,9 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
clk_set_parent(clk[VF610_CLK_SAI2_SEL], clk[VF610_CLK_AUDIO_EXT]);
clk_set_parent(clk[VF610_CLK_SAI3_SEL], clk[VF610_CLK_AUDIO_EXT]);
+ clk_set_parent(clk[VF610_CLK_DCU0_SEL], clk[VF610_CLK_PLL1_PFD2]);
+ clk_set_rate(clk[VF610_CLK_DCU0_DIV], 113200000);
+
/* Add the clocks to provider list */
clk_data.clks = clk;
clk_data.clk_num = ARRAY_SIZE(clk);
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h
index 15e997f..a2fc6d9 100644
--- a/include/dt-bindings/clock/vf610-clock.h
+++ b/include/dt-bindings/clock/vf610-clock.h
@@ -158,6 +158,7 @@
#define VF610_CLK_GPU_SEL 145
#define VF610_CLK_GPU_EN 146
#define VF610_CLK_GPU2D 147
-#define VF610_CLK_END 148
+#define VF610_CLK_TCON0 148
+#define VF610_CLK_END 149
#endif /* __DT_BINDINGS_CLOCK_VF610_H */
--
1.8.0
^ permalink raw reply related
* [PATCH 2/4] ARM: dts: vf610-twr: Enable DCU and TCON devices
From: Alison Wang @ 2013-07-05 7:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1373010702-9244-1-git-send-email-b18965@freescale.com>
This patch enables DCU and TCON devices for Vybrid VF610 TOWER board.
Signed-off-by: Alison Wang <b18965@freescale.com>
---
arch/arm/boot/dts/vf610-twr.dts | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
index b3905f5..605fb04 100644
--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -36,6 +36,12 @@
};
+&dcu0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_dcu0_1>;
+ status = "okay";
+};
+
&fec0 {
phy-mode = "rmii";
pinctrl-names = "default";
@@ -50,6 +56,10 @@
status = "okay";
};
+&tcon0 {
+ status = "okay";
+};
+
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1_1>;
--
1.8.0
^ permalink raw reply related
* [PATCH 1/4] ARM: dts: vf610: Add DCU and TCON nodes
From: Alison Wang @ 2013-07-05 7:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1373010702-9244-1-git-send-email-b18965@freescale.com>
This patch adds DCU and TCON nodes in SoC level DTS for Freescale
Vybrid VF610. It also removes useless pin for DCU0 pinctrl.
Signed-off-by: Alison Wang <b18965@freescale.com>
---
arch/arm/boot/dts/vf610.dtsi | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index e1eb7da..037e8f1 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -140,6 +140,14 @@
clock-names = "pit";
};
+ tcon0: tcon@4003d000 {
+ compatible = "fsl,vf610-tcon";
+ reg = <0x4003d000 0x1000>;
+ clocks = <&clks VF610_CLK_TCON0>;
+ clock-names = "tcon";
+ status = "disabled";
+ };
+
wdog@4003e000 {
compatible = "fsl,vf610-wdt", "fsl,imx21-wdt";
reg = <0x4003e000 0x1000>;
@@ -169,7 +177,6 @@
dcu0 {
pinctrl_dcu0_1: dcu0grp_1 {
fsl,pins = <
- VF610_PAD_PTB8__GPIO_30 0x42
VF610_PAD_PTE0__DCU0_HSYNC 0x42
VF610_PAD_PTE1__DCU0_VSYNC 0x42
VF610_PAD_PTE2__DCU0_PCLK 0x42
@@ -395,6 +402,16 @@
reg = <0x40050000 0x1000>;
};
+ dcu0: dcu@40058000 {
+ compatible = "fsl,vf610-dcu";
+ reg = <0x40058000 0x1200>;
+ interrupts = <0 30 0x04>;
+ clocks = <&clks VF610_CLK_DCU0>;
+ clock-names = "dcu";
+ tcon-controller = <&tcon0>;
+ status = "disabled";
+ };
+
i2c0: i2c@40066000 {
#address-cells = <1>;
#size-cells = <0>;
--
1.8.0
^ permalink raw reply related
* [PATCH 0/4] ARM: vf610: Add DCU framebuffer driver for Vybrid VF610 platform
From: Alison Wang @ 2013-07-05 7:51 UTC (permalink / raw)
To: linux-arm-kernel
This series contain DCU framebuffer driver for Freescale Vybrid VF610 platform.
The Display Controller Unit (DCU) module is a system master that
fetches graphics stored in internal or external memory and displays
them on a TFT LCD panel. A wide range of panel sizes is supported
and the timing of the interface signals is highly configurable.
Graphics are read directly from memory and then blended in real-time,
which allows for dynamic content creation with minimal CPU intervention.
The features:
(1) Full RGB888 output to TFT LCD panel.
(2) For the current LCD panel, WQVGA "480x272" is supported.
(3) Blending of each pixel using up to 4 source layers dependent on size of panel.
(4) Each graphic layer can be placed with one pixel resolution in either axis.
(5) Each graphic layer support RGB565 and RGB888 direct colors without alpha channel
and BGRA8888 direct colors with an alpha channel.
(6) Each graphic layer support alpha blending with 8-bit resolution.
----------------------------------------------------------------
Alison Wang (4):
ARM: dts: vf610: Add DCU and TCON nodes
ARM: dts: vf610-twr: Enable DCU and TCON devices
ARM: clk: vf610: Add DCU and TCON clock support
fb: Add DCU framebuffer driver for Vybrid VF610 platform
arch/arm/boot/dts/vf610-twr.dts | 10 +
arch/arm/boot/dts/vf610.dtsi | 18 ++
arch/arm/mach-imx/clk-vf610.c | 5 +
drivers/video/Kconfig | 9 +
drivers/video/Makefile | 1 +
drivers/video/fsl-dcu-fb.c | 1091 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
include/dt-bindings/clock/vf610-clock.h | 3 +-
7 files changed, 1136 insertions(+), 1 deletion(-)
create mode 100644 drivers/video/fsl-dcu-fb.c
^ permalink raw reply
* Re: [ANNOUNCE] I'm just back
From: Dave Airlie @ 2013-07-05 0:22 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20130703110644.GL305@game.jcrosoft.org>
> I get sick for 2 weeks and just back to Shanghai
>
> I'm going through the ML the following days
>
> And will send the pull to Linus
Have you a timeframe for the pull, the drm pull is blocked on that fb
options const patch.
Dave.
^ permalink raw reply
* Re: [PATCH 01/15] video: bfin: remove unnecessary platform_set_drvdata()
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
To: linux-fbdev
On 10:45 Tue 25 Jun , Jingoo Han wrote:
> On Saturday, May 11, 2013 9:45 PM, Jingoo Han wrote:
> >
> > The driver core clears the driver data to NULL after device_release
> > or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
> > (device-core: Ensure drvdata = NULL when no driver is bound).
> > Thus, it is not needed to manually clear the device driver data to NULL.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>
> Hi,
>
> I will squash everything down into one patch with the ACKs,
> and send it again.
fine by me
Best Regards,
J.
>
> Best regards,
> Jingoo Han
>
>
> > ---
> > drivers/video/bf54x-lq043fb.c | 1 -
> > drivers/video/bfin-lq035q1-fb.c | 2 --
> > drivers/video/bfin-t350mcqb-fb.c | 2 --
> > 3 files changed, 0 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
> > index 2726a5b..87f288b 100644
> > --- a/drivers/video/bf54x-lq043fb.c
> > +++ b/drivers/video/bf54x-lq043fb.c
> > @@ -681,7 +681,6 @@ out3:
> > out2:
> > free_dma(CH_EPPI0);
> > out1:
> > - platform_set_drvdata(pdev, NULL);
> >
> > return ret;
> > }
> > diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> > index 29d8c04..be65bae 100644
> > --- a/drivers/video/bfin-lq035q1-fb.c
> > +++ b/drivers/video/bfin-lq035q1-fb.c
> > @@ -759,7 +759,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
> > out2:
> > free_dma(CH_PPI);
> > out1:
> > - platform_set_drvdata(pdev, NULL);
> >
> > return ret;
> > }
> > @@ -788,7 +787,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev)
> > bfin_lq035q1_free_ports(info->disp_info->ppi_mode =
> > USE_RGB565_16_BIT_PPI);
> >
> > - platform_set_drvdata(pdev, NULL);
> > framebuffer_release(fbinfo);
> >
> > dev_info(&pdev->dev, "unregistered LCD driver\n");
> > diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
> > index d46da01..48c0c4e 100644
> > --- a/drivers/video/bfin-t350mcqb-fb.c
> > +++ b/drivers/video/bfin-t350mcqb-fb.c
> > @@ -578,7 +578,6 @@ out3:
> > out2:
> > free_dma(CH_PPI);
> > out1:
> > - platform_set_drvdata(pdev, NULL);
> >
> > return ret;
> > }
> > @@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev)
> >
> > bfin_t350mcqb_request_ports(0);
> >
> > - platform_set_drvdata(pdev, NULL);
> > framebuffer_release(fbinfo);
> >
> > printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n");
> > --
> > 1.7.2.5
>
>
^ permalink raw reply
* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <51C951C2.8090901@atmel.com>
On 10:16 Tue 25 Jun , Nicolas Ferre wrote:
> On 25/06/2013 10:14, Boris BREZILLON :
> >Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> >avoid common clk framework warnings.
> >
> >Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>
> Jean-Christophe, can you take this one?
Yes I'll
Best Regards,
J.
>
> Thanks, best regards,
>
> >---
> > drivers/video/atmel_lcdfb.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> >diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> >index 540909d..8525457 100644
> >--- a/drivers/video/atmel_lcdfb.c
> >+++ b/drivers/video/atmel_lcdfb.c
> >@@ -893,14 +893,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
> >
> > static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
> > {
> >- clk_enable(sinfo->bus_clk);
> >- clk_enable(sinfo->lcdc_clk);
> >+ clk_prepare_enable(sinfo->bus_clk);
> >+ clk_prepare_enable(sinfo->lcdc_clk);
> > }
> >
> > static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
> > {
> >- clk_disable(sinfo->bus_clk);
> >- clk_disable(sinfo->lcdc_clk);
> >+ clk_disable_unprepare(sinfo->bus_clk);
> >+ clk_disable_unprepare(sinfo->lcdc_clk);
> > }
> >
> >
> >
>
>
> --
> Nicolas Ferre
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox