diff options
-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 | } |