Hi Arjan,

Thanks for the info!
All the changes should be OK except this one (see inline).
And, also we have 2 test cases are depend on this 2 messages. So, can we use 
printk on this 2 messages?

> -    dprintk(1, "PM: ov5640 standby called\n");
> -    dprintk(1, "PM: ov5640 wakeup called\n");

And, BTW, your patch seems is based on the 0.942 version, Today Kristen already 
accept the 0.95 one, so you may need to re-generate the patch.

-----------------------
> @@ -377,22 +364,23 @@ static void ov5640_standby(struct v4l2_subdev *sd)
>           ov5640_status.reg_inited = OV5640_REG_RESET;
> 
>       spin_unlock_irqrestore(&ov5640_status.state_lock, flags);
> -    dprintk(1, "PM: ov5640 standby called\n");
> +    dev_dbg(&c->adapter->dev, "PM: ov5640 standby called\n");
>   }
> 
>   static void ov5640_wakeup(struct v4l2_subdev *sd, int hw_reinit)
>   {
>       unsigned long flags;
> -    dprintk(1, "PM: ov5640 wakeup called\n");
> +    struct i2c_client *c = v4l2_get_subdevdata(sd);
> +
> +    dev_dbg(&c->adapter->dev, "PM: ov5640 wakeup called\n");

We cannot use 'struct i2c_client *c' here, because when wakeup are firstly 
called, this 'struct i2c_client *c' pointer has not been inited yet.
But it's safe to use the 'struct i2c_client *c' pointer in  'if (hw_reinit) { 
... }'
For here, we can use printk() directly to print out this important message.

>       spin_lock_irqsave(&ov5640_status.state_lock, flags);
> 
>       if (ov5640_status.power == OV5640_POWER_OFF) {
>           ov5640_status.power = OV5640_POWER_ON;
>           spin_unlock_irqrestore(&ov5640_status.state_lock, flags);
> -        dprintk(1, "PM: ov5640 switch OFF to ON.\n");
> +        dev_dbg(&c->adapter->dev, "PM: ov5640 switch OFF to ON.\n");
>           gpio_set_value(GPIO_STDBY_PIN, 0);
>           if (hw_reinit)    {
> -            struct i2c_client *c = v4l2_get_subdevdata(sd);
>               ov5640_hw_init(c);
>               ov5640_restore_hw_status(c);
>           }
-- Yong
Phone (+86) 21-61166334
Lab (+86) 21-61167881

-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]] 
Sent: Saturday, June 18, 2011 11:45 PM
To: He, Yong M
Cc: [email protected]; Kristen Carlson Accardi
Subject: Re: [patch] mrstov5640: use linux debug print mechanism

On 6/18/2011 8:36 AM, He, Yong M wrote:
> Hi Arjan,
>
> Thanks for your suggestion, I'll work out a patch to replace all dprintk().

why do you have to work out a patch for this? I already sent you a patch that 
does this!

> Before that, I need to work on the 3 left (of total 5) critical camera 
> patches, the middle-ware team are waiting for them to be integrated. Is that 
> OK?

right now the driver is so noisy it makes the system unusable... I'm inclined 
to put my patch into MeeGo first before anything else to be honest.


> BTW, How can I set different debug levels using pr_debug and dev_dbg()?

at compile time you could do #define DEBUG and it's on by default

I've attached the kernel documentation (from the Documentation/ 
directory) for how to do this at runtime...
the kernel documentation describes it better than I ever could.




_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to