@@ -0,0 +1,16 @@+Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY+-------------------------------------------------++Required properties:+- compatible : "samsung,<soc_name>-video-phy", currently most SoCs can claim+ compatibility with the S5PV210 MIPI CSIS/DSIM PHY and thus should use+ "samsung,s5pv210-video-phy";+- reg : offset and length of the MIPI DPHY register set;+- #phy-cells : from the generic phy bindings, must be 1;++For "samsung,s5pv210-video-phy" compatible DPHYs the second cell in the PHY+specifier identifies the DPHY and its meaning is as follows:+ 0 - MIPI CSIS 0,+ 1 - MIPI DSIM 0,+ 2 - MIPI CSIS 1,+ 3 - MIPI DSIM 1.
@@ -2,4 +2,5 @@# Makefile for the phy drivers.#-obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_EXYNOS_VIDEO_MIPI_PHY)+=exynos_video_mipi_phy.o
Use the generic PHY API instead of the platform callback to control
the MIPI DSIM DPHY.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/display/source-exynos_dsi.c | 36 +++++++++--------------------
include/video/exynos_dsi.h | 5 ----
2 files changed, 11 insertions(+), 30 deletions(-)
@@ -1120,19 +1115,6 @@ static struct exynos_dsi_platform_data *exynos_dsi_parse_dt(returnNULL;}-prop_data=of_get_property(node,"samsung,phy-type",NULL);-if(!prop_data){-dev_err(dev,"failed to get phy-type property\n");-gotoerr_free_pd;-}--val=be32_to_cpu(*prop_data);-if(val>=ARRAY_SIZE(of_phy_enables)||!of_phy_enables[val]){-dev_err(dev,"Invalid phy-type %u\n",val);-gotoerr_free_pd;-}-dsi_pd->phy_enable=of_phy_enables[val];-prop_data=of_get_property(node,"samsung,pll-stable-time",NULL);if(!prop_data){dev_err(dev,"failed to get pll-stable-time property\n");
@@ -1254,6 +1236,10 @@ static int exynos_dsi_probe(struct platform_device *pdev)return-ENOMEM;}+dsi->phy=devm_phy_get(&pdev->dev,"dsim");+if(IS_ERR(dsi->phy))+returnPTR_ERR(dsi->phy);+platform_set_drvdata(pdev,dsi);dsi->irq=platform_get_irq(pdev,0);
Use the generic PHY API instead of the platform callback to control
the MIPI CSIS DPHY.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/media/platform/exynos4-is/mipi-csis.c | 11 +++++++++--
include/linux/platform_data/mipi-csis.h | 9 ---------
2 files changed, 9 insertions(+), 11 deletions(-)
Generic PHY drivers are used to handle the MIPI CSIS and MIPI DSIM
DPHYs so we can remove now unused code at arch/arm/plat-samsung.
In case there is any board file for S5PV210 platforms using MIPI
CSIS/DSIM (not any upstream currently) it should use the generic
PHY API to bind the PHYs to respective PHY consumer drivers.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-exynos/include/mach/regs-pmu.h | 5 --
arch/arm/mach-s5pv210/include/mach/regs-clock.h | 4 --
arch/arm/plat-samsung/Makefile | 1 -
arch/arm/plat-samsung/setup-mipiphy.c | 60 -----------------------
4 files changed, 70 deletions(-)
delete mode 100644 arch/arm/plat-samsung/setup-mipiphy.c
From: Kukjin Kim <hidden> Date: 2013-06-16 20:52:48
On 06/15/13 02:45, Sylwester Nawrocki wrote:
Generic PHY drivers are used to handle the MIPI CSIS and MIPI DSIM
DPHYs so we can remove now unused code at arch/arm/plat-samsung.
If so, sounds good :)
In case there is any board file for S5PV210 platforms using MIPI
CSIS/DSIM (not any upstream currently) it should use the generic
PHY API to bind the PHYs to respective PHY consumer drivers.
To be honest, I didn't test this on boards but if the working is fine,
please go ahead without RFC.
Thanks,
- Kukjin
@@ -0,0 +1,16 @@+Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY+-------------------------------------------------++Required properties:+- compatible : "samsung,<soc_name>-video-phy", currently most SoCs can
I don't like this <soc_name> here. It sounds like any SoC name can be put
here. IMHO just listing all supported compatible values should be enough.
quoted hunk
claim + compatibility with the S5PV210 MIPI CSIS/DSIM PHY and thus
should use + "samsung,s5pv210-video-phy";
+- reg : offset and length of the MIPI DPHY register set;
+- #phy-cells : from the generic phy bindings, must be 1;
+
+For "samsung,s5pv210-video-phy" compatible DPHYs the second cell in the
PHY +specifier identifies the DPHY and its meaning is as follows:
+ 0 - MIPI CSIS 0,
+ 1 - MIPI DSIM 0,
+ 2 - MIPI CSIS 1,
+ 3 - MIPI DSIM 1.
phy users can obtain reference to the PHY.
+
+if GENERIC_PHY
+
+config EXYNOS_VIDEO_MIPI_PHY
+ bool "S5P/EXYNOS MIPI CSI-2/DSI PHY driver"
+ depends on OF
Hmm. Is this driver designed only for OF-enabled boards?
quoted hunk
+ help
+ Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
+ S5P and EXYNOS SoCs.
+endif
@@ -2,4 +2,5 @@# Makefile for the phy drivers.#-obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_EXYNOS_VIDEO_MIPI_PHY)+=exynos_video_mipi_phy.o
diff --git a/drivers/phy/exynos_video_mipi_phy.c
b/drivers/phy/exynos_video_mipi_phy.c new file mode 100644
index 0000000..8d4976f
I don't find this statement too readable. What about:
void __iomem *addr = state->regs;
and below:
/* CSIS 1 and DSIM 1 PHYs have separate register */
if (id >= 2)
addr += 4;
+ unsigned long flags;
+ u32 reg, reset;
+
+ pr_debug("%s(): id: %d, on: %d, addr: %#x, base: %#x\n",
+ __func__, id, on, (u32)addr, (u32)state->regs);
+
+ if (WARN_ON(id > EXYNOS_MAX_VIDEO_PHYS))
+ return -EINVAL;
+
+ if (id & 1)
Nice trick ;), but not very readable. What about creating an enum of PHYs
and using those defined values here:
if (id = PHY_DSI0 || id = PHY_DSI1)
You can use platform_get_resource() here to get a resource generated for
you by of_platform_populate().
In addition you don't need to check the pointer returned by
platform_get_resource() because it is checked in devm_ioremap_resource().
+
+ state->regs = devm_ioremap_resource(dev, &res);
+ if (IS_ERR(state->regs))
+ return PTR_ERR(state->regs);
+
+ dev_set_drvdata(dev, state);
+
+ phy_provider = devm_of_phy_provider_register(dev, THIS_MODULE,
+ exynos_video_phy_xlate);
+ if (IS_ERR(phy_provider))
+ return PTR_ERR(phy_provider);
+
+ for (i = 0; i < EXYNOS_MAX_VIDEO_PHYS; i++) {
+ state->phys[i] = devm_phy_create(dev, i,
From: Tomasz Figa <hidden> Date: 2013-06-16 21:15:37
On Friday 14 of June 2013 19:45:49 Sylwester Nawrocki wrote:
Use the generic PHY API instead of the platform callback to control
the MIPI DSIM DPHY.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/display/source-exynos_dsi.c | 36
+++++++++-------------------- include/video/exynos_dsi.h
| 5 ----
2 files changed, 11 insertions(+), 30 deletions(-)
Yes, this is what I was really missing a lot while developing this driver.
Definitely looks good! It's a shame we don't have this driver in mainline
yet ;) ,
Best regards,
Tomasz
@@ -0,0 +1,16 @@+Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY+-------------------------------------------------++Required properties:+- compatible : "samsung,<soc_name>-video-phy", currently most SoCs can
I don't like this <soc_name> here. It sounds like any SoC name can be put
here. IMHO just listing all supported compatible values should be enough.
Hmm, OK, I'll simply put there the one compatible string supported now.
quoted
claim + compatibility with the S5PV210 MIPI CSIS/DSIM PHY and thus
should use + "samsung,s5pv210-video-phy";
+- reg : offset and length of the MIPI DPHY register set;
+- #phy-cells : from the generic phy bindings, must be 1;
+
+For "samsung,s5pv210-video-phy" compatible DPHYs the second cell in the
PHY +specifier identifies the DPHY and its meaning is as follows:
+ 0 - MIPI CSIS 0,
+ 1 - MIPI DSIM 0,
+ 2 - MIPI CSIS 1,
+ 3 - MIPI DSIM 1.
phy users can obtain reference to the PHY.
+
+if GENERIC_PHY
+
+config EXYNOS_VIDEO_MIPI_PHY
+ bool "S5P/EXYNOS MIPI CSI-2/DSI PHY driver"
+ depends on OF
Hmm. Is this driver designed only for OF-enabled boards?
Yes, there seems currently to be no users of MIPI CSIS/DSIM in the mainline
kernel among the non-dt platforms, so I initially focused on DT only. I will
rework this driver to make it usable on non-dt platforms, but I currently
have not way to fully test it. I believe S5PV210 will get migrated to device
tree sooner than anyone needs the functionality this driver provides on
non-dt, and S5PC100 seems to be forgotten anyway.
quoted
+ help
+ Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
+ S5P and EXYNOS SoCs.
+endif
@@ -2,4 +2,5 @@# Makefile for the phy drivers.#-obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_GENERIC_PHY)+=phy-core.o+obj-$(CONFIG_EXYNOS_VIDEO_MIPI_PHY)+=exynos_video_mipi_phy.o
diff --git a/drivers/phy/exynos_video_mipi_phy.c
b/drivers/phy/exynos_video_mipi_phy.c new file mode 100644
index 0000000..8d4976f
I don't find this statement too readable. What about:
void __iomem *addr = state->regs;
and below:
/* CSIS 1 and DSIM 1 PHYs have separate register */
if (id >= 2)
addr += 4;
OK, thanks for the suggestion. I've addressed this in v2.
quoted
+ unsigned long flags;
+ u32 reg, reset;
+
+ pr_debug("%s(): id: %d, on: %d, addr: %#x, base: %#x\n",
+ __func__, id, on, (u32)addr, (u32)state->regs);
+
+ if (WARN_ON(id > EXYNOS_MAX_VIDEO_PHYS))
+ return -EINVAL;
+
+ if (id & 1)
Nice trick ;), but not very readable. What about creating an enum of PHYs
and using those defined values here:
if (id = PHY_DSI0 || id = PHY_DSI1)
You can use platform_get_resource() here to get a resource generated for
you by of_platform_populate().
In addition you don't need to check the pointer returned by
platform_get_resource() because it is checked in devm_ioremap_resource().
Fixed.
quoted
+
+ state->regs = devm_ioremap_resource(dev, &res);
+ if (IS_ERR(state->regs))
+ return PTR_ERR(state->regs);
+
+ dev_set_drvdata(dev, state);
+
+ phy_provider = devm_of_phy_provider_register(dev, THIS_MODULE,
+ exynos_video_phy_xlate);
+ if (IS_ERR(phy_provider))
+ return PTR_ERR(phy_provider);
+
+ for (i = 0; i < EXYNOS_MAX_VIDEO_PHYS; i++) {
+ state->phys[i] = devm_phy_create(dev, i,
On Friday 14 of June 2013 19:45:49 Sylwester Nawrocki wrote:
quoted
quoted
Use the generic PHY API instead of the platform callback to control
the MIPI DSIM DPHY.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/display/source-exynos_dsi.c | 36
+++++++++-------------------- include/video/exynos_dsi.h
| 5 ----
2 files changed, 11 insertions(+), 30 deletions(-)
Yes, this is what I was really missing a lot while developing this driver.
Definitely looks good! It's a shame we don't have this driver in mainline
yet ;)
Yes, I should have mentioned in the cover letter this patch depends
on modified version of this [1] patch set of yours. I'll drop this
patch and will update the driver staying in mainline now, but I won't
be able to test it, on a non-dt platform.
I guess even some pre-eliminary display (panel) API would be helpful.
The CDF development seems to have been stalled for some time. I wonder
if we could first have something that works for limited set of devices
and be extending it gradually, rather than living with zero support
for displays on DT based ARM platforms.
[1] http://www.spinics.net/lists/linux-fbdev/msg09689.html
Regards,
Sylwester
From: Tomasz Figa <hidden> Date: 2013-06-19 17:20:19
On Wednesday 19 of June 2013 19:10:52 Sylwester Nawrocki wrote:
On 06/16/2013 11:15 PM, Tomasz Figa wrote:
quoted
On Friday 14 of June 2013 19:45:49 Sylwester Nawrocki wrote:
quoted
quoted
Use the generic PHY API instead of the platform callback to control
the MIPI DSIM DPHY.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/display/source-exynos_dsi.c | 36
+++++++++-------------------- include/video/exynos_dsi.h
| 5 ----
2 files changed, 11 insertions(+), 30 deletions(-)
Yes, this is what I was really missing a lot while developing this
driver.
Definitely looks good! It's a shame we don't have this driver in
mainline yet ;)
Yes, I should have mentioned in the cover letter this patch depends
on modified version of this [1] patch set of yours. I'll drop this
patch and will update the driver staying in mainline now, but I won't
be able to test it, on a non-dt platform.
I guess even some pre-eliminary display (panel) API would be helpful.
The CDF development seems to have been stalled for some time. I wonder
if we could first have something that works for limited set of devices
and be extending it gradually, rather than living with zero support
for displays on DT based ARM platforms.
Well, the problem is that once we define a binding for displays, we will
have to keep support for this binding even if we decide to change
something.
But as I discussed with Laurent and Alexandre at LinuxCon Japan, we should
be able to reuse V4L2 bindings for our purposes, so someone just needs to
code a proof of concept implementation that doesn't necessarily provide
full functionality yet, but allows to make something work. Probably based
on already posted RFC versions of CDF.
CCed Laurent and Alexandre, as they might be able to shed even more light
on this.
Best regards,
Tomasz
Generic PHY drivers are used to handle the MIPI CSIS and MIPI DSIM
DPHYs so we can remove now unused code at arch/arm/plat-samsung.
If so, sounds good :)
quoted
quoted
In case there is any board file for S5PV210 platforms using MIPI
CSIS/DSIM (not any upstream currently) it should use the generic
PHY API to bind the PHYs to respective PHY consumer drivers.
To be honest, I didn't test this on boards but if the working is fine,
please go ahead without RFC.
Thanks for review. I've tested it on Exynos4412 based board, and will
check also on Exynos4210 TRATS before posting the final version.
It seems to work fine, I just won't be able to test on any non-dt
platform (s5pv210), and there is currently no users of MIPI CSIS/DSIM
on s5pv210. Moreover this series depends on the generic PHY API,
perhaps it can be merged for 3.11.
[1] http://www.spinics.net/lists/arm-kernel/msg251232.html
Regards,
Sylwester