diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-09-17 05:02:48 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-05 21:28:43 -0400 |
commit | 69a3d4f7b3f976192f8ac1ab760a026c737d0d56 (patch) | |
tree | f5fcd9dda44325b5d931a2b7ca36313d65d9bd4c /arch/arm/plat-samsung/setup-mipiphy.c | |
parent | 73f56c239f341f14cd1591fb0c3aafc673f4d409 (diff) |
[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: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch/arm/plat-samsung/setup-mipiphy.c')
-rw-r--r-- | arch/arm/plat-samsung/setup-mipiphy.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/arm/plat-samsung/setup-mipiphy.c b/arch/arm/plat-samsung/setup-mipiphy.c index 683c466c0e6a..147459327601 100644 --- a/arch/arm/plat-samsung/setup-mipiphy.c +++ b/arch/arm/plat-samsung/setup-mipiphy.c | |||
@@ -14,24 +14,18 @@ | |||
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <mach/regs-clock.h> | 15 | #include <mach/regs-clock.h> |
16 | 16 | ||
17 | static int __s5p_mipi_phy_control(struct platform_device *pdev, | 17 | static int __s5p_mipi_phy_control(int id, bool on, u32 reset) |
18 | bool on, u32 reset) | ||
19 | { | 18 | { |
20 | static DEFINE_SPINLOCK(lock); | 19 | static DEFINE_SPINLOCK(lock); |
21 | void __iomem *addr; | 20 | void __iomem *addr; |
22 | unsigned long flags; | 21 | unsigned long flags; |
23 | int pid; | ||
24 | u32 cfg; | 22 | u32 cfg; |
25 | 23 | ||
26 | if (!pdev) | 24 | id = max(0, id); |
25 | if (id > 1) | ||
27 | return -EINVAL; | 26 | return -EINVAL; |
28 | 27 | ||
29 | pid = (pdev->id == -1) ? 0 : pdev->id; | 28 | addr = S5P_MIPI_DPHY_CONTROL(id); |
30 | |||
31 | if (pid != 0 && pid != 1) | ||
32 | return -EINVAL; | ||
33 | |||
34 | addr = S5P_MIPI_DPHY_CONTROL(pid); | ||
35 | 29 | ||
36 | spin_lock_irqsave(&lock, flags); | 30 | spin_lock_irqsave(&lock, flags); |
37 | 31 | ||
@@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev, | |||
52 | return 0; | 46 | return 0; |
53 | } | 47 | } |
54 | 48 | ||
55 | int s5p_csis_phy_enable(struct platform_device *pdev, bool on) | 49 | int s5p_csis_phy_enable(int id, bool on) |
56 | { | 50 | { |
57 | return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN); | 51 | return __s5p_mipi_phy_control(id, on, S5P_MIPI_DPHY_SRESETN); |
58 | } | 52 | } |
59 | 53 | ||
60 | int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) | 54 | int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) |
61 | { | 55 | { |
62 | return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN); | 56 | return __s5p_mipi_phy_control(pdev->id, on, S5P_MIPI_DPHY_MRESETN); |
63 | } | 57 | } |