From 373c23c7936c05f615d3db569198c10be3d9d4b2 Mon Sep 17 00:00:00 2001 From: Bryan Wu Date: Wed, 17 Sep 2014 18:04:17 -0700 Subject: media: tegra_v4l2_camera: use port num to init clk Change clks_init() internal API to use CSI port number to enable clks instead of using dev_id which is incorrect sometime, since vi.0 might also assigned to CSI_B/CSI_C port. Bug 1560636 Change-Id: I0e26308ec885e2e34fe8faa63fca404c911912c4 Signed-off-by: Bryan Wu Reviewed-on: http://git-master/r/539002 Reviewed-by: Venkat Moganty (cherry picked from commit c66d8e5880589b0d95dba63d10daff53e47e8628) Reviewed-on: http://git-master/r/665995 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Winnie Hsu --- drivers/media/platform/soc_camera/tegra_camera/vi2.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/media/platform/soc_camera/tegra_camera/vi2.c') diff --git a/drivers/media/platform/soc_camera/tegra_camera/vi2.c b/drivers/media/platform/soc_camera/tegra_camera/vi2.c index 00b400799cdf..09a3a6173a9f 100644 --- a/drivers/media/platform/soc_camera/tegra_camera/vi2.c +++ b/drivers/media/platform/soc_camera/tegra_camera/vi2.c @@ -344,7 +344,7 @@ static struct tegra_camera_clk vi2_clks1[] = { .use_devname = 1, }, { - .name = "vi_sensor", + .name = "vi_sensor2", .freq = 24000000, }, { @@ -366,12 +366,12 @@ static struct tegra_camera_clk vi2_clks1[] = { }, { .name = "cilcd", - .freq = 0, + .freq = 102000000, .use_devname = 1, }, { .name = "cile", - .freq = 0, + .freq = 102000000, .use_devname = 1, }, /* Always put "p11_d" at the end */ @@ -383,23 +383,24 @@ static struct tegra_camera_clk vi2_clks1[] = { #define MAX_DEVID_LENGTH 16 -static int vi2_clks_init(struct tegra_camera_dev *cam) +static int vi2_clks_init(struct tegra_camera_dev *cam, int port) { struct platform_device *pdev = cam->ndev; struct tegra_camera_clk *clks; int i; - switch (pdev->id) { - case 0: + switch (port) { + case TEGRA_CAMERA_PORT_CSI_A: cam->num_clks = ARRAY_SIZE(vi2_clks0); cam->clks = vi2_clks0; break; - case 1: + case TEGRA_CAMERA_PORT_CSI_B: + case TEGRA_CAMERA_PORT_CSI_C: cam->num_clks = ARRAY_SIZE(vi2_clks1); cam->clks = vi2_clks1; break; default: - dev_err(&pdev->dev, "Wrong device ID %d\n", pdev->id); + dev_err(&pdev->dev, "Wrong port number %d\n", port); return -ENODEV; } -- cgit v1.2.3