Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-24 Thread Guennadi Liakhovetski
On Tue, 7 Apr 2009, Robert Jarzmik wrote:

 Guennadi Liakhovetski g.liakhovet...@gmx.de writes:
 
  diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
  index 97c93a7..5c8aabf 100644
  --- a/arch/arm/mach-pxa/mioa701.c
  +++ b/arch/arm/mach-pxa/mioa701.c
  @@ -724,19 +724,19 @@ struct pxacamera_platform_data 
  mioa701_pxacamera_platform_data = {
  .mclk_10khz = 5000,
   };
   
  -static struct soc_camera_link iclink = {
  -   .bus_id = 0, /* Must match id in pxa27x_device_camera in device.c */
  -};
  -
   /* Board I2C devices. */
 I would rather have :
 /*
  * Board I2C devices
  */

As a matter of fact (from git-blame):

8e7ccddf (Robert Jarzmik 2008-11-15 16:09:54 +0100 732) /* Board I2C devices. */

 The remaining /* blurpblurg */ forms are a leftover in device comments.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-10 Thread Robert Jarzmik
Guennadi Liakhovetski g.liakhovet...@gmx.de writes:

 On Thu, 9 Apr 2009, Robert Jarzmik wrote:

 Guennadi Liakhovetski g.liakhovet...@gmx.de writes:
 

 Did you enable DEBUG? Looks like one of dev_dbg() had a (yet) invalid 
 device pointer. I'll have to try that too.
No, don't think so.

I think that calling mclk_get_divisor() too early, when
pcdev-soc_host.dev is not set, is the issue here (dev_warn is
mclk_get_divisor()).

And for the same price, I'll give you another stack :)
I'll leave that one up to you, as I'm not really confortable with that type of
sequence :
if (!icd-dev.parent ||
to_soc_camera_host(icd-dev.parent)-nr != icd-iface)

[  183.230769] [bf016128] (mt9m111_probe+0xcc/0x298 [mt9m111]) from 
[c0171a8c] (i2c_device_probe+0x8c/0x9c)
[  183.238108] [c0171a8c] (i2c_device_probe+0x8c/0x9c) from [c014777c] 
(driver_probe_device+0xa4/0x1a8)
[  183.245424] [c014777c] (driver_probe_device+0xa4/0x1a8) from [c0146a28] 
(bus_for_each_drv+0x60/0x8c)
[  183.252617] [c0146a28] (bus_for_each_drv+0x60/0x8c) from [c0147994] 
(device_attach+0x5c/0x74)
[  183.259792] [c0147994] (device_attach+0x5c/0x74) from [c0146994] 
(bus_attach_device+0x44/0x78)
[  183.266944] [c0146994] (bus_attach_device+0x44/0x78) from [c0145368] 
(device_add+0x394/0x5ac)
[  183.274084] [c0145368] (device_add+0x394/0x5ac) from [c0172790] 
(i2c_attach_client+0x80/0x148)
[  183.281228] [c0172790] (i2c_attach_client+0x80/0x148) from [c0172b14] 
(i2c_new_device+0x6c/0x90)
[  183.288340] [c0172b14] (i2c_new_device+0x6c/0x90) from [bf00ccb8] 
(soc_camera_probe+0x4c/0x188 [soc_camera])
[  183.295622] [bf00ccb8] (soc_camera_probe+0x4c/0x188 [soc_camera]) from 
[c014777c] (driver_probe_device+0xa4/0x1a8)
[  183.302774] [c014777c] (driver_probe_device+0xa4/0x1a8) from [c0146a28] 
(bus_for_each_drv+0x60/0x8c)
[  183.309863] [c0146a28] (bus_for_each_drv+0x60/0x8c) from [c0147994] 
(device_attach+0x5c/0x74)
[  183.316902] [c0147994] (device_attach+0x5c/0x74) from [c0146994] 
(bus_attach_device+0x44/0x78)
[  183.323927] [c0146994] (bus_attach_device+0x44/0x78) from [c0145368] 
(device_add+0x394/0x5ac)
[  183.330947] [c0145368] (device_add+0x394/0x5ac) from [bf00cb6c] 
(soc_camera_host_register+0x1a4/0x1ec [soc_camera])
[  183.337997] [bf00cb6c] (soc_camera_host_register+0x1a4/0x1ec [soc_camera]) 
from [bf01dc0c] (pxa_camera_probe+0x2e4/0x42c [pxa_camera])
[  183.345142] [bf01dc0c] (pxa_camera_probe+0x2e4/0x42c [pxa_camera]) from 
[c014858c] (platform_drv_probe+0x1c/0x24)
[  183.352164] [c014858c] (platform_drv_probe+0x1c/0x24) from [c014777c] 
(driver_probe_device+0xa4/0x1a8)
[  183.359158] [c014777c] (driver_probe_device+0xa4/0x1a8) from [c0147904] 
(__driver_attach+0x84/0x88)
[  183.366088] [c0147904] (__driver_attach+0x84/0x88) from [c0146cd8] 
(bus_for_each_dev+0x54/0x80)
[  183.372983] [c0146cd8] (bus_for_each_dev+0x54/0x80) from [c01472c8] 
(bus_add_driver+0xa4/0x218)
[  183.379873] [c01472c8] (bus_add_driver+0xa4/0x218) from [c0147b10] 
(driver_register+0x58/0x138)
[  183.386766] [c0147b10] (driver_register+0x58/0x138) from [c002128c] 
(do_one_initcall+0x2c/0x180)
[  183.393705] [c002128c] (do_one_initcall+0x2c/0x180) from [c0057514] 
(sys_init_module+0x88/0x198)
[  183.400650] [c0057514] (sys_init_module+0x88/0x198) from [c0021de0] 
(ret_fast_syscall+0x0/0x2c)
[  183.407554] Code: e3a03000 e1c53cb8 e2426020 e351 (e5968068)
[  183.411614] ---[ end trace b5c2161a92c2cf9d ]---

Cheers.

--
Robert
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-09 Thread Robert Jarzmik
Guennadi Liakhovetski g.liakhovet...@gmx.de writes:

 Try with the patch-stack I mentioned in the previous mail, will see then.
Euh, which mail ? I can't find a reference to it.

As a preparation for the weekend, my first try revealed that oops. I must admit
I made that test without any involvement of my brain.

Cheers.

--
Robert

[0.00] Linux version 2.6.29-next-20090330-mioa701-11198-g160d8ad-dirty 
(r...@velvet) (gcc version 4.2.0 20070413 (prerelease) (CodeSourcery Sourcery 
G++ Lite 2007q1-10)) #10 Thu Apr 9 00:00:27 CEST 2009
[0.00] CPU: XScale-PXA270 [69054117] revision 7 (ARMv5TE), cr=397f
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] Machine: MIO A701
...
[  714.620015] Mioa701: GSM status changed to on
[  771.479136] Unable to handle kernel NULL pointer dereference at virtual 
address 0044
[  771.485032] pgd = c3134000
[  771.487939] [0044] *pgd=a3f76031, *pte=, *ppte=
[  771.490809] Internal error: Oops: 17 [#1]
[  771.493629] Modules linked in: pxa_camera(+) mt9m111 soc_camera 
videobuf_dma_sg videobuf_core
[  771.499414] CPU: 0Not tainted  
(2.6.29-next-20090330-mioa701-11198-g160d8ad-dirty #10)
[  771.505293] PC is at dev_driver_string+0x10/0x48
[  771.508358] LR is at pxa_camera_probe+0x2c8/0x414 [pxa_camera]
[  771.511393] pc : [c0153a00]lr : [bf01ccf4]psr: 2013
[  771.511410] sp : c0493db0  ip : c0493dc0  fp : c0493dbc
[  771.517396] r10: c0305940  r9 : c0304380  r8 : 
[  771.520392] r7 : 0632ea00  r6 : 018cba80  r5 : c04370a0  r4 : 02faf080
[  771.523419] r3 :   r2 : d1b71759  r1 : 0632ea00  r0 : 
[  771.526426] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  771.529443] Control: 397f  Table: a3134000  DAC: 0015
[  771.532425] Process insmod (pid: 3125, stack limit = 0xc0492270)
[  771.535457] Stack: (0xc0493db0 to 0xc0494000)
[  771.538505] 3da0: c0493dfc c0493dc0 
bf01ccf4 c01539fc
[  771.544628] 3dc0:  c0304390 0021 c0304388 c0493dec c0304388 
bf01f360 bf01f360
[  771.550841] 3de0: c0338b84 c031ac80  c0324ca0 c0493e0c c0493e00 
c01581c0 bf01ca38
[  771.557230] 3e00: c0493e2c c0493e10 c0157250 c01581ac c0304388 c03043bc 
bf01f360 c0157350
[  771.563684] 3e20: c0493e4c c0493e30 c01573e0 c01571b4 c0493e4c  
c0493e50 bf01f360
[  771.570313] 3e40: c0493e74 c0493e50 c0156740 c015735c c38034d8 c3851d10 
 bf01f3dc
[  771.577052] 3e60: bf01f360 c0737480 c0493e84 c0493e78 c01570ac c01566f0 
c0493eb4 c0493e88
[  771.583879] 3e80: c0156d58 c0157098 bf01e188 bf01f3dc bf01f360 40a4 
bf01f3dc bf01f360
[  771.590777] 3ea0:  bf01dfb8 c0493edc c0493eb8 c015762c c0156cb8 
c0085c60 40a4
[  771.597815] 3ec0: bf01f3dc c0492000  bf01dfb8 c0493eec c0493ee0 
c0158668 c01575d4
[  771.604931] 3ee0: c0493efc c0493ef0 bf01dfcc c0158608 c0493f7c c0493f00 
c00222bc bf01dfc4
[  771.612094] 3f00: c4934c10 c49348c8 c4934806 c042e920 c4935a60 0015 
000b 
[  771.619378] 3f20: 0017 c4934c38 000160bc    
 
[  771.626714] 3f40:  40a4 bf01f3dc 00012018  40a4 
bf01f3dc 00012018
[  771.634073] 3f60:  c0023008 c0492000  c0493fa4 c0493f80 
c005af98 c0022294
[  771.641538] 3f80: c008d528 c008d41c  40a4 0003 0080 
 c0493fa8
[  771.649104] 3fa0: c0022e60 c005af14  40a4 00012018 40a4 
00012008 0001
[  771.656805] 3fc0:  40a4 0003 0080 beb73f91  
00012008 
[  771.664611] 3fe0: 8000 beb73d3c 8e00 4004 6010 00012018 
6e61656c 715f7075
[  771.672480] Backtrace:
[  771.676325] [c01539f0] (dev_driver_string+0x0/0x48) from [bf01ccf4] 
(pxa_camera_probe+0x2c8/0x414 [pxa_camera])
[  771.684198] [bf01ca2c] (pxa_camera_probe+0x0/0x414 [pxa_camera]) from 
[c01581c0] (platform_drv_probe+0x20/0x24)
[  771.692108] [c01581a0] (platform_drv_probe+0x0/0x24) from [c0157250] 
(driver_probe_device+0xa8/0x1a8)
[  771.73] [c01571a8] (driver_probe_device+0x0/0x1a8) from [c01573e0] 
(__driver_attach+0x90/0x94)
[  771.707840]  r7:c0157350 r6:bf01f360 r5:c03043bc r4:c0304388
[  771.711806] [c0157350] (__driver_attach+0x0/0x94) from [c0156740] 
(bus_for_each_dev+0x5c/0x88)
[  771.719550]  r6:bf01f360 r5:c0493e50 r4:
[  771.723403] [c01566e4] (bus_for_each_dev+0x0/0x88) from [c01570ac] 
(driver_attach+0x20/0x28)
[  771.731042]  r7:c0737480 r6:bf01f360 r5:bf01f3dc r4:
[  771.734893] [c015708c] (driver_attach+0x0/0x28) from [c0156d58] 
(bus_add_driver+0xac/0x220)
[  771.742451] [c0156cac] (bus_add_driver+0x0/0x220) from [c015762c] 
(driver_register+0x64/0x148)
[  771.749994]  r8:bf01dfb8 r7: r6:bf01f360 r5:bf01f3dc r4:40a4
[  771.753844] [c01575c8] (driver_register+0x0/0x148) from [c0158668] 
(platform_driver_register+0x6c/0x88)
[  771.761352]  r8:bf01dfb8 r7: r6:c0492000 r5:bf01f3dc 

Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-09 Thread Guennadi Liakhovetski
On Thu, 9 Apr 2009, Robert Jarzmik wrote:

 Guennadi Liakhovetski g.liakhovet...@gmx.de writes:
 
  Try with the patch-stack I mentioned in the previous mail, will see then.
 Euh, which mail ? I can't find a reference to it.

http://www.mail-archive.com/linux-media@vger.kernel.org/msg04213.html

 As a preparation for the weekend, my first try revealed that oops. I must 
 admit
 I made that test without any involvement of my brain.

Did you enable DEBUG? Looks like one of dev_dbg() had a (yet) invalid 
device pointer. I'll have to try that too.

Thanks
Guennadi

 
 Cheers.
 
 --
 Robert
 
 [0.00] Linux version 
 2.6.29-next-20090330-mioa701-11198-g160d8ad-dirty (r...@velvet) (gcc version 
 4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite 2007q1-10)) #10 
 Thu Apr 9 00:00:27 CEST 2009
 [0.00] CPU: XScale-PXA270 [69054117] revision 7 (ARMv5TE), cr=397f
 [0.00] CPU: VIVT data cache, VIVT instruction cache
 [0.00] Machine: MIO A701
 ...
 [  714.620015] Mioa701: GSM status changed to on
 [  771.479136] Unable to handle kernel NULL pointer dereference at virtual 
 address 0044
 [  771.485032] pgd = c3134000
 [  771.487939] [0044] *pgd=a3f76031, *pte=, *ppte=
 [  771.490809] Internal error: Oops: 17 [#1]
 [  771.493629] Modules linked in: pxa_camera(+) mt9m111 soc_camera 
 videobuf_dma_sg videobuf_core
 [  771.499414] CPU: 0Not tainted  
 (2.6.29-next-20090330-mioa701-11198-g160d8ad-dirty #10)
 [  771.505293] PC is at dev_driver_string+0x10/0x48
 [  771.508358] LR is at pxa_camera_probe+0x2c8/0x414 [pxa_camera]
 [  771.511393] pc : [c0153a00]lr : [bf01ccf4]psr: 2013
 [  771.511410] sp : c0493db0  ip : c0493dc0  fp : c0493dbc
 [  771.517396] r10: c0305940  r9 : c0304380  r8 : 
 [  771.520392] r7 : 0632ea00  r6 : 018cba80  r5 : c04370a0  r4 : 02faf080
 [  771.523419] r3 :   r2 : d1b71759  r1 : 0632ea00  r0 : 
 [  771.526426] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment 
 user
 [  771.529443] Control: 397f  Table: a3134000  DAC: 0015
 [  771.532425] Process insmod (pid: 3125, stack limit = 0xc0492270)
 [  771.535457] Stack: (0xc0493db0 to 0xc0494000)
 [  771.538505] 3da0: c0493dfc c0493dc0 
 bf01ccf4 c01539fc
 [  771.544628] 3dc0:  c0304390 0021 c0304388 c0493dec c0304388 
 bf01f360 bf01f360
 [  771.550841] 3de0: c0338b84 c031ac80  c0324ca0 c0493e0c c0493e00 
 c01581c0 bf01ca38
 [  771.557230] 3e00: c0493e2c c0493e10 c0157250 c01581ac c0304388 c03043bc 
 bf01f360 c0157350
 [  771.563684] 3e20: c0493e4c c0493e30 c01573e0 c01571b4 c0493e4c  
 c0493e50 bf01f360
 [  771.570313] 3e40: c0493e74 c0493e50 c0156740 c015735c c38034d8 c3851d10 
  bf01f3dc
 [  771.577052] 3e60: bf01f360 c0737480 c0493e84 c0493e78 c01570ac c01566f0 
 c0493eb4 c0493e88
 [  771.583879] 3e80: c0156d58 c0157098 bf01e188 bf01f3dc bf01f360 40a4 
 bf01f3dc bf01f360
 [  771.590777] 3ea0:  bf01dfb8 c0493edc c0493eb8 c015762c c0156cb8 
 c0085c60 40a4
 [  771.597815] 3ec0: bf01f3dc c0492000  bf01dfb8 c0493eec c0493ee0 
 c0158668 c01575d4
 [  771.604931] 3ee0: c0493efc c0493ef0 bf01dfcc c0158608 c0493f7c c0493f00 
 c00222bc bf01dfc4
 [  771.612094] 3f00: c4934c10 c49348c8 c4934806 c042e920 c4935a60 0015 
 000b 
 [  771.619378] 3f20: 0017 c4934c38 000160bc    
  
 [  771.626714] 3f40:  40a4 bf01f3dc 00012018  40a4 
 bf01f3dc 00012018
 [  771.634073] 3f60:  c0023008 c0492000  c0493fa4 c0493f80 
 c005af98 c0022294
 [  771.641538] 3f80: c008d528 c008d41c  40a4 0003 0080 
  c0493fa8
 [  771.649104] 3fa0: c0022e60 c005af14  40a4 00012018 40a4 
 00012008 0001
 [  771.656805] 3fc0:  40a4 0003 0080 beb73f91  
 00012008 
 [  771.664611] 3fe0: 8000 beb73d3c 8e00 4004 6010 00012018 
 6e61656c 715f7075
 [  771.672480] Backtrace:
 [  771.676325] [c01539f0] (dev_driver_string+0x0/0x48) from [bf01ccf4] 
 (pxa_camera_probe+0x2c8/0x414 [pxa_camera])
 [  771.684198] [bf01ca2c] (pxa_camera_probe+0x0/0x414 [pxa_camera]) from 
 [c01581c0] (platform_drv_probe+0x20/0x24)
 [  771.692108] [c01581a0] (platform_drv_probe+0x0/0x24) from [c0157250] 
 (driver_probe_device+0xa8/0x1a8)
 [  771.73] [c01571a8] (driver_probe_device+0x0/0x1a8) from [c01573e0] 
 (__driver_attach+0x90/0x94)
 [  771.707840]  r7:c0157350 r6:bf01f360 r5:c03043bc r4:c0304388
 [  771.711806] [c0157350] (__driver_attach+0x0/0x94) from [c0156740] 
 (bus_for_each_dev+0x5c/0x88)
 [  771.719550]  r6:bf01f360 r5:c0493e50 r4:
 [  771.723403] [c01566e4] (bus_for_each_dev+0x0/0x88) from [c01570ac] 
 (driver_attach+0x20/0x28)
 [  771.731042]  r7:c0737480 r6:bf01f360 r5:bf01f3dc r4:
 [  771.734893] [c015708c] (driver_attach+0x0/0x28) from [c0156d58] 
 (bus_add_driver+0xac/0x220)
 [  

Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-08 Thread Guennadi Liakhovetski
Hi Robert,

On Tue, 7 Apr 2009, Robert Jarzmik wrote:

 Guennadi Liakhovetski g.liakhovet...@gmx.de writes:
 
  This is more or less the final version of the first step of the 
  v4l2-subdev conversion, hence, all affected driver authors / platform 
  maintainers are encouraged to review and test. I have eliminated 
 
 OK, here goes a preliminary review for the bits I maintain. I'll test fully 
 this
 weekend.

Great, thanks.

 As a side note, I tried to apply your patch on top of linux-next-20090406. I 
 was
 a bit tedious. Would you tell me which tree you're based against, or even 
 better
 some git url ?

Look under

http://gross-embedded.homelinux.org/~lyakh/v4l-20090408/

that's based on linux-next of 30.03.2009 (commit ID in -base on 
linux-next history branch).

 snip
  diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
  index 97c93a7..5c8aabf 100644
  --- a/arch/arm/mach-pxa/mioa701.c
  +++ b/arch/arm/mach-pxa/mioa701.c
  @@ -724,19 +724,19 @@ struct pxacamera_platform_data 
  mioa701_pxacamera_platform_data = {
  .mclk_10khz = 5000,
   };
   
  -static struct soc_camera_link iclink = {
  -   .bus_id = 0, /* Must match id in pxa27x_device_camera in device.c */
  -};
  -
   /* Board I2C devices. */
 I would rather have :
 /*
  * Board I2C devices
  */
 The remaining /* blurpblurg */ forms are a leftover in device comments.
 
 snip
  @@ -754,20 +754,21 @@ static struct platform_device var = { 
  \
  .platform_data = pdata, \
  .parent = tparent,  \
  },  \
  -};
  +}
 No cookie for you for removing that semi-colon.

I believe this is correct. It is good to have

#define macro(x) do_something(x)

and then use

macro(x1);
macro(x2);

rather than

#define macro(x) do_something(x);

macro(x1)
macro(x2)

And you do have semicolons everywhere where you use MIO_PARENT_DEV and 
MIO_SIMPLE_DEV, so, probably, that change doesn't belong to this patch, 
but it is correct.

   #define MIO_SIMPLE_DEV(var, strname, pdata)\
  MIO_PARENT_DEV(var, strname, NULL, pdata)
   
  -MIO_SIMPLE_DEV(mioa701_gpio_keys, gpio-keys, 
  mioa701_gpio_keys_data)
  +MIO_SIMPLE_DEV(mioa701_gpio_keys, gpio-keys, 
  mioa701_gpio_keys_data);
   MIO_PARENT_DEV(mioa701_backlight, pwm-backlight,  
  pxa27x_device_pwm0.dev,
  mioa701_backlight_data);
  -MIO_SIMPLE_DEV(mioa701_led,  leds-gpio,  gpio_led_info)
  -MIO_SIMPLE_DEV(pxa2xx_pcm,   pxa2xx-pcm, NULL)
  -MIO_SIMPLE_DEV(pxa2xx_ac97,  pxa2xx-ac97,NULL)
  -MIO_PARENT_DEV(mio_wm9713_codec,  wm9713-codec,   pxa2xx_ac97.dev, NULL)
  -MIO_SIMPLE_DEV(mioa701_sound,mioa701-wm9713, NULL)
  -MIO_SIMPLE_DEV(mioa701_board,mioa701-board,  NULL)
  +MIO_SIMPLE_DEV(mioa701_led,  leds-gpio,  gpio_led_info);
  +MIO_SIMPLE_DEV(pxa2xx_pcm,   pxa2xx-pcm, NULL);
  +MIO_SIMPLE_DEV(pxa2xx_ac97,  pxa2xx-ac97,NULL);
  +MIO_PARENT_DEV(mio_wm9713_codec,  wm9713-codec,   pxa2xx_ac97.dev, 
  NULL);
  +MIO_SIMPLE_DEV(mioa701_sound,mioa701-wm9713, NULL);
  +MIO_SIMPLE_DEV(mioa701_board,mioa701-board,  NULL);
   MIO_SIMPLE_DEV(gpio_vbus,gpio-vbus,  gpio_vbus_data);
 Please, don't change the indentation. You will face :
  (a) conficts with patches in this merge window
  (b) that's not the object of your patch anyway
  (c) I like that indentation in that very specific case
 
  +MIO_SIMPLE_DEV(mioa701_camera,   soc-camera-pdrv,iclink[0]);
 ^
   isn't iclink enough ?

Oops, yeah, sure.

   static struct platform_device *devices[] __initdata = {
  mioa701_gpio_keys,
  @@ -781,6 +782,7 @@ static struct platform_device *devices[] __initdata = {
  strataflash,
  gpio_vbus,
  mioa701_board,
  +   mioa701_camera,
 Please invert mioa701_board and mioa701_camera. The board should always be 
 last
 for suspend/resume purpose (yes, that would have deserved a comment, I hear 
 you
 :))

ok

   };
   
   static void mioa701_machine_exit(void);
  @@ -825,7 +827,6 @@ static void __init mioa701_machine_init(void)
   
  pxa_set_i2c_info(i2c_pdata);
  pxa_set_camera_info(mioa701_pxacamera_platform_data);
  -   i2c_register_board_info(0, ARRAY_AND_SIZE(mioa701_i2c_devices));
 I'm wondering which version of mioa701.c had that line ... strange ...

commit 8e7ccddf0fd22617a3edc28ab2ce2fac0fb94823
Author: Robert Jarzmik robert.jarz...@free.fr
Date:   Sat Nov 15 16:09:54 2008 +0100

[ARM] pxa/MioA701: add camera support for Mio A701 board.

  diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
  index cdd1ddb..425aec2 100644
  --- a/drivers/media/video/mt9m111.c
  +++ b/drivers/media/video/mt9m111.c
 snip
  @@ -938,40 +955,42 @@ static int mt9m111_video_probe(struct 
  

Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-07 Thread Robert Jarzmik
Guennadi Liakhovetski g.liakhovet...@gmx.de writes:

 This is more or less the final version of the first step of the 
 v4l2-subdev conversion, hence, all affected driver authors / platform 
 maintainers are encouraged to review and test. I have eliminated 

OK, here goes a preliminary review for the bits I maintain. I'll test fully this
weekend.

As a side note, I tried to apply your patch on top of linux-next-20090406. I was
a bit tedious. Would you tell me which tree you're based against, or even better
some git url ?

snip
 diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
 index 97c93a7..5c8aabf 100644
 --- a/arch/arm/mach-pxa/mioa701.c
 +++ b/arch/arm/mach-pxa/mioa701.c
 @@ -724,19 +724,19 @@ struct pxacamera_platform_data 
 mioa701_pxacamera_platform_data = {
   .mclk_10khz = 5000,
  };
  
 -static struct soc_camera_link iclink = {
 - .bus_id = 0, /* Must match id in pxa27x_device_camera in device.c */
 -};
 -
  /* Board I2C devices. */
I would rather have :
/*
 * Board I2C devices
 */
The remaining /* blurpblurg */ forms are a leftover in device comments.

snip
 @@ -754,20 +754,21 @@ static struct platform_device var = {   
 \
   .platform_data = pdata, \
   .parent = tparent,  \
   },  \
 -};
 +}
No cookie for you for removing that semi-colon.

  #define MIO_SIMPLE_DEV(var, strname, pdata)  \
   MIO_PARENT_DEV(var, strname, NULL, pdata)
  
 -MIO_SIMPLE_DEV(mioa701_gpio_keys, gpio-keys,   
 mioa701_gpio_keys_data)
 +MIO_SIMPLE_DEV(mioa701_gpio_keys, gpio-keys,   
 mioa701_gpio_keys_data);
  MIO_PARENT_DEV(mioa701_backlight, pwm-backlight,  pxa27x_device_pwm0.dev,
   mioa701_backlight_data);
 -MIO_SIMPLE_DEV(mioa701_led,leds-gpio,  gpio_led_info)
 -MIO_SIMPLE_DEV(pxa2xx_pcm, pxa2xx-pcm, NULL)
 -MIO_SIMPLE_DEV(pxa2xx_ac97,pxa2xx-ac97,NULL)
 -MIO_PARENT_DEV(mio_wm9713_codec,  wm9713-codec,   pxa2xx_ac97.dev, NULL)
 -MIO_SIMPLE_DEV(mioa701_sound,  mioa701-wm9713, NULL)
 -MIO_SIMPLE_DEV(mioa701_board,  mioa701-board,  NULL)
 +MIO_SIMPLE_DEV(mioa701_led,leds-gpio,  gpio_led_info);
 +MIO_SIMPLE_DEV(pxa2xx_pcm, pxa2xx-pcm, NULL);
 +MIO_SIMPLE_DEV(pxa2xx_ac97,pxa2xx-ac97,NULL);
 +MIO_PARENT_DEV(mio_wm9713_codec,  wm9713-codec,   pxa2xx_ac97.dev, NULL);
 +MIO_SIMPLE_DEV(mioa701_sound,  mioa701-wm9713, NULL);
 +MIO_SIMPLE_DEV(mioa701_board,  mioa701-board,  NULL);
  MIO_SIMPLE_DEV(gpio_vbus,  gpio-vbus,  gpio_vbus_data);
Please, don't change the indentation. You will face :
 (a) conficts with patches in this merge window
 (b) that's not the object of your patch anyway
 (c) I like that indentation in that very specific case

 +MIO_SIMPLE_DEV(mioa701_camera, soc-camera-pdrv,iclink[0]);
^
  isn't iclink enough ?

  
  static struct platform_device *devices[] __initdata = {
   mioa701_gpio_keys,
 @@ -781,6 +782,7 @@ static struct platform_device *devices[] __initdata = {
   strataflash,
   gpio_vbus,
   mioa701_board,
 + mioa701_camera,
Please invert mioa701_board and mioa701_camera. The board should always be last
for suspend/resume purpose (yes, that would have deserved a comment, I hear you
:))

  };
  
  static void mioa701_machine_exit(void);
 @@ -825,7 +827,6 @@ static void __init mioa701_machine_init(void)
  
   pxa_set_i2c_info(i2c_pdata);
   pxa_set_camera_info(mioa701_pxacamera_platform_data);
 - i2c_register_board_info(0, ARRAY_AND_SIZE(mioa701_i2c_devices));
I'm wondering which version of mioa701.c had that line ... strange ...


 diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
 index cdd1ddb..425aec2 100644
 --- a/drivers/media/video/mt9m111.c
 +++ b/drivers/media/video/mt9m111.c
snip
 @@ -938,40 +955,42 @@ static int mt9m111_video_probe(struct soc_camera_device 
 *icd)
  
   dev_info(icd-dev, Detected a MT9M11x chip ID %x\n, data);
  
 - ret = soc_camera_video_start(icd);
 - if (ret)
 - goto eisis;
 -
   mt9m111-autoexposure = 1;
   mt9m111-autowhitebalance = 1;
  
   mt9m111-swap_rgb_even_odd = 1;
   mt9m111-swap_rgb_red_blue = 1;
  
 - return 0;
 -eisis:
  ei2c:
 + soc_camera_video_stop(icd);
 +
   return ret;
  }
  
  static void mt9m111_video_remove(struct soc_camera_device *icd)
  {
 - struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd);
 + struct i2c_client *client = to_i2c_client(icd-control);
  
 - dev_dbg(icd-dev, Video %x removed: %p, %p\n, mt9m111-client-addr,
 - mt9m111-icd.dev.parent, mt9m111-icd.vdev);
 - soc_camera_video_stop(mt9m111-icd);
 + dev_dbg(icd-dev, Video %x removed: %p, %p\n, client-addr,
 + icd-dev.parent, icd-vdev);
 + 

Re: [PATCH/RFC] soc-camera: Convert to a platform driver

2009-04-07 Thread Robert Jarzmik
Robert Jarzmik robert.jarz...@free.fr writes:

 I'll test fully this weekend.
I just made a first try, just to prepare my weekend. Even with Ming Lei patch
reverted, and all statically built, I have no camera detected ...

Is there something I need to know before attempting the brute force method
(ie. DEBUG, printks etc ...) ?

Cheers.

--
Robert
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html