All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] pxa_camera: remove init() callback
@ 2009-11-17 22:04 ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-media
  Cc: Antonio Ospite, Guennadi Liakhovetski, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Juergen Beisert, Robert Jarzmik

Hi,

this series removes the init() callback from pxa_camera_platform_data, and
fixes its users to do initialization statically at machine init time.

Guennadi requested this change because there seems to be no use cases for
dynamic initialization. I also believe that the current semantics for this
init() callback is ambiguous anyways, it is invoked in pxa_camera_activate(),
hence at device node open, but its users use it like a generic initialization
to be done at module init time (configure MFP, request GPIOs for *sensor*
control).

So removing it is definitely good.
As a side note, If we were really exposing some dynamic and generic
initialization, this could be done in soc-camera itself, not in pxa_camera
anyways.

Thanks,
   Antonio

Antonio Ospite (3):
  em-x270: don't use pxa_camera init() callback
  pcm990-baseboard: don't use pxa_camera init() callback
  pxa_camera: remove init() callback

 arch/arm/mach-pxa/em-x270.c             |    9 +++++----
 arch/arm/mach-pxa/include/mach/camera.h |    2 --
 arch/arm/mach-pxa/pcm990-baseboard.c    |    8 +-------
 drivers/media/video/pxa_camera.c        |   10 ----------
 4 files changed, 6 insertions(+), 23 deletions(-)

--
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 0/3] pxa_camera: remove init() callback
@ 2009-11-17 22:04 ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

this series removes the init() callback from pxa_camera_platform_data, and
fixes its users to do initialization statically at machine init time.

Guennadi requested this change because there seems to be no use cases for
dynamic initialization. I also believe that the current semantics for this
init() callback is ambiguous anyways, it is invoked in pxa_camera_activate(),
hence at device node open, but its users use it like a generic initialization
to be done at module init time (configure MFP, request GPIOs for *sensor*
control).

So removing it is definitely good.
As a side note, If we were really exposing some dynamic and generic
initialization, this could be done in soc-camera itself, not in pxa_camera
anyways.

Thanks,
   Antonio

Antonio Ospite (3):
  em-x270: don't use pxa_camera init() callback
  pcm990-baseboard: don't use pxa_camera init() callback
  pxa_camera: remove init() callback

 arch/arm/mach-pxa/em-x270.c             |    9 +++++----
 arch/arm/mach-pxa/include/mach/camera.h |    2 --
 arch/arm/mach-pxa/pcm990-baseboard.c    |    8 +-------
 drivers/media/video/pxa_camera.c        |   10 ----------
 4 files changed, 6 insertions(+), 23 deletions(-)

--
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3] em-x270: don't use pxa_camera init() callback
  2009-11-17 22:04 ` Antonio Ospite
@ 2009-11-17 22:04   ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-media
  Cc: Antonio Ospite, Guennadi Liakhovetski, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Juergen Beisert, Robert Jarzmik

pxa_camera init() is going to be removed.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/em-x270.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f42..f71f34c 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
 static struct regulator *em_x270_camera_ldo;
 
-static int em_x270_sensor_init(struct device *dev)
+static int em_x270_sensor_init(void)
 {
 	int ret;
 
@@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
 }
 
 struct pxacamera_platform_data em_x270_camera_platform_data = {
-	.init	= em_x270_sensor_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
 	.mclk_10khz = 2600,
@@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
 
 static void  __init em_x270_init_camera(void)
 {
-	pxa_set_camera_info(&em_x270_camera_platform_data);
-	platform_device_register(&em_x270_camera);
+	if (em_x270_sensor_init() == 0) {
+		pxa_set_camera_info(&em_x270_camera_platform_data);
+		platform_device_register(&em_x270_camera);
+	}
 }
 #else
 static inline void em_x270_init_camera(void) {}
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 1/3] em-x270: don't use pxa_camera init() callback
@ 2009-11-17 22:04   ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-arm-kernel

pxa_camera init() is going to be removed.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/em-x270.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f42..f71f34c 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
 static struct regulator *em_x270_camera_ldo;
 
-static int em_x270_sensor_init(struct device *dev)
+static int em_x270_sensor_init(void)
 {
 	int ret;
 
@@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
 }
 
 struct pxacamera_platform_data em_x270_camera_platform_data = {
-	.init	= em_x270_sensor_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
 	.mclk_10khz = 2600,
@@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
 
 static void  __init em_x270_init_camera(void)
 {
-	pxa_set_camera_info(&em_x270_camera_platform_data);
-	platform_device_register(&em_x270_camera);
+	if (em_x270_sensor_init() == 0) {
+		pxa_set_camera_info(&em_x270_camera_platform_data);
+		platform_device_register(&em_x270_camera);
+	}
 }
 #else
 static inline void em_x270_init_camera(void) {}
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
  2009-11-17 22:04 ` Antonio Ospite
@ 2009-11-17 22:04   ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-media
  Cc: Antonio Ospite, Guennadi Liakhovetski, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Juergen Beisert, Robert Jarzmik

pxa_camera init() is going to be removed.
Configure PXA CIF pins directly in machine init function.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda570..d5255ae 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
 	GPIO44_CIF_LV,
 };
 
-static int pcm990_pxacamera_init(struct device *dev)
-{
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
-	return 0;
-}
-
 /*
  * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
  *	MCLK_EN:	Master clock is generated by PXA
  *	PCP:		Data sampled on the falling edge of pixel clock
  */
 struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
-	.init	= pcm990_pxacamera_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
 	.mclk_10khz = 1000,
@@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
 	pxa_set_ac97_info(NULL);
 
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
 	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
 
 	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
@ 2009-11-17 22:04   ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-arm-kernel

pxa_camera init() is going to be removed.
Configure PXA CIF pins directly in machine init function.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda570..d5255ae 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
 	GPIO44_CIF_LV,
 };
 
-static int pcm990_pxacamera_init(struct device *dev)
-{
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
-	return 0;
-}
-
 /*
  * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
  *	MCLK_EN:	Master clock is generated by PXA
  *	PCP:		Data sampled on the falling edge of pixel clock
  */
 struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
-	.init	= pcm990_pxacamera_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
 	.mclk_10khz = 1000,
@@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
 	pxa_set_ac97_info(NULL);
 
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
 	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
 
 	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
  2009-11-17 22:04 ` Antonio Ospite
@ 2009-11-17 22:04   ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-media
  Cc: Antonio Ospite, Guennadi Liakhovetski, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Juergen Beisert, Robert Jarzmik

pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
even to request GPIOs to be used by the camera *sensor*. These initializations
can be performed statically in machine init functions.

The current semantics for this init() callback is ambiguous anyways, it is
invoked in pxa_camera_activate(), hence at device node open, but its users use
it like a generic initialization to be done at module init time (configure
MFP, request GPIOs for *sensor* control).

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/include/mach/camera.h |    2 --
 drivers/media/video/pxa_camera.c        |   10 ----------
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
index 31abe6d..6709b1c 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/arch/arm/mach-pxa/include/mach/camera.h
@@ -35,8 +35,6 @@
 #define PXA_CAMERA_VSP		0x400
 
 struct pxacamera_platform_data {
-	int (*init)(struct device *);
-
 	unsigned long flags;
 	unsigned long mclk_10khz;
 };
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 51b683c..49f2bf9 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -882,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
 
 static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
 {
-	struct pxacamera_platform_data *pdata = pcdev->pdata;
-	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
 	u32 cicr4 = 0;
 
-	dev_dbg(dev, "Registered platform device at %p data %p\n",
-		pcdev, pdata);
-
-	if (pdata && pdata->init) {
-		dev_dbg(dev, "%s: Init gpios\n", __func__);
-		pdata->init(dev);
-	}
-
 	/* disable all interrupts */
 	__raw_writel(0x3ff, pcdev->base + CICR0);
 
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
@ 2009-11-17 22:04   ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-17 22:04 UTC (permalink / raw)
  To: linux-arm-kernel

pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
even to request GPIOs to be used by the camera *sensor*. These initializations
can be performed statically in machine init functions.

The current semantics for this init() callback is ambiguous anyways, it is
invoked in pxa_camera_activate(), hence at device node open, but its users use
it like a generic initialization to be done at module init time (configure
MFP, request GPIOs for *sensor* control).

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/include/mach/camera.h |    2 --
 drivers/media/video/pxa_camera.c        |   10 ----------
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
index 31abe6d..6709b1c 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/arch/arm/mach-pxa/include/mach/camera.h
@@ -35,8 +35,6 @@
 #define PXA_CAMERA_VSP		0x400
 
 struct pxacamera_platform_data {
-	int (*init)(struct device *);
-
 	unsigned long flags;
 	unsigned long mclk_10khz;
 };
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 51b683c..49f2bf9 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -882,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
 
 static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
 {
-	struct pxacamera_platform_data *pdata = pcdev->pdata;
-	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
 	u32 cicr4 = 0;
 
-	dev_dbg(dev, "Registered platform device at %p data %p\n",
-		pcdev, pdata);
-
-	if (pdata && pdata->init) {
-		dev_dbg(dev, "%s: Init gpios\n", __func__);
-		pdata->init(dev);
-	}
-
 	/* disable all interrupts */
 	__raw_writel(0x3ff, pcdev->base + CICR0);
 
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] em-x270: don't use pxa_camera init() callback
  2009-11-17 22:04   ` Antonio Ospite
@ 2009-11-18  6:34     ` Mike Rapoport
  -1 siblings, 0 replies; 36+ messages in thread
From: Mike Rapoport @ 2009-11-18  6:34 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-media, Guennadi Liakhovetski, Eric Miao, linux-arm-kernel,
	Juergen Beisert, Robert Jarzmik



Antonio Ospite wrote:
> pxa_camera init() is going to be removed.
> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> ---
>  arch/arm/mach-pxa/em-x270.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)

Acked-by: Mike Rapoport <mike@compulab.co.il>

> diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
> index aec7f42..f71f34c 100644
> --- a/arch/arm/mach-pxa/em-x270.c
> +++ b/arch/arm/mach-pxa/em-x270.c
> @@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
>  static struct regulator *em_x270_camera_ldo;
>  
> -static int em_x270_sensor_init(struct device *dev)
> +static int em_x270_sensor_init(void)
>  {
>  	int ret;
>  
> @@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
>  }
>  
>  struct pxacamera_platform_data em_x270_camera_platform_data = {
> -	.init	= em_x270_sensor_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
>  	.mclk_10khz = 2600,
> @@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
>  
>  static void  __init em_x270_init_camera(void)
>  {
> -	pxa_set_camera_info(&em_x270_camera_platform_data);
> -	platform_device_register(&em_x270_camera);
> +	if (em_x270_sensor_init() == 0) {
> +		pxa_set_camera_info(&em_x270_camera_platform_data);
> +		platform_device_register(&em_x270_camera);
> +	}
>  }
>  #else
>  static inline void em_x270_init_camera(void) {}

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3] em-x270: don't use pxa_camera init() callback
@ 2009-11-18  6:34     ` Mike Rapoport
  0 siblings, 0 replies; 36+ messages in thread
From: Mike Rapoport @ 2009-11-18  6:34 UTC (permalink / raw)
  To: linux-arm-kernel



Antonio Ospite wrote:
> pxa_camera init() is going to be removed.
> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> ---
>  arch/arm/mach-pxa/em-x270.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)

Acked-by: Mike Rapoport <mike@compulab.co.il>

> diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
> index aec7f42..f71f34c 100644
> --- a/arch/arm/mach-pxa/em-x270.c
> +++ b/arch/arm/mach-pxa/em-x270.c
> @@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
>  static struct regulator *em_x270_camera_ldo;
>  
> -static int em_x270_sensor_init(struct device *dev)
> +static int em_x270_sensor_init(void)
>  {
>  	int ret;
>  
> @@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
>  }
>  
>  struct pxacamera_platform_data em_x270_camera_platform_data = {
> -	.init	= em_x270_sensor_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
>  	.mclk_10khz = 2600,
> @@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
>  
>  static void  __init em_x270_init_camera(void)
>  {
> -	pxa_set_camera_info(&em_x270_camera_platform_data);
> -	platform_device_register(&em_x270_camera);
> +	if (em_x270_sensor_init() == 0) {
> +		pxa_set_camera_info(&em_x270_camera_platform_data);
> +		platform_device_register(&em_x270_camera);
> +	}
>  }
>  #else
>  static inline void em_x270_init_camera(void) {}

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] em-x270: don't use pxa_camera init() callback
  2009-11-17 22:04   ` Antonio Ospite
@ 2009-11-18 10:10     ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-18 10:10 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() is going to be removed.

My nitpick here would be - I would put it the other way round. We do not 
remove .init() in platforms, because it is going to be removed, but rather 
we perform initialisation statically, because we think this is better so, 
and then .init becomes useless and gets removed.

> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/em-x270.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
> index aec7f42..f71f34c 100644
> --- a/arch/arm/mach-pxa/em-x270.c
> +++ b/arch/arm/mach-pxa/em-x270.c
> @@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
>  static struct regulator *em_x270_camera_ldo;
>  
> -static int em_x270_sensor_init(struct device *dev)
> +static int em_x270_sensor_init(void)
>  {
>  	int ret;
>  
> @@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
>  }
>  
>  struct pxacamera_platform_data em_x270_camera_platform_data = {
> -	.init	= em_x270_sensor_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
>  	.mclk_10khz = 2600,
> @@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
>  
>  static void  __init em_x270_init_camera(void)
>  {
> -	pxa_set_camera_info(&em_x270_camera_platform_data);
> -	platform_device_register(&em_x270_camera);
> +	if (em_x270_sensor_init() == 0) {
> +		pxa_set_camera_info(&em_x270_camera_platform_data);
> +		platform_device_register(&em_x270_camera);
> +	}
>  }
>  #else
>  static inline void em_x270_init_camera(void) {}
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3] em-x270: don't use pxa_camera init() callback
@ 2009-11-18 10:10     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-18 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() is going to be removed.

My nitpick here would be - I would put it the other way round. We do not 
remove .init() in platforms, because it is going to be removed, but rather 
we perform initialisation statically, because we think this is better so, 
and then .init becomes useless and gets removed.

> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/em-x270.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
> index aec7f42..f71f34c 100644
> --- a/arch/arm/mach-pxa/em-x270.c
> +++ b/arch/arm/mach-pxa/em-x270.c
> @@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
>  static struct regulator *em_x270_camera_ldo;
>  
> -static int em_x270_sensor_init(struct device *dev)
> +static int em_x270_sensor_init(void)
>  {
>  	int ret;
>  
> @@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
>  }
>  
>  struct pxacamera_platform_data em_x270_camera_platform_data = {
> -	.init	= em_x270_sensor_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
>  	.mclk_10khz = 2600,
> @@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
>  
>  static void  __init em_x270_init_camera(void)
>  {
> -	pxa_set_camera_info(&em_x270_camera_platform_data);
> -	platform_device_register(&em_x270_camera);
> +	if (em_x270_sensor_init() == 0) {
> +		pxa_set_camera_info(&em_x270_camera_platform_data);
> +		platform_device_register(&em_x270_camera);
> +	}
>  }
>  #else
>  static inline void em_x270_init_camera(void) {}
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
  2009-11-17 22:04   ` Antonio Ospite
@ 2009-11-18 10:12     ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-18 10:12 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() is going to be removed.
> Configure PXA CIF pins directly in machine init function.

Same comment as to patch 1/3.

> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Even though the change seems obvious, it better be tested - in case 
someone reconfigures camera pins somewhere after 
pcm990_baseboard_init()... Juergen, would you be able to test it?

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
>  1 files changed, 1 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
> index bbda570..d5255ae 100644
> --- a/arch/arm/mach-pxa/pcm990-baseboard.c
> +++ b/arch/arm/mach-pxa/pcm990-baseboard.c
> @@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
>  	GPIO44_CIF_LV,
>  };
>  
> -static int pcm990_pxacamera_init(struct device *dev)
> -{
> -	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
> -	return 0;
> -}
> -
>  /*
>   * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
>   *	MCLK_EN:	Master clock is generated by PXA
>   *	PCP:		Data sampled on the falling edge of pixel clock
>   */
>  struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
> -	.init	= pcm990_pxacamera_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
>  	.mclk_10khz = 1000,
> @@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
>  	pxa_set_ac97_info(NULL);
>  
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
> +	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
>  	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
>  
>  	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
@ 2009-11-18 10:12     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-18 10:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() is going to be removed.
> Configure PXA CIF pins directly in machine init function.

Same comment as to patch 1/3.

> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Even though the change seems obvious, it better be tested - in case 
someone reconfigures camera pins somewhere after 
pcm990_baseboard_init()... Juergen, would you be able to test it?

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
>  1 files changed, 1 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
> index bbda570..d5255ae 100644
> --- a/arch/arm/mach-pxa/pcm990-baseboard.c
> +++ b/arch/arm/mach-pxa/pcm990-baseboard.c
> @@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
>  	GPIO44_CIF_LV,
>  };
>  
> -static int pcm990_pxacamera_init(struct device *dev)
> -{
> -	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
> -	return 0;
> -}
> -
>  /*
>   * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
>   *	MCLK_EN:	Master clock is generated by PXA
>   *	PCP:		Data sampled on the falling edge of pixel clock
>   */
>  struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
> -	.init	= pcm990_pxacamera_init,
>  	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
>  		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
>  	.mclk_10khz = 1000,
> @@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
>  	pxa_set_ac97_info(NULL);
>  
>  #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
> +	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
>  	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
>  
>  	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
  2009-11-18 10:12     ` Guennadi Liakhovetski
@ 2009-11-18 10:39       ` Juergen Beisert
  -1 siblings, 0 replies; 36+ messages in thread
From: Juergen Beisert @ 2009-11-18 10:39 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Antonio Ospite, Linux Media Mailing List, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Robert Jarzmik

On Mittwoch, 18. November 2009, Guennadi Liakhovetski wrote:
> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > pxa_camera init() is going to be removed.
> > Configure PXA CIF pins directly in machine init function.
>
> Same comment as to patch 1/3.
>
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> Even though the change seems obvious, it better be tested - in case
> someone reconfigures camera pins somewhere after
> pcm990_baseboard_init()... Juergen, would you be able to test it?

Lets see, if I can grab some hardware.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/3] pcm990-baseboard: don't use pxa_camera init() callback
@ 2009-11-18 10:39       ` Juergen Beisert
  0 siblings, 0 replies; 36+ messages in thread
From: Juergen Beisert @ 2009-11-18 10:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mittwoch, 18. November 2009, Guennadi Liakhovetski wrote:
> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > pxa_camera init() is going to be removed.
> > Configure PXA CIF pins directly in machine init function.
>
> Same comment as to patch 1/3.
>
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> Even though the change seems obvious, it better be tested - in case
> someone reconfigures camera pins somewhere after
> pcm990_baseboard_init()... Juergen, would you be able to test it?

Lets see, if I can grab some hardware.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] em-x270: don't use pxa_camera init() callback
  2009-11-18 10:10     ` Guennadi Liakhovetski
@ 2009-11-18 17:02       ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-18 17:02 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

On Wed, 18 Nov 2009 11:10:06 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> 
> > pxa_camera init() is going to be removed.
> 
> My nitpick here would be - I would put it the other way round. We do not 
> remove .init() in platforms, because it is going to be removed, but rather 
> we perform initialisation statically, because we think this is better so, 
> and then .init becomes useless and gets removed.
> 

TBH, I am persuaded that the current use of init() is ambiguous /per se/
and so we'd just better not use it at all. If static initialization for
sensor GPIOs is better, well I just trust you on that.
However, the point here is not about static/dynamic initialization, it
is more about pxa_camera init() used one time to configure MFP pins, and
another time to request resources for the *sensor*, and in both cases
(mis)used as it was going to be called at _module_init_ time only, which
it wasn't.

So, can you see why I consider these changes (patches 1 and 2) as
merely functional to the removal of init() from pxa_camera?

Anyhow, if you don't like references to a future change without an
explanation I can arrange something in commit messages for the first
two patches :)

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3] em-x270: don't use pxa_camera init() callback
@ 2009-11-18 17:02       ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-18 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 18 Nov 2009 11:10:06 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> 
> > pxa_camera init() is going to be removed.
> 
> My nitpick here would be - I would put it the other way round. We do not 
> remove .init() in platforms, because it is going to be removed, but rather 
> we perform initialisation statically, because we think this is better so, 
> and then .init becomes useless and gets removed.
> 

TBH, I am persuaded that the current use of init() is ambiguous /per se/
and so we'd just better not use it at all. If static initialization for
sensor GPIOs is better, well I just trust you on that.
However, the point here is not about static/dynamic initialization, it
is more about pxa_camera init() used one time to configure MFP pins, and
another time to request resources for the *sensor*, and in both cases
(mis)used as it was going to be called at _module_init_ time only, which
it wasn't.

So, can you see why I consider these changes (patches 1 and 2) as
merely functional to the removal of init() from pxa_camera?

Anyhow, if you don't like references to a future change without an
explanation I can arrange something in commit messages for the first
two patches :)

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091118/d263ff16/attachment.sig>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 3/3] pxa_camera: remove init() callback
  2009-11-17 22:04   ` Antonio Ospite
@ 2009-11-27 14:06     ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-27 14:06 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> even to request GPIOs to be used by the camera *sensor*. These initializations
> can be performed statically in machine init functions.
> 
> The current semantics for this init() callback is ambiguous anyways, it is
> invoked in pxa_camera_activate(), hence at device node open, but its users use
> it like a generic initialization to be done at module init time (configure
> MFP, request GPIOs for *sensor* control).
> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Antonio, to make the merging easier and avoid imposing extra dependencies, 
I would postpone this to 2.6.34, and just remove uses of .init() by 
pxa-camera users as per your other two patches. Would this be ok with you?

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/include/mach/camera.h |    2 --
>  drivers/media/video/pxa_camera.c        |   10 ----------
>  2 files changed, 0 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
> index 31abe6d..6709b1c 100644
> --- a/arch/arm/mach-pxa/include/mach/camera.h
> +++ b/arch/arm/mach-pxa/include/mach/camera.h
> @@ -35,8 +35,6 @@
>  #define PXA_CAMERA_VSP		0x400
>  
>  struct pxacamera_platform_data {
> -	int (*init)(struct device *);
> -
>  	unsigned long flags;
>  	unsigned long mclk_10khz;
>  };
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 51b683c..49f2bf9 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -882,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
>  
>  static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
>  {
> -	struct pxacamera_platform_data *pdata = pcdev->pdata;
> -	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
>  	u32 cicr4 = 0;
>  
> -	dev_dbg(dev, "Registered platform device at %p data %p\n",
> -		pcdev, pdata);
> -
> -	if (pdata && pdata->init) {
> -		dev_dbg(dev, "%s: Init gpios\n", __func__);
> -		pdata->init(dev);
> -	}
> -
>  	/* disable all interrupts */
>  	__raw_writel(0x3ff, pcdev->base + CICR0);
>  
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
@ 2009-11-27 14:06     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-27 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 17 Nov 2009, Antonio Ospite wrote:

> pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> even to request GPIOs to be used by the camera *sensor*. These initializations
> can be performed statically in machine init functions.
> 
> The current semantics for this init() callback is ambiguous anyways, it is
> invoked in pxa_camera_activate(), hence at device node open, but its users use
> it like a generic initialization to be done at module init time (configure
> MFP, request GPIOs for *sensor* control).
> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Antonio, to make the merging easier and avoid imposing extra dependencies, 
I would postpone this to 2.6.34, and just remove uses of .init() by 
pxa-camera users as per your other two patches. Would this be ok with you?

Thanks
Guennadi

> ---
>  arch/arm/mach-pxa/include/mach/camera.h |    2 --
>  drivers/media/video/pxa_camera.c        |   10 ----------
>  2 files changed, 0 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
> index 31abe6d..6709b1c 100644
> --- a/arch/arm/mach-pxa/include/mach/camera.h
> +++ b/arch/arm/mach-pxa/include/mach/camera.h
> @@ -35,8 +35,6 @@
>  #define PXA_CAMERA_VSP		0x400
>  
>  struct pxacamera_platform_data {
> -	int (*init)(struct device *);
> -
>  	unsigned long flags;
>  	unsigned long mclk_10khz;
>  };
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 51b683c..49f2bf9 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -882,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
>  
>  static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
>  {
> -	struct pxacamera_platform_data *pdata = pcdev->pdata;
> -	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
>  	u32 cicr4 = 0;
>  
> -	dev_dbg(dev, "Registered platform device at %p data %p\n",
> -		pcdev, pdata);
> -
> -	if (pdata && pdata->init) {
> -		dev_dbg(dev, "%s: Init gpios\n", __func__);
> -		pdata->init(dev);
> -	}
> -
>  	/* disable all interrupts */
>  	__raw_writel(0x3ff, pcdev->base + CICR0);
>  
> -- 
> 1.6.5.2
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 3/3] pxa_camera: remove init() callback
  2009-11-27 14:06     ` Guennadi Liakhovetski
@ 2009-11-27 14:32       ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 14:32 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]

On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> 
> > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > even to request GPIOs to be used by the camera *sensor*. These initializations
> > can be performed statically in machine init functions.
> > 
> > The current semantics for this init() callback is ambiguous anyways, it is
> > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > it like a generic initialization to be done at module init time (configure
> > MFP, request GPIOs for *sensor* control).
> > 
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> Antonio, to make the merging easier and avoid imposing extra dependencies, 
> I would postpone this to 2.6.34, and just remove uses of .init() by 
> pxa-camera users as per your other two patches. Would this be ok with you?
> 
> Thanks
> Guennadi
>

Perfectly fine with me.

Feel also free to anticipate me and edit the commit messages to
whatever you want in the first two patches. Now that we aren't removing
init() immediately after these it makes even more sense to change the
phrasing from a future referencing
	"init() is going to be removed"
to a more present focused
	"better not to use init() at all"
form.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
@ 2009-11-27 14:32       ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Tue, 17 Nov 2009, Antonio Ospite wrote:
> 
> > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > even to request GPIOs to be used by the camera *sensor*. These initializations
> > can be performed statically in machine init functions.
> > 
> > The current semantics for this init() callback is ambiguous anyways, it is
> > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > it like a generic initialization to be done at module init time (configure
> > MFP, request GPIOs for *sensor* control).
> > 
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> Antonio, to make the merging easier and avoid imposing extra dependencies, 
> I would postpone this to 2.6.34, and just remove uses of .init() by 
> pxa-camera users as per your other two patches. Would this be ok with you?
> 
> Thanks
> Guennadi
>

Perfectly fine with me.

Feel also free to anticipate me and edit the commit messages to
whatever you want in the first two patches. Now that we aren't removing
init() immediately after these it makes even more sense to change the
phrasing from a future referencing
	"init() is going to be removed"
to a more present focused
	"better not to use init() at all"
form.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091127/d6e71e8d/attachment.sig>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 3/3] pxa_camera: remove init() callback
  2009-11-27 14:32       ` Antonio Ospite
@ 2009-11-27 14:37         ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-27 14:37 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

On Fri, 27 Nov 2009, Antonio Ospite wrote:

> On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > 
> > > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > > even to request GPIOs to be used by the camera *sensor*. These initializations
> > > can be performed statically in machine init functions.
> > > 
> > > The current semantics for this init() callback is ambiguous anyways, it is
> > > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > > it like a generic initialization to be done at module init time (configure
> > > MFP, request GPIOs for *sensor* control).
> > > 
> > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > 
> > Antonio, to make the merging easier and avoid imposing extra dependencies, 
> > I would postpone this to 2.6.34, and just remove uses of .init() by 
> > pxa-camera users as per your other two patches. Would this be ok with you?
> > 
> > Thanks
> > Guennadi
> >
> 
> Perfectly fine with me.
> 
> Feel also free to anticipate me and edit the commit messages to
> whatever you want in the first two patches. Now that we aren't removing
> init() immediately after these it makes even more sense to change the
> phrasing from a future referencing
> 	"init() is going to be removed"
> to a more present focused
> 	"better not to use init() at all"
> form.

I cannot edit those subject lines, because I will not be handling those 
patches, they will go via the PXA tree, that's why it is easier to wait 
with the pxa patch.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
@ 2009-11-27 14:37         ` Guennadi Liakhovetski
  0 siblings, 0 replies; 36+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-27 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 27 Nov 2009, Antonio Ospite wrote:

> On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > 
> > > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > > even to request GPIOs to be used by the camera *sensor*. These initializations
> > > can be performed statically in machine init functions.
> > > 
> > > The current semantics for this init() callback is ambiguous anyways, it is
> > > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > > it like a generic initialization to be done at module init time (configure
> > > MFP, request GPIOs for *sensor* control).
> > > 
> > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > 
> > Antonio, to make the merging easier and avoid imposing extra dependencies, 
> > I would postpone this to 2.6.34, and just remove uses of .init() by 
> > pxa-camera users as per your other two patches. Would this be ok with you?
> > 
> > Thanks
> > Guennadi
> >
> 
> Perfectly fine with me.
> 
> Feel also free to anticipate me and edit the commit messages to
> whatever you want in the first two patches. Now that we aren't removing
> init() immediately after these it makes even more sense to change the
> phrasing from a future referencing
> 	"init() is going to be removed"
> to a more present focused
> 	"better not to use init() at all"
> form.

I cannot edit those subject lines, because I will not be handling those 
patches, they will go via the PXA tree, that's why it is easier to wait 
with the pxa patch.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 3/3] pxa_camera: remove init() callback
  2009-11-27 14:37         ` Guennadi Liakhovetski
@ 2009-11-27 14:47           ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 14:47 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Linux Media Mailing List, Eric Miao, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 2434 bytes --]

On Fri, 27 Nov 2009 15:37:19 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Fri, 27 Nov 2009, Antonio Ospite wrote:
> 
> > On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
> > Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > 
> > > On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > > 
> > > > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > > > even to request GPIOs to be used by the camera *sensor*. These initializations
> > > > can be performed statically in machine init functions.
> > > > 
> > > > The current semantics for this init() callback is ambiguous anyways, it is
> > > > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > > > it like a generic initialization to be done at module init time (configure
> > > > MFP, request GPIOs for *sensor* control).
> > > > 
> > > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > 
> > > Antonio, to make the merging easier and avoid imposing extra dependencies, 
> > > I would postpone this to 2.6.34, and just remove uses of .init() by 
> > > pxa-camera users as per your other two patches. Would this be ok with you?
> > > 
> > > Thanks
> > > Guennadi
> > >
> > 
> > Perfectly fine with me.
> > 
> > Feel also free to anticipate me and edit the commit messages to
> > whatever you want in the first two patches. Now that we aren't removing
> > init() immediately after these it makes even more sense to change the
> > phrasing from a future referencing
> > 	"init() is going to be removed"
> > to a more present focused
> > 	"better not to use init() at all"
> > form.
> 
> I cannot edit those subject lines, because I will not be handling those 
> patches, they will go via the PXA tree, that's why it is easier to wait 
> with the pxa patch.
>

I see, I am sending a v2 for the first two patches with changed commit
messages in some hours then. Sorry for the delay.

> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 3/3] pxa_camera: remove init() callback
@ 2009-11-27 14:47           ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 27 Nov 2009 15:37:19 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Fri, 27 Nov 2009, Antonio Ospite wrote:
> 
> > On Fri, 27 Nov 2009 15:06:53 +0100 (CET)
> > Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > 
> > > On Tue, 17 Nov 2009, Antonio Ospite wrote:
> > > 
> > > > pxa_camera init() callback is sometimes abused to setup MFP for PXA CIF, or
> > > > even to request GPIOs to be used by the camera *sensor*. These initializations
> > > > can be performed statically in machine init functions.
> > > > 
> > > > The current semantics for this init() callback is ambiguous anyways, it is
> > > > invoked in pxa_camera_activate(), hence at device node open, but its users use
> > > > it like a generic initialization to be done at module init time (configure
> > > > MFP, request GPIOs for *sensor* control).
> > > > 
> > > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > 
> > > Antonio, to make the merging easier and avoid imposing extra dependencies, 
> > > I would postpone this to 2.6.34, and just remove uses of .init() by 
> > > pxa-camera users as per your other two patches. Would this be ok with you?
> > > 
> > > Thanks
> > > Guennadi
> > >
> > 
> > Perfectly fine with me.
> > 
> > Feel also free to anticipate me and edit the commit messages to
> > whatever you want in the first two patches. Now that we aren't removing
> > init() immediately after these it makes even more sense to change the
> > phrasing from a future referencing
> > 	"init() is going to be removed"
> > to a more present focused
> > 	"better not to use init() at all"
> > form.
> 
> I cannot edit those subject lines, because I will not be handling those 
> patches, they will go via the PXA tree, that's why it is easier to wait 
> with the pxa patch.
>

I see, I am sending a v2 for the first two patches with changed commit
messages in some hours then. Sorry for the delay.

> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091127/172f15ac/attachment.sig>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3 v2] em-x270: don't use pxa_camera init() callback
  2009-11-18 10:10     ` Guennadi Liakhovetski
@ 2009-11-27 20:30       ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Antonio Ospite, Linux Media Mailing List, Eric Miao,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

pxa_camera init() is ambiguous, it's better to statically configure the sensor.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Mike Rapoport <mike@compulab.co.il>
---

The only change from previous version is the commit message, we don't want to
mention .init() removal yet. Since the code is not changed the ack from Mike
Rapoport still holds.

 arch/arm/mach-pxa/em-x270.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f42..f71f34c 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
 static struct regulator *em_x270_camera_ldo;
 
-static int em_x270_sensor_init(struct device *dev)
+static int em_x270_sensor_init(void)
 {
 	int ret;
 
@@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
 }
 
 struct pxacamera_platform_data em_x270_camera_platform_data = {
-	.init	= em_x270_sensor_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
 	.mclk_10khz = 2600,
@@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
 
 static void  __init em_x270_init_camera(void)
 {
-	pxa_set_camera_info(&em_x270_camera_platform_data);
-	platform_device_register(&em_x270_camera);
+	if (em_x270_sensor_init() == 0) {
+		pxa_set_camera_info(&em_x270_camera_platform_data);
+		platform_device_register(&em_x270_camera);
+	}
 }
 #else
 static inline void em_x270_init_camera(void) {}
-- 
1.6.5.3


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 1/3 v2] em-x270: don't use pxa_camera init() callback
@ 2009-11-27 20:30       ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:30 UTC (permalink / raw)
  To: linux-arm-kernel

pxa_camera init() is ambiguous, it's better to statically configure the sensor.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Mike Rapoport <mike@compulab.co.il>
---

The only change from previous version is the commit message, we don't want to
mention .init() removal yet. Since the code is not changed the ack from Mike
Rapoport still holds.

 arch/arm/mach-pxa/em-x270.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f42..f71f34c 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
 static struct regulator *em_x270_camera_ldo;
 
-static int em_x270_sensor_init(struct device *dev)
+static int em_x270_sensor_init(void)
 {
 	int ret;
 
@@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
 }
 
 struct pxacamera_platform_data em_x270_camera_platform_data = {
-	.init	= em_x270_sensor_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
 	.mclk_10khz = 2600,
@@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
 
 static void  __init em_x270_init_camera(void)
 {
-	pxa_set_camera_info(&em_x270_camera_platform_data);
-	platform_device_register(&em_x270_camera);
+	if (em_x270_sensor_init() == 0) {
+		pxa_set_camera_info(&em_x270_camera_platform_data);
+		platform_device_register(&em_x270_camera);
+	}
 }
 #else
 static inline void em_x270_init_camera(void) {}
-- 
1.6.5.3

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3 v2] pcm990-baseboard: don't use pxa_camera init() callback
  2009-11-18 10:12     ` Guennadi Liakhovetski
@ 2009-11-27 20:31       ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:31 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Antonio Ospite, Linux Media Mailing List, Eric Miao,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

pxa_camera init() is ambiguous, it's better to configure PXA CIF pins
statically in machine init function.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---

The only change from previous version is the commit message, we don't want to
mention .init() removal yet.

 arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda570..d5255ae 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
 	GPIO44_CIF_LV,
 };
 
-static int pcm990_pxacamera_init(struct device *dev)
-{
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
-	return 0;
-}
-
 /*
  * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
  *	MCLK_EN:	Master clock is generated by PXA
  *	PCP:		Data sampled on the falling edge of pixel clock
  */
 struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
-	.init	= pcm990_pxacamera_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
 	.mclk_10khz = 1000,
@@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
 	pxa_set_ac97_info(NULL);
 
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
 	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
 
 	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
-- 
1.6.5.3


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3 v2] pcm990-baseboard: don't use pxa_camera init() callback
@ 2009-11-27 20:31       ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

pxa_camera init() is ambiguous, it's better to configure PXA CIF pins
statically in machine init function.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---

The only change from previous version is the commit message, we don't want to
mention .init() removal yet.

 arch/arm/mach-pxa/pcm990-baseboard.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda570..d5255ae 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
 	GPIO44_CIF_LV,
 };
 
-static int pcm990_pxacamera_init(struct device *dev)
-{
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
-	return 0;
-}
-
 /*
  * CICR4: PCLK_EN:	Pixel clock is supplied by the sensor
  *	MCLK_EN:	Master clock is generated by PXA
  *	PCP:		Data sampled on the falling edge of pixel clock
  */
 struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
-	.init	= pcm990_pxacamera_init,
 	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
 		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
 	.mclk_10khz = 1000,
@@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
 	pxa_set_ac97_info(NULL);
 
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+	pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
 	pxa_set_camera_info(&pcm990_pxacamera_platform_data);
 
 	i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
-- 
1.6.5.3

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 0/3] pxa_camera: remove init() callback
  2009-11-17 22:04 ` Antonio Ospite
@ 2009-11-27 20:39   ` Antonio Ospite
  -1 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:39 UTC (permalink / raw)
  To: linux-media
  Cc: Antonio Ospite, Guennadi Liakhovetski, Eric Miao,
	linux-arm-kernel, Mike Rapoport, Juergen Beisert, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

On Tue, 17 Nov 2009 23:04:20 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> Hi,
> 
> this series removes the init() callback from pxa_camera_platform_data, and
> fixes its users to do initialization statically at machine init time.
> 
[...]
> Antonio Ospite (3):
>   em-x270: don't use pxa_camera init() callback
>   pcm990-baseboard: don't use pxa_camera init() callback

Eric, if Guennadi ACKs v2 for these two please apply them only, we are
postponing the third one, hence you can discard it.

>   pxa_camera: remove init() callback
> 

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 0/3] pxa_camera: remove init() callback
@ 2009-11-27 20:39   ` Antonio Ospite
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Ospite @ 2009-11-27 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 17 Nov 2009 23:04:20 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> Hi,
> 
> this series removes the init() callback from pxa_camera_platform_data, and
> fixes its users to do initialization statically at machine init time.
> 
[...]
> Antonio Ospite (3):
>   em-x270: don't use pxa_camera init() callback
>   pcm990-baseboard: don't use pxa_camera init() callback

Eric, if Guennadi ACKs v2 for these two please apply them only, we are
postponing the third one, hence you can discard it.

>   pxa_camera: remove init() callback
> 

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091127/23d5141f/attachment.sig>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 0/3] pxa_camera: remove init() callback
  2009-11-27 20:39   ` Antonio Ospite
@ 2009-11-29  2:25     ` Eric Miao
  -1 siblings, 0 replies; 36+ messages in thread
From: Eric Miao @ 2009-11-29  2:25 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-media, Guennadi Liakhovetski, linux-arm-kernel,
	Mike Rapoport, Juergen Beisert, Robert Jarzmik

On Sat, Nov 28, 2009 at 4:39 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> On Tue, 17 Nov 2009 23:04:20 +0100
> Antonio Ospite <ospite@studenti.unina.it> wrote:
>
>> Hi,
>>
>> this series removes the init() callback from pxa_camera_platform_data, and
>> fixes its users to do initialization statically at machine init time.
>>
> [...]
>> Antonio Ospite (3):
>>   em-x270: don't use pxa_camera init() callback
>>   pcm990-baseboard: don't use pxa_camera init() callback
>
> Eric, if Guennadi ACKs v2 for these two please apply them only, we are
> postponing the third one, hence you can discard it.
>

OK, fine.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 0/3] pxa_camera: remove init() callback
@ 2009-11-29  2:25     ` Eric Miao
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Miao @ 2009-11-29  2:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Nov 28, 2009 at 4:39 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> On Tue, 17 Nov 2009 23:04:20 +0100
> Antonio Ospite <ospite@studenti.unina.it> wrote:
>
>> Hi,
>>
>> this series removes the init() callback from pxa_camera_platform_data, and
>> fixes its users to do initialization statically at machine init time.
>>
> [...]
>> Antonio Ospite (3):
>> ? em-x270: don't use pxa_camera init() callback
>> ? pcm990-baseboard: don't use pxa_camera init() callback
>
> Eric, if Guennadi ACKs v2 for these two please apply them only, we are
> postponing the third one, hence you can discard it.
>

OK, fine.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/3 v2] pcm990-baseboard: don't use pxa_camera init() callback
  2009-11-27 20:31       ` Antonio Ospite
@ 2009-11-29  2:29         ` Eric Miao
  -1 siblings, 0 replies; 36+ messages in thread
From: Eric Miao @ 2009-11-29  2:29 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, Linux Media Mailing List, Mike Rapoport,
	Juergen Beisert, Robert Jarzmik

On Sat, Nov 28, 2009 at 4:31 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> pxa_camera init() is ambiguous, it's better to configure PXA CIF pins
> statically in machine init function.
>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

I'll grab this and get it exposed to next -rc phase.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/3 v2] pcm990-baseboard: don't use pxa_camera init() callback
@ 2009-11-29  2:29         ` Eric Miao
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Miao @ 2009-11-29  2:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Nov 28, 2009 at 4:31 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> pxa_camera init() is ambiguous, it's better to configure PXA CIF pins
> statically in machine init function.
>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

I'll grab this and get it exposed to next -rc phase.

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2009-11-29  2:30 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-17 22:04 [PATCH 0/3] pxa_camera: remove init() callback Antonio Ospite
2009-11-17 22:04 ` Antonio Ospite
2009-11-17 22:04 ` [PATCH 1/3] em-x270: don't use pxa_camera " Antonio Ospite
2009-11-17 22:04   ` Antonio Ospite
2009-11-18  6:34   ` Mike Rapoport
2009-11-18  6:34     ` Mike Rapoport
2009-11-18 10:10   ` Guennadi Liakhovetski
2009-11-18 10:10     ` Guennadi Liakhovetski
2009-11-18 17:02     ` Antonio Ospite
2009-11-18 17:02       ` Antonio Ospite
2009-11-27 20:30     ` [PATCH 1/3 v2] " Antonio Ospite
2009-11-27 20:30       ` Antonio Ospite
2009-11-17 22:04 ` [PATCH 2/3] pcm990-baseboard: " Antonio Ospite
2009-11-17 22:04   ` Antonio Ospite
2009-11-18 10:12   ` Guennadi Liakhovetski
2009-11-18 10:12     ` Guennadi Liakhovetski
2009-11-18 10:39     ` Juergen Beisert
2009-11-18 10:39       ` Juergen Beisert
2009-11-27 20:31     ` [PATCH 2/3 v2] " Antonio Ospite
2009-11-27 20:31       ` Antonio Ospite
2009-11-29  2:29       ` Eric Miao
2009-11-29  2:29         ` Eric Miao
2009-11-17 22:04 ` [PATCH 3/3] pxa_camera: remove " Antonio Ospite
2009-11-17 22:04   ` Antonio Ospite
2009-11-27 14:06   ` Guennadi Liakhovetski
2009-11-27 14:06     ` Guennadi Liakhovetski
2009-11-27 14:32     ` Antonio Ospite
2009-11-27 14:32       ` Antonio Ospite
2009-11-27 14:37       ` Guennadi Liakhovetski
2009-11-27 14:37         ` Guennadi Liakhovetski
2009-11-27 14:47         ` Antonio Ospite
2009-11-27 14:47           ` Antonio Ospite
2009-11-27 20:39 ` [PATCH 0/3] " Antonio Ospite
2009-11-27 20:39   ` Antonio Ospite
2009-11-29  2:25   ` Eric Miao
2009-11-29  2:25     ` Eric Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.