* 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 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 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 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 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: 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
* [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
* [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 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 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 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] 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
* 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
* [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
* [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
* [PATCH V6 1/4] ARM: dts: Add DP PHY node to exynos5250.dtsi
From: Jingoo Han @ 2013-07-09 8:04 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 fc9fb3d..c326c06 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -616,6 +616,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 @@
interrupt-parent = <&combiner>;
#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 V6 2/4] phy: Add driver for Exynos DP PHY
From: Jingoo Han @ 2013-07-09 8:04 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 V6 3/4] video: exynos_dp: remove non-DT support for Exynos Display Port
From: Jingoo Han @ 2013-07-09 8:05 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 V6 4/4] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-09 8:05 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 c60da67..e2874ae 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.
@@ -21,6 +21,10 @@ Required properties for dp-controller:
of memory mapped region.
-interrupts:
interrupt combiner values.
+ -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:
@@ -61,12 +65,8 @@ SOC specific portion:
reg = <0x145b0000 0x10000>;
interrupts = <10 3>;
interrupt-parent = <&combiner>;
-
- 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
* Re: [PATCH V6 0/4] Generic PHY driver for the Exynos SoC DP PHY
From: Sylwester Nawrocki @ 2013-07-09 8:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <003d01ce7c7a$d04043d0$70c0cb70$@samsung.com>
On 07/09/2013 10:03 AM, Jingoo Han wrote:
> 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
I'm not sure if we really need to keep the documentation of the
original binding. Anyway, for the whole series, please feel free
to ad my
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
--
Thanks,
Sylwester
^ permalink raw reply
* [PATCH 1/1] OMAPDSS: Add sil9022 driver
From: Sathya Prakash M R @ 2013-07-09 9:19 UTC (permalink / raw)
To: tomi.valkeinen
Cc: archit, linux-omap, linux-fbdev, Srinivas Pulukuru,
Sathya Prakash M R
From: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
Add driver for SIL9022 DPI-to-HDMI chip.
Signed-off-by: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
[sathyap@ti.com: Ported the driver from 2.6.32 based internal
kernel to v3.10 kernel]
Signed-off-by: Sathya Prakash M R <sathyap@ti.com>
---
This patch was tested using the legacy OMAP3630 based Zoom3 platform.
There is no DT support for Zoom , hence board file changes
made locally were used for validation purpose.
Further, DT support will be added for a newer SOC which uses
the sil9022 HDMI interface chip.
drivers/video/omap2/displays/Kconfig | 8 +
drivers/video/omap2/displays/Makefile | 1 +
drivers/video/omap2/displays/panel-sil9022.c | 1274 ++++++++++++++++++++++++++
drivers/video/omap2/displays/panel-sil9022.h | 527 +++++++++++
4 files changed, 1810 insertions(+)
create mode 100644 drivers/video/omap2/displays/panel-sil9022.c
create mode 100644 drivers/video/omap2/displays/panel-sil9022.h
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index c3853c9..53d8bb7 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -39,6 +39,14 @@ config PANEL_NEC_NL8048HL11_01B
This NEC NL8048HL11-01B panel is TFT LCD
used in the Zoom2/3/3630 sdp boards.
+config PANEL_SIL9022
+ tristate "HDMI interface"
+ depends on OMAP2_DSS_DPI
+ depends on I2C
+ help
+ Driver for SIL9022 DPI-to-HDMI chip
+ Driver uses i2c to read EDID information.
+
config PANEL_PICODLP
tristate "TI PICO DLP mini-projector"
depends on OMAP2_DSS_DPI && I2C
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 58a5176..34cfa8e 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_PANEL_TFP410) += panel-tfp410.o
obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o
+obj-$(CONFIG_PANEL_SIL9022) += panel-sil9022.o
obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
obj-$(CONFIG_PANEL_PICODLP) += panel-picodlp.o
diff --git a/drivers/video/omap2/displays/panel-sil9022.c b/drivers/video/omap2/displays/panel-sil9022.c
new file mode 100644
index 0000000..3b5cb17
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-sil9022.c
@@ -0,0 +1,1274 @@
+/*
+ * drivers/video/omap2/panel-sil9022.c
+ *
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ *
+ * SIL9022 hdmi driver
+ * Owner: kiran Chitriki
+ *
+ */
+
+/***********************************/
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/i2c.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <video/omapdss.h>
+#include <video/omap-panel-data.h>
+#include "panel-sil9022.h"
+
+u16 current_descriptor_addrs;
+
+static struct i2c_client *sil9022_client;
+
+static struct omap_video_timings omap_dss_hdmi_timings = {
+ .x_res = HDMI_XRES,
+ .y_res = HDMI_YRES,
+ .pixel_clock = HDMI_PIXCLOCK_MAX,
+ .hfp = 110,
+ .hbp = 220,
+ .hsw = 40,
+ .vfp = 5,
+ .vbp = 20,
+ .vsw = 5,
+ .vsync_level = OMAPDSS_SIG_ACTIVE_LOW,
+ .hsync_level = OMAPDSS_SIG_ACTIVE_LOW,
+ .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
+ .de_level = OMAPDSS_SIG_ACTIVE_HIGH,
+ .sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES,
+};
+
+static struct hdmi_reg_data hdmi_tpi_audio_config_data[] = {
+ /* Transmitter is brought to Full operation when value of power
+ * state register is 0x0 */
+ { HDMI_TPI_POWER_STATE_CTRL_REG, TPI_AVI_POWER_STATE_D0 },
+ /* TMDS output lines active. bit 3 1:TMDS inactive, 0: TMDS active */
+ { HDMI_SYS_CTRL_DATA_REG, 0x01 },
+ /*HDCP Enable - Disable */
+ { HDMI_TPI_HDCP_CONTROLDATA_REG, 0 },
+ /* I2S mode , Mute Enabled , PCM */
+ { HDMI_TPI_AUDIO_CONFIG_BYTE2_REG, TPI_AUDIO_INTERFACE_I2S |
+ TPI_AUDIO_MUTE_ENABLE |
+ TPI_AUDIO_CODING_PCM },
+ /* I2S Input configuration register */
+ { HDMI_TPI_I2S_INPUT_CONFIG_REG, TPI_I2S_SCK_EDGE_RISING |
+ TPI_I2S_MCLK_MULTIPLIER_256 |
+ TPI_I2S_WS_POLARITY_HIGH |
+ TPI_I2S_SD_JUSTIFY_LEFT |
+ TPI_I2S_SD_DIRECTION_MSB_FIRST |
+ TPI_I2S_FIRST_BIT_SHIFT_YES },
+ /* I2S Enable ad Mapping Register */
+ { HDMI_TPI_I2S_ENABLE_MAPPING_REG, TPI_I2S_SD_CHANNEL_ENABLE |
+ TPI_I2S_SD_FIFO_0 |
+ TPI_I2S_DOWNSAMPLE_DISABLE |
+ TPI_I2S_LF_RT_SWAP_NO |
+ TPI_I2S_SD_CONFIG_SELECT_SD0 },
+ { HDMI_TPI_I2S_ENABLE_MAPPING_REG, TPI_I2S_SD_CHANNEL_DISABLE |
+ TPI_I2S_SD_FIFO_1 |
+ TPI_I2S_DOWNSAMPLE_DISABLE |
+ TPI_I2S_LF_RT_SWAP_NO |
+ TPI_I2S_SD_CONFIG_SELECT_SD1 },
+ { HDMI_TPI_I2S_ENABLE_MAPPING_REG, TPI_I2S_SD_CHANNEL_DISABLE |
+ TPI_I2S_SD_FIFO_2 |
+ TPI_I2S_DOWNSAMPLE_DISABLE |
+ TPI_I2S_LF_RT_SWAP_NO |
+ TPI_I2S_SD_CONFIG_SELECT_SD2 },
+ { HDMI_TPI_I2S_ENABLE_MAPPING_REG, TPI_I2S_SD_CHANNEL_DISABLE |
+ TPI_I2S_SD_FIFO_3 |
+ TPI_I2S_DOWNSAMPLE_DISABLE |
+ TPI_I2S_LF_RT_SWAP_NO |
+ TPI_I2S_SD_CONFIG_SELECT_SD3 },
+ { HDMI_TPI_AUDIO_CONFIG_BYTE3_REG, TPI_AUDIO_SAMPLE_SIZE_16 |
+ TPI_AUDIO_FREQ_44KHZ |
+ TPI_AUDIO_2_CHANNEL },
+ /* Speaker Configuration refer CEA Specification*/
+ { HDMI_TPI_AUDIO_CONFIG_BYTE4_REG, (0x0 << 0)},
+ /* Stream Header Settings */
+ { HDMI_TPI_I2S_STRM_HDR_0_REG, I2S_CHAN_STATUS_MODE },
+ { HDMI_TPI_I2S_STRM_HDR_1_REG, I2S_CHAN_STATUS_CAT_CODE },
+ { HDMI_TPI_I2S_STRM_HDR_2_REG, I2S_CHAN_SOURCE_CHANNEL_NUM },
+ { HDMI_TPI_I2S_STRM_HDR_3_REG, I2S_CHAN_ACCURACY_N_44_SAMPLING_FS },
+ { HDMI_TPI_I2S_STRM_HDR_4_REG, I2S_CHAN_ORIGIN_FS_N_SAMP_LENGTH },
+ /* Infoframe data Select */
+ { HDMI_CPI_MISC_IF_SELECT_REG, HDMI_INFOFRAME_TX_ENABLE |
+ HDMI_INFOFRAME_TX_REPEAT |
+ HDMI_AUDIO_INFOFRAME },
+};
+
+static u8 misc_audio_info_frame_data[] = {
+ MISC_INFOFRAME_TYPE | MISC_INFOFRAME_ALWAYS_SET,
+ MISC_INFOFRAME_VERSION,
+ MISC_INFOFRAME_LENGTH,
+ 0, /* Checksum byte*/
+ HDMI_SH_PCM | HDMI_SH_TWO_CHANNELS,
+ HDMI_SH_44KHz | HDMI_SH_16BIT, /* 44.1 KHz*/
+ 0x0, /* Default 0*/
+ HDMI_SH_SPKR_FLFR,
+ HDMI_SH_0dB_ATUN | 0x1, /* 0 dB Attenuation*/
+ 0x0,
+ 0x0,
+ 0x0,
+ 0x0,
+ 0x0
+};
+
+static u8 avi_info_frame_data[] = {
+ 0x00,
+ 0x00,
+ 0xA8,
+ 0x00,
+ 0x04,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00
+};
+
+void get_horz_vert_timing_info(u8 *edid)
+{
+ /*HORIZONTAL FRONT PORCH */
+ omap_dss_hdmi_timings.hfp = edid[current_descriptor_addrs + 8];
+ /*HORIZONTAL SYNC WIDTH */
+ omap_dss_hdmi_timings.hsw = edid[current_descriptor_addrs + 9];
+ /*HORIZONTAL BACK PORCH */
+ omap_dss_hdmi_timings.hbp = (((edid[current_descriptor_addrs + 4]
+ & 0x0F) << 8) |
+ edid[current_descriptor_addrs + 3]) -
+ (omap_dss_hdmi_timings.hfp + omap_dss_hdmi_timings.hsw);
+ /*VERTICAL FRONT PORCH */
+ omap_dss_hdmi_timings.vfp = ((edid[current_descriptor_addrs + 10] &
+ 0xF0) >> 4);
+ /*VERTICAL SYNC WIDTH */
+ omap_dss_hdmi_timings.vsw = (edid[current_descriptor_addrs + 10] &
+ 0x0F);
+ /*VERTICAL BACK PORCH */
+ omap_dss_hdmi_timings.vbp = (((edid[current_descriptor_addrs + 7] &
+ 0x0F) << 8) |
+ edid[current_descriptor_addrs + 6]) -
+ (omap_dss_hdmi_timings.vfp + omap_dss_hdmi_timings.vsw);
+
+ dev_dbg(&sil9022_client->dev, "<%s>\n"
+ "hfp = %d\n"
+ "hsw = %d\n"
+ "hbp = %d\n"
+ "vfp = %d\n"
+ "vsw = %d\n"
+ "vbp = %d\n",
+ __func__,
+ omap_dss_hdmi_timings.hfp,
+ omap_dss_hdmi_timings.hsw,
+ omap_dss_hdmi_timings.hbp,
+ omap_dss_hdmi_timings.vfp,
+ omap_dss_hdmi_timings.vsw,
+ omap_dss_hdmi_timings.vbp
+ );
+
+}
+
+void get_edid_timing_data(u8 *edid, u16 *pixel_clk, u16 *horizontal_res,
+ u16 *vertical_res)
+{
+ u8 offset, effective_addrs;
+ u8 count;
+ u8 i;
+ u8 flag = false;
+ /*check for 720P timing in block0 */
+ for (count = 0; count < EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR; count++) {
+ current_descriptor_addrs + EDID_DESCRIPTOR_BLOCK0_ADDRESS +
+ count * EDID_TIMING_DESCRIPTOR_SIZE;
+ *horizontal_res + (((edid[EDID_DESCRIPTOR_BLOCK0_ADDRESS + 4 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE] & 0xF0) << 4) |
+ edid[EDID_DESCRIPTOR_BLOCK0_ADDRESS + 2 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE]);
+ *vertical_res + (((edid[EDID_DESCRIPTOR_BLOCK0_ADDRESS + 7 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE] & 0xF0) << 4) |
+ edid[EDID_DESCRIPTOR_BLOCK0_ADDRESS + 5 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE]);
+
+ dev_dbg(&sil9022_client->dev,
+ "<%s> ***Block-0-Timing-descriptor[%d]***\n",
+ __func__, count);
+ for (i = current_descriptor_addrs;
+ i <
+ (current_descriptor_addrs+EDID_TIMING_DESCRIPTOR_SIZE);
+ i++)
+ dev_dbg(&sil9022_client->dev,
+ "%x => %x\n", i, edid[i]);
+
+ dev_dbg(&sil9022_client->dev,
+ "<%s>\n"
+ "E-EDID Buffer Index = %d\n"
+ "horizontal_res = %d\n"
+ "vertical_res = %d\n",
+ __func__,
+ current_descriptor_addrs,
+ *horizontal_res,
+ *vertical_res
+ );
+
+ if (*horizontal_res = HDMI_XRES &&
+ *vertical_res = HDMI_YRES) {
+ dev_info(&sil9022_client->dev,
+ "<%s>\nFound EDID Data for %d x %dp\n",
+ __func__, *horizontal_res, *vertical_res);
+ flag = true;
+ break;
+ }
+ }
+
+ /*check for the Timing in block1 */
+ if (flag != true) {
+ offset = edid[EDID_DESCRIPTOR_BLOCK1_ADDRESS + 2];
+ if (offset != 0) {
+ effective_addrs = EDID_DESCRIPTOR_BLOCK1_ADDRESS
+ + offset;
+ /*to determine the number of descriptor blocks */
+ for (count = 0;
+ count < EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR;
+ count++) {
+ current_descriptor_addrs = effective_addrs +
+ count * EDID_TIMING_DESCRIPTOR_SIZE;
+ *horizontal_res + (((edid[effective_addrs + 4 +
+ count*EDID_TIMING_DESCRIPTOR_SIZE] &
+ 0xF0) << 4) |
+ edid[effective_addrs + 2 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE]);
+ *vertical_res + (((edid[effective_addrs + 7 +
+ count*EDID_TIMING_DESCRIPTOR_SIZE] &
+ 0xF0) << 4) |
+ edid[effective_addrs + 5 +
+ count * EDID_TIMING_DESCRIPTOR_SIZE]);
+
+ dev_dbg(&sil9022_client->dev,
+ "<%s> Block1-Timing-descriptor[%d]\n",
+ __func__, count);
+
+ for (i = current_descriptor_addrs;
+ i < (current_descriptor_addrs+
+ EDID_TIMING_DESCRIPTOR_SIZE); i++)
+ dev_dbg(&sil9022_client->dev,
+ "%x => %x\n",
+ i, edid[i]);
+
+ dev_dbg(&sil9022_client->dev, "<%s>\n"
+ "current_descriptor = %d\n"
+ "horizontal_res = %d\n"
+ "vertical_res = %d\n",
+ __func__, current_descriptor_addrs,
+ *horizontal_res, *vertical_res);
+
+ if (*horizontal_res = HDMI_XRES &&
+ *vertical_res = HDMI_YRES) {
+ dev_info(&sil9022_client->dev,
+ "<%s> Found EDID Data for "
+ "%d x %dp\n",
+ __func__,
+ *horizontal_res,
+ *vertical_res
+ );
+ flag = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (flag = true) {
+ *pixel_clk = ((edid[current_descriptor_addrs + 1] << 8) |
+ edid[current_descriptor_addrs]);
+
+ omap_dss_hdmi_timings.x_res = *horizontal_res;
+ omap_dss_hdmi_timings.y_res = *vertical_res;
+ omap_dss_hdmi_timings.pixel_clock = *pixel_clk*10;
+ dev_dbg(&sil9022_client->dev,
+ "EDID TIMING DATA supported by zoom2 FOUND\n"
+ "EDID DTD block address = %d\n"
+ "pixel_clk = %d\n"
+ "horizontal res = %d\n"
+ "vertical res = %d\n",
+ current_descriptor_addrs,
+ omap_dss_hdmi_timings.pixel_clock,
+ omap_dss_hdmi_timings.x_res,
+ omap_dss_hdmi_timings.y_res
+ );
+
+ get_horz_vert_timing_info(edid);
+ } else {
+
+ dev_info(&sil9022_client->dev,
+ "<%s>\n"
+ "EDID TIMING DATA supported by zoom2 NOT FOUND\n"
+ "setting default timing values for 720p\n"
+ "pixel_clk = %d\n"
+ "horizontal res = %d\n"
+ "vertical res = %d\n",
+ __func__,
+ omap_dss_hdmi_timings.pixel_clock,
+ omap_dss_hdmi_timings.x_res,
+ omap_dss_hdmi_timings.y_res
+ );
+
+ *pixel_clk = omap_dss_hdmi_timings.pixel_clock;
+ *horizontal_res = omap_dss_hdmi_timings.x_res;
+ *vertical_res = omap_dss_hdmi_timings.y_res;
+ }
+
+
+}
+
+
+static int
+sil9022_blockwrite_reg(struct i2c_client *client,
+ u8 reg, u16 alength, u8 *val, u16 *out_len)
+{
+ int err = 0, i;
+ struct i2c_msg msg[1];
+ u8 data[2];
+
+ if (!client->adapter) {
+ dev_err(&client->dev, "<%s> ERROR: No HDMI Device\n", __func__);
+ return -ENODEV;
+ }
+
+ msg->addr = client->addr;
+ msg->flags = I2C_M_WR;
+ msg->len = 2;
+ msg->buf = data;
+
+ /* high byte goes out first */
+ data[0] = reg >> 8;
+
+ for (i = 0; i < alength - 1; i++) {
+ data[1] = val[i];
+ err = i2c_transfer(client->adapter, msg, 1);
+ udelay(50);
+ dev_dbg(&client->dev, "<%s> i2c Block write at 0x%x, "
+ "*val=%d flags=%d byte[%d] err=%d\n",
+ __func__, data[0], data[1], msg->flags, i, err);
+ if (err < 0)
+ break;
+ }
+ /* set the number of bytes written*/
+ *out_len = i;
+
+ if (err < 0) {
+ dev_err(&client->dev, "<%s> ERROR: i2c Block Write at 0x%x, "
+ "*val=%d flags=%d bytes written=%d "
+ "err=%d\n",
+ __func__, data[0], data[1], msg->flags, i, err);
+ return err;
+ }
+ return 0;
+}
+
+static int
+sil9022_blockread_reg(struct i2c_client *client,
+ u16 data_length, u16 alength,
+ u8 reg, u8 *val, u16 *out_len)
+{
+ int err = 0, i;
+ struct i2c_msg msg[1];
+ u8 data[2];
+
+ if (!client->adapter) {
+ dev_err(&client->dev, "<%s> ERROR: No HDMI Device\n", __func__);
+ return -ENODEV;
+ }
+
+ msg->addr = client->addr;
+ msg->flags = I2C_M_WR;
+ msg->len = 1;
+ msg->buf = data;
+
+ /* High byte goes out first */
+ data[0] = reg;
+ err = i2c_transfer(client->adapter, msg, 1);
+ dev_dbg(&client->dev, "<%s> i2c Block Read1 at 0x%x, "
+ "*val=%d flags=%d err=%d\n",
+ __func__, data[0], data[1], msg->flags, err);
+
+ for (i = 0; i < alength; i++) {
+ if (err >= 0) {
+ mdelay(3);
+ msg->flags = I2C_M_RD;
+ msg->len = data_length;
+ err = i2c_transfer(client->adapter, msg, 1);
+ } else
+ break;
+ if (err >= 0) {
+ val[i] = 0;
+ /* High byte comes first */
+ if (data_length = 1)
+ val[i] = data[0];
+ else if (data_length = 2)
+ val[i] = data[1] + (data[0] << 8);
+ dev_dbg(&client->dev, "<%s> i2c Block Read2 at 0x%x, "
+ "*val=%d flags=%d byte=%d "
+ "err=%d\n",
+ __func__, reg, val[i], msg->flags, i, err);
+ } else
+ break;
+ }
+ *out_len = i;
+ dev_dbg(&client->dev, "<%s> i2c Block Read at 0x%x, bytes read = %d\n",
+ __func__, client->addr, *out_len);
+
+ if (err < 0) {
+ dev_err(&client->dev, "<%s> ERROR: i2c Read at 0x%x, "
+ "*val=%d flags=%d bytes read=%d err=%d\n",
+ __func__, reg, *val, msg->flags, i, err);
+ return err;
+ }
+ return 0;
+}
+
+
+/* Write a value to a register in sil9022 device.
+ * @client: i2c driver client structure.
+ * @reg: Address of the register to read value from.
+ * @val: Value to be written to a specific register.
+ * Returns zero if successful, or non-zero otherwise.
+ */
+static int
+sil9022_write_reg(struct i2c_client *client, u8 reg, u8 val)
+{
+ int err = 0;
+ struct i2c_msg msg[1];
+ u8 data[2];
+ int retries = 0;
+
+ if (!client->adapter) {
+ dev_err(&client->dev, "<%s> ERROR: No HDMI Device\n", __func__);
+ return -ENODEV;
+ }
+
+retry:
+ msg->addr = client->addr;
+ msg->flags = I2C_M_WR;
+ msg->len = 2;
+ msg->buf = data;
+
+ data[0] = reg;
+ data[1] = val;
+
+ err = i2c_transfer(client->adapter, msg, 1);
+ dev_dbg(&client->dev, "<%s> i2c write at=%x "
+ "val=%x flags=%d err=%d\n",
+ __func__, data[0], data[1], msg->flags, err);
+ udelay(50);
+
+ if (err >= 0)
+ return 0;
+
+ dev_err(&client->dev, "<%s> ERROR: i2c write at=%x "
+ "val=%x flags=%d err=%d\n",
+ __func__, data[0], data[1], msg->flags, err);
+ if (retries <= 5) {
+ dev_info(&client->dev, "Retrying I2C... %d\n", retries);
+ retries++;
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(msecs_to_jiffies(20));
+ goto retry;
+ }
+ return err;
+}
+
+/*
+ * Read a value from a register in sil9022 device.
+ * The value is returned in 'val'.
+ * Returns zero if successful, or non-zero otherwise.
+ */
+static int
+sil9022_read_reg(struct i2c_client *client, u16 data_length, u8 reg, u8 *val)
+{
+ int err = 0;
+ struct i2c_msg msg[1];
+ u8 data[2];
+
+ if (!client->adapter) {
+ dev_err(&client->dev, "<%s> ERROR: No HDMI Device\n", __func__);
+ return -ENODEV;
+ }
+
+ msg->addr = client->addr;
+ msg->flags = I2C_M_WR;
+ msg->len = 1;
+ msg->buf = data;
+
+ data[0] = reg;
+ err = i2c_transfer(client->adapter, msg, 1);
+ dev_dbg(&client->dev, "<%s> i2c Read1 reg=%x val=%d "
+ "flags=%d err=%d\n",
+ __func__, reg, data[1], msg->flags, err);
+
+ if (err >= 0) {
+ mdelay(3);
+ msg->flags = I2C_M_RD;
+ msg->len = data_length;
+ err = i2c_transfer(client->adapter, msg, 1);
+ }
+
+ if (err >= 0) {
+ *val = 0;
+ if (data_length = 1)
+ *val = data[0];
+ else if (data_length = 2)
+ *val = data[1] + (data[0] << 8);
+ dev_dbg(&client->dev, "<%s> i2c Read2 at 0x%x, *val=%d "
+ "flags=%d err=%d\n",
+ __func__, reg, *val, msg->flags, err);
+ return 0;
+ }
+
+ dev_err(&client->dev, "<%s> ERROR: i2c Read at 0x%x, "
+ "*val=%d flags=%d err=%d\n",
+ __func__, reg, *val, msg->flags, err);
+ return err;
+}
+
+static int
+sil9022_read_edid(struct i2c_client *client, u16 len,
+ char *p_buffer, u16 *out_len)
+{
+ int err = 0;
+ u8 val = 0;
+ int retries = 0;
+ int i = 0;
+ int k = 0;
+
+ len = (len < HDMI_EDID_MAX_LENGTH) ? len : HDMI_EDID_MAX_LENGTH;
+
+ /* Request DDC bus access to read EDID info from HDTV */
+ dev_info(&client->dev, "<%s> Reading HDMI EDID\n", __func__);
+
+ /* Bring transmitter to low-Power state */
+ val = TPI_AVI_POWER_STATE_D2;
+ err = sil9022_write_reg(client, HDMI_TPI_DEVICE_POWER_STATE_DATA, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Failed during bring power state - low.\n",
+ __func__);
+ return err;
+ }
+
+ /* Disable TMDS clock */
+ val = 0x11;
+ err = sil9022_write_reg(client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Failed during bring power state - low.\n",
+ __func__);
+ return err;
+ }
+
+ val = 0;
+ /* Read TPI system control register*/
+ err = sil9022_read_reg(client, 1, HDMI_SYS_CTRL_DATA_REG, &val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Reading DDC BUS REQUEST\n", __func__);
+ return err;
+ }
+
+ /* The host writes 0x1A[2]=1 to request the
+ * DDC(Display Data Channel) bus
+ */
+ val |= TPI_SYS_CTRL_DDC_BUS_REQUEST;
+ err = sil9022_write_reg(client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Writing DDC BUS REQUEST\n", __func__);
+ return err;
+ }
+
+ /* Poll for bus DDC Bus control to be granted */
+ dev_info(&client->dev, "<%s> Poll for DDC bus access\n", __func__);
+ val = 0;
+ do {
+ err = sil9022_read_reg(client, 1, HDMI_SYS_CTRL_DATA_REG, &val);
+ if (retries++ > 100)
+ return err;
+
+ } while ((val & TPI_SYS_CTRL_DDC_BUS_GRANTED) = 0);
+
+ /* Close the switch to the DDC */
+ val |= TPI_SYS_CTRL_DDC_BUS_REQUEST | TPI_SYS_CTRL_DDC_BUS_GRANTED;
+ err = sil9022_write_reg(client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Close switch to DDC BUS REQUEST\n",
+ __func__);
+ return err;
+ }
+
+ memset(p_buffer, 0, len);
+ /* change I2C SetSlaveAddress to HDMI_I2C_MONITOR_ADDRESS */
+ /* Read the EDID structure from the monitor I2C address */
+ client->addr = HDMI_I2C_MONITOR_ADDRESS;
+ err = sil9022_blockread_reg(client, 1, len,
+ 0x00, p_buffer, out_len);
+ if (err < 0 || *out_len <= 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Reading EDID from "
+ "HDMI_I2C_MONITOR_ADDRESS\n", __func__);
+ return err;
+ }
+
+ for (i = 0; i < *out_len; i++) {
+ if ((i / 18) < 3) {
+ dev_dbg(&client->dev, "byte->%02x %x\n",
+ i, p_buffer[i]);
+ continue;
+ }
+ if ((i/18 >= 3 && i/18 <= 6) && (i%18 = 0))
+ dev_dbg(&client->dev, "\n DTD Block %d\n", k++);
+
+ if ((i/18 = 7) && (i%18 = 0))
+ dev_dbg(&client->dev, "\n");
+
+ dev_dbg(&client->dev, "byte->%02x %x\n", i, p_buffer[i]);
+ }
+
+ /* Release DDC bus access */
+ client->addr = SI9022_I2CSLAVEADDRESS;
+ val &= ~(TPI_SYS_CTRL_DDC_BUS_REQUEST | TPI_SYS_CTRL_DDC_BUS_GRANTED);
+ err = sil9022_write_reg(client, HDMI_SYS_CTRL_DATA_REG, val);
+
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Releasing DDC Bus Access\n",
+ __func__);
+ return err;
+ }
+
+ /* Success */
+ return 0;
+}
+
+static int
+sil9022_enable_audio(struct i2c_client *client)
+{
+ int err = 0;
+ u8 val = 0;
+ u8 crc = 0;
+ u32 count = 0;
+ int index = 0;
+
+ for (index = 0;
+ index < sizeof(hdmi_tpi_audio_config_data) /
+ sizeof(struct hdmi_reg_data);
+ index++) {
+ err = sil9022_write_reg(
+ client,
+ hdmi_tpi_audio_config_data[index].reg_offset,
+ hdmi_tpi_audio_config_data[index].value);
+ if (err != 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Writing "
+ "tpi_audio_config_data[%d]={ %d, %d }\n",
+ __func__, index,
+ hdmi_tpi_audio_config_data[index].reg_offset,
+ hdmi_tpi_audio_config_data[index].value);
+ return err;
+ }
+ }
+
+ /* Fill the checksum byte for Infoframe data*/
+ count = 0;
+ while (count < MISC_INFOFRAME_SIZE_MEMORY) {
+ crc += misc_audio_info_frame_data[count];
+ count++;
+ }
+ crc = 0x100 - crc;
+
+ /* Fill CRC Byte*/
+ misc_audio_info_frame_data[0x3] = crc;
+
+ for (count = 0; count < MISC_INFOFRAME_SIZE_MEMORY; count++) {
+ err = sil9022_write_reg(client,
+ (HDMI_CPI_MISC_IF_OFFSET + count),
+ misc_audio_info_frame_data[count]);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: writing audio info frame"
+ " CRC data: %d\n", __func__, count);
+ return err;
+ }
+ }
+
+ /* Decode Level 0 Packets */
+ val = 0x2;
+ sil9022_write_reg(client, 0xBC, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: writing level 0 packets to 0xBC\n",
+ __func__);
+ return err;
+ }
+
+ val = 0x24;
+ err = sil9022_write_reg(client, 0xBD, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: writing level 0 packets to 0xBD\n",
+ __func__);
+ return err;
+ }
+
+ val = 0x2;
+ err = sil9022_write_reg(client, 0xBE, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: writing level 0 packets to 0xBE\n",
+ __func__);
+ return err;
+ }
+
+ /* Disable Mute */
+ val = TPI_AUDIO_INTERFACE_I2S |
+ TPI_AUDIO_MUTE_DISABLE |
+ TPI_AUDIO_CODING_PCM;
+ err = sil9022_write_reg(client, HDMI_TPI_AUDIO_CONFIG_BYTE2_REG, val);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Disabling mute\n",
+ __func__);
+ return err;
+ }
+
+ dev_info(&client->dev, "<%s> hdmi audio enabled\n",
+ __func__);
+ return 0;
+
+}
+
+static int
+sil9022_disable_audio(struct i2c_client *client)
+{
+ u8 val = 0;
+ int err = 0;
+ /* Disable Audio */
+ val = TPI_AUDIO_INTERFACE_DISABLE;
+ err = sil9022_write_reg(client, HDMI_TPI_AUDIO_CONFIG_BYTE2_REG, val);
+ if (err < 0)
+ dev_err(&client->dev,
+ "<%s> ERROR: Disisable audio interface", __func__);
+
+ dev_info(&client->dev, "<%s> hdmi audio disabled\n", __func__);
+ return err;
+}
+
+static int
+sil9022_enable(struct omap_dss_device *dssdev)
+{
+ int err;
+ u8 val, vals[14];
+ int i;
+ u16 out_len = 0;
+ u8 edid[HDMI_EDID_MAX_LENGTH];
+ u16 horizontal_res;
+ u16 vertical_res;
+ u16 pixel_clk;
+
+ memset(edid, 0, HDMI_EDID_MAX_LENGTH);
+ memset(vals, 0, 14);
+
+ err = sil9022_read_edid(sil9022_client, HDMI_EDID_MAX_LENGTH,
+ edid, &out_len);
+ if (err < 0 || out_len = 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> Unable to read EDID for monitor\n", __func__);
+ return err;
+ }
+
+ get_edid_timing_data(edid,
+ &pixel_clk,
+ &horizontal_res,
+ &vertical_res
+ );
+
+ /* Fill the TPI Video Mode Data structure */
+ vals[0] = (pixel_clk & 0xFF); /* Pixel clock */
+ vals[1] = ((pixel_clk & 0xFF00) >> 8);
+ vals[2] = VERTICAL_FREQ; /* Vertical freq */
+ vals[3] = 0x00;
+ vals[4] = (horizontal_res & 0xFF); /* Horizontal pixels*/
+ vals[5] = ((horizontal_res & 0xFF00) >> 8);
+ vals[6] = (vertical_res & 0xFF); /* Vertical pixels */
+ vals[7] = ((vertical_res & 0xFF00) >> 8);
+
+ dev_info(&sil9022_client->dev, "<%s>\nHDMI Monitor E-EDID Timing Data\n"
+ "horizontal_res = %d\n"
+ "vertical_res = %d\n"
+ "pixel_clk = %d\n"
+ "hfp = %d\n"
+ "hsw = %d\n"
+ "hbp = %d\n"
+ "vfp = %d\n"
+ "vsw = %d\n"
+ "vbp = %d\n",
+ __func__,
+ omap_dss_hdmi_timings.x_res,
+ omap_dss_hdmi_timings.y_res,
+ omap_dss_hdmi_timings.pixel_clock,
+ omap_dss_hdmi_timings.hfp,
+ omap_dss_hdmi_timings.hsw,
+ omap_dss_hdmi_timings.hbp,
+ omap_dss_hdmi_timings.vfp,
+ omap_dss_hdmi_timings.vsw,
+ omap_dss_hdmi_timings.vbp
+ );
+
+ dssdev->panel.timings = omap_dss_hdmi_timings;
+ /* Write out the TPI Video Mode Data */
+ out_len = 0;
+ err = sil9022_blockwrite_reg(sil9022_client,
+ HDMI_TPI_VIDEO_DATA_BASE_REG,
+ 8, vals, &out_len);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI video mode data\n", __func__);
+ return err;
+ }
+
+ /* Write out the TPI Pixel Repetition Data (24 bit wide bus,
+ falling edge, no pixel replication) */
+ val = TPI_AVI_PIXEL_REP_BUS_24BIT |
+ TPI_AVI_PIXEL_REP_FALLING_EDGE |
+ TPI_AVI_PIXEL_REP_NONE;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_PIXEL_REPETITION_REG,
+ val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI pixel repetition data\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI AVI Input Format */
+ val = TPI_AVI_INPUT_BITMODE_8BIT |
+ TPI_AVI_INPUT_RANGE_AUTO |
+ TPI_AVI_INPUT_COLORSPACE_RGB;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_AVI_IN_FORMAT_REG,
+ val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI AVI Input format\n", __func__);
+ return err;
+ }
+
+ /* Write out the TPI AVI Output Format */
+ val = TPI_AVI_OUTPUT_CONV_BT709 |
+ TPI_AVI_OUTPUT_RANGE_AUTO |
+ TPI_AVI_OUTPUT_COLORSPACE_RGBHDMI;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_AVI_OUT_FORMAT_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI AVI output format\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI System Control Data to power down */
+ val = TPI_SYS_CTRL_POWER_DOWN;
+ err = sil9022_write_reg(sil9022_client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI power down control data\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI AVI InfoFrame Data (all defaults) */
+ /* Compute CRC*/
+ val = 0x82 + 0x02 + 13;
+
+ for (i = 0; i < sizeof(avi_info_frame_data); i++)
+ val += avi_info_frame_data[i];
+
+ avi_info_frame_data[0] = 0x100 - val;
+
+ out_len = 0;
+ err = sil9022_blockwrite_reg(sil9022_client,
+ HDMI_TPI_AVI_DBYTE_BASE_REG,
+ sizeof(avi_info_frame_data),
+ avi_info_frame_data, &out_len);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing TPI AVI infoframe data\n",
+ __func__);
+ return err;
+ }
+
+ /* Audio Configuration */
+ err = sil9022_enable_audio(sil9022_client);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Unable set audio configuration\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI Device Power State (D0) */
+ val = TPI_AVI_POWER_STATE_D0;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_POWER_STATE_CTRL_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Setting device power state to D0\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI System Control Data to power up and
+ * select output mode
+ */
+ val = TPI_SYS_CTRL_POWER_ACTIVE | TPI_SYS_CTRL_OUTPUT_MODE_HDMI;
+ err = sil9022_write_reg(sil9022_client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Writing system control data\n", __func__);
+ return err;
+ }
+
+ /* Read back TPI System Control Data to latch settings */
+ msleep(20);
+ err = sil9022_read_reg(sil9022_client, 1, HDMI_SYS_CTRL_DATA_REG, &val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Writing system control data\n",
+ __func__);
+ return err;
+ }
+
+ /* HDCP Enable - Disable */
+ val = 0;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_HDCP_CONTROLDATA_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Enable (1) / Disable (0) => HDCP: %d\n",
+ __func__, val);
+ return err;
+ }
+
+ dev_info(&sil9022_client->dev, "<%s> hdmi enabled\n", __func__);
+ return 0;
+
+}
+
+static int
+sil9022_disable(void)
+{
+ u8 val = 0;
+ int err = 0;
+
+ err = sil9022_disable_audio(sil9022_client);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: failed to disable audio\n", __func__);
+ return err;
+ }
+
+ /* Write out the TPI System Control Data to power down */
+ val = TPI_SYS_CTRL_POWER_DOWN;
+ err = sil9022_write_reg(sil9022_client, HDMI_SYS_CTRL_DATA_REG, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: writing control data - power down\n",
+ __func__);
+ return err;
+ }
+
+ /* Write out the TPI Device Power State (D2) */
+ val = TPI_AVI_POWER_STATE_D2;
+ err = sil9022_write_reg(sil9022_client,
+ HDMI_TPI_DEVICE_POWER_STATE_DATA, val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Setting device power state to D2\n",
+ __func__);
+ return err;
+ }
+
+ /* Read back TPI System Control Data to latch settings */
+ mdelay(10);
+ err = sil9022_read_reg(sil9022_client, 1, HDMI_SYS_CTRL_DATA_REG, &val);
+ if (err < 0) {
+ dev_err(&sil9022_client->dev,
+ "<%s> ERROR: Reading System control data "
+ "- latch settings\n", __func__);
+ return err;
+ }
+
+ dev_info(&sil9022_client->dev, "<%s> hdmi disabled\n", __func__);
+ return 0;
+
+}
+
+static int sil9022_set_reg_read_ctrl(struct i2c_client *client)
+{
+ int err = 0;
+ u8 ver;
+
+ /* probe for sil9022 chip version*/
+ err = sil9022_write_reg(client, SI9022_REG_TPI_RQB, 0x00);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Writing HDMI configuration to "
+ "reg - SI9022_REG_TPI_RQB\n", __func__);
+ err = -ENODEV;
+ goto ERROR1;
+ }
+
+ err = sil9022_read_reg(client, 1, SI9022_REG_CHIPID0, &ver);
+ if (err < 0) {
+ dev_err(&client->dev,
+ "<%s> ERROR: Reading HDMI version Id\n", __func__);
+ err = -ENODEV;
+ goto ERROR1;
+ } else if (ver != SI9022_CHIPID_902x) {
+ dev_err(&client->dev,
+ "<%s> Not a valid verId: 0x%x\n", __func__, ver);
+ err = -ENODEV;
+ goto ERROR1;
+ } else
+ dev_info(&client->dev,
+ "<%s> sil9022 HDMI Chip version = %x\n",
+ __func__, ver);
+
+ return 0;
+ERROR1:
+ return err;
+}
+
+static inline struct sil9022_platform_data
+*get_panel_data(const struct omap_dss_device *dssdev)
+{
+ return (struct sil9022_platform_data *) dssdev->data;
+}
+
+
+static int sil9022_panel_probe(struct omap_dss_device *dssdev)
+{
+ struct sil9022_platform_data *sidata = get_panel_data(dssdev);
+ int r;
+ if (!sidata)
+ return -EINVAL;
+
+ dssdev->panel.timings = omap_dss_hdmi_timings;
+
+ if (gpio_is_valid(sidata->res_gpio)) {
+ r = devm_gpio_request_one(&dssdev->dev, sidata->res_gpio,
+ GPIOF_OUT_INIT_HIGH, "HDMI");
+ if (r)
+ return r;
+ }
+
+ return 0;
+}
+
+static void sil9022_panel_remove(struct omap_dss_device *dssdev)
+{
+ omap_dss_unregister_driver(dssdev->driver);
+}
+
+
+static int sil9022_panel_power_on(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+ struct sil9022_platform_data *sidata = get_panel_data(dssdev);
+
+ if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+ if (gpio_is_valid(sidata->res_gpio))
+ gpio_set_value_cansleep(sidata->res_gpio, 1);
+
+ omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+ omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
+ r = omapdss_dpi_display_enable(dssdev);
+ return r;
+
+}
+
+static void sil9022_panel_power_off(struct omap_dss_device *dssdev)
+{
+ struct sil9022_platform_data *sidata = get_panel_data(dssdev);
+
+ if (gpio_is_valid(sidata->res_gpio))
+ gpio_set_value_cansleep(sidata->res_gpio, 0);
+ return;
+
+}
+
+static int sil9022_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ r = sil9022_panel_power_on(dssdev);
+ if (r)
+ goto ERROR0;
+ r = sil9022_set_reg_read_ctrl(sil9022_client);
+ if (r)
+ goto ERROR0;
+
+ r = sil9022_enable(dssdev);
+ if (r)
+ goto ERROR0;
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+ return 0;
+
+ERROR0:
+ return r;
+}
+
+static void sil9022_panel_disable(struct omap_dss_device *dssdev)
+{
+ sil9022_disable();
+ /* wait couple of vsyncs until enabling the hdmi */
+ msleep(50);
+ sil9022_panel_power_off(dssdev);
+ return;
+}
+
+static struct omap_dss_driver hdmi_driver = {
+ .probe = sil9022_panel_probe,
+ .remove = sil9022_panel_remove,
+
+ .enable = sil9022_panel_enable,
+ .disable = sil9022_panel_disable,
+
+ .driver = {
+ .name = "sil9022_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int
+sil9022_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+ int err = 0;
+
+ sil9022_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+ if (!sil9022_client) {
+ err = -ENOMEM;
+ goto ERROR0;
+ }
+ memset(sil9022_client, 0, sizeof(struct i2c_client));
+
+ strncpy(sil9022_client->name, client->name, I2C_NAME_SIZE);
+ sil9022_client->addr = client->addr;
+ sil9022_client->adapter = client->adapter;
+
+ err = sil9022_set_reg_read_ctrl(client);
+ if (err)
+ goto ERROR1;
+
+ omap_dss_register_driver(&hdmi_driver);
+ return 0;
+
+ERROR1:
+ kfree(sil9022_client);
+ERROR0:
+ return err;
+}
+
+
+static int
+sil9022_remove(struct i2c_client *client)
+
+{
+ int err = 0;
+
+ if (!client->adapter) {
+ dev_err(&sil9022_client->dev, "<%s> No HDMI Device\n",
+ __func__);
+ return -ENODEV;
+ }
+ kfree(sil9022_client);
+
+ return err;
+}
+
+static const struct i2c_device_id sil9022_id[] = {
+ { SIL9022_DRV_NAME, 0 },
+ { },
+};
+
+MODULE_DEVICE_TABLE(i2c, sil9022_id);
+
+static struct i2c_driver sil9022_driver = {
+ .driver = {
+ .name = SIL9022_DRV_NAME,
+ .owner = THIS_MODULE,
+ },
+ .probe = sil9022_probe,
+ .remove = sil9022_remove,
+ .id_table = sil9022_id,
+};
+
+static int __init
+sil9022_init(void)
+{
+ int err = 0;
+ err = i2c_add_driver(&sil9022_driver);
+ if (err < 0) {
+ printk(KERN_ERR "<%s> Driver registration failed\n", __func__);
+ err = -ENODEV;
+ goto ERROR0;
+ }
+
+ if (sil9022_client = NULL) {
+ printk(KERN_ERR "<%s> sil9022_client not allocated\n"
+ "<%s> No HDMI Device\n", __func__, __func__);
+ err = -ENODEV;
+ goto ERROR0;
+ }
+ return 0;
+
+ERROR0:
+ return err;
+}
+
+static void __exit
+sil9022_exit(void)
+{
+ i2c_del_driver(&sil9022_driver);
+}
+
+late_initcall(sil9022_init);
+module_exit(sil9022_exit);
+
+MODULE_AUTHOR("Texas Instruments");
+MODULE_DESCRIPTION("SIL9022 HDMI Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sil9022.h b/drivers/video/omap2/displays/panel-sil9022.h
new file mode 100644
index 0000000..7c920c0
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-sil9022.h
@@ -0,0 +1,527 @@
+/*
+ * drivers/video/omap2/displays/panel-sil9022.c
+ *
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ *
+ * sil9022 hdmi driver
+ */
+#ifndef _SI9022_H_
+#define _SI9022_H_
+
+#define SIL9022_DRV_NAME "sil9022"
+
+#define CLKOUT2_EN (0x1 << 7)
+#define CLKOUT2_DIV (0x4 << 3)
+#define CLKOUT2SOURCE (0x2 << 0)
+#define CM_CLKOUT_CTRL 0x48004D70
+
+#define HDMI_XRES 1280
+#define HDMI_YRES 720
+#define HDMI_PIXCLOCK_MAX 74250
+#define VERTICAL_FREQ 0x3C
+
+#define I2C_M_WR 0
+
+#define SI9022_USERST_PIN 1
+
+#define SI9022_REG_PIX_CLK_LSB 0x00
+#define SI9022_REG_PIX_CLK_MSB 0x01
+
+#define SI9022_REG_PIX_REPETITION 0x08
+#define SI9022_REG_INPUT_FORMAT 0x09
+#define SI9022_REG_OUTPUT_FORMAT 0x0A
+#define SI9022_REG_SYNC_GEN_CTRL 0x60
+
+#define SI9022_REG_DE_CTRL 0x63
+#define DE_DLY_MSB_BITPOS 0
+#define HSYNCPOL_INVERT_BITPOS 4
+#define VSYNCPOL_INVERT_BITPOS 5
+#define DE_GENERATOR_EN_BITPOS 6
+
+#define SI9022_REG_PWR_STATE 0x1E
+
+#define SI9022_REG_TPI_RQB 0xC7
+
+#define SI9022_REG_INT_PAGE 0xBC
+#define SI9022_REG_OFFSET 0xBD
+#define SI9022_REG_VALUE 0xBE
+
+#define SI9022_PLLMULT_BITPOS 0x05
+
+#define SI9022_REG_TPI_SYSCTRL 0x1A
+#define I2DDCREQ_BITPOS 2
+#define TMDS_ENABLE_BITPOS 4
+#define HDMI_ENABLE_BITPOS 0
+
+#define SI9022_REG_CHIPID0 0x1B
+#define SI9022_REG_CHIPID1 0x1C
+#define SI9022_REG_CHIPID2 0x1D
+#define SI9022_REG_HDCPVER 0x30
+
+#define SI9022_REG_INTSTATUS 0x3D
+#define HOTPLUG_PENDING_BITPOS 0
+#define RCV_SENSE_PENDING_BITPOS 1
+#define HOTPLUG_SENSE_BITPOS 2
+#define RX_SENSE_BITPOS 3
+#define AUDIO_ERR_PENDING_BITPOS 4
+
+
+#define SI9022_I2CSLAVEADDRESS 0x39
+
+#define SI9022_CHIPID_902x 0xB0
+
+#define SI9022_MAXRETRY 100
+
+#define SI9022_EDID_DETAILED_TIMING_OFFSET 0x36 /*EDID Detailed Timing */
+ /*Info 0 begin offset*/
+#define SI9022_EDID_PIX_CLK_OFFSET 0
+#define SI9022_EDID_H_ACTIVE_OFFSET 2
+#define SI9022_EDID_H_BLANKING_OFFSET 3
+#define SI9022_EDID_V_ACTIVE_OFFSET 5
+#define SI9022_EDID_V_BLANKING_OFFSET 6
+#define SI9022_EDID_H_SYNC_OFFSET 8
+#define SI9022_EDID_H_SYNC_PW_OFFSET 9
+#define SI9022_EDID_V_SYNC_OFFSET 10
+#define SI9022_EDID_V_SYNC_PW_OFFSET 10
+#define SI9022_EDID_H_IMAGE_SIZE_OFFSET 12
+#define SI9022_EDID_V_IMAGE_SIZE_OFFSET 13
+#define SI9022_EDID_H_BORDER_OFFSET 15
+#define SI9022_EDID_V_BORDER_OFFSET 16
+#define SI9022_EDID_FLAGS_OFFSET 17
+
+#define SI9022_PLUG_DETECTED 0xF0
+#define SI9022_UNPLUG_DETECTED 0xF1
+
+
+/* --------------------------------------------------------------------- */
+#define EDID_TIMING_DESCRIPTOR_SIZE 0x12
+#define EDID_DESCRIPTOR_BLOCK0_ADDRESS 0x36
+#define EDID_DESCRIPTOR_BLOCK1_ADDRESS 0x80
+#define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4
+#define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4
+
+/* HDMI Connected States */
+#define HDMI_STATE_NOMONITOR 0 /* NOT CONNECTED */
+#define HDMI_STATE_CONNECTED 1 /* CONNECTED */
+#define HDMI_STATE_ON 2 /* CONNECTED AND POWERED ON */
+
+
+/* HDMI EDID Length */
+#define HDMI_EDID_MAX_LENGTH 256
+
+/* HDMI EDID DTDs */
+#define HDMI_EDID_MAX_DTDS 4
+
+/* HDMI EDID DTD Tags */
+#define HDMI_EDID_DTD_TAG_MONITOR_NAME 0xFC
+#define HDMI_EDID_DTD_TAG_MONITOR_SERIALNUM 0xFF
+#define HDMI_EDID_DTD_TAG_MONITOR_LIMITS 0xFD
+
+
+/* HDMI EDID Extension Data Block Tags */
+#define HDMI_EDID_EX_DATABLOCK_TAG_MASK 0xE0
+#define HDMI_EDID_EX_DATABLOCK_LEN_MASK 0x1F
+
+#define HDMI_EDID_EX_DATABLOCK_AUDIO 0x20
+#define HDMI_EDID_EX_DATABLOCK_VIDEO 0x40
+#define HDMI_EDID_EX_DATABLOCK_VENDOR 0x60
+#define HDMI_EDID_EX_DATABLOCK_SPEAKERS 0x80
+
+/* HDMI EDID Extenion Data Block Values: Video */
+#define HDMI_EDID_EX_VIDEO_NATIVE 0x80
+#define HDMI_EDID_EX_VIDEO_MASK 0x7F
+#define HDMI_EDID_EX_VIDEO_MAX 35
+
+#define HDMI_EDID_EX_VIDEO_640x480p_60Hz_4_3 1
+#define HDMI_EDID_EX_VIDEO_720x480p_60Hz_4_3 2
+#define HDMI_EDID_EX_VIDEO_720x480p_60Hz_16_9 3
+#define HDMI_EDID_EX_VIDEO_1280x720p_60Hz_16_9 4
+#define HDMI_EDID_EX_VIDEO_1920x1080i_60Hz_16_9 5
+#define HDMI_EDID_EX_VIDEO_720x480i_60Hz_4_3 6
+#define HDMI_EDID_EX_VIDEO_720x480i_60Hz_16_9 7
+#define HDMI_EDID_EX_VIDEO_720x240p_60Hz_4_3 8
+#define HDMI_EDID_EX_VIDEO_720x240p_60Hz_16_9 9
+#define HDMI_EDID_EX_VIDEO_2880x480i_60Hz_4_3 10
+#define HDMI_EDID_EX_VIDEO_2880x480i_60Hz_16_9 11
+#define HDMI_EDID_EX_VIDEO_2880x480p_60Hz_4_3 12
+#define HDMI_EDID_EX_VIDEO_2880x480p_60Hz_16_9 13
+#define HDMI_EDID_EX_VIDEO_1440x480p_60Hz_4_3 14
+#define HDMI_EDID_EX_VIDEO_1440x480p_60Hz_16_9 15
+#define HDMI_EDID_EX_VIDEO_1920x1080p_60Hz_16_9 16
+#define HDMI_EDID_EX_VIDEO_720x576p_50Hz_4_3 17
+#define HDMI_EDID_EX_VIDEO_720x576p_50Hz_16_9 18
+#define HDMI_EDID_EX_VIDEO_1280x720p_50Hz_16_9 19
+#define HDMI_EDID_EX_VIDEO_1920x1080i_50Hz_16_9 20
+#define HDMI_EDID_EX_VIDEO_720x576i_50Hz_4_3 21
+#define HDMI_EDID_EX_VIDEO_720x576i_50Hz_16_9 22
+#define HDMI_EDID_EX_VIDEO_720x288p_50Hz_4_3 23
+#define HDMI_EDID_EX_VIDEO_720x288p_50Hz_16_9 24
+#define HDMI_EDID_EX_VIDEO_2880x576i_50Hz_4_3 25
+#define HDMI_EDID_EX_VIDEO_2880x576i_50Hz_16_9 26
+#define HDMI_EDID_EX_VIDEO_2880x288p_50Hz_4_3 27
+#define HDMI_EDID_EX_VIDEO_2880x288p_50Hz_16_9 28
+#define HDMI_EDID_EX_VIDEO_1440x576p_50Hz_4_3 29
+#define HDMI_EDID_EX_VIDEO_1440x576p_50Hz_16_9 30
+#define HDMI_EDID_EX_VIDEO_1920x1080p_50Hz_16_9 31
+#define HDMI_EDID_EX_VIDEO_1920x1080p_24Hz_16_9 32
+#define HDMI_EDID_EX_VIDEO_1920x1080p_25Hz_16_9 33
+#define HDMI_EDID_EX_VIDEO_1920x1080p_30Hz_16_9 34
+
+/* HDMI TPI Registers */
+#define HDMI_TPI_VIDEO_DATA_BASE_REG 0x00
+#define HDMI_TPI_PIXEL_CLK_LSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x00)
+#define HDMI_TPI_PIXEL_CLK_MSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x01)
+#define HDMI_TPI_VFREQ_LSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x02)
+#define HDMI_TPI_VFREQ_MSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x03)
+#define HDMI_TPI_PIXELS_LSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x04)
+#define HDMI_TPI_PIXELS_MSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x05)
+#define HDMI_TPI_LINES_LSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x06)
+#define HDMI_TPI_LINES_MSB_REG (HDMI_TPI_VIDEO_DATA_BASE_REG + 0x07)
+
+#define HDMI_TPI_PIXEL_REPETITION_REG 0x08
+
+#define HDMI_TPI_AVI_INOUT_BASE_REG 0x09
+#define HDMI_TPI_AVI_IN_FORMAT_REG (HDMI_TPI_AVI_INOUT_BASE_REG + 0x00)
+#define HDMI_TPI_AVI_OUT_FORMAT_REG (HDMI_TPI_AVI_INOUT_BASE_REG + 0x01)
+
+#define HDMI_SYS_CTRL_DATA_REG 0x1A
+
+#define HDMI_TPI_SYN_GENERATOR_REG 0x60
+
+#define HDMI_TPI_VIDEO_SYN_POLARITY_REG 0x61
+
+#define HDMI_TPI_DE_BASE_REG 0x62
+#define HDMI_TPI_DE_DLY_LSB_REG (HDMI_TPI_DE_BASE_REG + 0x0)
+#define HDMI_TPI_DE_DLY_MSB_REG (HDMI_TPI_DE_BASE_REG + 0x1)
+#define HDMI_TPI_DE_TOP_REG (HDMI_TPI_DE_BASE_REG + 0x2)
+#define HDMI_TPI_DE_RSVD_REG (HDMI_TPI_DE_BASE_REG + 0x3)
+#define HDMI_TPI_DE_CNT_LSB_REG (HDMI_TPI_DE_BASE_REG + 0x4)
+#define HDMI_TPI_DE_CNT_MSB_REG (HDMI_TPI_DE_BASE_REG + 0x5)
+#define HDMI_TPI_DE_LIN_LSB_REG (HDMI_TPI_DE_BASE_REG + 0x6)
+#define HDMI_TPI_DE_LIN_MSB_REG (HDMI_TPI_DE_BASE_REG + 0x7)
+
+#define HDMI_TPI_HRES_LSB_REG 0x6A
+#define HDMI_TPI_HRES_MSB_REG 0x6B
+
+#define HDMI_TPI_VRES_LSB_REG 0x6C
+#define HDMI_TPI_VRES_MSB_REG 0x6D
+
+#define HDMI_TPI_RQB_REG 0xC7
+#define HDMI_TPI_DEVID_REG 0x1B
+#define HDMI_TPI_DEVREV_REG 0x1C
+
+#define HDMI_TPI_DEVICE_POWER_STATE_DATA 0x1E
+#define HDMI_REQ_GRANT_BMODE_REG 0xC7
+#define HDMI_TPI_DEVICE_ID_REG 0x1B
+#define HDMI_TPI_REVISION_REG 0x1C
+#define HDMI_TPI_ID_BYTE2_REG 0x1D
+#define HDMI_TPI_POWER_STATE_CTRL_REG 0x1E
+
+#define HDMI_TPI_INTERRUPT_ENABLE_REG 0x3C
+#define HDMI_TPI_INTERRUPT_STATUS_REG 0x3D
+
+
+/* AVI InfoFrames can be readed byte by byte but must be write in a burst */
+#define HDMI_TPI_AVI_DBYTE_BASE_REG 0x0C
+#define HDMI_TPI_AVI_DBYTE0_CHKSUM_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x00)
+#define HDMI_TPI_AVI_DBYTE1_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x01)
+#define HDMI_TPI_AVI_DBYTE2_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x02)
+#define HDMI_TPI_AVI_DBYTE3_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x03)
+#define HDMI_TPI_AVI_DBYTE4_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x04)
+#define HDMI_TPI_AVI_DBYTE5_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x05)
+#define HDMI_TPI_AVI_ETB_LSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x06)
+#define HDMI_TPI_AVI_ETB_MSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x07)
+#define HDMI_TPI_AVI_SBB_LSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x08)
+#define HDMI_TPI_AVI_SBB_MSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x09)
+#define HDMI_TPI_AVI_ELB_LSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x0A)
+#define HDMI_TPI_AVI_ELB_MSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x0B)
+#define HDMI_TPI_AVI_SRB_LSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x0C)
+#define HDMI_TPI_AVI_SRB_MSB_REG (HDMI_TPI_AVI_DBYTE_BASE_REG + 0x0D)
+
+#define HDMI_CPI_MISC_IF_SELECT_REG 0xBF
+#define HDMI_CPI_MISC_IF_OFFSET 0xC0
+
+#define MISC_INFOFRAME_SIZE_MEMORY 14
+#define MISC_INFOFRAME_TYPE_SUBOFFSET 0
+#define MISC_INFOFRAME_VERSION_SUBOFFSET 1
+#define MISC_INFOFRAME_LENGTH_SUBOFFSET 2
+#define MISC_INFOFRAME_CHECKSUM_SUBOFFSET 3
+#define MISC_INFOFRAME_DBYTE1_SUBOFFSET 4
+#define MISC_INFOFRAME_DBYTE2_SUBOFFSET 5
+#define MISC_INFOFRAME_DBYTE3_SUBOFFSET 6
+#define MISC_INFOFRAME_DBYTE4_SUBOFFSET 7
+#define MISC_INFOFRAME_DBYTE5_SUBOFFSET 8
+#define MISC_INFOFRAME_DBYTE6_SUBOFFSET 9
+#define MISC_INFOFRAME_DBYTE7_SUBOFFSET 10
+#define MISC_INFOFRAME_DBYTE8_SUBOFFSET 11
+#define MISC_INFOFRAME_DBYTE9_SUBOFFSET 12
+#define MISC_INFOFRAME_DBYTE10_SUBOFFSET 13
+
+#define HDMI_CPI_MISC_TYPE_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_TYPE_SUBOFFSET)
+#define HDMI_CPI_MISC_VERSION_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_VERSION_SUBOFFSET)
+#define HDMI_CPI_MISC_LENGTH_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_LENGTH_SUBOFFSET)
+#define HDMI_CPI_MISC_CHECKSUM_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_CHECKSUM_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE1_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE1_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE2_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE2_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE3_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE3_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE4_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE4_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE5_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE5_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE6_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE6_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE7_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE7_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE8_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE8_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE9_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE9_SUBOFFSET)
+#define HDMI_CPI_MISC_DBYTE10_REG (HDMI_CPI_MISC_IF_OFFSET\
+ + MISC_INFOFRAME_DBYTE10_SUBOFFSET)
+
+/* Audio */
+#define HDMI_TPI_I2S_ENABLE_MAPPING_REG 0x1F
+#define HDMI_TPI_I2S_INPUT_CONFIG_REG 0x20
+#define HDMI_TPI_I2S_STRM_HDR_BASE 0x21
+#define HDMI_TPI_I2S_STRM_HDR_0_REG (HDMI_TPI_I2S_STRM_HDR_BASE + 0)
+#define HDMI_TPI_I2S_STRM_HDR_1_REG (HDMI_TPI_I2S_STRM_HDR_BASE + 1)
+#define HDMI_TPI_I2S_STRM_HDR_2_REG (HDMI_TPI_I2S_STRM_HDR_BASE + 2)
+#define HDMI_TPI_I2S_STRM_HDR_3_REG (HDMI_TPI_I2S_STRM_HDR_BASE + 3)
+#define HDMI_TPI_I2S_STRM_HDR_4_REG (HDMI_TPI_I2S_STRM_HDR_BASE + 4)
+#define HDMI_TPI_AUDIO_CONFIG_BYTE2_REG 0x26
+#define HDMI_TPI_AUDIO_CONFIG_BYTE3_REG 0x27
+#define HDMI_TPI_AUDIO_CONFIG_BYTE4_REG 0x28
+
+/* HDCP */
+#define HDMI_TPI_HDCP_QUERYDATA_REG 0x29
+#define HDMI_TPI_HDCP_CONTROLDATA_REG 0x2A
+
+/* HDMI_TPI_DEVICE_ID_REG */
+#define TPI_DEVICE_ID 0xB0
+
+/* HDMI_TPI_REVISION_REG */
+#define TPI_REVISION 0x00
+
+/* HDMI_TPI_ID_BYTE2_REG */
+#define TPI_ID_BYTE2_VALUE 0x00
+
+/* HDMI_SYS_CTRL_DATA_REG */
+#define TPI_SYS_CTRL_POWER_DOWN (1 << 4)
+#define TPI_SYS_CTRL_POWER_ACTIVE (0 << 4)
+#define TPI_SYS_CTRL_AV_MUTE (1 << 3)
+#define TPI_SYS_CTRL_DDC_BUS_REQUEST (1 << 2)
+#define TPI_SYS_CTRL_DDC_BUS_GRANTED (1 << 1)
+#define TPI_SYS_CTRL_OUTPUT_MODE_HDMI (1 << 0)
+#define TPI_SYS_CTRL_OUTPUT_MODE_DVI (0 << 0)
+
+
+/* HDMI Monitor I2C default address */
+#define HDMI_I2C_MONITOR_ADDRESS 0x50
+
+
+/* HDMI_TPI_INTR_ENABLE */
+#define TPI_INTR_ENABLE_SECURITY_EVENT (1 << 5)
+#define TPI_INTR_ENABLE_AUDIO_EVENT (1 << 4)
+#define TPI_INTR_ENABLE_CPI_EVENT (1 << 3)
+#define TPI_INTR_ENABLE_RECEIVER_EVENT (1 << 1)
+#define TPI_INTR_ENABLE_HOTPLUG_EVENT (1 << 0)
+
+/* HDMI_TPI_INTR_STATUS */
+#define TPI_INTR_STATUS_SECURITY_EVENT (1 << 5)
+#define TPI_INTR_STATUS_AUDIO_EVENT (1 << 4)
+#define TPI_INTR_STATUS_POWERED_EVENT (1 << 3)
+#define TPI_INTR_STATUS_HOTPLUG_STATE (1 << 2)
+#define TPI_INTR_STATUS_RECEIVER_EVENT (1 << 1)
+#define TPI_INTR_STATUS_HOTPLUG_EVENT (1 << 0)
+
+
+/* HDMI_TPI_PIXEL_REPETITION */
+#define TPI_AVI_PIXEL_REP_BUS_24BIT (1 << 5)
+#define TPI_AVI_PIXEL_REP_BUS_12BIT (0 << 5)
+#define TPI_AVI_PIXEL_REP_RISING_EDGE (1 << 4)
+#define TPI_AVI_PIXEL_REP_FALLING_EDGE (0 << 4)
+#define TPI_AVI_PIXEL_REP_4X (3 << 0)
+#define TPI_AVI_PIXEL_REP_2X (1 << 0)
+#define TPI_AVI_PIXEL_REP_NONE (0 << 0)
+
+/* HDMI_TPI_AVI_INPUT_FORMAT */
+#define TPI_AVI_INPUT_BITMODE_12BIT (1 << 7)
+#define TPI_AVI_INPUT_BITMODE_8BIT (0 << 7)
+#define TPI_AVI_INPUT_DITHER (1 << 6)
+#define TPI_AVI_INPUT_RANGE_LIMITED (2 << 2)
+#define TPI_AVI_INPUT_RANGE_FULL (1 << 2)
+#define TPI_AVI_INPUT_RANGE_AUTO (0 << 2)
+#define TPI_AVI_INPUT_COLORSPACE_BLACK (3 << 0)
+#define TPI_AVI_INPUT_COLORSPACE_YUV422 (2 << 0)
+#define TPI_AVI_INPUT_COLORSPACE_YUV444 (1 << 0)
+#define TPI_AVI_INPUT_COLORSPACE_RGB (0 << 0)
+
+
+/* HDMI_TPI_AVI_OUTPUT_FORMAT */
+#define TPI_AVI_OUTPUT_CONV_BT709 (1 << 4)
+#define TPI_AVI_OUTPUT_CONV_BT601 (0 << 4)
+#define TPI_AVI_OUTPUT_RANGE_LIMITED (2 << 2)
+#define TPI_AVI_OUTPUT_RANGE_FULL (1 << 2)
+#define TPI_AVI_OUTPUT_RANGE_AUTO (0 << 2)
+#define TPI_AVI_OUTPUT_COLORSPACE_RGBDVI (3 << 0)
+#define TPI_AVI_OUTPUT_COLORSPACE_YUV422 (2 << 0)
+#define TPI_AVI_OUTPUT_COLORSPACE_YUV444 (1 << 0)
+#define TPI_AVI_OUTPUT_COLORSPACE_RGBHDMI (0 << 0)
+
+
+/* HDMI_TPI_DEVICE_POWER_STATE */
+#define TPI_AVI_POWER_STATE_D3 (3 << 0)
+#define TPI_AVI_POWER_STATE_D2 (2 << 0)
+#define TPI_AVI_POWER_STATE_D0 (0 << 0)
+
+/* HDMI_TPI_AUDIO_CONFIG_BYTE2_REG */
+#define TPI_AUDIO_CODING_STREAM_HEADER (0 << 0)
+#define TPI_AUDIO_CODING_PCM (1 << 0)
+#define TPI_AUDIO_CODING_AC3 (2 << 0)
+#define TPI_AUDIO_CODING_MPEG1 (3 << 0)
+#define TPI_AUDIO_CODING_MP3 (4 << 0)
+#define TPI_AUDIO_CODING_MPEG2 (5 << 0)
+#define TPI_AUDIO_CODING_AAC (6 << 0)
+#define TPI_AUDIO_CODING_DTS (7 << 0)
+#define TPI_AUDIO_CODING_ATRAC (8 << 0)
+#define TPI_AUDIO_MUTE_DISABLE (0 << 4)
+#define TPI_AUDIO_MUTE_ENABLE (1 << 4)
+#define TPI_AUDIO_INTERFACE_DISABLE (0 << 6)
+#define TPI_AUDIO_INTERFACE_SPDIF (1 << 6)
+#define TPI_AUDIO_INTERFACE_I2S (2 << 6)
+
+/* HDMI_TPI_AUDIO_CONFIG_BYTE3_REG */
+#define TPI_AUDIO_CHANNEL_STREAM (0 << 0)
+#define TPI_AUDIO_2_CHANNEL (1 << 0)
+#define TPI_AUDIO_8_CHANNEL (7 << 0)
+#define TPI_AUDIO_FREQ_STREAM (0 << 3)
+#define TPI_AUDIO_FREQ_32KHZ (1 << 3)
+#define TPI_AUDIO_FREQ_44KHZ (2 << 3)
+#define TPI_AUDIO_FREQ_48KHZ (3 << 3)
+#define TPI_AUDIO_FREQ_88KHZ (4 << 3)
+#define TPI_AUDIO_FREQ_96KHZ (5 << 3)
+#define TPI_AUDIO_FREQ_176KHZ (6 << 3)
+#define TPI_AUDIO_FREQ_192KHZ (7 << 3)
+#define TPI_AUDIO_SAMPLE_SIZE_STREAM (0 << 6)
+#define TPI_AUDIO_SAMPLE_SIZE_16 (1 << 6)
+#define TPI_AUDIO_SAMPLE_SIZE_20 (2 << 6)
+#define TPI_AUDIO_SAMPLE_SIZE_24 (3 << 6)
+
+/* HDMI_TPI_I2S_ENABLE_MAPPING_REG */
+#define TPI_I2S_SD_CONFIG_SELECT_SD0 (0 << 0)
+#define TPI_I2S_SD_CONFIG_SELECT_SD1 (1 << 0)
+#define TPI_I2S_SD_CONFIG_SELECT_SD2 (2 << 0)
+#define TPI_I2S_SD_CONFIG_SELECT_SD3 (3 << 0)
+#define TPI_I2S_LF_RT_SWAP_NO (0 << 2)
+#define TPI_I2S_LF_RT_SWAP_YES (1 << 2)
+#define TPI_I2S_DOWNSAMPLE_DISABLE (0 << 3)
+#define TPI_I2S_DOWNSAMPLE_ENABLE (1 << 3)
+#define TPI_I2S_SD_FIFO_0 (0 << 4)
+#define TPI_I2S_SD_FIFO_1 (1 << 4)
+#define TPI_I2S_SD_FIFO_2 (2 << 4)
+#define TPI_I2S_SD_FIFO_3 (3 << 4)
+#define TPI_I2S_SD_CHANNEL_DISABLE (0 << 7)
+#define TPI_I2S_SD_CHANNEL_ENABLE (1 << 7)
+
+
+/* HDMI_TPI_I2S_INPUT_CONFIG_REG */
+#define TPI_I2S_FIRST_BIT_SHIFT_YES (0 << 0)
+#define TPI_I2S_FIRST_BIT_SHIFT_NO (1 << 0)
+#define TPI_I2S_SD_DIRECTION_MSB_FIRST (0 << 1)
+#define TPI_I2S_SD_DIRECTION_LSB_FIRST (1 << 1)
+#define TPI_I2S_SD_JUSTIFY_LEFT (0 << 2)
+#define TPI_I2S_SD_JUSTIFY_RIGHT (1 << 2)
+#define TPI_I2S_WS_POLARITY_LOW (0 << 3)
+#define TPI_I2S_WS_POLARITY_HIGH (1 << 3)
+#define TPI_I2S_MCLK_MULTIPLIER_128 (0 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_256 (1 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_384 (2 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_512 (3 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_768 (4 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_1024 (5 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_1152 (6 << 4)
+#define TPI_I2S_MCLK_MULTIPLIER_192 (7 << 4)
+#define TPI_I2S_SCK_EDGE_FALLING (0 << 7)
+#define TPI_I2S_SCK_EDGE_RISING (1 << 7)
+
+/* HDMI_TPI_I2S_STRM_HDR_REG */
+/* the reference of this values is in IEC 60958-3 */
+#define I2S_CHAN_STATUS_MODE 0x00
+#define I2S_CHAN_STATUS_CAT_CODE 0x00
+#define I2S_CHAN_SOURCE_CHANNEL_NUM 0x00
+#define I2S_CHAN_ACCURACY_N_44_SAMPLING_FS 0x20
+#define I2S_CHAN_ACCURACY_N_48_SAMPLING_FS 0x22
+#define I2S_CHAN_ORIGIN_FS_N_SAMP_LENGTH 0xD2
+
+
+/* MISCELLANOUS INFOFRAME VALUES */
+
+#define HDMI_INFOFRAME_TX_ENABLE (0x1 << 7)
+#define HDMI_INFOFRAME_TX_REPEAT (0x1 << 6)
+#define HDMI_AUDIO_INFOFRAME (0x2 << 0)
+
+/* Stream Header Data */
+#define HDMI_SH_PCM (0x1 << 4)
+#define HDMI_SH_TWO_CHANNELS (0x1 << 0)
+#define HDMI_SH_44KHz (0x2 << 2)
+#define HDMI_SH_48KHz (0x3 << 2)
+#define HDMI_SH_16BIT (0x1 << 0)
+#define HDMI_SH_SPKR_FLFR 0x0
+#define HDMI_SH_0dB_ATUN 0x0
+
+/* MISC_TYPE */
+#define MISC_INFOFRAME_TYPE 0x04 /* for Audio */
+#define MISC_INFOFRAME_ALWAYS_SET 0x80
+
+/* MISC_VERSION */
+#define MISC_INFOFRAME_VERSION 0x01
+
+/* MISC_LENGTH */
+#define MISC_INFOFRAME_LENGTH 0x0A /*length for Audio infoframe*/
+#define MISC_INFOFRAME_LENGTH_RSVD_BITS 0xE0
+
+/* MISC_DBYTE1 */
+/* Type, Encoding, Trandport */
+#define MISC_DBYTE1_CT_CHK_HEADER_STREAM 0x00
+
+/* audio channel count */
+#define MISC_DBYTE1_CC_CHK_HEADER_STREAM 0x00
+#define MISC_DBYTE1_CC_2_CHANNELS 0x01
+
+/* MISC_DBYTE2 */
+/*Sample Size */
+#define MISC_DBYTE2_SS_CHK_HEADER_STREAM 0x00 /* for hdmi by default */
+
+/* Sampling Frequency */
+#define MISC_DBYTE2_SF_CHK_HEADER_STREAM 0x00 /* for hdmi by default */
+
+/* MISC_DBYTE3 */
+/* Code Extention */
+#define MISC_DBYTE3_CTX_TAKE_DBYTE1 0x00 /* for hdmi by default */
+
+/* MISC_DBYTE4 */
+#define MISC_DBYTE4 0x00 /*for no multichannel( */
+ /* multichannel means more*/
+ /* than 2 channels */
+
+/* MISC_DBYTE5 */
+#define MISC_DBYTE5 0x00 /* for no multichannel(multichannel */
+ /* means more than 2 channels */
+
+struct hdmi_reg_data {
+ u8 reg_offset;
+ u8 value;
+};
+
+#endif
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/1] OMAPDSS: Add sil9022 driver
From: Yegor Yefremov @ 2013-07-09 9:37 UTC (permalink / raw)
To: Sathya Prakash M R
Cc: Valkeinen, Tomi, archit, linux-omap, linux-fbdev,
Srinivas Pulukuru
In-Reply-To: <1373360825-25170-1-git-send-email-sathyap@ti.com>
On Tue, Jul 9, 2013 at 11:07 AM, Sathya Prakash M R <sathyap@ti.com> wrote:
> From: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
>
> Add driver for SIL9022 DPI-to-HDMI chip.
>
> Signed-off-by: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
> [sathyap@ti.com: Ported the driver from 2.6.32 based internal
> kernel to v3.10 kernel]
> Signed-off-by: Sathya Prakash M R <sathyap@ti.com>
> ---
> This patch was tested using the legacy OMAP3630 based Zoom3 platform.
> There is no DT support for Zoom , hence board file changes
> made locally were used for validation purpose.
> Further, DT support will be added for a newer SOC which uses
> the sil9022 HDMI interface chip.
>
> drivers/video/omap2/displays/Kconfig | 8 +
> drivers/video/omap2/displays/Makefile | 1 +
> drivers/video/omap2/displays/panel-sil9022.c | 1274 ++++++++++++++++++++++++++
> drivers/video/omap2/displays/panel-sil9022.h | 527 +++++++++++
> 4 files changed, 1810 insertions(+)
> create mode 100644 drivers/video/omap2/displays/panel-sil9022.c
> create mode 100644 drivers/video/omap2/displays/panel-sil9022.h
What about making this driver more general. We've tested this HDMI
chip on am335x and there are also Freescal based devices using this
chip (http://www.genesi-tech.com/products/efika and kernel repo
http://github.com/genesi/linux-legacy).
Yegor
^ permalink raw reply
* Re: [V3 2/7] ARM: mmp: remove the legacy rbswap setting for ttc_dkb platform
From: Haojian Zhuang @ 2013-07-09 10:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1372332524-6772-1-git-send-email-jtzhou@marvell.com>
On Thu, Jun 27, 2013 at 7:28 PM, Jett.Zhou <jtzhou@marvell.com> wrote:
> According to new rbswap scheme of mmp_display, it support appropriate
> rbswap setting based specific pix_fmt, then we can remove the legacy
> rbswap setting for ttc_dkb platform.
>
> Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
> ---
> arch/arm/mach-mmp/ttc_dkb.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
> index 8483906..cb08485 100644
> --- a/arch/arm/mach-mmp/ttc_dkb.c
> +++ b/arch/arm/mach-mmp/ttc_dkb.c
> @@ -191,7 +191,6 @@ static struct pxa3xx_nand_platform_data dkb_nand_info = {
> #define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */
> /* link config */
> #define CFG_DUMBMODE(mode) (mode << 28) /* 0x0 ~ 0x6*/
> -#define CFG_GRA_SWAPRB(x) (x << 0) /* 1: rbswap enabled */
> static struct mmp_mach_path_config dkb_disp_config[] = {
> [0] = {
> .name = "mmp-parallel",
> @@ -199,8 +198,7 @@ static struct mmp_mach_path_config dkb_disp_config[] = {
> .output_type = PATH_OUT_PARALLEL,
> .path_config = CFG_IOPADMODE(0x1)
> | SCLK_SOURCE_SELECT(0x1),
> - .link_config = CFG_DUMBMODE(0x2)
> - | CFG_GRA_SWAPRB(0x1),
> + .link_config = CFG_DUMBMODE(0x2),
> },
> };
>
> --
> 1.7.0.4
>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
^ permalink raw reply
* Re: [PATCH 1/1] OMAPDSS: Add sil9022 driver
From: Sathya Prakash @ 2013-07-09 10:56 UTC (permalink / raw)
To: Yegor Yefremov
Cc: Sathya Prakash M R, Valkeinen, Tomi, archit, linux-omap,
linux-fbdev, Srinivas Pulukuru
In-Reply-To: <CAGm1_kuVLrTPS2TYw=TRWOppbY4HW0tpYUJzWqyv7MapJTL-_Q@mail.gmail.com>
Hi,
On Tuesday 09 July 2013 03:07 PM, Yegor Yefremov wrote:
> On Tue, Jul 9, 2013 at 11:07 AM, Sathya Prakash M R <sathyap@ti.com> wrote:
>> From: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
>>
>> Add driver for SIL9022 DPI-to-HDMI chip.
>>
>> Signed-off-by: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
>> [sathyap@ti.com: Ported the driver from 2.6.32 based internal
>> kernel to v3.10 kernel]
>> Signed-off-by: Sathya Prakash M R <sathyap@ti.com>
>> ---
>> This patch was tested using the legacy OMAP3630 based Zoom3 platform.
>> There is no DT support for Zoom , hence board file changes
>> made locally were used for validation purpose.
>> Further, DT support will be added for a newer SOC which uses
>> the sil9022 HDMI interface chip.
>>
>> drivers/video/omap2/displays/Kconfig | 8 +
>> drivers/video/omap2/displays/Makefile | 1 +
>> drivers/video/omap2/displays/panel-sil9022.c | 1274 ++++++++++++++++++++++++++
>> drivers/video/omap2/displays/panel-sil9022.h | 527 +++++++++++
>> 4 files changed, 1810 insertions(+)
>> create mode 100644 drivers/video/omap2/displays/panel-sil9022.c
>> create mode 100644 drivers/video/omap2/displays/panel-sil9022.h
> What about making this driver more general. We've tested this HDMI
> chip on am335x and there are also Freescal based devices using this
> chip (http://www.genesi-tech.com/products/efika and kernel repo
> http://github.com/genesi/linux-legacy).
Currently the panel driver is tied to the OMAPDSS and hence making
this driver more generic is a difficult job.
But the Common Display Framework (CDF) will surely help us in future
to get drivers like this easy to port across different platforms.
In the future, will make this driver part of CDF to help in making it
more general.
Regards,
Sathya Prakash M R
> Yegor
^ permalink raw reply
* Re: [PATCH 1/1] OMAPDSS: Add sil9022 driver
From: Yegor Yefremov @ 2013-07-09 12:31 UTC (permalink / raw)
To: Sathya Prakash
Cc: Sathya Prakash M R, Valkeinen, Tomi, archit, linux-omap,
linux-fbdev, Srinivas Pulukuru
In-Reply-To: <51DBEC74.70406@ti.com>
On Tue, Jul 9, 2013 at 12:56 PM, Sathya Prakash <a0393677@ti.com> wrote:
> Hi,
>
>
> On Tuesday 09 July 2013 03:07 PM, Yegor Yefremov wrote:
>>
>> On Tue, Jul 9, 2013 at 11:07 AM, Sathya Prakash M R <sathyap@ti.com>
>> wrote:
>>>
>>> From: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
>>>
>>> Add driver for SIL9022 DPI-to-HDMI chip.
>>>
>>> Signed-off-by: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
>>> [sathyap@ti.com: Ported the driver from 2.6.32 based internal
>>> kernel to v3.10 kernel]
>>> Signed-off-by: Sathya Prakash M R <sathyap@ti.com>
>>> ---
>>> This patch was tested using the legacy OMAP3630 based Zoom3 platform.
>>> There is no DT support for Zoom , hence board file changes
>>> made locally were used for validation purpose.
>>> Further, DT support will be added for a newer SOC which uses
>>> the sil9022 HDMI interface chip.
>>>
>>> drivers/video/omap2/displays/Kconfig | 8 +
>>> drivers/video/omap2/displays/Makefile | 1 +
>>> drivers/video/omap2/displays/panel-sil9022.c | 1274
>>> ++++++++++++++++++++++++++
>>> drivers/video/omap2/displays/panel-sil9022.h | 527 +++++++++++
>>> 4 files changed, 1810 insertions(+)
>>> create mode 100644 drivers/video/omap2/displays/panel-sil9022.c
>>> create mode 100644 drivers/video/omap2/displays/panel-sil9022.h
>>
>> What about making this driver more general. We've tested this HDMI
>> chip on am335x and there are also Freescal based devices using this
>> chip (http://www.genesi-tech.com/products/efika and kernel repo
>> http://github.com/genesi/linux-legacy).
>
> Currently the panel driver is tied to the OMAPDSS and hence making
> this driver more generic is a difficult job.
> But the Common Display Framework (CDF) will surely help us in future
> to get drivers like this easy to port across different platforms.
> In the future, will make this driver part of CDF to help in making it more
> general.
O.K.
Yegor
^ 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