All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Franklin Meng <fmeng2002@yahoo.com>
Cc: linux-media@vger.kernel.org,
	Douglas Schilling Landgraf <dougsland@gmail.com>
Subject: Re: [Patch 1/3] Kworld 315U
Date: Mon, 25 Jan 2010 11:59:16 -0200	[thread overview]
Message-ID: <4B5DA3B4.3080005@infradead.org> (raw)
In-Reply-To: <647298.8638.qm@web32701.mail.mud.yahoo.com>

Franklin Meng wrote:
> Patch to add the s_power function to the saa7115.c code.
> 
> Signed-off-by: Franklin Meng<fmeng2002@yahoo.com>

I got an error while applying:

No file to patch.  Skipping patch.
patch: **** malformed patch at line 22:         return 0;                                        Patch may be line wrapped

I suspect that your email is destroying your patch.


> 
> 
> diff -r b6b82258cf5e linux/drivers/media/video/saa7115.c                              
> --- a/linux/drivers/media/video/saa7115.c       Thu Dec 31 19:14:54 2009 -0200        
> +++ b/linux/drivers/media/video/saa7115.c       Sun Jan 17 22:54:21 2010 -0800        
> @@ -1338,6 +1338,59 @@                                                                
>         return 0;                                                                     
>  }                                                                                    
>                                                                                       
> +static int saa711x_s_power(struct v4l2_subdev *sd, int val)                          
> +{                                                                                    
> +       struct saa711x_state *state = to_state(sd);                                   
> +                                                                                     
> +       if(val > 1 || val < 0)                                                        
> +               return -EINVAL; 

Also, please validade your patch against coding style, with checkpatch.pl (you can use
make checkpatch, if you're using the -hg tree).

Basically, you need a space between if and ( at the above line.

                                                      
> +                                                                                     
> +       /* There really isn't a way to put the chip into power saving                 
> +               other than by pulling CE to ground so all we do is return             
> +               out of this function                                                  
> +       */                                                                            
> +       if(val == 0)                                                                  
> +               return 0;                                                             
> +                                                                                     
> +       /* When enabling the chip again we need to reinitialize the                   
> +               all the values                                                        
> +       */                                                                            
> +       state->input = -1;                                                            
> +       state->output = SAA7115_IPORT_ON;                                             
> +       state->enable = 1;                                                            
> +       state->radio = 0;                                                             
> +       state->bright = 128;                                                          
> +       state->contrast = 64;                                                         
> +       state->hue = 0;                                                               
> +       state->sat = 64;                                                              
> +                                                                                     
> +       state->audclk_freq = 48000;                                                   
> +                                                                                     
> +       v4l2_dbg(1, debug, sd, "writing init values s_power\n");                      
> +                                                                                     
> +       /* init to 60hz/48khz */                                                      
> +       state->crystal_freq = SAA7115_FREQ_24_576_MHZ;                                
> +       switch (state->ident) {                                                       
> +       case V4L2_IDENT_SAA7111:                                                      
> +               saa711x_writeregs(sd, saa7111_init);                                  
> +               break;                                                                
> +       case V4L2_IDENT_SAA7113:                                                      
> +               saa711x_writeregs(sd, saa7113_init);
> +               break;
> +       default:
> +               state->crystal_freq = SAA7115_FREQ_32_11_MHZ;
> +               saa711x_writeregs(sd, saa7115_init_auto_input);
> +       }
> +       if (state->ident != V4L2_IDENT_SAA7111)
> +               saa711x_writeregs(sd, saa7115_init_misc);
> +       saa711x_set_v4lstd(sd, V4L2_STD_NTSC);
> +
> +       v4l2_dbg(1, debug, sd, "status: (1E) 0x%02x, (1F) 0x%02x\n",
> +               saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC),
> +               saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC));
> +       return 0;
> +}
> +
>  static int saa711x_reset(struct v4l2_subdev *sd, u32 val)
>  {
>         v4l2_dbg(1, debug, sd, "decoder RESET\n");
> @@ -1513,6 +1566,7 @@
>         .s_std = saa711x_s_std,
>         .reset = saa711x_reset,
>         .s_gpio = saa711x_s_gpio,
> +       .s_power = saa711x_s_power,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>         .g_register = saa711x_g_register,
>         .s_register = saa711x_s_register,
> 
> 
> 
> 
> 
> 
> 
> 
>       
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      parent reply	other threads:[~2010-01-25 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18  7:03 [Patch 1/3] Kworld 315U Franklin Meng
2010-01-18  7:07 ` [Patch 2/3] " Franklin Meng
2010-01-25 14:15   ` Mauro Carvalho Chehab
2010-01-25 13:59 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5DA3B4.3080005@infradead.org \
    --to=mchehab@infradead.org \
    --cc=dougsland@gmail.com \
    --cc=fmeng2002@yahoo.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.