@@ -160,6 +160,7 @@ struct csis_pktbuf {
160160 * protecting @format and @flags members
161161 * @pads: CSIS pads array
162162 * @sd: v4l2_subdev associated with CSIS device instance
163+ * @index: the hardware instance index
163164 * @pdev: CSIS platform device
164165 * @regs: mmaped I/O registers memory
165166 * @supplies: CSIS regulator supplies
@@ -176,6 +177,7 @@ struct csis_state {
176177 struct mutex lock ;
177178 struct media_pad pads [CSIS_PADS_NUM ];
178179 struct v4l2_subdev sd ;
180+ u8 index ;
179181 struct platform_device * pdev ;
180182 void __iomem * regs ;
181183 struct regulator_bulk_data supplies [CSIS_NUM_SUPPLIES ];
@@ -666,14 +668,15 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
666668 spin_lock_init (& state -> slock );
667669
668670 state -> pdev = pdev ;
671+ state -> index = max (0 , pdev -> id );
669672
670673 pdata = pdev -> dev .platform_data ;
671- if (pdata == NULL || pdata -> phy_enable == NULL ) {
674+ if (pdata == NULL ) {
672675 dev_err (& pdev -> dev , "Platform data not fully specified\n" );
673676 return - EINVAL ;
674677 }
675678
676- if ((pdev -> id == 1 && pdata -> lanes > CSIS1_MAX_LANES ) ||
679+ if ((state -> index == 1 && pdata -> lanes > CSIS1_MAX_LANES ) ||
677680 pdata -> lanes > CSIS0_MAX_LANES ) {
678681 dev_err (& pdev -> dev , "Unsupported number of data lanes: %d\n" ,
679682 pdata -> lanes );
@@ -756,7 +759,6 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
756759
757760static int s5pcsis_pm_suspend (struct device * dev , bool runtime )
758761{
759- struct s5p_platform_mipi_csis * pdata = dev -> platform_data ;
760762 struct platform_device * pdev = to_platform_device (dev );
761763 struct v4l2_subdev * sd = platform_get_drvdata (pdev );
762764 struct csis_state * state = sd_to_csis_state (sd );
@@ -768,7 +770,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
768770 mutex_lock (& state -> lock );
769771 if (state -> flags & ST_POWERED ) {
770772 s5pcsis_stop_stream (state );
771- ret = pdata -> phy_enable (state -> pdev , false);
773+ ret = s5p_csis_phy_enable (state -> index , false);
772774 if (ret )
773775 goto unlock ;
774776 ret = regulator_bulk_disable (CSIS_NUM_SUPPLIES ,
@@ -787,7 +789,6 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
787789
788790static int s5pcsis_pm_resume (struct device * dev , bool runtime )
789791{
790- struct s5p_platform_mipi_csis * pdata = dev -> platform_data ;
791792 struct platform_device * pdev = to_platform_device (dev );
792793 struct v4l2_subdev * sd = platform_get_drvdata (pdev );
793794 struct csis_state * state = sd_to_csis_state (sd );
@@ -805,7 +806,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
805806 state -> supplies );
806807 if (ret )
807808 goto unlock ;
808- ret = pdata -> phy_enable (state -> pdev , true);
809+ ret = s5p_csis_phy_enable (state -> index , true);
809810 if (!ret ) {
810811 state -> flags |= ST_POWERED ;
811812 } else {
0 commit comments