[RFC,12/17] omap3isp: Add lane configuration to platform data

Message ID 1324412889-17961-12-git-send-email-sakari.ailus@maxwell.research.nokia.com (mailing list archive)
State RFC, archived
Headers

Commit Message

Sakari Ailus Dec. 20, 2011, 8:28 p.m. UTC
  From: Sakari Ailus <sakari.ailus@iki.fi>

Add lane configuration (order of clock and data lane) to platform data on
both CCP2 and CSI-2.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
 drivers/media/video/omap3isp/ispcsiphy.h |   15 ++-------------
 include/media/omap3isp.h                 |   15 +++++++++++++++
 2 files changed, 17 insertions(+), 13 deletions(-)
  

Comments

Laurent Pinchart Jan. 6, 2012, 10:06 a.m. UTC | #1
Hi Sakari,

Thanks for the patch.

On Tuesday 20 December 2011 21:28:04 Sakari Ailus wrote:
> From: Sakari Ailus <sakari.ailus@iki.fi>
> 
> Add lane configuration (order of clock and data lane) to platform data on
> both CCP2 and CSI-2.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
>  drivers/media/video/omap3isp/ispcsiphy.h |   15 ++-------------
>  include/media/omap3isp.h                 |   15 +++++++++++++++
>  2 files changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/video/omap3isp/ispcsiphy.h
> b/drivers/media/video/omap3isp/ispcsiphy.h index 9596dc6..e93a661 100644
> --- a/drivers/media/video/omap3isp/ispcsiphy.h
> +++ b/drivers/media/video/omap3isp/ispcsiphy.h
> @@ -27,22 +27,11 @@
>  #ifndef OMAP3_ISP_CSI_PHY_H
>  #define OMAP3_ISP_CSI_PHY_H
> 
> +#include <media/omap3isp.h>
> +
>  struct isp_csi2_device;
>  struct regulator;
> 
> -struct csiphy_lane {
> -	u8 pos;
> -	u8 pol;
> -};
> -
> -#define ISP_CSIPHY2_NUM_DATA_LANES	2
> -#define ISP_CSIPHY1_NUM_DATA_LANES	1
> -
> -struct isp_csiphy_lanes_cfg {
> -	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
> -	struct csiphy_lane clk;
> -};
> -
>  struct isp_csiphy_dphy_cfg {
>  	u8 ths_term;
>  	u8 ths_settle;
> diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
> index e917b1d..8fe0bdf 100644
> --- a/include/media/omap3isp.h
> +++ b/include/media/omap3isp.h
> @@ -86,6 +86,19 @@ enum {
>  	ISP_CCP2_MODE_CCP2 = 1,
>  };
> 
> +struct csiphy_lane {
> +	u8 pos;
> +	u8 pol;
> +};
> +
> +#define ISP_CSIPHY2_NUM_DATA_LANES	2
> +#define ISP_CSIPHY1_NUM_DATA_LANES	1
> +
> +struct isp_csiphy_lanes_cfg {
> +	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
> +	struct csiphy_lane clk;
> +};

Could you please document the two structures using kerneldoc ?

> +
>  /**
>   * struct isp_ccp2_platform_data - CCP2 interface platform data
>   * @strobe_clk_pol: Strobe/clock polarity
> @@ -105,6 +118,7 @@ struct isp_ccp2_platform_data {
>  	unsigned int ccp2_mode:1;
>  	unsigned int phy_layer:1;
>  	unsigned int vpclk_div:2;
> +	struct isp_csiphy_lanes_cfg *lanecfg;

Lane configuration is mandatory, what about embedding struct 
isp_csiphy_lanes_cfg inside struct isp_ccp2_platform instead of having a 
pointer ?

>  };
> 
>  /**
> @@ -115,6 +129,7 @@ struct isp_ccp2_platform_data {
>  struct isp_csi2_platform_data {
>  	unsigned crc:1;
>  	unsigned vpclk_div:2;
> +	struct isp_csiphy_lanes_cfg *lanecfg;

Same here.

>  };
> 
>  struct isp_subdev_i2c_board_info {
  
Sakari Ailus Jan. 7, 2012, 11:39 p.m. UTC | #2
Hi Laurent,

Laurent Pinchart wrote:
> On Tuesday 20 December 2011 21:28:04 Sakari Ailus wrote:
>> From: Sakari Ailus <sakari.ailus@iki.fi>
>>
>> Add lane configuration (order of clock and data lane) to platform data on
>> both CCP2 and CSI-2.
>>
>> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
>> ---
>>  drivers/media/video/omap3isp/ispcsiphy.h |   15 ++-------------
>>  include/media/omap3isp.h                 |   15 +++++++++++++++
>>  2 files changed, 17 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/media/video/omap3isp/ispcsiphy.h
>> b/drivers/media/video/omap3isp/ispcsiphy.h index 9596dc6..e93a661 100644
>> --- a/drivers/media/video/omap3isp/ispcsiphy.h
>> +++ b/drivers/media/video/omap3isp/ispcsiphy.h
>> @@ -27,22 +27,11 @@
>>  #ifndef OMAP3_ISP_CSI_PHY_H
>>  #define OMAP3_ISP_CSI_PHY_H
>>
>> +#include <media/omap3isp.h>
>> +
>>  struct isp_csi2_device;
>>  struct regulator;
>>
>> -struct csiphy_lane {
>> -	u8 pos;
>> -	u8 pol;
>> -};
>> -
>> -#define ISP_CSIPHY2_NUM_DATA_LANES	2
>> -#define ISP_CSIPHY1_NUM_DATA_LANES	1
>> -
>> -struct isp_csiphy_lanes_cfg {
>> -	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
>> -	struct csiphy_lane clk;
>> -};
>> -
>>  struct isp_csiphy_dphy_cfg {
>>  	u8 ths_term;
>>  	u8 ths_settle;
>> diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
>> index e917b1d..8fe0bdf 100644
>> --- a/include/media/omap3isp.h
>> +++ b/include/media/omap3isp.h
>> @@ -86,6 +86,19 @@ enum {
>>  	ISP_CCP2_MODE_CCP2 = 1,
>>  };
>>
>> +struct csiphy_lane {
>> +	u8 pos;
>> +	u8 pol;
>> +};
>> +
>> +#define ISP_CSIPHY2_NUM_DATA_LANES	2
>> +#define ISP_CSIPHY1_NUM_DATA_LANES	1
>> +
>> +struct isp_csiphy_lanes_cfg {
>> +	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
>> +	struct csiphy_lane clk;
>> +};
> 
> Could you please document the two structures using kerneldoc ?

Done.

>> +
>>  /**
>>   * struct isp_ccp2_platform_data - CCP2 interface platform data
>>   * @strobe_clk_pol: Strobe/clock polarity
>> @@ -105,6 +118,7 @@ struct isp_ccp2_platform_data {
>>  	unsigned int ccp2_mode:1;
>>  	unsigned int phy_layer:1;
>>  	unsigned int vpclk_div:2;
>> +	struct isp_csiphy_lanes_cfg *lanecfg;
> 
> Lane configuration is mandatory, what about embedding struct 
> isp_csiphy_lanes_cfg inside struct isp_ccp2_platform instead of having a 
> pointer ?

Done.

>>  };
>>
>>  /**
>> @@ -115,6 +129,7 @@ struct isp_ccp2_platform_data {
>>  struct isp_csi2_platform_data {
>>  	unsigned crc:1;
>>  	unsigned vpclk_div:2;
>> +	struct isp_csiphy_lanes_cfg *lanecfg;
> 
> Same here.

Ditto.

>>  };
>>
>>  struct isp_subdev_i2c_board_info {
>
  

Patch

diff --git a/drivers/media/video/omap3isp/ispcsiphy.h b/drivers/media/video/omap3isp/ispcsiphy.h
index 9596dc6..e93a661 100644
--- a/drivers/media/video/omap3isp/ispcsiphy.h
+++ b/drivers/media/video/omap3isp/ispcsiphy.h
@@ -27,22 +27,11 @@ 
 #ifndef OMAP3_ISP_CSI_PHY_H
 #define OMAP3_ISP_CSI_PHY_H
 
+#include <media/omap3isp.h>
+
 struct isp_csi2_device;
 struct regulator;
 
-struct csiphy_lane {
-	u8 pos;
-	u8 pol;
-};
-
-#define ISP_CSIPHY2_NUM_DATA_LANES	2
-#define ISP_CSIPHY1_NUM_DATA_LANES	1
-
-struct isp_csiphy_lanes_cfg {
-	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
-	struct csiphy_lane clk;
-};
-
 struct isp_csiphy_dphy_cfg {
 	u8 ths_term;
 	u8 ths_settle;
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
index e917b1d..8fe0bdf 100644
--- a/include/media/omap3isp.h
+++ b/include/media/omap3isp.h
@@ -86,6 +86,19 @@  enum {
 	ISP_CCP2_MODE_CCP2 = 1,
 };
 
+struct csiphy_lane {
+	u8 pos;
+	u8 pol;
+};
+
+#define ISP_CSIPHY2_NUM_DATA_LANES	2
+#define ISP_CSIPHY1_NUM_DATA_LANES	1
+
+struct isp_csiphy_lanes_cfg {
+	struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
+	struct csiphy_lane clk;
+};
+
 /**
  * struct isp_ccp2_platform_data - CCP2 interface platform data
  * @strobe_clk_pol: Strobe/clock polarity
@@ -105,6 +118,7 @@  struct isp_ccp2_platform_data {
 	unsigned int ccp2_mode:1;
 	unsigned int phy_layer:1;
 	unsigned int vpclk_div:2;
+	struct isp_csiphy_lanes_cfg *lanecfg;
 };
 
 /**
@@ -115,6 +129,7 @@  struct isp_ccp2_platform_data {
 struct isp_csi2_platform_data {
 	unsigned crc:1;
 	unsigned vpclk_div:2;
+	struct isp_csiphy_lanes_cfg *lanecfg;
 };
 
 struct isp_subdev_i2c_board_info {