Skip to content

Commit

Permalink
mxc_mipi_csi2: Needs hdmi_isfr_clk to function
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
  • Loading branch information
ericnelsonaz committed Apr 23, 2014
1 parent 6aef4ff commit 3338700
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_h.c
Expand Up @@ -1016,6 +1016,7 @@ static struct mipi_csi2_platform_data plat_mipi_csi2 = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_nitrogen6_max.c
Expand Up @@ -1312,6 +1312,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_nitrogen6x.c
Expand Up @@ -1382,6 +1382,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_r.c
Expand Up @@ -758,6 +758,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

#define GPIOF_HIGH GPIOF_OUT_INIT_HIGH
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_s.c
Expand Up @@ -978,6 +978,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6_utc.c
Expand Up @@ -929,6 +929,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6q_arm2.c
Expand Up @@ -1542,6 +1542,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static struct fsl_mxc_capture_platform_data capture_data[] = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6q_sabreauto.c
Expand Up @@ -1165,6 +1165,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 1,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static void sabreauto_suspend_enter(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6q_sabrelite.c
Expand Up @@ -1128,6 +1128,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx6/board-mx6q_sabresd.c
Expand Up @@ -1673,6 +1673,7 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
.cfg_clk = "hdmi_isfr_clk",
};

static int __init caam_setup(char *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-mxc/include/mach/mipi_csi2.h
Expand Up @@ -114,6 +114,7 @@ struct mipi_csi2_platform_data {
unsigned int lanes;
char *dphy_clk;
char *pixel_clk;
char *cfg_clk;
int (*init)(struct platform_device *);
void (*exit)(struct platform_device *);
};
Expand Down
14 changes: 14 additions & 0 deletions drivers/mxc/mipi/mxc_mipi_csi2.c
Expand Up @@ -75,6 +75,7 @@ bool mipi_csi2_enable(struct mipi_csi2_info *info)

if (!info->mipi_en) {
info->mipi_en = true;
clk_enable(info->cfg_clk);
clk_enable(info->dphy_clk);
} else
mipi_dbg("mipi csi2 already enabled!\n");
Expand Down Expand Up @@ -102,6 +103,7 @@ bool mipi_csi2_disable(struct mipi_csi2_info *info)
if (info->mipi_en) {
info->mipi_en = false;
clk_disable(info->dphy_clk);
clk_disable(info->cfg_clk);
} else
mipi_dbg("mipi csi2 already disabled!\n");

Expand Down Expand Up @@ -402,6 +404,14 @@ static int mipi_csi2_probe(struct platform_device *pdev)
gmipi_csi2->v_channel = plat_data->v_channel;
gmipi_csi2->lanes = plat_data->lanes;

/* get mipi cfg clk */
gmipi_csi2->cfg_clk = clk_get(&pdev->dev, plat_data->cfg_clk);
if (IS_ERR(gmipi_csi2->cfg_clk)) {
dev_err(&pdev->dev, "failed to get cfg clk\n");
ret = PTR_ERR(gmipi_csi2->cfg_clk);
goto err_clk0;
}

/* get mipi dphy clk */
gmipi_csi2->dphy_clk = clk_get(&pdev->dev, plat_data->dphy_clk);
if (IS_ERR(gmipi_csi2->dphy_clk)) {
Expand Down Expand Up @@ -432,11 +442,13 @@ static int mipi_csi2_probe(struct platform_device *pdev)
}

/* mipi dphy clk enable for register access */
clk_enable(gmipi_csi2->cfg_clk);
clk_enable(gmipi_csi2->dphy_clk);
/* get mipi csi2 dphy version */
mipi_csi2_dphy_ver = mipi_csi2_read(gmipi_csi2, CSI2_VERSION);

clk_disable(gmipi_csi2->dphy_clk);
clk_disable(gmipi_csi2->cfg_clk);

platform_set_drvdata(pdev, gmipi_csi2);

Expand All @@ -452,6 +464,8 @@ static int mipi_csi2_probe(struct platform_device *pdev)
err_clk2:
clk_put(gmipi_csi2->dphy_clk);
err_clk1:
clk_put(gmipi_csi2->cfg_clk);
err_clk0:
kfree(gmipi_csi2);
alloc_failed:
return ret;
Expand Down
1 change: 1 addition & 0 deletions drivers/mxc/mipi/mxc_mipi_csi2.h
Expand Up @@ -36,6 +36,7 @@ struct mipi_csi2_info {
unsigned int datatype;
struct clk *dphy_clk;
struct clk *pixel_clk;
struct clk *cfg_clk;
unsigned int *mipi_csi2_base;
struct platform_device *pdev;

Expand Down

0 comments on commit 3338700

Please sign in to comment.