Commit 69a3d4f7 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] ARM: samsung: Change __s5p_mipi_phy_control() function signature

Replace pdev argument __s5p_mipi_phy_control() helper with plain int
so MIPI-CSIS hardware instance index can be passed directly making
the function usable on platforms instantiated from device tree.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 73f56c23
...@@ -14,24 +14,18 @@ ...@@ -14,24 +14,18 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <mach/regs-clock.h> #include <mach/regs-clock.h>
static int __s5p_mipi_phy_control(struct platform_device *pdev, static int __s5p_mipi_phy_control(int id, bool on, u32 reset)
bool on, u32 reset)
{ {
static DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
void __iomem *addr; void __iomem *addr;
unsigned long flags; unsigned long flags;
int pid;
u32 cfg; u32 cfg;
if (!pdev) id = max(0, id);
if (id > 1)
return -EINVAL; return -EINVAL;
pid = (pdev->id == -1) ? 0 : pdev->id; addr = S5P_MIPI_DPHY_CONTROL(id);
if (pid != 0 && pid != 1)
return -EINVAL;
addr = S5P_MIPI_DPHY_CONTROL(pid);
spin_lock_irqsave(&lock, flags); spin_lock_irqsave(&lock, flags);
...@@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev, ...@@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev,
return 0; return 0;
} }
int s5p_csis_phy_enable(struct platform_device *pdev, bool on) int s5p_csis_phy_enable(int id, bool on)
{ {
return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN); return __s5p_mipi_phy_control(id, on, S5P_MIPI_DPHY_SRESETN);
} }
int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) int s5p_dsim_phy_enable(struct platform_device *pdev, bool on)
{ {
return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN); return __s5p_mipi_phy_control(pdev->id, on, S5P_MIPI_DPHY_MRESETN);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment