Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333796
b: refs/heads/master
c: ccbfd1d
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Oct 6, 2012
1 parent c7fb9ec commit fef1d4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eabe7b01c249c9d8166a1a10bb6effce2b3de665
refs/heads/master: ccbfd1d49dc0d6a6edab827ab4888cf93348f249
13 changes: 7 additions & 6 deletions trunk/drivers/media/platform/s5p-fimc/mipi-csis.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct csis_pktbuf {
* protecting @format and @flags members
* @pads: CSIS pads array
* @sd: v4l2_subdev associated with CSIS device instance
* @index: the hardware instance index
* @pdev: CSIS platform device
* @regs: mmaped I/O registers memory
* @supplies: CSIS regulator supplies
Expand All @@ -176,6 +177,7 @@ struct csis_state {
struct mutex lock;
struct media_pad pads[CSIS_PADS_NUM];
struct v4l2_subdev sd;
u8 index;
struct platform_device *pdev;
void __iomem *regs;
struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES];
Expand Down Expand Up @@ -666,14 +668,15 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
spin_lock_init(&state->slock);

state->pdev = pdev;
state->index = max(0, pdev->id);

pdata = pdev->dev.platform_data;
if (pdata == NULL || pdata->phy_enable == NULL) {
if (pdata == NULL) {
dev_err(&pdev->dev, "Platform data not fully specified\n");
return -EINVAL;
}

if ((pdev->id == 1 && pdata->lanes > CSIS1_MAX_LANES) ||
if ((state->index == 1 && pdata->lanes > CSIS1_MAX_LANES) ||
pdata->lanes > CSIS0_MAX_LANES) {
dev_err(&pdev->dev, "Unsupported number of data lanes: %d\n",
pdata->lanes);
Expand Down Expand Up @@ -756,7 +759,6 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)

static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
{
struct s5p_platform_mipi_csis *pdata = dev->platform_data;
struct platform_device *pdev = to_platform_device(dev);
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csis_state *state = sd_to_csis_state(sd);
Expand All @@ -768,7 +770,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
mutex_lock(&state->lock);
if (state->flags & ST_POWERED) {
s5pcsis_stop_stream(state);
ret = pdata->phy_enable(state->pdev, false);
ret = s5p_csis_phy_enable(state->index, false);
if (ret)
goto unlock;
ret = regulator_bulk_disable(CSIS_NUM_SUPPLIES,
Expand All @@ -787,7 +789,6 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)

static int s5pcsis_pm_resume(struct device *dev, bool runtime)
{
struct s5p_platform_mipi_csis *pdata = dev->platform_data;
struct platform_device *pdev = to_platform_device(dev);
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csis_state *state = sd_to_csis_state(sd);
Expand All @@ -805,7 +806,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
state->supplies);
if (ret)
goto unlock;
ret = pdata->phy_enable(state->pdev, true);
ret = s5p_csis_phy_enable(state->index, true);
if (!ret) {
state->flags |= ST_POWERED;
} else {
Expand Down
11 changes: 5 additions & 6 deletions trunk/include/linux/platform_data/mipi-csis.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__

struct platform_device;

/**
* struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
* @clk_rate: bus clock frequency
Expand All @@ -34,10 +32,11 @@ struct s5p_platform_mipi_csis {

/**
* s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
* @pdev: MIPI-CSIS platform device
* @on: true to enable D-PHY and deassert its reset
* false to disable D-PHY
* @id: MIPI-CSIS harware instance index (0...1)
* @on: true to enable D-PHY and deassert its reset
* false to disable D-PHY
* @return: 0 on success, or negative error code on failure
*/
int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
int s5p_csis_phy_enable(int id, bool on);

#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */

0 comments on commit fef1d4a

Please sign in to comment.